/* Stowed marketing site: shared tokens, type, nav, footer and page furniture.
   Direction and rationale live in /DESIGN.md (web/DESIGN.md in the repo). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 100%;
  font-display: swap;
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched fallback for Archivo (audit P1-12): local Arial scaled so text
   occupies the same space before the web font swaps in, cutting layout shift.
   Values computed from archivo-var-latin.woff2 vs Arial (Capsize method,
   English letter-frequency weighted average advance width). */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 102.51%;
  ascent-override: 85.65%;
  descent-override: 20.49%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-mono-500-latin.woff2") format("woff2");
}

:root {
  /* Ground: warm stock paper, three steps */
  --paper: #f2eee5;
  --paper-deep: #e8e2d4;
  --sheet: #fbf9f4;
  --rule: #d4ccbb;

  /* Ink: teal-black family */
  --ink: #14211f;
  --ink-2: #3b4845;
  --ink-3: #5d6763;

  /* Brand teal (identity anchor) */
  --teal: #2e6f6b;
  --teal-deep: #24605c;
  --teal-bright: #5ab8b3;
  --teal-tint: #dde7e2;

  /* Night: the dark field */
  --night: #0c1e1d;
  --night-2: #132928;
  --night-rule: #27403e;
  --night-text: #e8e4da;
  --night-muted: #a9bbb8;

  /* Signal: label amber. Fills only, always with --ink text. */
  --amber: #e8a33d;
  --amber-soft: #f6dfae;

  /* Legacy aliases so older inline styles keep resolving */
  --accent: var(--teal);
  --accent-light: var(--teal-deep);
  --accent-bright: var(--teal-bright);
  --bg-dark: var(--night);
  --bg-mid: var(--night-2);
  --bg-light: var(--paper-deep);
  --border: var(--rule);
  --muted: var(--ink-3);
  --white: #fff;

  /* Type */
  --f-sans: "Archivo", "Archivo Fallback", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --t-display: clamp(3.25rem, 1.8rem + 5.4vw, 6.5rem); /* 52 -> 104 */
  --t-h2: clamp(2.125rem, 1.45rem + 2.7vw, 3.75rem);    /* 34 -> 60 */
  --t-h3: 1.375rem;                                    /* 22 */
  --t-lead: 1.1875rem;                                 /* 19 */
  --t-body: 1.0625rem;                                 /* 17 */
  --t-ui: 0.9375rem;                                   /* 15 */
  --t-small: 0.8125rem;                                /* 13 */

  /* Space (8px base) */
  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 48px; --s-6: 64px; --s-7: 96px; --s-8: 128px;
  --gutter: clamp(16px, 2vw, 32px);
  --margin: clamp(20px, 4vw, 48px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
strong { font-weight: 650; }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--teal-deep); outline-offset: 3px; }
.on-night :focus-visible, .site-footer :focus-visible { outline-color: var(--teal-bright); }

.skip-link {
  position: absolute; left: var(--margin); top: -60px; z-index: 1000;
  background: var(--ink); color: var(--paper); padding: 10px 16px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--margin)); margin: 0 auto; padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* ---------- Type roles ---------- */
.display, .h2, .h3 { font-family: var(--f-sans); color: inherit; }
.display {
  font-size: var(--t-display); font-weight: 760; font-stretch: 72%;
  line-height: 0.9; letter-spacing: -0.012em;
}
.h2 {
  font-size: var(--t-h2); font-weight: 720; font-stretch: 78%;
  line-height: 0.98; letter-spacing: -0.008em;
}
.h3 { font-size: var(--t-h3); font-weight: 650; font-stretch: 90%; line-height: 1.2; letter-spacing: -0.005em; }
.lead { font-size: var(--t-lead); line-height: 1.55; color: var(--ink-2); }
.mono { font-family: var(--f-mono); font-size: var(--t-small); letter-spacing: 0; }
.fine { font-size: var(--t-small); line-height: 1.55; color: var(--ink-3); }
.fine a, .lead a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Buttons: square, solid, label-like ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  font-family: var(--f-sans); font-size: var(--t-ui); font-weight: 650; font-stretch: 92%;
  letter-spacing: 0.005em; line-height: 1.2; text-decoration: none;
  border: 0; border-radius: 0; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--teal-deep); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn .arrow { font-family: var(--f-mono); font-weight: 500; }
.text-link {
  color: var(--teal-deep); font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.text-link:hover { color: var(--ink); }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(242, 238, 229, 0.94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: var(--s-3); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.brand span { font-size: 1.5rem; font-weight: 760; font-stretch: 75%; letter-spacing: -0.01em; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: var(--t-ui); font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.nav-links a.btn { color: #fff; padding: 10px 18px; min-height: 40px; }
.nav-links a.btn:hover { text-decoration: none; }
.nav-sep { width: 1px; height: 20px; background: var(--rule); }

/* No-JS menu used on secondary pages */
.nav-menu { display: none; position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; font-size: var(--t-ui); font-weight: 600;
  padding: 10px 14px; box-shadow: inset 0 0 0 1.5px var(--ink); min-height: 44px; display: flex; align-items: center;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: var(--ink); color: var(--paper); }
.nav-menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 2 * var(--margin)));
  background: var(--sheet); box-shadow: 0 1px 0 var(--rule), 0 18px 40px rgba(20, 33, 31, 0.18);
  display: flex; flex-direction: column; padding: 8px 0;
}
.nav-menu .menu-panel a { padding: 13px 18px; text-decoration: none; font-weight: 550; border-bottom: 1px solid var(--paper-deep); }
.nav-menu .menu-panel a:last-child { border-bottom: 0; }
.nav-menu .menu-panel a:hover { background: var(--paper); }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
}

/* ---------- Secondary page header ---------- */
.page-head { padding: var(--s-6) 0 var(--s-5); border-bottom: 1px solid var(--rule); }
.crumbs { font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-3); margin-bottom: var(--s-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--teal-deep); text-decoration: underline; }
.page-head h1 { font-size: var(--t-h2); font-weight: 720; font-stretch: 78%; line-height: 0.98; letter-spacing: -0.008em; max-width: 20ch; }
.page-head .lead { margin-top: var(--s-3); max-width: 60ch; }
.page-head .meta { margin-top: var(--s-2); font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-3); }
.page-head .cta-row { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Long-form prose ---------- */
.page-body { padding: var(--s-5) 0 var(--s-7); }
.prose { max-width: 680px; }
.prose > * + * { margin-top: 1em; }
.prose p, .prose li { color: var(--ink-2); }
.prose p.lead { color: var(--ink-2); font-size: var(--t-lead); }
.prose h2 {
  font-size: var(--t-h3); font-weight: 700; font-stretch: 88%; line-height: 1.2; color: var(--ink);
  margin-top: 2.4em; padding-top: 0.9em; border-top: 2px solid var(--ink);
}
.prose h3 { font-size: var(--t-body); font-weight: 700; color: var(--ink); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--teal); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-5) 0; }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-ui); margin-top: 1.5em; }
.prose th, .prose td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-family: var(--f-mono); font-size: var(--t-small); font-weight: 500; color: var(--ink-3); border-bottom: 2px solid var(--ink); }
.prose td:last-child { color: var(--teal-deep); font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* FAQ blocks as ruled entries */
.faq-item { border-top: 1px solid var(--rule); padding: 20px 0 22px; }
.faq-item:last-of-type { border-bottom: 1px solid var(--rule); }
.prose .faq-item { margin-top: 0; }
.faq-q { font-weight: 650; font-size: var(--t-body); color: var(--ink); margin-bottom: 6px; }
.faq-a { color: var(--ink-2); }

/* Call-to-action slab (secondary pages) */
.cta-band, .cta-slab {
  background: var(--night); color: var(--night-text);
  padding: var(--s-4) var(--s-4) var(--s-4); margin: var(--s-5) 0;
  display: grid; gap: var(--s-2); justify-items: start;
}
.cta-band h2, .cta-slab h2 {
  font-size: var(--t-h3); font-weight: 720; font-stretch: 85%; line-height: 1.15; color: #fff;
  border: 0; padding: 0; margin: 0;
}
.cta-band p, .cta-slab p { color: var(--night-muted); margin: 0; }
.cta-band .btn, .cta-slab .btn { margin-top: 8px; }
.prose .cta-band a.btn, .prose .cta-slab a.btn { color: #fff; text-decoration: none; }

/* Feature trio (secondary pages) */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3); }
.feature-card { border-top: 2px solid var(--ink); padding-top: 14px; }
.feature-card strong { display: block; font-size: var(--t-body); color: var(--ink); margin-bottom: 6px; }
.feature-card p { font-size: var(--t-ui); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--night-muted); padding: var(--s-6) 0 var(--s-4); }
.site-footer .grid { row-gap: var(--s-4); }
.footer-brand { grid-column: span 5; }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin-top: var(--s-2); max-width: 34ch; font-size: var(--t-ui); }
.footer-col { grid-column: span 2; }
.footer-col:first-of-type { grid-column: 7 / span 2; }
.footer-col h2, .footer-col .footer-h { font-family: var(--f-mono); font-size: var(--t-small); font-weight: 500; color: var(--teal-bright); margin-bottom: 12px; }
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { color: var(--night-text); text-decoration: none; font-size: var(--t-ui); }
.footer-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-legal {
  margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--night-rule);
  font-size: var(--t-small); line-height: 1.6; color: var(--night-muted);
}
@media (max-width: 860px) {
  .footer-brand { grid-column: 1 / -1; }
  .footer-col, .footer-col:first-of-type { grid-column: span 4; }
}
@media (max-width: 520px) {
  .footer-col, .footer-col:first-of-type { grid-column: span 6; }
}

/* ---------- Single-card utility pages (crypto, thanks) ---------- */
.utility-page { background: var(--night); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet {
  background: var(--sheet); width: 100%; max-width: 480px; padding: 36px 32px 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); position: relative;
}
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--teal); }
.sheet .brand { margin-bottom: var(--s-3); }
.sheet h1 { font-size: 2.25rem; font-weight: 740; font-stretch: 78%; line-height: 1; letter-spacing: -0.008em; margin-bottom: 12px; }
.sheet p { color: var(--ink-2); font-size: var(--t-ui); margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Buttons inside prose keep their own colors */
.prose a.btn { text-decoration: none; }
.prose a.btn-primary { color: #fff; }
.prose a.btn-line { color: var(--ink); }
.prose a.btn-line:hover { color: var(--paper); }

/* Two-column secondary layout: prose plus a slim rail */
.page-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.page-layout .prose { grid-column: 1 / span 8; }
.page-layout .rail { grid-column: 10 / span 3; align-self: start; position: sticky; top: 100px; }
.rail-box { border-top: 2px solid var(--ink); padding-top: 14px; }
.rail-box p { font-size: var(--t-ui); color: var(--ink-2); margin-bottom: 14px; }
.rail-box .btn { width: 100%; }
.rail-box .mono { display: block; color: var(--ink-3); margin-bottom: 8px; }
@media (max-width: 900px) {
  .page-layout .prose, .page-layout .rail { grid-column: 1 / -1; }
  .page-layout .rail { position: static; margin-top: var(--s-5); }
}

/* Blog index: posts as a ruled list */
.post-list { list-style: none; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 7fr) minmax(0, 1fr); column-gap: var(--gutter);
  padding: 28px 0 30px; border-top: 1px solid var(--ink); text-decoration: none; color: inherit;
}
.post-list li:last-child .post-card { border-bottom: 1px solid var(--ink); }
.post-tag { font-family: var(--f-mono); font-size: var(--t-small); color: var(--teal-deep); padding-top: 6px; }
.post-card h2 { font-size: var(--t-h3); font-weight: 680; font-stretch: 88%; line-height: 1.2; margin-bottom: 8px; max-width: 40ch; }
.post-card p { color: var(--ink-2); max-width: 62ch; }
.post-card .go { font-family: var(--f-mono); font-size: var(--t-h3); color: var(--teal-deep); justify-self: end; padding-top: 2px; transition: transform .15s ease; }
.post-card:hover h2 { color: var(--teal-deep); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.post-card:hover .go { transform: translateX(4px); }
@media (max-width: 700px) {
  .post-card { grid-template-columns: 1fr; row-gap: 6px; }
  .post-card .go { display: none; }
}

/* Support page pieces */
.contact-slab { background: var(--sheet); box-shadow: inset 4px 0 0 var(--teal); padding: 22px 24px; }
.contact-slab strong { display: block; font-size: var(--t-lead); color: var(--ink); margin-bottom: 4px; }
.contact-slab p { margin: 0; color: var(--ink-2); font-size: var(--t-ui); }
.callout { background: var(--amber-soft); padding: 20px 24px 20px 44px; }
.callout li { color: var(--ink); }
.callout li::marker { color: var(--ink); font-family: var(--f-mono); }
.page-head h1.wide { max-width: 24ch; }
.prose hr:has(+ h2) { display: none; }
.prose h2 + .faq-item { margin-top: 14px; }
.prose .callout { padding: 18px 24px 18px 48px; }
