/* BRON downloads page.
   Palette: the Chambers tokens in frontend/src/app/globals.css (paper, light) and
   frontend/src/app/components/marketing/publicDarkSurface.ts (lamplit study, dark),
   the same hexes ios/BronCollectorMac/CollectorTheme.swift mirrors.
   Type: EB Garamond for display (the brand face), Inter for text (the app's sans).
   Both are the Latin subsets the frontend already serves, self-hosted under fonts/ (OFL). */

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #FAF7F2;
  --bg-glow: rgba(197, 106, 78, 0.07);
  --surface: #FFFDF9;
  --sunken: #F4EEE4;
  --fill: #F1EADE;
  --ink: #1C1A17;
  --ink-2: #3A332A;
  --muted: #6B6256;
  --hairline: #E8E0D2;
  --hairline-strong: #DCD2C1;
  --mark: #C56A4E;
  --action: #A84F34;
  --action-hover: #954329;
  --on-action: #FFF7F2;
  --focus: #A84F34;
  --pass: #7C9A86;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.04), 0 12px 32px -12px rgba(60, 40, 20, 0.12);

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-press: 160ms;
  --duration-enter: 600ms;

  --gutter: 16px;
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141009;
    --bg-glow: rgba(217, 146, 111, 0.10);
    --surface: #1C1710;
    --sunken: #0E0B07;
    --fill: #221C15;
    --ink: #EDE5D8;
    --ink-2: #D9CFBF;
    --muted: #A79A85;
    --hairline: #2B241B;
    --hairline-strong: #3A3126;
    --mark: #D9926F;
    --action: #D9926F;
    --action-hover: #E5A585;
    --on-action: #2A130A;
    --focus: #D9926F;
    --pass: #93B49E;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.55);
  }
}

@media (min-width: 640px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--action); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

code, pre { font-family: var(--mono); font-size: 0.8125rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ── Header ──────────────────────────────────────────────── */
.site-header { position: relative; z-index: 2; }
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-decoration: none;
  color: var(--ink);
  padding-block: 10px;
}
.wordmark:hover { color: var(--ink); }
.header-link {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
}
.header-link:hover { color: var(--ink); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding-block: clamp(40px, 9vw, 104px) clamp(56px, 9vw, 112px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -64px 0 auto;
  height: 560px;
  background: radial-gradient(ellipse 50% 60% at 50% 20%, var(--bg-glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-mark {
  width: 44px;
  height: 46px;
  stroke: var(--mark);
  margin-bottom: 28px;
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.875rem, 8.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lede {
  margin-top: 20px;
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 30rem;
}
.cta-ios { display: none; }
html[data-platform="iphone"] .cta-mac,
html[data-platform="ipad"] .cta-mac { display: none; }
html[data-platform="iphone"] .cta-ios,
html[data-platform="ipad"] .cta-ios { display: flex; }
.note-other { display: none; }
html[data-platform="other"] .note-other { display: block; }

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dot { opacity: 0.6; }
.note { font-size: 0.9375rem; color: var(--muted); text-wrap: pretty; }
.alt { font-size: 0.9375rem; }
.alt a {
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.alt a::after { content: "\2009\2192"; }
.alt a:hover { color: var(--action); }

/* ── Buttons ─────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-press) var(--ease-out),
              background-color var(--duration-press) var(--ease-out),
              border-color var(--duration-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.button:active { transform: scale(0.97); }
.button-primary {
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 24px -10px color-mix(in srgb, var(--action) 70%, transparent);
}
.button-primary:hover { background: var(--action-hover); color: var(--on-action); }
.button-icon { width: 20px; height: 20px; margin-left: -4px; }
.button-secondary {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.9375rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline-strong);
}
.button-secondary:hover { color: var(--ink); border-color: var(--muted); background: var(--fill); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 1rem;
}
.status-pill-small { min-height: 36px; padding: 0 14px; font-size: 0.875rem; margin-top: 20px; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 22%, transparent);
}

/* ── Platform cards ──────────────────────────────────────── */
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 20px; } }

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}
@media (min-width: 640px) { .card { padding: 32px; } }
.card .button-secondary { margin-top: 24px; }
.eyebrow {
  margin-top: 28px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-title {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.card-body { margin-top: 10px; color: var(--ink-2); text-wrap: pretty; }
.card-meta { margin-top: 14px; font-size: 0.8125rem; color: var(--muted); text-wrap: pretty; }
.card-meta a { color: var(--ink-2); }

/* Card art: drawn with CSS, decorative only. */
.card-art {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, var(--bg-glow), transparent 70%),
    var(--sunken);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.menubar {
  position: absolute;
  inset: 0 0 auto;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-inline: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.menubar-glyph {
  order: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--ink);
}
.menubar-glyph svg { width: 16px; height: 16px; }
.menubar-bar { width: 44px; height: 6px; border-radius: 3px; background: var(--hairline-strong); order: 1; }
.menubar-bar.short { width: 24px; }
.popover {
  position: absolute;
  top: 40px;
  right: 72px;
  width: min(236px, calc(100% - 84px));
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.popover-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.005em; }
.popover-rows { display: grid; gap: 8px; margin-top: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-line { height: 6px; width: 70%; border-radius: 3px; background: var(--hairline-strong); }
.row-line.short { width: 48%; }
.row-mark { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--pass); }
.popover-button {
  display: block;
  margin-top: 14px;
  padding: 7px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--fill);
  color: var(--ink);
}

.card-art-phone { display: grid; place-items: end center; }
.phone {
  position: relative;
  width: 124px;
  height: 176px;
  margin-bottom: -24px;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-bottom: 0;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 40px;
  height: 11px;
  margin-left: -20px;
  border-radius: 999px;
  background: #0A0806;
}
.phone-mark { width: 34px; height: 36px; stroke: var(--mark); margin-top: -8px; }

/* ── Sections ────────────────────────────────────────────── */
.platforms { padding-bottom: clamp(24px, 5vw, 48px); }
.section { padding-block: clamp(48px, 8vw, 88px); }
/* Dividers sit inside the column, not edge to edge. */
.section + .section { padding-top: 0; }
.section + .section > .wrap::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--hairline);
  margin-bottom: clamp(48px, 8vw, 88px);
}
.section-head { max-width: 36rem; margin-bottom: clamp(28px, 4vw, 44px); }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.section-lede { margin-top: 12px; color: var(--muted); font-size: 1.0625rem; text-wrap: pretty; }

.points { display: grid; gap: 28px; }
@media (min-width: 640px) { .points { grid-template-columns: 1fr 1fr; gap: 36px 40px; } }
@media (min-width: 980px) { .points { grid-template-columns: repeat(4, 1fr); gap: 32px; } }
.point { padding-top: 18px; border-top: 1px solid var(--hairline-strong); }
.point-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--mark);
  font-variant-numeric: oldstyle-nums;
}
.point-title { margin-top: 10px; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.point p { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; text-wrap: pretty; }
.aside { margin-top: clamp(32px, 5vw, 48px); font-size: 0.875rem; color: var(--muted); max-width: 40rem; }

.req-col { padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--hairline); }
@media (min-width: 640px) { .req-col { padding: 28px 32px; } }
.req-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.req-list { margin-top: 12px; }
.req-list div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 16px;
  padding-block: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 0.9375rem;
}
.req-list div:first-child { border-top: 0; }
.req-list dt { color: var(--muted); }
.req-list dd { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── What's new ──────────────────────────────────────────── */
.release { max-width: 42rem; }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.release-version { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.release-date { color: var(--muted); font-size: 0.9375rem; }
.release-notes { margin-top: 16px; color: var(--ink-2); }
.release-notes > * + * { margin-top: 10px; }
.release-notes h3 { font-size: 0.9375rem; font-weight: 600; margin-top: 18px; }
.release-notes ul { margin: 8px 0 0; padding-left: 1.2em; }
.release-notes li { margin-top: 6px; }
.release-notes li::marker { color: var(--mark); }
.release-link { margin-top: 14px; font-size: 0.9375rem; }
.release-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.release-link a::after { content: "\2009\2192"; }

.verify {
  margin-top: 24px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.verify summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: 16px;
}
.verify summary::-webkit-details-marker { display: none; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform 200ms var(--ease-out); }
.verify[open] .chev { transform: rotate(90deg); }
.verify-body {
  padding: 4px 18px 20px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.verify-body > * + * { margin-top: 12px; }
.verify-body code { overflow-wrap: anywhere; }
.hash-row { display: flex; align-items: flex-start; gap: 10px; }
.hash {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  color: var(--ink);
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
}
.copy {
  flex: none;
  min-height: 44px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-press) var(--ease-out);
  touch-action: manipulation;
}
.copy:hover { background: var(--fill); }
.copy:active { transform: scale(0.97); }
.verify-state { font-size: 0.8125rem; color: var(--muted); }
.verify-state:empty { display: none; }
.cmd {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.verify-foot { font-size: 0.8125rem; color: var(--muted); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
  font-size: 0.8125rem;
  color: var(--muted);
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-mark { width: 14px; height: 15px; stroke: var(--mark); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-left: -4px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--ink); }

/* ── Entry motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    animation: rise var(--duration-enter) var(--ease-out) both;
  }
  .hero-inner > :nth-child(2) { animation-delay: 60ms; }
  .hero-inner > :nth-child(3) { animation-delay: 120ms; }
  .hero-inner > :nth-child(n+4) { animation-delay: 180ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-inner > * { animation: fade 300ms ease both; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .button:active, .copy:active { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --muted: var(--ink-2); --hairline: var(--hairline-strong); }
}
@media (prefers-reduced-transparency: reduce) {
  .menubar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .button, .copy, .status-pill, .card, .verify { border: 1px solid CanvasText; }
}

[hidden] { display: none !important; }
