/* ==========================================================================
   fanoutfox.com shared shell.
   Tokens, base type, the header, the footer, buttons, and the article shell
   the inner pages are built on. Every page loads this file, so a change here
   lands once instead of five times.

   What stays inline on a page: only what that page alone draws. The homepage
   keeps its hero, fan-out diagram, feature grid and FAQ; the inner pages keep
   their download card, release list and legal typography.

   The header and footer MARKUP is byte-identical on all five pages (there is
   no build step to share it), so a nav or footer edit is a blanket replace
   across every page's index.html, never a hand-edit of the two you remember.
   Every in-page anchor is written root-relative (/#how) so the same markup
   works on the homepage and away from it.
   ========================================================================== */

/* ============ TOKENS (brand) ============ */
:root{
  --bg:#100f0d;
  --bg-2:#0c0b09;
  --bg-3:#171613;
  --ink:#f2efe9;
  --muted:#a09a8e;
  --dim:#8a857a;      /* lowest step still legible as text: 5.22:1 on --bg */
  --faint:#5d594f;    /* decoration only (hairlines, underlines). Never text. */
  --accent:#b85c1e;
  --accent-bright:#e08b4c;
  --accent-hover:#c96a28;
  --green:#8fce9b;
  --good:#4f9d69;
  --border:rgba(237,233,225,.08);
  --border-strong:rgba(237,233,225,.16);
  --sans:'Hanken Grotesk',system-ui,-apple-system,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,'SF Mono',Menlo,monospace;
  --maxw:1160px;
  --doc:720px;        /* reading column on the inner pages */
  --r-btn:6px;
  --r-card:12px;
}

/* ============ BASE ============ */
*{margin:0;padding:0;box-sizing:border-box}
/* overflow-x on BOTH html and body. Mobile Safari ignores it on html alone
   when body is a flex container, which the 404 is. */
html{scroll-behavior:smooth;overflow-x:hidden}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
::selection{background:var(--accent);color:var(--ink)}
a{color:inherit;text-decoration:none}

/* Focus. One ring everywhere, drawn in the accent so it reads as ours rather
   than as the browser's: 7.27:1 on the ground, and the outline follows each
   element's own corner radius. Keyboard only, so a mouse click never shows it. */
a:focus-visible,button:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--accent-bright);outline-offset:3px;
}
.btn:focus-visible{outline-offset:2px}
img{display:block;max-width:100%}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 32px}
.mono{font-family:var(--mono)}

/* ============ REVEAL ============ */
.rv{opacity:0;transform:translateY(16px);transition:opacity .6s cubic-bezier(.22,.61,.36,1),transform .6s cubic-bezier(.22,.61,.36,1)}
.rv.in{opacity:1;transform:none}
.rv-d1{transition-delay:.08s}.rv-d2{transition-delay:.16s}.rv-d3{transition-delay:.24s}
.rv-d4{transition-delay:.32s}.rv-d5{transition-delay:.4s}.rv-d6{transition-delay:.48s}
@media (prefers-reduced-motion:reduce){
  .rv{opacity:1;transform:none;transition:none}
  html{scroll-behavior:auto}
}

/* ============ HEADER ============ */
header{
  position:fixed;inset:0 0 auto 0;z-index:100;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  background:rgba(16,15,13,.72);
  border-bottom:1px solid transparent;
  transition:border-color .25s ease,background .25s ease;
}
header.scrolled{border-bottom-color:var(--border);background:rgba(16,15,13,.86)}
.nav{max-width:var(--maxw);margin:0 auto;padding:0 32px;height:68px;display:flex;align-items:center;gap:36px}
.brand{display:flex;align-items:center;gap:11px;font-weight:600;font-size:17px;letter-spacing:-.01em;padding:7px 0}
.brand img{width:30px;height:30px;object-fit:contain}
.brand .fx{color:var(--accent-bright)}
.nav-links{display:flex;gap:10px;margin-left:auto;align-items:center}
.nav-links a.nl{
  font-size:14px;color:var(--muted);position:relative;padding:11px 9px;
  transition:color .15s ease;
}
.nav-links a.nl::after{
  content:"";position:absolute;left:9px;right:9px;bottom:11px;height:1px;
  background:var(--accent-bright);transform:scaleX(0);transform-origin:left;
  transition:transform .2s ease;
}
.nav-links a.nl:hover{color:var(--ink)}
.nav-links a.nl:hover::after{transform:scaleX(1)}
.nav-links a.nl[aria-current="page"]{color:var(--ink)}
.nav-links a.nl[aria-current="page"]::after{transform:scaleX(1);background:var(--accent)}
.ver-tag{
  font-family:var(--mono);font-size:11px;color:var(--dim);
  border:1px solid var(--border);border-radius:999px;padding:3px 10px;
  transition:color .15s,border-color .15s;
}
.ver-tag:hover{color:var(--accent-bright);border-color:rgba(224,139,76,.35)}
.burger{display:none;margin-left:auto;background:none;border:none;color:var(--ink);cursor:pointer;padding:11px}
@media(max-width:900px){
  .nav-links{display:none}
  .burger{display:block}
  .nav-links.open{
    display:flex;position:absolute;top:68px;left:0;right:0;flex-direction:column;
    background:var(--bg-2);border-bottom:1px solid var(--border);padding:20px 32px 28px;gap:18px;align-items:flex-start;
  }
}

/* ============ BUTTONS ============ */
.btn{
  display:inline-flex;align-items:center;gap:9px;
  font-family:var(--sans);font-weight:600;font-size:14.5px;
  border-radius:var(--r-btn);padding:11px 20px;min-height:44px;cursor:pointer;border:none;
  transition:background .15s ease,transform .15s ease,border-color .15s ease,color .15s ease;
}
.btn-primary{background:var(--accent);color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.16)}
.btn-primary:hover{background:var(--accent-hover);transform:translateY(-1px)}
.btn-ghost{background:transparent;color:var(--ink);border:1px solid var(--border-strong)}
.btn-ghost:hover{border-color:rgba(224,139,76,.5);color:var(--accent-bright)}
.btn-sm{padding:11px 16px;font-size:13.5px}
.nav-cta{margin-left:4px}

/* ============ AMBIENT LAYERS ============ */
/* The warm glow and the dot field. Shape and colour live here; every page that
   uses them sets its own offset and mask. */
.hero-glow{
  position:absolute;width:760px;height:760px;pointer-events:none;
  background:radial-gradient(circle at center,rgba(184,92,30,.16) 0%,rgba(184,92,30,.05) 42%,transparent 68%);
}
.dotgrid{
  position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(rgba(237,233,225,.07) 1px,transparent 1px);
  background-size:26px 26px;
}

/* ============ SECTION FURNITURE ============ */
.sec-label{
  font-family:var(--mono);font-size:12px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--accent-bright);margin-bottom:22px;display:flex;align-items:center;gap:12px;
}
.sec-label::after{content:"";height:1px;width:64px;background:linear-gradient(90deg,var(--accent),transparent)}

/* ============ THE ARTICLE SHELL (inner pages) ============ */
/* A page band that matches the homepage hero's ground, then a reading column.
   Everything is scoped under .doc so the homepage's display type is untouched. */
.doc-head{position:relative;padding:150px 0 0;overflow:hidden}
.doc-head .hero-glow{top:-320px;right:-160px}
.doc-head .dotgrid{
  -webkit-mask-image:radial-gradient(ellipse 90% 90% at 60% 0%,#000 0%,transparent 70%);
  mask-image:radial-gradient(ellipse 90% 90% at 60% 0%,#000 0%,transparent 70%);
}
.doc-head .wrap{position:relative}
.doc-head .wrap,.doc .wrap{max-width:calc(var(--doc) + 64px)}
.kicker{
  font-family:var(--mono);font-size:12.5px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent-bright);display:flex;align-items:center;gap:10px;margin-bottom:22px;
}
.kicker::after{content:"";height:1px;width:56px;background:linear-gradient(90deg,var(--accent),transparent)}
.doc-head h1{
  font-size:clamp(34px,4.2vw,52px);line-height:1.06;letter-spacing:-.03em;font-weight:700;
  margin-bottom:20px;max-width:16ch;
}
.lede{font-size:17.5px;line-height:1.65;color:var(--muted)}
.lede a{color:var(--accent-bright);border-bottom:1px solid rgba(224,139,76,.35);transition:border-color .15s}
.lede a:hover{border-color:var(--accent-bright)}
.updated{font-family:var(--mono);font-size:13px;color:var(--dim);margin-top:18px}

.doc{padding:56px 0 104px}
.doc h2{
  font-family:var(--mono);font-size:19px;font-weight:700;letter-spacing:-.01em;
  margin:56px 0 18px;padding-top:30px;border-top:1px solid var(--border);
}
.doc h3{font-size:17px;font-weight:600;letter-spacing:-.01em;margin:26px 0 8px;line-height:1.35}
.doc p{color:var(--muted);font-size:16px;line-height:1.72;margin-bottom:16px}
.doc ul{color:var(--muted);margin:0 0 18px;padding-left:22px;font-size:16px;line-height:1.72}
.doc li{margin-bottom:10px}
.doc li::marker{color:var(--dim)}
.doc strong{color:var(--ink);font-weight:600}
.doc em{color:var(--ink);font-style:italic}
/* Prose links only. The download button and the back link carry their own
   treatment and must not be repainted as body copy. */
.doc a:not(.btn):not(.back){color:var(--accent-bright);border-bottom:1px solid rgba(224,139,76,.35);transition:border-color .15s}
.doc a:not(.btn):not(.back):hover{border-color:var(--accent-bright)}
.doc code{
  font-family:var(--mono);font-size:13.5px;color:var(--ink);
  background:rgba(237,233,225,.06);border:1px solid var(--border);border-radius:4px;
  padding:2px 7px;white-space:nowrap;
}
.note{
  color:var(--dim);font-family:var(--mono);font-size:12.5px;line-height:1.66;
  margin-top:22px;max-width:70ch;
}
.note a{color:var(--accent-bright);border-bottom:1px solid rgba(224,139,76,.3)}
.note a:hover{border-bottom-color:var(--accent-bright)}
.back{
  display:inline-flex;align-items:center;gap:8px;margin-top:56px;
  font-family:var(--mono);font-size:13px;color:var(--dim);
  border-bottom:1px solid var(--faint);padding-bottom:2px;
  transition:color .15s,border-color .15s;
}
.back:hover{color:var(--accent-bright);border-color:var(--accent-bright)}

/* Small controls whose visual size the design fixes: the version pill, the two
   underlined links and the back link. Padding would move the pill's border or
   the underline, so the hit area is extended with a transparent pseudo-element
   instead. The control looks the same and answers to a 44px thumb. */
.ver-tag,.install-link,.store-link,.back{position:relative}
.ver-tag::before,.install-link::before,.store-link::before,.back::before{
  content:"";position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%);
}

/* ============ FOOTER ============ */
footer{background:var(--bg-2);border-top:1px solid var(--border);padding:72px 0 34px}
.foot-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:44px;margin-bottom:64px}
@media(max-width:820px){.foot-grid{grid-template-columns:1fr 1fr}}
.foot-brand p{color:var(--dim);font-size:14px;line-height:1.65;margin-top:18px;max-width:300px}
.foot-col h3{font-family:var(--mono);font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--dim);margin-bottom:18px}
.foot-col a{display:block;color:var(--muted);font-size:14px;padding:11px 0;transition:color .15s}
.foot-col a:hover{color:var(--accent-bright)}
.foot-bottom{
  border-top:1px solid var(--border);padding-top:26px;
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
  font-family:var(--mono);font-size:12px;color:var(--dim);
}
.foot-bottom a{color:var(--dim);display:inline-flex;align-items:center;min-height:44px;margin:-12px 0;transition:color .15s}
.foot-bottom a:hover{color:var(--accent-bright)}
