/* ==========================================================================
   Lumiere — website
   Tokens mirror the app's AppTheme (Lumiere/Models/CameraSettings.swift).
   The site re-skins itself with the same eight themes as the app.
   ========================================================================== */

:root {
  --bg: #000;
  --bg-2: #070707;
  --bg-3: #0e0e0e;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.88);
  --text-2: rgba(255, 255, 255, 0.56);
  --text-3: rgba(255, 255, 255, 0.34);
  --accent: #d6b063;          /* Classic Gold: Color(0.84, 0.69, 0.39) */
  --accent-hi: #f3dca0;
  --accent-ink: #000;
  --accent-rgb: 214, 176, 99;
  --glow: rgba(214, 176, 99, 0.35);
  --live: #4cd97f;            /* lumiereSuccess */
  --rec: #e63333;             /* lumiereRed */

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

/* ---- The app's eight themes ------------------------------------------- */
:root[data-theme="silver"]   { --accent: #bfbfc7; --accent-hi: #ececf2; --accent-rgb: 191,191,199; --glow: rgba(191,191,199,.28); --bg: #080808; --bg-2: #0c0c0c; --bg-3: #131313; }
:root[data-theme="midnight"] { --accent: #638cdb; --accent-hi: #a9c3f5; --accent-rgb: 99,140,219; --accent-ink: #fff; --glow: rgba(99,140,219,.35); --bg: #05081a; --bg-2: #080c22; --bg-3: #0d132e; }
:root[data-theme="rose"]     { --accent: #d19682; --accent-hi: #f2c9b8; --accent-rgb: 209,150,130; --glow: rgba(209,150,130,.32); --bg: #0a0505; --bg-2: #100808; --bg-3: #170c0c; }
:root[data-theme="cinema"]   { --accent: #d23a3a; --accent-hi: #f08a8a; --accent-rgb: 210,58,58; --accent-ink: #fff; --glow: rgba(210,58,58,.35); --bg: #0d0303; --bg-2: #140505; --bg-3: #1c0808; }
:root[data-theme="graphite"] { --accent: #949499; --accent-hi: #d4d4d8; --accent-rgb: 148,148,153; --accent-ink: #fff; --glow: rgba(148,148,153,.25); --bg: #0d0d0d; --bg-2: #121212; --bg-3: #181818; }
:root[data-theme="deepspace"] {
  --accent: #72ddf7; --accent-hi: #c4f2fd; --accent-rgb: 114,221,247; --accent-ink: #080e1c; --glow: rgba(114,221,247,.32);
  --bg: #080e1c; --bg-2: #0b1324; --bg-3: #101b2f;
  --surface: rgba(16, 27, 47, 0.7); --surface-2: rgba(24, 40, 68, 0.75);
  --line: #1a2944; --line-2: #243653;
  --text: #edf4ff; --text-2: #c0cde2; --text-3: #9aadc7;
  --font-display: "Orbitron", "Oxanium", var(--font-text);
  --font-mono: "Oxanium", ui-monospace, monospace;
}
:root[data-theme="minimal"] {
  color-scheme: light;
  --accent: #262626; --accent-hi: #000; --accent-rgb: 38,38,38; --accent-ink: #fff; --glow: rgba(0,0,0,.12);
  --bg: #f2f2f2; --bg-2: #ebebeb; --bg-3: #e2e2e2;
  --surface: rgba(0,0,0,.035); --surface-2: rgba(0,0,0,.06);
  --line: rgba(0,0,0,.1); --line-2: rgba(0,0,0,.16);
  --text: rgba(0,0,0,.86); --text-2: rgba(0,0,0,.6); --text-3: rgba(0,0,0,.4);
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
/* belt and braces for iOS, where body overflow-x alone can still let the page pan sideways;
   clip (unlike hidden) keeps sticky sections working */
main, .footer { overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Type --------------------------------------------------------------- */
.eyebrow {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.h-display {
  font: 650 clamp(44px, 7.4vw, 104px)/0.96 var(--font-display);
  letter-spacing: -0.035em; margin: 0;
}
.h-section {
  font: 650 clamp(34px, 5vw, 64px)/1.02 var(--font-display);
  letter-spacing: -0.03em; margin: 18px 0 0;
}
:root[data-theme="deepspace"] .h-display, :root[data-theme="deepspace"] .h-section { letter-spacing: -0.01em; font-weight: 700; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.gold { color: var(--accent); }
.gold-grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-hi) 45%, var(--accent) 70%, var(--accent-hi) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s linear infinite;
}
@keyframes sheen { to { background-position: -220% 0; } }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 620px; margin: 22px 0 0; }
.mono { font-family: var(--font-mono); }
.label {
  font: 600 11px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-3);
}

/* Split-word headline reveal */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.split.in .w > span { transform: none; }

/* ---- Reveal on scroll ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.94); transition: opacity 1.1s var(--ease), transform 1.2s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-scale.in { opacity: 1; transform: none; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 15px/1 var(--font-text);
  transition: transform .3s var(--ease), background-color .3s, color .3s, box-shadow .3s;
  will-change: transform;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 40px -10px var(--glow); }
.btn-accent:hover { box-shadow: 0 14px 50px -8px var(--glow); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); background: var(--surface); backdrop-filter: blur(12px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 18px; height: 18px; }

/* App Store badge (swap for Apple's official artwork before launch — see README) */
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px 0 18px; border-radius: 14px;
  background: #000; color: #fff; border: 1px solid #a6a6a6;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.appstore:hover { border-color: var(--accent); box-shadow: 0 12px 40px -12px var(--glow); }
.appstore svg { width: 26px; height: 26px; fill: #fff; margin-top: -3px; }
.appstore span { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.appstore small { font: 500 11px/1 var(--font-text); letter-spacing: .02em; }
.appstore b { font: 600 22px/1.05 var(--font-display); letter-spacing: -0.02em; margin-top: 3px; }
:root[data-theme="minimal"] .appstore { border-color: #000; }

/* ---- Nav ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .4s, backdrop-filter .4s, border-color .4s, transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border-color: var(--line); }
.nav.hide { transform: translateY(-100%); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line-2); }
.brand b { font: 700 15px/1 var(--font-mono); letter-spacing: .32em; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  font: 500 14px/1 var(--font-text); color: var(--text-2);
  padding: 10px 14px; border-radius: 999px; transition: color .25s, background-color .25s;
}
.nav-links a:hover, .nav-links a.on { color: var(--text); background: var(--surface-2); }
.nav-cta { height: 40px; padding: 0 18px; font-size: 14px; }
.theme-dot {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; background: var(--surface);
  transition: border-color .3s, transform .3s var(--ease);
}
.theme-dot:hover { border-color: var(--accent); transform: rotate(30deg); }
.theme-dot i { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(#d6b063, #bfbfc7, #638cdb, #72ddf7, #d19682, #d23a3a, #949499, #f2f2f2, #d6b063); }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); place-items: center; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 16px; height: 1.5px; background: var(--text); position: relative; transition: transform .3s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -5px; } .menu-btn span::after { top: 5px; }
.nav.open .menu-btn span { background: transparent; }
.nav.open .menu-btn span::before { transform: translateY(5px) rotate(45deg); }
.nav.open .menu-btn span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; height: calc(100vh - 68px); height: calc(100dvh - 68px); flex-direction: column; gap: 0; overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg);
    padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
  }
  .nav-links a { padding: 16px 0; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 17px; background: none !important; }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav.open { background: var(--bg); }
  html.menu-open { overflow: hidden; }
  .menu-btn { display: grid; }
  .nav-cta { display: none; }
  .theme-dot { margin-left: auto; }
}

/* ---- Theme picker ---------------------------------------------------------- */
.theme-pop {
  position: fixed; top: 76px; right: var(--gutter); z-index: 120; width: min(340px, calc(100vw - 32px));
  background: color-mix(in srgb, var(--bg-3) 92%, transparent); backdrop-filter: blur(24px);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 16px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transform-origin: top right;
  transition: opacity .25s, transform .35s var(--ease);
}
.theme-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.theme-pop h4 { margin: 2px 4px 12px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 2px; border-radius: 14px; transition: background-color .2s; }
.theme-opt img { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 0 0 1px var(--line-2); transition: transform .3s var(--ease-spring), box-shadow .3s; }
.theme-opt span { font: 500 11px/1.2 var(--font-text); color: var(--text-2); text-align: center; }
.theme-opt:hover { background: var(--surface-2); }
.theme-opt:hover img { transform: scale(1.07); }
.theme-opt[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--accent), 0 0 24px -4px var(--glow); }
.theme-opt[aria-pressed="true"] span { color: var(--text); }

/* ---- Sections ------------------------------------------------------------- */
section { position: relative; }
.sec { padding: clamp(96px, 13vw, 180px) 0; }
@media (max-width: 600px) { .sec { padding: 76px 0; } }
.sec-head { max-width: 760px; }
.sec-head.center { margin: 0 auto; text-align: center; }
.sec-head.center .lede { margin-left: auto; margin-right: auto; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }

/* ---- iPhone frame ---------------------------------------------------------- */
.iphone {
  --w: 300px;
  position: relative; width: var(--w); flex: none;
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.168);
  background:
    linear-gradient(150deg, #5b5b60 0%, #1d1d20 18%, #2b2b2f 48%, #121214 72%, #3b3b40 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    inset 0 0 0 calc(var(--w) * 0.012) #0b0b0c,
    0 0 0 1px rgba(0,0,0,.9),
    0 50px 100px -30px rgba(0,0,0,.85),
    0 0 140px -40px var(--glow);
}
.iphone::before { /* side buttons */
  content: ""; position: absolute; left: -2px; top: 22%; width: 3px; height: 7%; border-radius: 2px;
  background: #2a2a2d; box-shadow: 0 calc(var(--w) * 0.2) 0 #2a2a2d, 0 calc(var(--w) * 0.36) 0 #2a2a2d;
}
.iphone::after {
  content: ""; position: absolute; right: -2px; top: 30%; width: 3px; height: 12%; border-radius: 2px; background: #2a2a2d;
}
.iphone .screen {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 1206 / 2622; border-radius: calc(var(--w) * 0.136);
  background: #000; container-type: inline-size;
}
.iphone .island {
  position: absolute; z-index: 30; top: 1.55%; left: 50%; transform: translateX(-50%);
  width: 31%; height: 3.35%; border-radius: 999px; background: #000;
  box-shadow: 0 0 0 .5px rgba(255,255,255,.04);
}
.iphone .screen > img.shot { width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="minimal"] .iphone { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), inset 0 0 0 calc(var(--w) * 0.012) #0b0b0c, 0 50px 90px -30px rgba(0,0,0,.45); }

/* ---- Apple Watch frame ------------------------------------------------------ */
.watch {
  --w: 190px;
  position: relative; width: var(--w); flex: none;
}
.watch .band {
  position: absolute; left: 50%; transform: translateX(-50%); width: 74%; height: 62%; z-index: 0;
  background: linear-gradient(90deg, #121214, #232327 30%, #1a1a1d 70%, #0e0e10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.watch .band.top { bottom: 78%; border-radius: 14px 14px 4px 4px; }
.watch .band.bottom { top: 78%; border-radius: 4px 4px 14px 14px; }
.watch .band::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(255,255,255,.025) 9px 10px); border-radius: inherit; }
.watch .case {
  position: relative; z-index: 2; aspect-ratio: 416 / 496;
  padding: calc(var(--w) * 0.055);
  border-radius: calc(var(--w) * 0.24);
  background: linear-gradient(145deg, #6a6a70, #232326 22%, #3a3a3e 55%, #151517 80%, #4a4a50);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), inset 0 0 0 calc(var(--w) * 0.02) #070708, 0 30px 60px -20px rgba(0,0,0,.8), 0 0 90px -30px var(--glow);
}
.watch .crown {
  position: absolute; z-index: 3; right: calc(var(--w) * -0.06); top: 22%; width: calc(var(--w) * 0.1); height: 20%;
  border-radius: 5px; background: repeating-linear-gradient(180deg, #8b8b90 0 2px, #4b4b50 2px 4px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); cursor: ns-resize; touch-action: none;
}
.watch .crown::before { content: ""; position: absolute; inset: -10px -14px; } /* bigger hit area */
@media (max-width: 760px) { .watch .crown::before { inset: -12px -6px -12px -16px; } }
.watch .crown:hover { filter: brightness(1.25); }
.crown-hint { position: absolute; z-index: 3; left: calc(100% + 26px); top: 26%; font: 600 10px/1.3 var(--font-mono); letter-spacing: .14em; color: var(--accent); white-space: nowrap; pointer-events: none; animation: nudge 2.4s ease-in-out infinite; }
.crown-hint::before { content: "← "; }
@keyframes nudge { 50% { transform: translateX(-4px); } }
@media (max-width: 760px) { .crown-hint { display: none; } }
.watch .side-btn { position: absolute; z-index: 1; right: calc(var(--w) * -0.025); top: 52%; width: calc(var(--w) * 0.04); height: 20%; border-radius: 4px; background: #3a3a3e; }
.watch .wscreen {
  position: relative; height: 100%; overflow: hidden; background: #000;
  border-radius: calc(var(--w) * 0.19); container-type: inline-size;
}

/* ---- Marquee -------------------------------------------------------------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 0; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 600 14px/1 var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; padding: 0 22px; }
.marquee span i { font-style: normal; color: var(--accent); padding-left: 44px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Footer ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; color: var(--text-2); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer h5 { font: 600 11px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 16px; }
.footer a { display: block; padding: 5px 0; transition: color .2s; }
.footer a:hover { color: var(--accent); }
.footer .fine { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); line-height: 1.6; display: grid; gap: 8px; }
.footer .fine a { display: inline; padding: 0; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---- Utilities ------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface);
  font: 500 14px/1 var(--font-text); white-space: nowrap;
  transition: color .2s, border-color .2s, background-color .2s, transform .2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"], .chip.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.kbd { font: 600 11px/1 var(--font-mono); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); }
.pill-note { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1 var(--font-text); color: var(--text-2); padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pill-note b { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--glow); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--glow); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }

/* Deep Space starfield (the app draws static stars in settings & gallery) */
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1s; }
:root[data-theme="deepspace"] .stars { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-scale { opacity: 1; transform: none; }
  .split .w > span { transform: none; }
}

/* Theme switch: circular reveal (driven from site.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }
.nav-links .nav-film { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); }
.nav-links .nav-film .ic { width: 16px; height: 16px; }
