/* Agate — agatepro.com. The app's own tokens (Theme.swift, the terracotta
   theme that matches the icon): Petrona for words, the system sans for UI,
   mono capitals for kickers. */

@font-face {
  font-family: "Petrona";
  src: url("/assets/fonts/Petrona.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Petrona";
  src: url("/assets/fonts/Petrona-Italic.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --desk: #EFE9DF;
  --page: #FBF8F3;
  --sheet: #FFFDF9;
  --recess: #F3EDE3;
  --border: #EAE1D5;
  --ink: #2A211B;
  --soft: #5C4F45;
  --muted: #93867A;
  --accent: #A65B3B;
  --accent-hover: #8A4A2F;
  --on-accent: #FBF8F3;
  --halo: rgba(166, 91, 59, 0.14);
  --rail: #2B2724;
  --rail-ink: #E9E1D8;
  --rail-muted: #A09489;
  --shadow: 0 0 0 1px rgba(42, 33, 27, 0.08), 0 24px 64px rgba(42, 33, 27, 0.16);
  --serif: "Petrona", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #181411;
    --page: #211C18;
    --sheet: #2A241F;
    --recess: #1B1713;
    --border: #3B332C;
    --ink: #EFE7DE;
    --soft: #CFC3B7;
    --muted: #9C8F83;
    --accent: #C97F5A;
    --accent-hover: #DB9471;
    --on-accent: #1B1511;
    --halo: rgba(201, 127, 90, 0.18);
    --rail: #151210;
    --shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 22px; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 22px; font-family: var(--sans); font-size: 14px; }
.nav a { color: var(--soft); text-decoration: none; }
.nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 56px 0 40px; text-align: center; }
.hero img.icon { width: 128px; height: 128px; }
.kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.06; font-weight: 600; letter-spacing: -0.01em; margin: 18px auto 18px; max-width: 16ch; }
.lede { font-size: clamp(19px, 2.2vw, 22px); color: var(--soft); max-width: 40em; margin: 0 auto; }
.lede em { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; font-family: var(--sans); }
.button {
  display: inline-block; padding: 11px 20px; border-radius: 8px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--on-accent);
}
.button:hover { background: var(--accent-hover); color: var(--on-accent); }
.button.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.button.quiet:hover { color: var(--accent); background: transparent; }
.fineprint { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 14px; }

/* The window: a drawing of the app, not a screenshot. */
.window {
  margin: 48px auto 0; max-width: 940px; border-radius: 14px; overflow: hidden;
  background: var(--sheet); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 220px 1fr; text-align: left;
}
.rail { background: var(--rail); color: var(--rail-ink); padding: 18px 12px; font-family: var(--sans); font-size: 13.5px; }
.lights { display: flex; gap: 7px; padding: 0 6px 18px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #4A433E; display: block; }
.rail .row { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px; color: var(--rail-muted); }
.rail .row.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.rail hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 10px 6px; }
.pane { padding: 28px 32px 32px; min-width: 0; }
.pane h2 { font-size: 30px; margin: 0 0 4px; font-weight: 600; }
.pane .sub { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 0 0 20px; }
.band {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--recess); color: var(--muted); padding: 7px 14px; border-radius: 6px; margin-bottom: 12px;
  display: flex; justify-content: space-between;
}
.card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; background: var(--sheet); }
.card.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--halo), inset 3px 0 0 var(--accent); }
.card .title { display: flex; gap: 12px; font-weight: 600; font-size: 18px; line-height: 1.3; }
.card .check { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); margin-top: 3px; }
.card .source { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin: 4px 0 0 30px; }
.card blockquote { margin: 10px 0 0 30px; padding-left: 12px; border-left: 2px solid var(--border); font-style: italic; font-size: 15px; color: var(--soft); }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 0 30px; padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--sans); font-size: 12.5px; color: var(--soft); }
.footer-row kbd { font-family: var(--mono); font-size: 10px; background: var(--halo); color: var(--accent); border-radius: 4px; padding: 1px 5px; margin-left: 5px; }

/* Sections */
section { padding: 72px 0 0; }
section > .kicker { display: block; text-align: center; }
section h2.big { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; font-weight: 600; text-align: center; margin: 10px auto 12px; max-width: 22ch; }
section p.intro { text-align: center; color: var(--soft); max-width: 38em; margin: 0 auto 36px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cell { border: 1px solid var(--border); border-radius: 12px; padding: 22px; background: var(--sheet); }
.cell .kicker { color: var(--accent); }
.cell h3 { font-size: 21px; font-weight: 600; margin: 8px 0 6px; line-height: 1.2; }
.cell p { margin: 0; font-size: 16px; color: var(--soft); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--sheet); }
.step { padding: 22px; border-left: 1px solid var(--border); }
.step:first-child { border-left: 0; }
.step b { display: block; font-size: 19px; margin: 6px 0 4px; }
.step p { margin: 0; font-size: 15.5px; color: var(--soft); }

.private { background: var(--recess); border-radius: 14px; padding: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.private h2 { font-size: 30px; margin: 8px 0 10px; font-weight: 600; line-height: 1.15; }
.private p { margin: 0 0 12px; color: var(--soft); font-size: 17px; }
.private ul { margin: 0; padding: 0; list-style: none; font-size: 16px; }
.private li { padding: 10px 0; border-top: 1px solid var(--border); color: var(--soft); }
.private li:first-child { border-top: 0; padding-top: 0; }
.private li b { color: var(--ink); }

.requirements { text-align: center; font-family: var(--sans); font-size: 14px; color: var(--muted); padding: 56px 0 0; }

/* Prose pages */
.prose { padding: 32px 0 0; }
.prose h1 { text-align: left; margin: 8px 0 8px; max-width: none; font-size: clamp(34px, 5vw, 46px); }
.prose h2 { font-size: 25px; font-weight: 600; margin: 40px 0 8px; line-height: 1.2; }
.prose p, .prose li { color: var(--soft); }
.prose li { margin-bottom: 6px; }
.prose .dated { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.prose code, .prose kbd { font-family: var(--mono); font-size: 0.82em; background: var(--recess); border-radius: 4px; padding: 2px 6px; color: var(--ink); }

/* Footer */
footer { margin-top: 88px; border-top: 1px solid var(--border); padding: 28px 0 40px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer a { color: var(--muted); text-decoration: none; margin-left: 18px; }
footer a:first-child { margin-left: 0; }
footer a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { border-left: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--border); }
  .private { grid-template-columns: 1fr; padding: 26px; }
  .window { grid-template-columns: 1fr; }
  .rail { display: none; }
  .pane { padding: 22px 18px; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .nav { gap: 14px; }
  .steps { grid-template-columns: 1fr; }
  .step { border-left: 0; border-top: 1px solid var(--border); }
  .step:first-child { border-top: 0; }
  .card blockquote, .card .source, .footer-row { margin-left: 0; }
}
