/* Flöde website, one stylesheet for every page (index, privacy, support, 404).
   VOICE  calm product page, the app's own "Fjord & bone" look (colours from app/Theme.swift)
   IDEA   the hold screen: a quiet bone page, one fjord band, mint only where something is steady
   PICTURE the app's real screens (store/screenshots), no device frames, no drawn AirPods
   COLOUR bone #F3EFE6 / ink #1E2B36 / fjord #2B4153 / mint #9CCBB4; night #121B23 / #1B2731 / #A7C2D6
   TYPE   system fonts only (SF Pro and SF Pro Rounded on Apple devices), no web fonts
   LAYOUT phone first: one column; from 900px the hero text and the slide captions run down the left while
          one pinned phone on the right shows each slide ("Tour" below) */

:root {
  color-scheme: light dark;
  --bg: #F3EFE6; --card: #FBF9F4; --track: #E7E1D4; --line: #E2DACB;
  --ink: #1E2B36; --muted: #545C65; --accent: #2B4153;
  --band: #2B4153; --band-ink: #F3EFE6; --band-muted: #CBD3D9; --band-line: rgba(243,239,230,.22);
  --steady: #9CCBB4; --steady-ink: #2C6E53; --wobble: #EBCB8B;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121B23; --card: #1B2731; --track: #263541; --line: #2A3946;
    --ink: #EDE6D6; --muted: #A3ADB6; --accent: #A7C2D6;
    --band: #1B2731; --band-ink: #EDE6D6; --band-muted: #A9B4BE; --band-line: rgba(237,230,214,.16);
    --steady: #A3D9C1; --steady-ink: #A3D9C1; --wobble: #F0D392;
  }
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--text); overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 2; }

/* Header and footer: the same on every page */
.top { background: var(--band); color: var(--band-ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px/1 var(--round); letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--band-line); }
.top nav { display: flex; gap: 20px; font-size: 16px; }
.top nav a { text-decoration: none; color: var(--band-muted); padding: 10px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--band-ink); }
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 15px; }
.foot .wrap { display: grid; gap: 18px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink); }
.foot li a { display: inline-block; padding: 4px 0; }
.foot small { font-size: 13px; line-height: 1.5; display: block; max-width: 60em; }
/* Instagram: hidden until the placeholder handle in its link is replaced with the real one */
a[href*="INSTAGRAM_HANDLE"], li:has(> a[href*="INSTAGRAM_HANDLE"]) { display: none; }

/* App Store: the "Coming January 2027" note shows until the badge link gets the real app ID */
.store { display: flex; align-items: center; min-height: 52px; }
.store .badge img { height: 52px; width: auto; }
.store .badge[href*="APP_STORE_ID"] { display: none; }
.store .badge:not([href*="APP_STORE_ID"]) + .soon { display: none; }
.soon { display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 7px 20px; border-radius: 12px;
  border: 1px solid currentColor; font-size: 13px; line-height: 1.25; }
.soon b { font: 600 18px/1.2 var(--text); letter-spacing: -.01em; }

/* Launch list ("Notify me at launch"), on the fjord band in the hero and in "Get Flöde".
   One quiet field with the bone button inside it. The row and its "on the list" line share one grid
   cell, and so do the consent line and any error, so nothing below moves when the state changes. */
.notify { display: grid; gap: 10px; max-width: 30rem; margin-top: 28px; scroll-margin-top: 28px; }
.nlabel { font-weight: 600; font-size: 16px; letter-spacing: -.005em; }
.nstack { display: grid; }
.nstack > * { grid-area: 1 / 1; }
.nrow { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: rgba(243, 239, 230, .07);
  box-shadow: inset 0 0 0 1px var(--band-line); transition: box-shadow .2s ease; }
.nrow:focus-within { box-shadow: inset 0 0 0 1.5px var(--band-ink); }
.nrow input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: none;
  color: var(--band-ink); font: 17px/1 var(--text); outline: none; }
.nrow input::placeholder { color: var(--band-muted); opacity: .7; }
.nrow button { flex: none; min-width: 7.4em; height: 46px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--band-ink); color: var(--band); font: 600 16px/1 var(--text); letter-spacing: -.01em; transition: opacity .2s ease; }
.nrow button:hover { opacity: .9; }
.nrow button:focus-visible { outline: 2px solid var(--band-ink); outline-offset: 2px; }
.notify[aria-busy="true"] button { opacity: .6; cursor: progress; }
.notify.bad .nrow { box-shadow: inset 0 0 0 1.5px var(--wobble); }
.ndone { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 4px; color: var(--band-muted); font-size: 16px; visibility: hidden; outline: none; }
.ndone span { color: var(--band-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.ndone span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--steady); box-shadow: 0 0 0 4px rgba(156, 203, 180, .22); }
.notify.done .nrow { visibility: hidden; }
.notify.done .ndone { visibility: visible; }
.nnote, .nmsg { font-size: 13px; line-height: 1.45; text-wrap: pretty; }
.nnote { color: var(--band-muted); }
.nnote a { color: var(--band-muted); }
.nmsg { color: var(--wobble); visibility: hidden; }
.notify.bad .nmsg { visibility: visible; }
.notify.bad .nnote { visibility: hidden; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Once a badge link carries the real App Store ID, the list has done its job: hide both forms */
body:has(.badge:not([href*="APP_STORE_ID"])) .notify { display: none; }
.end .notify { margin-top: 24px; }

/* Hero: the fjord band with the title and the launch list. Its phone is the tour's first slide (below). */
.hero { background: var(--band); color: var(--band-ink); }
.hero .wrap { display: grid; gap: 36px; padding-top: 28px; padding-bottom: 28px; }
.hero h1 { font: 700 clamp(64px, 18vw, 120px)/1 var(--text); letter-spacing: -.045em; }
.hero .say { font-size: clamp(21px, 5.4vw, 27px); line-height: 1.3; margin: 14px 0 24px; max-width: 22em; text-wrap: balance; }
.hero .need { color: var(--band-muted); font-size: 15px; margin-top: 18px; max-width: 30em; }
.screen { border-radius: 13% / 6%; }

/* Sections */
.sec { padding: 64px 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec h2 { font-size: clamp(30px, 7vw, 44px); font-weight: 700; }
.lede { color: var(--muted); font-size: 18px; margin-top: 12px; max-width: 36em; }

/* Showcase, stacked (no JavaScript): caption, then the screen in a phone outline. */
.show .list { max-width: 1120px; margin: 0 auto; padding: 24px max(20px, env(safe-area-inset-left)) 48px; }
.slide { display: grid; gap: 28px; justify-items: start; padding: 48px 0; }
.cap h2 { font: 700 clamp(34px, 9vw, 60px)/1.03 var(--text); letter-spacing: -.035em; max-width: 9.5em; }
.cap p { color: var(--muted); font-size: 18px; margin-top: 14px; max-width: 25em; }
.show .shot { justify-self: center; width: min(300px, 64vw); }
.show .shot img { width: 100%; border-radius: 13.7% / 6.3%; box-shadow: 0 0 0 7px #0D141A, 0 0 0 8px #3B4752, 0 28px 60px rgba(20, 32, 42, .22); }
.rail { display: none; }

/* Tour (html.tour-on, set in <head>): the hero and the slides share one pinned phone.
   .tour is one grid cell stacked three deep: .hero and .show (the text, scrolling as usual) over .rail,
   a full-height layer whose .stage sticks to the viewport. The stage holds the tone backdrop, the phone,
   the phone-size captions and the progress ticks, all aria-hidden copies made by the script.
   Phones: the hero stays a band on top, and the rail starts under it (phone first, caption under it).
   From 900px the rail runs from the top, so the phone stands beside the hero text from the first screen.
   Motion: each screen, caption and tick is "past", "on" or ahead, and eases between them with transform,
   opacity and filter only. Scrolling back reverses the same path. Reduced motion: short fades only.
   Heights use svh/lvh, never innerHeight, so Safari's moving address bar never shifts a slide. */
.tour-on .tour { display: grid; grid-template-columns: minmax(0, 1fr); }
.tour-on .hero { grid-area: 1 / 1; position: relative; z-index: 1; }
.tour-on .show { grid-area: 2 / 1; position: relative; z-index: 1; }
.tour-on .rail { display: block; grid-area: 2 / 1; }
.tour-on .show .list { padding: 0; }
.tour-on .show .slide { height: 64svh; padding: 0; }
.tour-on .show .shot, .tour-on .show .cap {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
.tones, .tones i { position: absolute; inset: 0; }
.tones i { opacity: 0; background: var(--bg); }
.tones i.on { opacity: 1; }
.tones [data-tone="band"] { background: var(--band); }
.tones [data-tone="mint"] { background: #E4EDE5; }
.tones [data-tone="butter"] { background: #F4ECDA; }
.tones [data-tone="fjord"] { background: #E5EAEE; }
@media (prefers-color-scheme: dark) {
  .tones [data-tone="mint"] { background: #13211F; }
  .tones [data-tone="butter"] { background: #1F1E17; }
  .tones [data-tone="fjord"] { background: #14202A; }
}
.frame { position: relative; height: 100vh; height: 100svh; display: grid; justify-items: center;
  grid-template-rows: minmax(0, 1fr) auto auto; row-gap: 18px; padding: 16px max(20px, env(safe-area-inset-left)) 16px; }

/* The phone: a dark screen window (clips the moving screens) inside a thin ring */
.phone { container-type: size; width: 100%; height: 100%; display: grid; place-items: center; }
.device { position: relative; width: min(100cqw, calc(100cqh * 1206 / 2622), 76vw, 330px); aspect-ratio: 1206 / 2622;
  border-radius: 13.7% / 6.3%; box-shadow: 0 0 0 7px #0D141A, 0 0 0 8px #3B4752, 0 30px 70px rgba(13, 20, 26, .26); }
.screens { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: #0D141A; isolation: isolate; transform: translateZ(0); }
/* Ahead: a touch large and low; past: softened. Both still cover the window, so no dark edge shows mid-fade */
.scr { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translate3d(0, 1.5%, 0) scale(1.07); filter: blur(4px); }
.scr.past { transform: scale(1.03); filter: blur(6px); }
.scr.on { opacity: 1; visibility: visible; transform: none; filter: none; z-index: 1; }
.scr picture, .scr img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Phone-size captions, under the phone: one grid cell, the tallest sets the height */
.caps { display: grid; width: 100%; max-width: 34rem; text-align: center; }
.caps .cap { grid-area: 1 / 1; align-self: start; color: var(--ink); visibility: hidden; }
.caps .cap[data-tone="band"] { color: var(--band-ink); }
.caps .cap h2 { font-size: clamp(26px, 7.2vw, 34px); max-width: none; letter-spacing: -.03em; }
.caps .cap p { font-size: 15px; line-height: 1.45; margin: 8px auto 0; max-width: 24em; text-wrap: pretty; }
.caps .cap[data-tone="band"] p { color: var(--band-muted); }
.caps .cap > * { opacity: 0; transform: translate3d(0, 14px, 0); }
.caps .cap.past > * { transform: translate3d(0, -10px, 0); }
.caps .cap.on { visibility: visible; }
.caps .cap.on > * { opacity: 1; transform: none; }

/* Progress: one tick per slide, filling as you scroll through it */
.prog { display: flex; gap: 4px; color: var(--ink); }
.rail[data-tone="band"] .prog { color: var(--band-ink); }
.prog i { position: relative; width: 16px; height: 3px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, currentColor 18%, transparent); }
.prog i::after { content: ""; position: absolute; inset: 0; background: currentColor; transform-origin: left; transform: scaleX(var(--f, 0)); }

/* Motion, once the first frame is placed (no animation on load) */
.tour-ready .tones i { transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1); }
/* The incoming screen fades in on top while the outgoing one recedes, still opaque, beneath it: never a dip to black */
.tour-ready .scr { transition: opacity .3s linear .55s, transform .9s cubic-bezier(.2, .75, .15, 1), filter .7s ease, visibility 0s linear .85s; }
.tour-ready .scr.on { transition: opacity .55s cubic-bezier(.3, 0, .2, 1), transform .95s cubic-bezier(.2, .75, .15, 1), filter .7s ease, visibility 0s; }
.tour-ready .caps .cap { transition: visibility 0s linear .2s; }
.tour-ready .caps .cap > * { transition: opacity .16s ease, transform .3s ease; }
.tour-ready .caps .cap.on { transition: visibility 0s; }
.tour-ready .caps .cap.on > * { transition: opacity .45s ease .12s, transform .8s cubic-bezier(.2, .75, .15, 1) .12s; }
.tour-ready .caps .cap.on p { transition-delay: .2s; }
.tour-ready .prog { transition: color 1.1s ease; }
.tour-ready .prog i::after { transition: transform .25s linear; }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; border-top: 1px solid var(--line); padding: 20px 0 24px; display: grid; gap: 6px; }
.steps li::before { content: "Step " counter(s); color: var(--muted); font-size: 14px; }
.steps h3 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.steps p { color: var(--muted); max-width: 26em; }

.program { background: var(--card); border-radius: 26px; padding: 30px 24px; margin-top: 36px; display: grid; gap: 28px; }
.program h3 { font: 700 clamp(28px, 6vw, 36px)/1.1 var(--round); }
.program p { color: var(--muted); margin-top: 10px; max-width: 34em; }
.program p.free { color: var(--ink); }
.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px 8px; }
.days li { aspect-ratio: 1; border-radius: 50%; background: var(--track); display: grid; place-items: center; font: 600 14px/1 var(--round); color: var(--muted); }
.days li.check { background: var(--steady); color: #17382A; }
.days li.mid { box-shadow: inset 0 0 0 3px var(--steady); color: var(--ink); }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; margin-top: 14px; }
.key span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: var(--track); }
.key .k1::before { background: var(--steady); }
.key .k2::before { background: none; box-shadow: inset 0 0 0 2px var(--steady); }

.plans { display: grid; gap: 12px; }
.plans .copy { display: grid; gap: 10px; }
.plans p { font-size: 19px; max-width: 40em; }
.plans .fine { color: var(--muted); font-size: 15px; }
.price { white-space: nowrap; font-weight: 600; }

.end { background: var(--band); color: var(--band-ink); text-align: left; }
.end .wrap { display: grid; gap: 22px; padding-top: 56px; padding-bottom: 56px; }
.end h2 { font-size: clamp(30px, 7vw, 44px); font-weight: 700; }
.end p { color: var(--band-muted); max-width: 34em; }

/* Text pages (privacy, support, 404), generated by tools/store/privacy_html.py */
.doc { max-width: 42rem; margin: 0 auto; padding: 48px max(20px, env(safe-area-inset-left)) 64px; }
.doc h1 { font: 700 clamp(32px, 8vw, 44px)/1.1 var(--round); margin: 0 0 12px; }
.doc h2 { font-size: 23px; margin: 44px 0 10px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 28px 0 6px; letter-spacing: -.01em; }
.doc p { margin: 0 0 14px; }
.doc ul { padding-left: 1.25rem; margin: 0 0 14px; }
.doc li { margin: 6px 0; }
.doc h1 + p { color: var(--muted); }
.doc .button { display: inline-block; margin-top: 12px; padding: 12px 22px; border-radius: 12px; background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 600; }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
  .end .wrap { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
@media (min-width: 900px) {
  .hero .wrap { padding-top: 48px; padding-bottom: 72px; }
  .sec { padding: 96px 0; }
  html:not(.tour-on) .slide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; padding: 64px 0; }
  html:not(.tour-on) .show .shot { justify-self: end; margin-right: 8%; width: 300px; }

  /* Tour, wide: text on the left, the phone pinned on the right from the top of the page */
  .tour-on .tour { --pw: min(calc((100svh - 140px) * 1206 / 2622), 340px); --side: calc(var(--pw) + 6vw + 96px); }
  .tour-on .rail { grid-area: 1 / 1 / 3 / 2; }
  .tour-on .hero { background: none; }
  .tour-on .hero .wrap { min-height: calc(100svh - 64px); align-content: center; padding-top: 32px; padding-bottom: 48px; padding-right: var(--side); }
  .tour-on .show .list { max-width: 1120px; margin: 0 auto; padding: 0 var(--side) 8svh max(20px, env(safe-area-inset-left)); }
  .tour-on .show .slide { height: auto; min-height: 84svh; align-content: center; }
  .tour-on .show .cap { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .tour-on .show .cap h2 { font-size: clamp(44px, 5.4vw, 68px); }
  .tour-on .show .cap p { font-size: 19px; margin-top: 18px; }
  .tour-on .show .slide[data-tone="band"] .cap { color: var(--band-ink); }
  .tour-on .show .slide[data-tone="band"] .cap p { color: var(--band-muted); }
  /* The captions are the page's real text, so they never dim: the one taking over glides up into place
     (title, then paragraph), and the one leaving drifts up a little faster than the page */
  .tour-on .show .cap > * { transform: translate3d(0, 44px, 0); }
  .tour-on .show .slide.past .cap > * { transform: translate3d(0, -24px, 0); }
  .tour-on .show .slide.on .cap > * { transform: none; }
  .tour-ready .show .cap > * { transition: transform 1.1s cubic-bezier(.2, .75, .15, 1); }
  .tour-ready .show .slide.on .cap p { transition-delay: .1s; }
  .frame { max-width: 1120px; margin: 0 auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr);
    align-items: center; padding: 0 max(20px, env(safe-area-inset-right)) 0 0; }
  .phone { grid-column: 2; container-type: normal; width: auto; height: auto; margin-right: 6vw; position: relative; }
  .device { width: var(--pw); }
  .caps { display: none; }
  .prog { position: absolute; grid-column: 2; justify-self: end; margin-right: calc(6vw - 44px); flex-direction: column; gap: 4px; }
  .prog i { width: 2px; height: 22px; }
  .prog i::after { transform-origin: top; transform: scaleY(var(--f, 0)); }
  .program { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; padding: 48px; gap: 56px; }
  .days { gap: 14px 12px; }
  .days li { font-size: 15px; }
  .plans { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 56px; align-items: start; }
}

/* Reduced motion: the same tour, but every change is a short fade in place (the new screen over the old) */
@media (prefers-reduced-motion: reduce) {
  .scr, .scr.past, .caps .cap > *, .caps .cap.past > *, .tour-on .show .cap > *, .tour-on .show .slide.past .cap > * { transform: none !important; filter: none !important; }
  .tour-ready .scr { transition: opacity 0s linear .3s, visibility 0s linear .3s; }
  .tour-ready .scr.on { transition: opacity .3s ease, visibility 0s; }
  .tour-ready .caps .cap > * { transition: opacity .2s ease; }
  .tour-ready .caps .cap.on > *, .tour-ready .caps .cap.on p { transition: opacity .3s ease .15s; }
  .tour-ready .tones i { transition-duration: .3s; }
  .tour-ready .prog i::after { transition: none; }
}
