/* ============================================================================
   Flat Earth Files — design system
   Aesthetic: observatory archive. Ink-navy ground, parchment accents, a horizon
   rule used as the repeating motif, instrument-grade numerals for measurements.
   No framework, no external requests except one display + one text face.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ink ground */
  --ink-900: #080b14;
  --ink-800: #0c1020;
  --ink-700: #121829;
  --ink-600: #1b2338;
  --line: rgba(199, 178, 128, 0.18);
  --line-strong: rgba(199, 178, 128, 0.34);

  /* parchment + brass */
  --paper: #f4efe2;
  --paper-dim: #d9d2c0;
  --brass: #c7b280;
  --brass-bright: #e2cc96;
  --silt: #7d8aa3;

  /* signal */
  --ok: #6fae87;
  --warn: #d8a75f;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 3px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--paper-dim);
  font: 400 clamp(1rem, 0.35vw + 0.94rem, 1.075rem)/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* the ground is never flat: a faint horizon glow anchored to the viewport */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 62vh;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 118%, rgba(199, 178, 128, 0.10), transparent 62%),
    radial-gradient(90% 55% at 12% -12%, rgba(60, 92, 158, 0.16), transparent 70%);
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); }
p { margin: 0 0 1.15em; max-width: var(--measure); }
a { color: var(--brass-bright); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brass); }
strong { color: var(--paper); font-weight: 600; }
small { font-size: 0.82rem; color: var(--silt); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }

.wrap { width: min(1180px, 100% - var(--gutter) * 2); margin-inline: auto; position: relative; z-index: 1; }
.narrow { max-width: 760px; }
.eyebrow {
  font: 600 0.72rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass);
  display: block; margin-bottom: 0.9rem;
}
.lede { font-size: clamp(1.08rem, 1.5vw, 1.3rem); color: var(--paper); max-width: 60ch; }
.muted { color: var(--silt); }

/* ---- header ------------------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--ink-900) 88%, transparent);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: Fraunces, serif; font-weight: 700;
         font-size: 1.06rem; color: var(--paper); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; flex: 0 0 auto; }
.masthead nav { margin-left: auto; display: flex; gap: 1.35rem; align-items: center; }
.masthead nav a { color: var(--paper-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--brass-bright); }
@media (max-width: 720px) {
  .masthead nav { gap: 0.9rem; }
  .masthead nav a.hide-sm { display: none; }
}

/* ---- the motif: a horizon rule ----------------------------------------- */
.horizon { position: relative; height: 1px; background: var(--line-strong); margin: 3.2rem 0; }
.horizon::after {
  content: ""; position: absolute; left: 50%; top: -3px; width: 7px; height: 7px;
  transform: translateX(-50%) rotate(45deg); background: var(--brass);
}

/* ---- hero -------------------------------------------------------------- */
.hero { padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero h1 { max-width: 20ch; }
.hero h1 em { font-style: normal; color: var(--brass-bright); }
.hero .lede { margin-top: 1.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.35rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1px solid var(--line-strong); color: var(--paper);
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--brass); }
.btn-primary { background: linear-gradient(180deg, var(--brass-bright), var(--brass)); color: #16130a; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(180deg, #efdcac, var(--brass-bright)); }

/* ---- cards / grids ----------------------------------------------------- */
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  position: relative; display: block; padding: 1.5rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.card::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0; transition: opacity .2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card h3 { margin-bottom: 0.4rem; }
.card p { font-size: 0.95rem; margin-bottom: 0; color: var(--silt); }
.card .tag { font: 600 0.68rem/1 ui-monospace, monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); display: block; margin-bottom: 0.75rem; }

/* ---- measurement strip (the site's signature component) ---------------- */
.measure-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--ink-800), var(--ink-700));
}
.measure-strip div { padding: 1.3rem 1.4rem; border-right: 1px solid var(--line); }
.measure-strip div:last-child { border-right: 0; }
.measure-strip .val {
  font: 700 clamp(1.5rem, 2.6vw, 2.05rem)/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--brass-bright); display: block; letter-spacing: -0.02em;
}
.measure-strip .lbl { display: block; margin-top: 0.5rem; font-size: 0.84rem; color: var(--silt); }
@media (max-width: 640px) { .measure-strip div { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---- article / long-form ---------------------------------------------- */
.article { padding: clamp(2.5rem, 6vw, 4.5rem) 0 5rem; }
.article header { margin-bottom: 2.5rem; }
.article .meta { font-size: 0.86rem; color: var(--silt); display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.9rem; }
.article h2 { margin-top: 2.6rem; }
.article h3 { margin-top: 2rem; }
.article ul, .article ol { max-width: var(--measure); padding-left: 1.2rem; color: var(--paper-dim); }
.article li { margin-bottom: 0.5rem; }
.article blockquote {
  margin: 2rem 0; padding: 1.2rem 1.5rem; border-left: 2px solid var(--brass);
  background: var(--ink-800); color: var(--paper); font-family: Fraunces, serif; font-size: 1.08rem;
}
.article blockquote p:last-child { margin-bottom: 0; }
.article figure { margin: 2.2rem 0; }
.article figure figcaption { font-size: 0.86rem; color: var(--silt); margin-top: 0.7rem; }
.article img, .article svg.diagram { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-800); }
.table-scroll { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 520px; }
th, td { padding: 0.75rem 0.95rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--ink-700); color: var(--paper); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--brass-bright); }

/* observation / claim callout */
.callout {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--brass);
  background: var(--ink-800); padding: 1.2rem 1.4rem; margin: 2rem 0; border-radius: var(--radius);
}
.callout .eyebrow { margin-bottom: 0.45rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.counter { border-left-color: var(--silt); }
.callout.counter .eyebrow { color: var(--silt); }

/* ---- FAQ (AEO-friendly: real <details>, real text) -------------------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--ink-800); margin-bottom: 0.7rem; overflow: hidden;
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer; padding: 1.05rem 1.25rem; font-weight: 600; color: var(--paper);
  font-family: Fraunces, serif; font-size: 1.06rem; list-style: none; display: flex; gap: 0.9rem; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--brass); font-family: Inter, sans-serif; font-weight: 400; flex: 0 0 auto; }
.faq details[open] summary::before { content: "－"; }
.faq .answer { padding: 0 1.25rem 1.2rem 2.6rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---- capture ---------------------------------------------------------- */
.capture {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--ink-700), var(--ink-800));
  padding: clamp(1.6rem, 3vw, 2.6rem); display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center;
}
.capture form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.capture input[type=email] {
  flex: 1 1 220px; padding: 0.85rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--ink-900); color: var(--paper); font-size: 0.95rem;
}
.capture input[type=email]:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }

/* ---- footer ----------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--line); margin-top: 4rem; padding: 3rem 0 3.5rem;
  background: var(--ink-800);
}
footer.site .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
footer.site h4 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-family: Inter, sans-serif; margin-bottom: 0.9rem; }
footer.site a { display: block; color: var(--paper-dim); text-decoration: none; font-size: 0.92rem; margin-bottom: 0.5rem; }
footer.site a:hover { color: var(--brass-bright); }
.standing-note {
  margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  font-size: 0.84rem; color: var(--silt); max-width: 78ch;
}

/* ---- utilities -------------------------------------------------------- */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--brass); color: #16130a; padding: 0.6rem 1rem; border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
