/* ============================================================
   Spark of Light · Aurora beta · beta.sparkoflight.com
   Tokens lifted from sol-prototype/sol-aurora/sol.css (the brand
   reference for anything that leaves the company). The page is a
   field of light; content floats in it. The arc measures progress.
   ============================================================ */

:root {
  --display: 'Cormorant Garamond', Georgia, serif;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --gold-lit:  #F4DDA1;
  --gold:      #EDB64A;
  --gold-warm: #C9A55C;

  --r-chip: 10px;
  --r-input: 14px;
  --r-card: 22px;
  --r-sheet: 30px;
  --r-pill: 999px;

  --in: 460ms;
  --out: 340ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: 26px;
  --col: 560px;
}

/* ---------- NIGHT: the eclipse ---------- */
html[data-theme="dark"] {
  --atmos: url('./assets/bg-dark.jpg');
  --atmos-op: 1;
  --page: #0B0A0C;
  --void: #08070A;
  --ink: #F5F3EE;
  --ink-2: rgba(245,243,238,0.72);
  --ink-3: rgba(245,243,238,0.46);
  --card: rgba(28,25,22,0.60);
  --card-2: rgba(38,34,29,0.72);
  --card-line: rgba(244,221,161,0.16);
  --card-line-2: rgba(244,221,161,0.30);
  --raise: rgba(255,252,244,0.06);
  --shade: 0 1px 1px rgba(0,0,0,.5), 0 18px 40px -22px rgba(0,0,0,.9);
  --glow: 0 0 40px -8px rgba(237,182,74,.45);
  --on-gold: #16120A;
  --grain-op: .30;
  --veil-op: 1;
  --gold-ink: #F4DDA1;
  --gold-a06: rgba(237,182,74,.07);
  --scrim: rgba(6,5,8,.72);
  color-scheme: dark;
}

/* ---------- DAY: the sun disc ---------- */
html[data-theme="light"] {
  --atmos: url('./assets/bg-light.jpg');
  --atmos-op: .92;
  --page: #E9E4DA;
  --void: #FBF8F1;
  --ink: #17140F;
  --ink-2: rgba(23,20,15,0.70);
  --ink-3: rgba(23,20,15,0.50);
  --card: rgba(255,253,247,0.86);
  --card-2: rgba(252,248,238,0.98);
  --card-line: rgba(176,141,67,0.20);
  --card-line-2: rgba(176,141,67,0.36);
  --raise: rgba(250,244,230,0.92);
  --shade: 0 1px 1px rgba(120,96,48,.06), 0 22px 46px -26px rgba(110,88,44,.40);
  --glow: 0 10px 28px -12px rgba(214,158,52,.50);
  --on-gold: #17130A;
  --grain-op: .10;
  --veil-op: .55;
  --gold-ink: #96701F;
  --gold-a06: rgba(201,165,92,.11);
  --scrim: rgba(60,48,26,.32);
  color-scheme: light;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  transition: background var(--in) var(--ease), color var(--in) var(--ease);
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(237,182,74,.35); }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold-warm); outline-offset: 3px; border-radius: 6px; }

/* ---------- the field of light ---------- */
.field-of-light {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: var(--void);
  transition: background var(--in) var(--ease);
}
.atmos {
  position: absolute; inset: 0;
  background-image: var(--atmos);
  background-size: cover; background-position: center top;
  opacity: var(--atmos-op);
  transition: opacity var(--in) var(--ease);
  pointer-events: none;
}
/* the plate is drawn once, in-app; here it breathes, slowly */
@media (prefers-reduced-motion: no-preference) {
  .atmos { animation: breathe 14s ease-in-out infinite alternate; }
  @keyframes breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
}
.veil {
  position: absolute; inset: 0; pointer-events: none; opacity: var(--veil-op);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--void) 30%, transparent) 0%,
    color-mix(in srgb, var(--void) 8%, transparent) 30%,
    color-mix(in srgb, var(--void) 62%, transparent) 74%,
    color-mix(in srgb, var(--void) 92%, transparent) 100%);
  transition: background var(--in) var(--ease);
}
.grain {
  position: absolute; inset: 0; opacity: var(--grain-op); pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- frame ---------- */
.frame {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
}
.topbar {
  width: min(100%, var(--col)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 44px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand span { font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }

.world {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--card-line);
  background: var(--raise); color: var(--ink-2);
  transition: transform var(--out) var(--ease), background var(--in) var(--ease);
}
.world:active { transform: scale(.92); }
.world svg { width: 18px; height: 18px; }
html[data-theme="light"] .world .moon { display: none; }
html[data-theme="dark"]  .world .sun  { display: none; }

main {
  width: min(100%, var(--col)); margin: 0 auto;
  display: grid; align-content: start; gap: 18px;
  padding-top: 18px;
}
main.wide { --col: 920px; }

/* ---------- the arc: progress is a curve ---------- */
.arc {
  width: min(100%, 320px); margin: 0 auto 4px; position: relative;
}
.arc svg { width: 100%; height: auto; overflow: visible; }
.arc .track { fill: none; stroke: var(--card-line-2); stroke-width: 1.25; }
.arc .fill  {
  fill: none; stroke: url(#arcgrad); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 900ms var(--ease);
}
.arc .node { fill: var(--void); stroke: var(--card-line-2); stroke-width: 1.25; transition: all var(--in) var(--ease); }
.arc .node.lit { fill: var(--gold); stroke: var(--gold-lit); }
.arc .node.done { fill: var(--gold-warm); stroke: var(--gold-warm); }
.arc .tick { stroke: var(--card-line-2); stroke-width: 1; }
.arc .lbl {
  font-family: var(--ui); font-size: 9.5px; font-weight: 500; letter-spacing: .2em;
  text-transform: uppercase; fill: var(--ink-3); transition: fill var(--in) var(--ease);
}
.arc .lbl.lit { fill: var(--gold-ink); }

/* ---------- type ---------- */
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold-ink); margin: 0;
}
.display {
  font-family: var(--display); font-weight: 300; letter-spacing: -0.025em;
  line-height: 1.02; color: var(--ink); text-wrap: balance; margin: 0;
}
.d1 { font-size: clamp(44px, 11vw, 60px); }
.d2 { font-size: clamp(34px, 8.5vw, 44px); }
.d3 { font-size: 27px; letter-spacing: -0.02em; line-height: 1.14; }
.serif-it { font-family: var(--display); font-style: italic; font-weight: 400; }
.gold { color: var(--gold-ink); }
.lede { font-size: 16px; line-height: 1.62; color: var(--ink-2); margin: 0; max-width: 44ch; }
.lede.serif { font-family: var(--display); font-size: 21px; line-height: 1.34; font-weight: 400; color: var(--ink); max-width: 36ch; }
.meta { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin: 0; }
.meta a { border-bottom: 1px solid var(--card-line-2); }
.label { font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--r-card); box-shadow: var(--shade);
  -webkit-backdrop-filter: blur(22px) saturate(1.1); backdrop-filter: blur(22px) saturate(1.1);
  padding: 22px;
  transition: background var(--in) var(--ease), border-color var(--in) var(--ease);
}
.card.sheet { border-radius: var(--r-sheet); padding: 26px; }
.hair { height: 1px; background: var(--card-line); border: 0; margin: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px; width: 100%; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--gold-lit), var(--gold));
  color: var(--on-gold); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: var(--glow);
  transition: transform var(--out) var(--ease), filter var(--out) var(--ease), opacity var(--out) var(--ease);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.975); filter: brightness(1.06); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; border: 1px solid var(--card-line-2); font-weight: 500; }
.btn.ghost:hover { background: var(--raise); color: var(--ink); }
.btn.sm { min-height: 44px; font-size: 14px; width: auto; padding: 0 22px; }
.btn svg { width: 18px; height: 18px; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border-radius: var(--r-pill); border: 1px solid var(--card-line-2); background: var(--raise);
}
.seg button {
  min-height: 44px; border-radius: var(--r-pill); color: var(--ink-2);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--out) var(--ease);
}
.seg button svg { width: 16px; height: 16px; opacity: .8; }
.seg button.on { color: var(--on-gold); font-weight: 600; background: linear-gradient(135deg, var(--gold-lit), var(--gold)); box-shadow: var(--glow); }
.seg button.on svg { opacity: 1; }

.fieldset { display: grid; gap: 8px; }
.fieldset label.label { padding-left: 2px; }
.input {
  width: 100%; min-height: 54px; padding: 0 18px;
  border-radius: var(--r-input); border: 1px solid var(--card-line-2);
  background: var(--raise); color: var(--ink); font-size: 16px; outline: none;
  transition: border-color var(--out) var(--ease), box-shadow var(--out) var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--gold-warm); box-shadow: 0 0 0 4px var(--gold-a06); }
.form.err .input:invalid { border-color: rgba(214,120,90,.7); }
.hp { display: none; }
.msg { min-height: 1.2em; font-size: 13.5px; color: var(--ink-2); margin: 0; }
.form.err .msg { color: #D6785A; }
html[data-theme="light"] .form.err .msg { color: #A8451F; }

/* ---------- stages ---------- */
.stage { display: none; }
.stage.on { display: grid; gap: 18px; }
.stage.leaving { opacity: 0; transform: translateY(-6px); transition: opacity var(--out) var(--ease), transform var(--out) var(--ease); }

/* rise-in for the children of the live stage, breath-paced */
.stage.on > * { animation: rise var(--in) var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stage.on > * { animation: none; }
  .arc .fill { transition: none; }
}

/* ---------- welcome ---------- */
.hero { display: grid; gap: 16px; }
.hero .icon {
  width: 72px; height: 72px; border-radius: 20px; margin: 4px 0 8px;
  box-shadow: 0 0 0 1px var(--card-line), 0 24px 48px -20px rgba(237,182,74,.45);
}
.inside { display: grid; gap: 0; margin-top: 6px; }
.inside .row {
  display: grid; grid-template-columns: 34px 1fr; align-items: baseline; gap: 12px;
  padding: 11px 2px; border-top: 1px solid var(--card-line);
}
.inside .row:last-child { border-bottom: 1px solid var(--card-line); }
.inside .idx { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--gold-ink); }
.inside .what { font-size: 15px; color: var(--ink); line-height: 1.45; }
.inside .what b { font-weight: 500; }
.inside .what span { color: var(--ink-2); }

/* ---------- download ---------- */
.stores { display: grid; gap: 14px; }
.store { display: grid; gap: 14px; }
.store.dim { opacity: .62; }
.store .head { display: flex; align-items: center; gap: 14px; }
.store .head img { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 0 0 1px var(--card-line); }
.store .head .t { display: grid; gap: 2px; }
.store .head .t b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.store .head .t span { font-size: 13px; color: var(--ink-3); }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.steps li i { font-style: italic; font-family: var(--display); font-size: 17px; color: var(--gold-ink); line-height: 1.25; }
.steps li b { color: var(--ink); font-weight: 500; }
.store .acts { display: grid; gap: 10px; }
.other { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.other button { color: var(--gold-ink); font-weight: 500; font-size: 14px; border-bottom: 1px solid var(--card-line-2); padding-bottom: 1px; }

.note { display: grid; gap: 12px; }
.note p { margin: 0; }
.note .btn { margin-top: 2px; }

.companion {
  display: grid; justify-items: center; text-align: center; gap: 6px; padding: 10px 0 0;
}
.companion img { width: 148px; height: 148px; }
html[data-theme="light"] .companion img.night { display: none; }
html[data-theme="dark"]  .companion img.day   { display: none; }
.companion .display { font-size: 25px; line-height: 1.16; }

/* ---------- footer ---------- */
.foot {
  width: min(100%, var(--col)); margin: 26px auto 0;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
.foot .meta a { border: 0; }
.foot .meta a:hover { color: var(--ink-2); }

/* ---------- noscript ---------- */
.nojs { display: grid; gap: 10px; }

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  main.wide .stores { grid-template-columns: 1fr 1fr; align-items: start; }
  .frame { padding-top: 26px; }
  main { padding-top: 28px; }
  .card { padding: 26px; }
  .card.sheet { padding: 32px; }
  .hero { gap: 18px; }
}
