/* Downer website. The app's own rules, on the web:
   glass is for the controls you touch, content sits on flat surfaces, red is reserved for the one primary
   action and the progress line, everything else is neutral, and motion is smooth and never bouncy.
   Tokens mirror Downer/DesignSystem.swift: Brand.red #F0384A, ink #0E0A0C, porcelain #F8F3F4. */

:root {
  color-scheme: light dark;
  --ground: #f8f3f4;
  --ink: #1c1417;
  --ink-2: #5d5156;
  --ink-3: #7d7075;
  --surface: #ffffff;
  --surface-2: #f1eaec;
  --line: rgba(28, 20, 23, 0.10);
  --line-strong: rgba(28, 20, 23, 0.18);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(28, 20, 23, 0.10);
  --red: #f0384a;
  --red-light: #ff5468;
  --red-deep: #d9213c;
  --on-red: #ffffff;
  --glow-a: rgba(240, 56, 74, 0.20);
  --glow-b: rgba(120, 128, 220, 0.20);
  --glow-c: rgba(255, 170, 140, 0.22);
  --shadow: 0 30px 70px -24px rgba(60, 20, 30, 0.35), 0 8px 22px -10px rgba(60, 20, 30, 0.22);
  --r: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e0a0c;
    --ink: #f6eff1;
    --ink-2: #b8abb0;
    --ink-3: #8f8287;
    --surface: #1a1215;
    --surface-2: #231a1e;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.17);
    --glass: rgba(34, 24, 28, 0.62);
    --glass-line: rgba(255, 255, 255, 0.12);
    --glow-a: rgba(240, 56, 74, 0.30);
    --glow-b: rgba(110, 90, 210, 0.28);
    --glow-c: rgba(255, 120, 130, 0.16);
    --shadow: 0 34px 80px -24px rgba(0, 0, 0, 0.75), 0 10px 26px -10px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* the window ground from the app: three soft colour fields over ink or porcelain */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 980px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(520px 420px at 12% 6%, var(--glow-a), transparent 70%),
    radial-gradient(560px 460px at 92% 14%, var(--glow-b), transparent 70%),
    radial-gradient(520px 380px at 56% 46%, var(--glow-c), transparent 72%);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); text-decoration: none; transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 8px; }

/* Navigation: the control layer, so it is glass */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(22px);
  backdrop-filter: saturate(1.6) blur(22px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--glass-line); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav nav a { display: block; padding: 8px 12px; border-radius: 999px; font-size: 15px; color: var(--ink-2); text-decoration: none; transition: color 0.2s var(--ease), background 0.2s var(--ease); }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
/* the progress line: red, and it only ever reports how far down the page you are */
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--red-light), var(--red-deep)); }

/* Buttons: capsules; red is the one primary action */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: 600 16px/1 var(--font); text-decoration: none; padding: 0 22px; height: 46px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { color: var(--on-red); background: linear-gradient(180deg, var(--red-light), var(--red-deep)); box-shadow: 0 10px 24px -10px rgba(240, 56, 74, 0.7); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { color: var(--ink); background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14.5px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 17px; }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero-icon { width: 104px; height: 104px; margin: 0 auto 26px; filter: drop-shadow(0 18px 30px rgba(120, 20, 40, 0.35)); }
h1 { font-size: clamp(38px, 6.4vw, 68px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 720; margin: 0 auto; max-width: 15ch; text-wrap: balance; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); max-width: 36em; margin: 20px auto 0; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.note { color: var(--ink-3); font-size: 14.5px; margin: 16px 0 0; }
.stage { position: relative; margin: 56px auto 70px; width: min(900px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; justify-items: center; }
.stage .win { width: 100%; max-width: 410px; }
.stage .win:nth-child(2) { margin-top: 44px; }
.stage .pop { position: absolute; left: 50%; bottom: -58px; width: min(340px, 56%); transform: translateX(-50%); }
.win img, .pop img { width: 100%; border-radius: 22px; box-shadow: var(--shadow); }
.pop img { border-radius: 16px; }

.trust { padding: 36px 0 8px; }
.trust ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; list-style: none; margin: 0; padding: 0; }
.trust li { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 14.5px; font-weight: 550; background: color-mix(in srgb, var(--surface) 60%, transparent); }

section { padding: 84px 0 0; }
.head { max-width: 720px; margin-bottom: 40px; }
.head.center { margin-inline: auto; text-align: center; }
.eyebrow { margin: 0 0 12px; font-size: 13.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
h2, .h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; margin: 0; text-wrap: balance; }
h3 { font-size: 19px; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 650; }
.head .lede { margin: 16px 0 0; }
.head.center .lede { margin-inline: auto; }

/* Content sits on flat surfaces: no glass on glass */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.ic { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 16px; }
.ic svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; counter-reset: p; }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 26px 24px; position: relative; counter-increment: p; }
.principle::before { content: counter(p); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 650; font-size: 14px; margin-bottom: 14px; }
.principle p { margin: 0; color: var(--ink-2); }
.principle.wide { grid-column: 1 / -1; }
.principle.plain { counter-increment: none; }
.principle.plain::before { display: none; }
.rules { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.rules li { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.rules b { color: var(--ink); font-weight: 650; }

/* Gallery */
.gallery-bar { display: flex; justify-content: center; margin-bottom: 28px; }
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tabs button { border: 0; background: transparent; color: var(--ink-2); font: 600 15px/1 var(--font); padding: 11px 18px; border-radius: 999px; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink); }
.panel { margin: 0; display: grid; place-items: center; gap: 18px; }
.panel[hidden] { display: none; }
.panel .win img { max-height: 760px; width: auto; max-width: 100%; margin-inline: auto; }
.panel figcaption { color: var(--ink-2); text-align: center; max-width: 46ch; font-size: 16px; }
.panel.in { animation: rise 0.45s var(--ease) both; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.menubar { margin-top: 56px; text-align: center; }
.menubar img { margin-inline: auto; border-radius: 14px; max-width: min(100%, 700px); }
.menubar p { color: var(--ink-2); font-size: 16px; margin: 14px auto 0; max-width: 52ch; }

/* Install */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 800px; }
.steps > li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px 22px 70px; position: relative; }
.steps > li::before { content: counter(s); position: absolute; left: 22px; top: 22px; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-weight: 650; font-size: 15px; color: var(--ink-2); }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }
.steps p + p, .steps .cmd { margin-top: 12px; }
.cmd { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 8px 8px 8px 16px; }
.cmd code { font: 500 14px/1.4 var(--mono); overflow-x: auto; white-space: nowrap; flex: 1; scrollbar-width: none; }
.cmd button { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.install-cta { margin-top: 28px; }

/* Privacy */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.privacy ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.privacy li { color: var(--ink-2); padding-left: 24px; position: relative; font-size: 16px; }
.privacy li::before { content: ""; position: absolute; left: 4px; top: 0.7em; width: 8px; height: 8px; border-radius: 999px; background: var(--ink-3); }
.privacy b { color: var(--ink); font-weight: 650; }

footer { margin-top: 110px; padding: 36px 0 56px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
footer ul { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* Changelog */
.page-head { padding: 64px 0 8px; }
.page-head h1 { margin: 0; max-width: 18ch; font-size: clamp(36px, 5.2vw, 56px); }
.page-head .lede { margin-left: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 26px 0 0; }
.jump a { display: block; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 15px; font-weight: 550; color: var(--ink-2); transition: border-color 0.2s var(--ease), color 0.2s var(--ease); }
.jump a:hover { color: var(--ink); border-color: var(--line-strong); }
.log { padding-top: 48px; }
.log-wrap { display: grid; gap: 16px; max-width: 820px; }
.release { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 30px; }
.release h2 { font-size: 26px; letter-spacing: -0.02em; }
.release .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--ink-3); font-size: 14.5px; margin: 8px 0 16px; }
.tag { padding: 3px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.release ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); font-size: 16px; }
.release li::marker { color: var(--ink-3); }
.release strong { color: var(--ink); font-weight: 650; }
.release code, .steps code:not(.block) { font: 500 0.9em var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.release .more { margin: 16px 0 0; font-size: 15px; color: var(--ink-3); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .privacy, .principles { grid-template-columns: 1fr; }
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .stage { grid-template-columns: 1fr; margin-bottom: 40px; }
  .stage .win:nth-child(2) { display: none; }
  .stage .pop { position: static; transform: none; width: 100%; max-width: 340px; margin-top: -6px; }
  section { padding-top: 64px; }
  .release { padding: 22px 20px; }
  .steps > li { padding: 20px 18px 20px 62px; }
  .steps > li::before { left: 16px; top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.12s !important; }
  .js .reveal { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .tabs, .btn-ghost { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(128, 128, 128, 0.55); --ink-2: var(--ink); --ink-3: var(--ink); }
}
