/* ==========================================================================
   YouSee360 WebAR 3D Portal Design System & Mobile Responsive Stylesheet
   Brand Palette: Dark Obsidian (#06070a), Electric Cyan (#00f2fe), Teal (#4facfe)
   ========================================================================== */

:root {
  --bg-dark: #06070a;
  --bg-surface: #0c1017;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.9);
  --accent-cyan: #00f2fe;
  --accent-teal: #4facfe;
  --accent-emerald: #00f5a0;
  --accent-gold: #ffb703;
  --accent-purple: #7928ca;
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.35);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #101929 0%, #06070a 60%);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  line-height: 1.6;
}

/* Background Ambient Glow & Grid */
.bg-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.bg-orb-1 {
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: var(--accent-cyan);
}
.bg-orb-2 {
  bottom: 10%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
}

/* Container */
.ar-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Typography Utilities */
.apple-heading {
  font-size: clamp(1.85rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.highlight {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 242, 254, 0.25);
  margin-bottom: 14px;
}

/* Header & Navigation */
.ar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 14px 0;
  padding-top: max(14px, env(safe-area-inset-top));
  transition: var(--transition);
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.ar-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.ar-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #06070a;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ar-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.ar-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
}
.ar-nav-link:hover {
  color: var(--accent-cyan);
}

.btn-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #06070a;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.35);
  transition: var(--transition);
  touch-action: manipulation;
  min-height: 44px;
}
.btn-glow:active {
  transform: scale(0.97);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
  min-height: 44px;
}
.btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.97);
}

.btn-glow-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  background: rgba(6, 7, 10, 0.72);
  color: var(--accent-cyan);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* Hero Section with Interactive 3D Canvas */
.ar-hero {
  padding-top: 130px;
  padding-bottom: 60px;
  position: relative;
}

.ar-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.ar-hero-content p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 28px;
  max-width: 520px;
}

.ar-hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* 3D Canvas Frame Container */
.ar-canvas-card {
  position: relative;
  width: 100%;
  height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  touch-action: none;
}

#arCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

/* Canvas Floating Overlay Controls */
.canvas-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.hud-pill {
  pointer-events: auto;
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.canvas-instruction {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 7, 10, 0.88);
  border: 1px solid var(--border-glow);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fullscreen WebAR Camera Overlay */
/* ============================================================
   WEBAR CAMERA EXPERIENCE
   Every element below is gated on [data-ar-state] on .webar-overlay.
   The camera feed is the interface; chrome earns its place or it is
   not on screen. One primary action is visible at any moment.
   ============================================================ */
.webar-overlay {
  --ar-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ar-pad: max(18px, env(safe-area-inset-left));
  --ar-accent: var(--accent-emerald);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: none;
  overflow: hidden;
  font-family: var(--font-family);
}
.webar-overlay.active { display: block; }

.webar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* A soft vertical scrim keeps white text legible over a bright room
   without dimming the middle of the frame, where the portal stands. */
.webar-scrim {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 34%);
}

.webar-overlay #arCanvas.ar-camera-mode {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: auto;
}

/* ---------- Top bar ---------- */
.ar-topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: var(--ar-pad);
  right: var(--ar-pad);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.ar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 68%;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ar-accent);
  box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.55);
  animation: ar-breathe 2.4s var(--ar-ease) infinite;
}
@keyframes ar-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.5); }
  60%      { box-shadow: 0 0 0 7px rgba(0, 245, 160, 0); }
}
.ar-icon-btn {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s var(--ar-ease), background 0.2s var(--ar-ease);
}
.ar-icon-btn:active { transform: scale(0.92); background: rgba(8, 10, 14, 0.8); }

/* ---------- Scanning affordance ---------- */
.ar-stage {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ar-scan { position: relative; width: 132px; height: 132px; }
.ar-scan-ring,
.ar-scan-core {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ar-scan-ring {
  width: 100%;
  height: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  opacity: 0;
  animation: ar-sonar 3s var(--ar-ease) infinite;
}
.ar-scan-ring:nth-child(2) { animation-delay: 1.5s; }
.ar-scan-core {
  width: 12px;
  height: 12px;
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}
@keyframes ar-sonar {
  0%   { opacity: 0;    transform: translate(-50%, -50%) scale(0.35); }
  35%  { opacity: 0.85; }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Portal entry moment ---------- */
.ar-portal-moment {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 21;
  display: grid;
  gap: 4px;
  padding: 16px 24px;
  border-radius: 18px;
  background: rgba(8, 10, 14, 0.5);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 0.5s var(--ar-ease), transform 0.5s var(--ar-ease);
}
.ar-portal-moment.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ar-portal-moment span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ar-portal-moment strong { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Bottom controls ---------- */
.ar-controls {
  position: absolute;
  left: var(--ar-pad);
  right: var(--ar-pad);
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  text-align: center;
}
.ar-guidance {
  max-width: 30ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  text-wrap: balance;
}
.ar-phase {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ar-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* One full-width primary action. Which one is visible is decided by state. */
.ar-action {
  pointer-events: auto;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-full);
  background: #fff;
  color: #06070a;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 12px 34px -10px rgba(0, 0, 0, 0.7);
  transition: transform 0.18s var(--ar-ease), opacity 0.18s var(--ar-ease);
}
.ar-action:active { transform: scale(0.97); }
.ar-action i { font-size: 0.92em; }

.ar-chips {
  display: none;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.ar-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s var(--ar-ease), background 0.18s var(--ar-ease);
}
.ar-chip:active { transform: scale(0.95); background: rgba(8, 10, 14, 0.8); }

/* ---------- Sheets ---------- */
.ar-sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ar-sheet.is-open { display: flex; animation: ar-fade 0.28s var(--ar-ease) both; }
@keyframes ar-fade { from { opacity: 0; } to { opacity: 1; } }

.ar-sheet-card {
  width: 100%;
  max-width: 440px;
  padding: 26px 24px 20px;
  border-radius: 26px;
  background: rgba(18, 21, 27, 0.86);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  animation: ar-rise 0.36s var(--ar-ease) both;
}
@keyframes ar-rise {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.ar-sheet-card .ar-action { display: inline-flex; margin-top: 18px; }
.ar-sheet-grabber {
  display: block;
  width: 38px;
  height: 4px;
  margin: -8px auto 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
}
.ar-sheet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.25rem;
}
.ar-sheet-card h2 {
  margin: 0 0 8px;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.ar-sheet-card p {
  margin: 0 auto;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
  line-height: 1.5;
}
.ar-sheet-note {
  margin-top: 12px !important;
  font-size: 0.78rem !important;
  color: rgba(255, 255, 255, 0.45) !important;
}
.ar-sheet-dismiss {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}
.ar-sheet-dismiss:active { color: #fff; }

.ar-scene-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ar-scene-list .tour-pill {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  justify-content: flex-start;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
}
.ar-scene-list .tour-pill.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

/* ============================================================
   STATE MACHINE
   Each state declares exactly what belongs on screen.
   ============================================================ */
.webar-overlay .ar-topbar,
.webar-overlay .ar-controls { opacity: 1; transition: opacity 0.3s var(--ar-ease); }

/* priming — only the sheet; nothing else competes with the ask */
.webar-overlay[data-ar-state="priming"] .ar-topbar,
.webar-overlay[data-ar-state="priming"] .ar-controls { opacity: 0; pointer-events: none; }

/* starting / scanning — guidance plus the sonar, no actions yet */
.webar-overlay[data-ar-state="scanning"] .ar-stage,
.webar-overlay[data-ar-state="starting"] .ar-stage { display: flex; }

/* ready — a surface is tracked, so offer the one thing worth doing */
.webar-overlay[data-ar-state="ready"] #btnARPlacePortal { display: inline-flex; }

/* placed — enter it, or nudge it, or change the view */
.webar-overlay[data-ar-state="placed"] #btnARStepInside,
.webar-overlay[data-ar-state="inside"] #btnARStepInside { display: inline-flex; }
.webar-overlay[data-ar-state="placed"] .ar-chips,
.webar-overlay[data-ar-state="inside"] .ar-chips { display: flex; }
.webar-overlay[data-ar-state="inside"] #btnARReposition { display: none; }

/* inside — drop the guidance line, the scene speaks for itself */
.webar-overlay[data-ar-state="inside"] .ar-guidance,
.webar-overlay[data-ar-state="inside"] .ar-phase { display: none; }

/* blocked — recovery only */
.webar-overlay[data-ar-state="blocked"] #btnARStartCamera { display: inline-flex; }
.webar-overlay[data-ar-state="blocked"] .ar-phase { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ar-scan-ring, .ar-status-dot { animation: none; }
  .ar-scan-ring:first-child { opacity: 0.5; transform: translate(-50%, -50%) scale(0.8); }
  .ar-sheet.is-open, .ar-sheet-card { animation: none; }
  .ar-action, .ar-chip, .ar-icon-btn { transition: none; }
}

/* Short phones: reclaim vertical space rather than letting the HUD crowd
   the middle of the frame, which is where the portal actually is. */
@media (max-height: 700px) {
  .ar-guidance { font-size: 0.88rem; }
  .ar-action { min-height: 50px; }
  .ar-controls { gap: 9px; }
  .ar-sheet-card { padding: 20px 20px 14px; }
  .ar-sheet-icon { width: 46px; height: 46px; margin-bottom: 12px; }
}

/* Portal Tour Selector Carousel */
.tour-selector-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 10px;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}
.tour-selector-bar::-webkit-scrollbar { display: none; }

.tour-pill {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
}
.tour-pill:hover, .tour-pill.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #06070a;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

/* Quick Info Card */
.active-portal-info {
  background: rgba(12, 16, 23, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  width: 100%;
}
.active-portal-info h3 {
  font-size: 1.08rem;
  color: #fff;
}
.active-portal-info p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Feature Grid Section */
.ar-section {
  padding: 70px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px auto;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 10px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.15);
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.05));
  border: 1px solid rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-cyan);
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Portfolio Showcase Cards */
.portal-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.portal-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.portal-item-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.portal-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.portal-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-badge-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.portal-card-body {
  padding: 20px;
}
.portal-card-body h3 {
  font-size: 1.18rem;
  color: #fff;
  margin-bottom: 6px;
}
.portal-card-body p {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 16px;
}
.portal-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Mobile Handoff QR Code Modal */
.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-modal.active {
  display: flex;
}

.qr-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.qr-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  touch-action: manipulation;
}

.qr-box {
  width: 190px;
  height: 190px;
  margin: 20px auto;
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fullscreen Tour Iframe Modal */
.tour-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.94);
  z-index: 10000;
  display: none;
  flex-direction: column;
}
.tour-modal.active {
  display: flex;
}
.tour-modal-header {
  height: 56px;
  padding-top: max(0px, env(safe-area-inset-top));
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
}
.tour-modal-header h3 {
  font-size: 1rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.tour-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
}

/* Lead Form Section */
.ar-quote-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  max-width: 800px;
  margin: 0 auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.form-group-full {
  grid-column: 1 / -1;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* Footer */
.ar-footer {
  padding: 48px 0 32px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* iPhone & Mobile Responsive Optimizations */
@media (max-width: 768px) {
  .ar-container {
    padding: 0 16px;
  }
  .ar-nav-links { display: none; }
  .btn-hide-mobile { display: none !important; }
  
  .ar-hero {
    padding-top: 90px;
    padding-bottom: 40px;
  }
  
  .ar-hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .ar-hero-content p {
    font-size: 0.98rem;
    margin-top: 12px;
    margin-bottom: 20px;
  }
  
  .ar-hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  .ar-hero-cta-group .btn-glow,
  .ar-hero-cta-group .btn-secondary {
    width: 100%;
  }

  .ar-canvas-card {
    height: 380px;
    height: 50vh;
    min-height: 320px;
    border-radius: var(--radius-md);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .portal-portfolio-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .ar-quote-card {
    padding: 24px 16px;
  }

  .apple-heading {
    font-size: 1.9rem;
  }
}

/* ---------- Shareable portal files ---------- */
.portal-file-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 26px;
}
.portal-file {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}
.portal-file:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}
.portal-file-name { font-weight: 600; font-size: 0.95rem; }
.portal-file-meta {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.portal-files-hint,
.portal-files-note {
  max-width: 60ch;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}
.portal-files-hint { color: var(--accent-cyan); }
/* Keep the portal, instruction and destination controls inside narrow phones. */
html,body{overflow-x:clip}
.ar-hero-grid>div{min-width:0}
.bg-orb{max-width:90vw;pointer-events:none}
.canvas-instruction{max-width:calc(100% - 24px);white-space:normal;text-align:center;line-height:1.45}
.canvas-instruction span{min-width:0;white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){.tour-selector-bar{max-width:100%;justify-content:flex-start!important;overflow-x:auto}.tour-selector-bar .tour-pill{flex:0 0 auto}.canvas-instruction{font-size:11px;padding:10px 12px}.canvas-hud{gap:8px}.canvas-hud .hud-pill{font-size:10px}}

/* Shared curated collection and the fullscreen handoff from The Between. */
.ar-world-collection{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:12px 0 18px}.ar-collection-label{margin-top:22px;font-size:12px!important;color:#bcd7c0}
.ar-world-choice{overflow:hidden;padding:0 0 9px;border:1px solid #bad6bf44;border-radius:8px;background:#153128;color:#edf6e9;cursor:pointer;font:inherit;font-size:11px}
.ar-world-choice img{width:100%;height:75px;object-fit:cover;display:block;margin-bottom:8px}.ar-world-choice:hover{border-color:#d1ebba}
.between-ar{background:#0d1c17;--accent-cyan:#c4dfbe;--accent-teal:#a9cdb3;font-family:Outfit,Arial,sans-serif}
.between-ar>header,.between-ar>main,.between-ar>footer,.between-ar>.bg-grid-overlay,.between-ar>.bg-orb{visibility:hidden}
.between-ar .ar-sheet-card{background:#132b21;border-color:#8cac8950}.between-ar .ar-action{background:#d1e7c6;color:#13281e;box-shadow:none}
.between-ar .webar-overlay{background:#0b1812}.between-ar .webar-overlay.active{background:transparent}.between-ar .ar-controls{left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 40px);max-width:620px}
.between-ar .ar-portal-moment{background:#132b21e8}
.webar-overlay[data-ar-state=blocked] .ar-chips{display:flex}.webar-overlay[data-ar-state=blocked] .ar-chips>*:not([data-return-world]){display:none}
@media(max-width:600px){.ar-world-collection{grid-template-columns:repeat(2,1fr)}.ar-world-choice img{height:65px}.ar-chips{flex-wrap:wrap}.ar-chip{font-size:11px}}
