/* The home page: one ring travels through every section (the hero, the
   app's timer ring, the Live Activity, the download). It wobbles when it
   arrives and when you tap it. The page stays monochrome; colour lives only
   on the phone. Sub-pages use style.css. */
:root {
  color-scheme: dark;
  --bg: #0C0C0C;
  --text-1: #E8E8E8;
  --text-2: #A0A0A0;
  --text-3: #808080;
  --border-1: #555555;
  --border-2: #333333;
  --border-3: #1C1C1C;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* the phone's atmosphere, set from home.js */
  --a-top: #0B0B0B; --a-hor: #1D1B19; --a-light: #D6D0C6;
  --ph: min(78svh, 620px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--text-1); font-family: var(--font); font-weight: 400; -webkit-font-smoothing: antialiased; line-height: 1.7; overflow-x: clip; }
h1, h2, h3, p, a, button, span, label, output, b { font-weight: 400; }
a { color: var(--text-2); text-decoration-color: var(--border-1); text-underline-offset: .2em; }
a:hover { color: var(--text-1); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--text-2); outline-offset: 4px; }
.gutter { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 13px; letter-spacing: .08em; color: var(--text-3); }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.body { color: var(--text-2); max-width: 30rem; }

#ring { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
#spill { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.anchor { border-radius: 50%; display: block; position: relative; }
/* Without JavaScript the rings aren't drawn, so outline them instead. */
html:not(.js) .anchor { box-shadow: inset 0 0 0 1px var(--border-1); }
button.anchor { cursor: pointer; }

/* ---------- Hero ---------- */
/* above the story, whose fade behind the phone reaches up into the hero */
.hero { position: relative; z-index: 2; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; text-align: center; padding-block: calc(env(safe-area-inset-top, 0px) + 22px) calc(env(safe-area-inset-bottom, 0px) + 26px); }
.hero .stage { display: grid; place-items: center; gap: 2rem; align-self: center; }
#a-hero { width: min(62vw, 46svh, 380px); aspect-ratio: 1; }
.hero-line { font-size: clamp(1.3rem, 3.6vw, 1.75rem); line-height: 1.35; min-height: 2.8em; max-width: 22rem; text-wrap: balance; transition: opacity .5s ease; }
.hero-hint { font-size: 13px; color: var(--text-3); transition: opacity .6s; }

/* ---------- Story with the phone ---------- */
/* No overflow clip here: on iPhone, Safari can't keep a sticky element still
   inside a clipped box (with the body's clip too), and the phone wobbles by a
   point or two as the page scrolls. The body's clip is enough. */
.story { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(2rem, 6vw, 6rem); max-width: 64rem; margin: 0 auto; }
.phone-col { grid-column: 2; grid-row: 1; position: sticky; top: calc((100svh - var(--ph)) / 2); height: var(--ph); align-self: start; }
.texts { grid-column: 1; grid-row: 1; }
.block { min-height: 100svh; display: grid; align-content: center; gap: 1.2rem; }
.row { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; font-size: 14px; color: var(--text-3); }
.row button { color: var(--text-2); padding: 8px 0; min-height: 44px; text-decoration: underline; text-decoration-color: var(--border-1); text-underline-offset: .25em; }
.row button[aria-pressed="true"] { color: var(--text-1); }
@media (max-width: 760px) {
  :root { --ph: min(46svh, 430px); }
  .story { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .phone-col { grid-column: 1; top: calc(env(safe-area-inset-top, 0px) + 12px); justify-self: center; z-index: 2; }
  .phone-col::before { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: -40px; bottom: -28px; background: linear-gradient(var(--bg) 86%, rgba(12,12,12,0)); z-index: -1; }
  .texts { grid-row: 2; margin-top: calc(var(--ph) * -1); }
  .block { min-height: 100svh; align-content: end; gap: 1rem; padding-bottom: 6svh; }
  .body { font-size: 16px; line-height: 1.6; }
}
@media (max-width: 760px) and (max-height: 700px) {
  :root { --ph: min(40svh, 430px); }
}

.phone {
  position: relative; height: 100%; aspect-ratio: 9 / 19.5; border-radius: calc(var(--ph) * .068); overflow: hidden; container-type: size; background: #0B0B0B;
  box-shadow: 0 0 0 1px #2a2a2a, 0 0 0 8px #141414, 0 0 0 9px #2a2a2a, 0 40px 80px rgba(0,0,0,.6);
}
.phone #atm { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .6s; }
.scr { position: absolute; inset: 0; transition: opacity .6s ease; }
.scr-home { display: grid; grid-template-rows: auto 1fr auto auto auto; justify-items: center; padding: 9cqh 0 6cqh; color: var(--a-light); }
.p-name { font-size: 3.4cqw; letter-spacing: .08em; opacity: .55; margin-top: 1cqh; }
.p-ringwrap { position: relative; align-self: center; width: 70cqw; aspect-ratio: 1; }
.p-ringwrap .anchor { width: 100%; height: 100%; }
.p-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11cqw; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #EDEDED; pointer-events: none; }
.p-pills, .p-sounds { display: flex; gap: 2.4cqw; }
.p-pills { margin-bottom: 3cqh; }
.pp, .ps { font-size: 3.6cqw; min-height: 9cqw; min-width: 13cqw; padding: 0 3.6cqw; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.62); display: inline-grid; place-items: center; transition: border-color .6s, color .6s; }
.pp.on, .ps.on { border-color: var(--a-light); color: var(--a-light); }
/* The sound switch, as in the app: waves when on, waves with a slash when off. */
.p-wave { width: 6.4cqw; height: 6.4cqw; fill: none; stroke: rgba(255,255,255,.42); stroke-width: 1.3; stroke-linecap: round; transition: stroke .6s; }
.p-wave.on { stroke: var(--a-light); }
.p-wave .slash { transition: opacity .4s; }
.p-wave.on .slash { opacity: 0; }
.p-sounds { margin-bottom: 4cqh; }
.p-play { width: 15cqw; height: 15cqw; display: grid; place-items: center; }
.p-play svg { width: 9cqw; height: 9cqw; fill: none; stroke: var(--a-light); stroke-width: 1.4; stroke-linejoin: round; }

.scr-lock { opacity: 0; background: linear-gradient(#0E0E10 0%, #0E0E10 35%, #24221F 100%); transition: opacity .6s ease, filter 1.4s ease; }
.island { position: absolute; top: 2.2cqh; left: 50%; transform: translateX(-50%); width: 30cqw; height: 4.4cqh; border-radius: 999px; background: #000; }
.clock { position: absolute; top: 10cqh; left: 0; right: 0; text-align: center; color: #F2F2F2; transition: color 1.4s, opacity 1.4s; }
.clock .date { font-size: 4.4cqw; opacity: .8; }
.clock .hm { font-size: 24cqw; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .5cqh; }
.la {
  position: absolute; left: 4cqw; right: 4cqw; bottom: 15cqh; border-radius: 6.5cqw; padding: 4.5cqw 5cqw;
  display: grid; grid-template-columns: auto 1fr auto; gap: 4cqw; align-items: center;
  background: linear-gradient(var(--a-top) 0%, var(--a-top) 40%, var(--a-hor) 100%); color: var(--a-light); transition: filter 1.4s;
}
.la .anchor { width: 13cqw; height: 13cqw; }
.la .lbl { display: grid; line-height: 1.3; min-width: 0; }
.la .lbl .app { font-size: 3.4cqw; opacity: .7; letter-spacing: .06em; }
.la .lbl .cap { font-size: 3.8cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.la .left { font-size: 8.5cqw; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #F2F2F2; }
.homebar { position: absolute; bottom: 1.4cqh; left: 50%; transform: translateX(-50%); width: 36cqw; height: .6cqh; border-radius: 9px; background: rgba(255,255,255,.7); }
.phone.st-lock .scr-home, .phone.st-lock #atm { opacity: 0; }
.phone.st-lock .scr-lock { opacity: 1; }
.phone.asleep .scr-lock { background: #050505; }
.phone.asleep .clock { color: #8a8a8a; }
.phone.asleep .la { filter: brightness(.55) saturate(.7); }

/* ---------- End ---------- */
.end { position: relative; z-index: 1; max-width: 44rem; margin: 0 auto; padding-block: 14svh 6rem; display: grid; gap: 4rem; }
.end .eyebrow { margin-bottom: .8rem; }
.inflow { font-size: clamp(1.1rem, 2.6vw, 1.4rem); line-height: 1.7; }
.outflow { color: var(--text-2); }
.get { display: grid; justify-items: center; gap: 1.2rem; text-align: center; }
#a-end { width: 72px; height: 72px; }
.get a { padding: 10px 0; }
.guides { list-style: none; display: grid; border-top: 1px solid var(--border-3); }
.guides li { border-bottom: 1px solid var(--border-3); }
.guides a { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; text-decoration: none; color: var(--text-1); }
.guides a span:last-child { color: var(--text-3); font-size: 14px; text-align: right; }
.guides a:hover span:first-child { color: #fff; }

.foot { position: relative; z-index: 1; text-align: center; font-size: 13px; color: var(--text-3); padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 3rem); }
.foot a { color: var(--text-3); }
