/* ==========================================================================
   forge-polish.css — Apple polish pass (Mark approved, 2026-11-02).
   Loaded LAST by every static marketing page (index, core, hyperion,
   ariadne, field-guide), after the page's own styles, so it only overrides.
   Style only: no words, labels, links or titles change here.

   Audit: ~/Developer/reference/apple-polish-2026-11/05-buildwithforge.app.md
     C-1  44px hit areas on nav, footer and controls
     H-1  one header look on every public route
     H-3  12px floor and one type ramp (12/14/17/21/28/40/56+)
     H-4  display tracking scale, text-wrap: balance
     M-2  primary button shape (12px radius), Forge violet kept
     M-3  helper line under the hero CTA
   The Next-rendered routes (/pricing, /press) carry the same header values
   in src/app/(marketing)/public-marketing.css. Change one, change both.

   Two token sets meet here: the homepage uses --ground/--line/--text/--muted,
   the ledger pages use --paper/--rule/--ink/--ink-2. Every rule falls back
   from one to the other.
   ========================================================================== */

/* ── H-1  One header: 72px, translucent paper, hairline, same wordmark ── */
.site-header,
.masthead {
  position: sticky !important;
  top: 0;
  z-index: 120;
  background: color-mix(in srgb, var(--paper, var(--ground)) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--rule, var(--line));
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .site-header,
  .masthead {
    background: var(--paper, var(--ground));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  .site-header,
  .masthead { border-bottom-color: var(--ink, var(--text)); }
}
.header-inner,
.masthead-in {
  max-width: 1320px;
  width: calc(100% - 80px);
  height: 72px;
  min-height: 72px !important;
  margin-inline: auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* The wordmark: the homepage's flat lockup at one size everywhere. */
.site-header .wordmark,
.masthead .wordmark {
  --wm-fs: 29px;
  --wm-glow: transparent;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  flex-shrink: 0;
}
:is(.site-header, .masthead) .fw-row {
  display: flex;
  align-items: baseline;
  font: 400 29px/1 Cinzel, Georgia, serif;
  letter-spacing: -1px;
  color: var(--ink, var(--text));
  filter: none;
}
:is(.site-header, .masthead) .fw-flame {
  display: inline-block;
  width: 13px;
  height: 25px;
  position: relative;
  top: 1px;
  margin: 0 1px;
  transform: none;
}
:is(.site-header, .masthead) .fw-bar {
  height: 1px;
  width: 100%;
  margin-top: 1px;
  background: var(--copper, #A34C20);
  opacity: 1;
}
:root[data-theme="dark"] :is(.site-header, .masthead) .fw-bar { background: #D58A52; }

/* Nav and sign-in: Inter 14, mixed case, muted ink, 44px tall (C-1). */
.desktop-nav,
.nav > ul { gap: 12px; }
.header-actions { gap: 12px; }
.desktop-nav a,
.site-header .login,
.nav > ul > li > a,
.nav .nav-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font: 400 14px/1.2 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2, var(--muted));
  border: 0;
  background: none;
  margin: 0;
  white-space: nowrap;
}
.desktop-nav a:hover,
.site-header .login:hover,
.nav > ul > li > a:hover,
.nav .nav-trigger:hover {
  color: var(--ink, var(--text));
  background: none;
  border: 0;
}
.nav > ul > li > a.signin { color: var(--ink-2); border: 0; margin-left: 0; padding: 0 8px; }
.nav > ul > li > a.signin:hover { color: var(--ink); background: none; }

/* Controls: the same 44px round-cornered shape on every page. */
.theme-toggle,
.themetog {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--rule, var(--line));
  background: none;
  color: var(--ink, var(--text));
  font: 400 14px/1 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.theme-toggle { width: 44px; font-size: 20px; }
.themetog { padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; }

/* Family rule 4: the appearance control lives in the footer, not the header.
   Same control, same id and script; it still follows the system until used. */
.footer-bottom { align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.footer-bottom .theme-toggle { flex: 0 0 auto; }
.foot-rule { align-items: center; }
.foot-rule .themetog {
  color: var(--plate-fg, #F3EEE4);
  border-color: rgba(243, 238, 228, .4);
  font-size: 14px;
}
.foot-rule .themetog:hover { border-color: var(--plate-fg, #F3EEE4); color: var(--plate-fg, #F3EEE4); }
.foot-rule .themetog .tt-sw { border-color: currentColor; }
@media (max-width: 900px) {
  .masthead .burger { margin-left: auto; }
}
.menu-toggle,
.burger {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  border: 0;
  background: none;
  color: var(--ink, var(--text));
  font: 400 14px/1 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 800px) {
  .menu-toggle { display: inline-flex; }
  .site-header .login { display: none; } /* phones keep Sign in in the menu, as before */
}
.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 17px;
}
.mobile-nav { gap: 0; }

@media (max-width: 1180px) {
  .desktop-nav a,
  .site-header .login,
  .nav > ul > li > a,
  .nav .nav-trigger { font-size: 13px; padding-inline: 6px; }
  .desktop-nav,
  .nav > ul { gap: 4px; }
}
@media (max-width: 520px) {
  :is(.site-header, .masthead) .fw-row { font-size: 24px; }
  :is(.site-header, .masthead) .fw-flame { width: 11px; height: 21px; }
}
@media (max-width: 900px) {
  .header-inner,
  .masthead-in { width: calc(100% - 40px); height: 60px; min-height: 60px !important; }
}

/* The field guide's sticky header needs its anchors to clear it. */
.chapter:target,
.guide-topic:target { scroll-margin-top: 88px !important; }

/* ── C-1  44px hit areas: footer and stand-alone links ───────────────── */
.site-footer nav { gap: 0 35px; }
.site-footer nav a,
.site-footer > div > a:not(.wordmark),
.site-footer .wordmark,
.colophon-foot .contact a,
.guide-intro > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
/* Text links that sit beside a button or alone: a 44px hit area from a
   transparent ::after, so nothing moves and the space before a trailing
   arrow (a flex item would drop it) is kept. */
.text-link { position: relative; }
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}
.site-footer > div > a:not(.wordmark) { display: flex !important; margin-top: 0; padding-block: 0 !important; }
.site-footer > div > a:not(.wordmark):first-of-type { margin-top: 8px; }
.colophon-foot .contact a { display: flex; }
.hiring-details summary,
.section-context > summary { min-height: 44px; padding-block: 12px; box-sizing: border-box; }

/* ── H-3  12px floor, one ramp ───────────────────────────────────────── */
/* Homepage: 9–11px labels and fine print come up to 12. */
.eyebrow { font-size: 12px; letter-spacing: .08em; }
.fine-print,
.hero-status,
.roof-photo figcaption,
.tool-list small,
.tools-footnote,
.proof-brand p,
.attribution,
.trade-live span,
.quote-label span,
.site-footer p,
.site-footer nav,
.site-footer > div > a:not(.wordmark),
.footer-bottom,
.thread-label,
.decision-state,
.example-note,
.charter-strip a,
.section-note p,
.hiring-steps li > span,
.quiet-link,
.learning-controls,
.learning-note > .fine-print,
.audio-transcript summary { font-size: 12px; }
.fine-print { font-size: 12px !important; }
.tool-list > a { font-size: 12px !important; }
.button { font-size: 14px; }
.text-link { font-size: 14px; }

/* Ledger pages (core, hyperion, ariadne, field guide): the mono labels set
   at .58–.74rem (9–11.8px) come up to the 12px label size, tracking capped
   at .08em. Measured list, 2026-11-02. */
html :is(
  .tt-o, .dateline span, .slip-head, .slip-head span, .slip-meta, .slip-meta span,
  .slip-why .wl, .figcap b, .register i, caption, th, .f-label, .f-unit, .f-src,
  .f-src a, .e-num, .d-k, .in-head, .in-head span, .in-flag, .rec-head span,
  .chapter dt, .step-btn, .sp-meta, .sp-meta span, .chapter h4, .r-k, .ix-role,
  .ix-link, .flag, .who, .who b, .terms-line, .card-role, .card-fig, .cx-role,
  .e-when, .epigram .attr, .colophon-foot h3, .foot-rule span, .cm-soon,
  .rate-terms, .pl-terms, .s-k, .capture-head, .capture-head span, .capture-seq,
  .capture-seq b, .col > h3, .instead > h3, .command > h3, .covenant > h3,
  .footnotes > h3, .runhead-in, .eyebrow, .footing .f-label,
  .footing .f-unit, h4 .live, h4 .next, .cm-n, .cm-role, .cm-soon, a > b + span,
  .job, .job i
) {
  font-size: 12px !important;
  letter-spacing: .08em !important;
}
html :is(
  .figcap, .register li, .r-yours, .r-yours em, .command .why, .step-prompt,
  .sp-note, .chart-note, .ranges-note, .ranges-note b, .charter-next,
  .charter-next a, .contact a, .contact span, .fn, .colophon-foot li a,
  .section-context > summary, .section-context .marginalia, .chapter .figcap,
  .t-t, .t-t + span
) {
  font-size: 12px !important;
}
.chapter .btn { font-size: 14px !important; letter-spacing: 0 !important; text-transform: none !important; font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif !important; }

/* ── H-4  Display tracking scale ─────────────────────────────────────── */
/* 60px+: -.025em · 32–59: -.02em · 20–31: -.01em · under 20: 0. */
h1 { letter-spacing: -.025em !important; line-height: 1.08 !important; text-wrap: balance; }
h2 { letter-spacing: -.02em !important; text-wrap: balance; }
h3 { text-wrap: balance; }
@media (max-width: 900px) {
  h1 { letter-spacing: -.02em !important; }
}
/* The hero's accent line balances on its own, so "you." is never alone. */
.hero h1 em { display: inline-block; text-wrap: balance; }
:where(.site-header ~ main) h3 { letter-spacing: 0; }
.product-feature h3 { letter-spacing: -.02em; }
.learning-note blockquote,
.charter-block h3,
.quote-label,
.tool-list .tool-name,
.trades-section h3,
.sabina-message p,
.guide-topic > summary { letter-spacing: -.01em; }
/* ── M-2  Primary button: family shape (12px radius), Forge violet ───── */
.button,
.chapter .btn { border-radius: 12px; }

/* Press feedback lives in forge-motion.css (rule 12, Sol r8: the `scale` property, so it composes with entrances).
   The homepage stylesheet's own hover lift (a transform, not limited to pointer devices) stays off; forge-motion.css
   lifts on hover:hover only. */
.button:hover { transform: none; }

/* ── M-3  The helper line under the CTA: a 12px gap, set at 13px ──────── */
.actions + .fine-print,
.charter-block .button + .fine-print { margin-top: 12px; font-size: 13px !important; }

@media (prefers-reduced-motion: reduce) {
  .button,
  .chapter .btn,
  .theme-toggle,
  .themetog { transition: none; }
  .button:active,
  .chapter .btn:active,
  .theme-toggle:active,
  .themetog:active { transform: none; }
}

/* With the appearance control gone from the masthead, "The chest" sits near the right edge, and its menu (left-aligned
   to the trigger, 380px+ wide) ran 67px past a 1440 screen and 146px past 1024: clipped when open. It now opens
   right-aligned to its trigger. */
.nav-chest .chest-menu { left: auto; right: 0; }

/* ── Family rule 11 (Mark, 2026-11-03, rewritten 16:53Z): nothing scroll-scrubbed or scroll-linked; the one-time entrances are forge-motion.css ──────────────────────
   Ledger pages: figures and charts are in their final state from the first paint (the page script now adds .in at
   once, with no observer); these rules also hold without JavaScript. */
.reveal { opacity: 1; transform: none; transition: none; } /* the page's own reveal is off; motion v2 (forge-motion) drives entrances */
.draw path, .draw circle, .draw line { stroke-dashoffset: 0 !important; opacity: 1 !important; animation: none !important; transition: none !important; }
.chart-wrap .draw-line { stroke-dashoffset: 0 !important; transition: none !important; }
.chart-wrap .fade-line, .chart-wrap circle { opacity: 1 !important; transition: none !important; }
/* Rule 11 proof, home at 390 with touch: the Hyperion logo is a lazy SVG whose width/height attributes (245x72)
   reserve 52.9px at its 180px width, but the artwork is 1100x280 (45.8px). When it loaded mid-scroll, every heading
   below it jumped 7px. The box now reserves the artwork's own proportion, so nothing moves when it arrives. */
.hyperion-logo { aspect-ratio: 1100 / 280; height: auto; }
/* Same for the lazy roof photo: its attributes say 1000x750 (4:3) but the file is 1114x842, a 2px jump at phone width. */
.roof-photo img { aspect-ratio: 1114 / 842; }
