/* Ambient Lab website.
   Neutral, warm near-black so the fire and scene imagery carry the colour.
   The "Glowing A" icon supplies the brand: its peach is the single accent (primary button, active sound),
   and its indigo glow appears once, behind the icon at the end of the page. Rounded headings echo its shape. */
:root {
  --bg: #0c0b0b;
  --bg-raised: #161514;
  --surface: rgba(255, 250, 245, 0.06);
  --line: rgba(255, 250, 245, 0.1);
  --text: #f4f1ec;
  --muted: rgba(244, 241, 236, 0.62);
  --peach: #f7b583;
  --amber: #ec8a4c;
  --indigo: #3b37a3;
  --on-peach: #22160c;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --gutter: clamp(16px, 4.5vw, 56px);
  --section: clamp(72px, 11vw, 140px);
  --max: 1200px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-round); font-weight: 700; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5rem); line-height: 1.02; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.2rem; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section) 0; }
.hero + .section { padding-top: clamp(40px, 6vw, 80px); }
.section-sub { margin-top: 12px; color: var(--muted); max-width: 34em; }
.app-icon { border-radius: 22.5%; }

/* Header */
.topbar {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-round); font-weight: 650; }
.topbar-get {
  text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  background: rgba(12, 11, 11, 0.45); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* Hero */
.hero { position: relative; min-height: min(100svh, 980px); display: flex; align-items: flex-end; isolation: isolate; overflow: hidden; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% center; z-index: -2; background: #000; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(12, 11, 11, 0.82) 26%, rgba(12, 11, 11, 0) 60%),
    linear-gradient(to right, rgba(12, 11, 11, 0.55), rgba(12, 11, 11, 0) 55%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 20%);
}
.hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding-bottom: clamp(40px, 8vh, 88px); }
.hero-copy { max-width: 620px; }
.kicker { font-size: 0.95rem; font-weight: 500; color: rgba(244, 241, 236, 0.8); margin-bottom: 12px; }
.lede { margin-top: 18px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: rgba(245, 240, 234, 0.86); max-width: 32em; }
.hero h1, .hero .lede, .kicker { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5); }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 28px; }
.cta-row.center { justify-content: center; }
.fineprint { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }

/* Apple badge, with a text fallback if the image cannot load. */
.badge { display: inline-flex; border-radius: 10px; }
.badge img { height: 50px; width: auto; }
.badge.fallback {
  align-items: center; height: 50px; padding: 0 20px; background: #000; color: #fff;
  border: 1px solid #a6a6a6; text-decoration: none; font-weight: 600; font-size: 0.95rem;
}

.listen {
  display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px 0 14px; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(12, 11, 11, 0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-weight: 600; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.listen svg { width: 20px; height: 20px; }
.listen .when-on, .listen[aria-pressed="true"] .when-off { display: none; }
.listen[aria-pressed="true"] .when-on { display: block; }
.listen[aria-pressed="true"] { border-color: rgba(255, 250, 245, 0.4); }
.listen[aria-pressed="true"] svg { color: var(--peach); }

.qr-card {
  display: none; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; max-width: 320px;
  background: rgba(12, 11, 11, 0.6); border: 1px solid var(--line); border-radius: var(--r-md);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.qr-card img, .qr-inline img { background: #fff; padding: 6px; border-radius: 10px; flex: none; }
.qr-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.qr-card strong { color: var(--text); display: block; font-weight: 600; }

/* Mixer */
.split { display: grid; gap: 36px; align-items: center; }
.prose p { margin-top: 14px; color: var(--muted); font-size: 1.08rem; max-width: 30em; }
.panel {
  position: relative; padding: 14px; border-radius: var(--r-lg);
  background: var(--bg-raised); border: 1px solid var(--line);
}
.track { display: flex; align-items: center; gap: 14px; padding: 12px; }
.track + .track { border-top: 1px solid var(--line); }
.track-toggle {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: 0.2s;
}
.track-toggle svg { width: 22px; height: 22px; }
.track-toggle[aria-pressed="true"] {
  color: var(--on-peach); border-color: transparent; background: var(--peach);
}
.track-body { flex: 1; min-width: 0; }
.track-body label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--peach); transition: opacity 0.2s; }
.track:has(.track-toggle[aria-pressed="false"]) input[type="range"] { opacity: 0.45; }
.button {
  display: block; margin: 10px 2px 2px; padding: 15px; text-align: center; border-radius: 14px;
  text-decoration: none; font-weight: 650; background: var(--peach); color: var(--on-peach); transition: background 0.2s;
}
.button:hover { background: #ffc79c; }

/* Rails (scenes, uses): swipe on phones, grid on wide screens */
.rail {
  list-style: none; margin: 28px 0 0; padding: 0 var(--gutter) 8px;
  display: grid; grid-auto-flow: column; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > li { scroll-snap-align: start; }

.scene-rail { grid-auto-columns: min(78vw, 320px); }
.scene { position: relative; aspect-ratio: 3 / 2; border-radius: var(--r-md); overflow: hidden; background: var(--bg-raised); }
.scene img { width: 100%; height: 100%; object-fit: cover; }
.scene::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(to top, rgba(12, 11, 11, 0.85), transparent); }
.scene-name { position: absolute; left: 14px; bottom: 12px; z-index: 1; font-weight: 600; font-size: 0.95rem; }
.tag {
  position: absolute; top: 10px; left: 10px; z-index: 1; font-size: 0.75rem; font-weight: 650;
  padding: 3px 9px; border-radius: 999px; background: rgba(12, 11, 11, 0.6); color: var(--text);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.use-rail { grid-auto-columns: min(58vw, 250px); gap: 18px; }
.screen { width: 100%; height: auto; aspect-ratio: 600 / 1304; object-fit: cover; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-raised); }
.use h3 { margin-top: 18px; }
.use p { margin-top: 6px; color: var(--muted); font-size: 0.98rem; }

/* FAQ */
.faq-grid { display: grid; gap: 20px; }
details { border-bottom: 1px solid var(--line); }
details:first-child { border-top: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 1.05rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
details p { padding-bottom: 18px; color: var(--muted); max-width: 40em; }

/* Closer: the icon with its own glow, like on a home screen at night */
.closer { padding-block: var(--section); text-align: center; }
.closer-inner { display: flex; flex-direction: column; align-items: center; }
.halo { position: relative; isolation: isolate; margin-bottom: 26px; }
.halo::before {
  content: ""; position: absolute; inset: -60%; z-index: -1;
  background: radial-gradient(closest-side, rgba(236, 138, 76, 0.22), rgba(59, 55, 163, 0.12) 60%, transparent);
}
.closer p { margin-top: 10px; color: var(--muted); max-width: 26em; text-wrap: balance; }
.qr-inline { display: none; align-items: center; gap: 14px; margin-top: 26px; color: var(--muted); font-size: 0.9rem; }

/* Sticky get bar (phones only) */
.sticky-get {
  position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 20px;
  background: rgba(28, 27, 26, 0.88); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(150%); transition: transform 0.35s ease;
}
.sticky-get.show { transform: none; }
.sticky-get div { flex: 1; min-width: 0; line-height: 1.25; }
.sticky-get strong { display: block; font-size: 0.95rem; }
.sticky-get span { display: block; font-size: 0.8rem; color: var(--muted); }
.sticky-get a { text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 8px 22px; border-radius: 999px; background: var(--peach); color: var(--on-peach); }

.footer { padding: 28px 0 calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.footer span { margin-right: auto; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* Legal and other reading pages */
.topbar.static { position: static; max-width: var(--max); margin-inline: auto; }
.doc { max-width: calc(42rem + 2 * var(--gutter)); padding-block: clamp(32px, 6vw, 72px) var(--section); }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.doc-date { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.doc h2 { font-size: 1.3rem; letter-spacing: -0.01em; margin-top: 44px; }
.doc p, .doc ul { margin-top: 14px; color: rgba(244, 241, 236, 0.82); }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--muted); }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--text); text-decoration-color: rgba(244, 241, 236, 0.35); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--peach); }
.doc .summary { margin-top: 28px; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }

/* ---------- Phones and portrait tablets: the fire gets the top of the screen, the pitch sits below ---------- */
@media (max-width: 859px) {
  .hero { min-height: 0; display: block; }
  /* The video fades itself out (mask) over the page background, so no layer edge can show as a seam. */
  .hero-video {
    height: 56svh; object-position: center 70%; background: transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  }
  .hero-shade { height: 56svh; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 22%); }
  .hero-inner { display: block; padding-top: calc(56svh - 40px); padding-bottom: 8px; }
  .hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); }
  .topbar-get { display: none; } /* the sticky bar and Apple's banner do this job on phones */
  body:has(.sticky-get) .footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* ---------- Tablets in landscape and up ---------- */
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr minmax(360px, 440px); gap: clamp(48px, 8vw, 120px); }
  .rail { grid-auto-flow: row; overflow: visible; max-width: var(--max); margin-inline: auto; }
  .scene-rail { grid-template-columns: repeat(3, 1fr); }
  .use-rail { grid-template-columns: repeat(3, minmax(0, 280px)); justify-content: space-between; gap: 32px; }
  .faq-grid { grid-template-columns: minmax(200px, 1fr) 2fr; gap: 40px; }
  .sticky-get { display: none; }
}

/* Desktop pointer: QR codes, since a phone camera is the real path to install. */
@media (min-width: 860px) and (hover: hover) and (pointer: fine) {
  .qr-card, .qr-inline { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
