@font-face { font-family: "Fraunces"; src: url(/fonts/Fraunces.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/JetBrainsMono.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --bg: #f0efe6; --surface: #f8f7f0; --surface-alt: #e7e6da; --line: #cfd0c0; --topo: rgba(30, 70, 45, .16);
  --text: #12241a; --muted: #566559; --accent: #2d6a3e; --accent-ink: #f8f7f0; --signal: #8cc63f;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1410; --surface: #101c16; --surface-alt: #15251d; --line: #223629; --topo: rgba(160, 215, 120, .17);
    --text: #ecebe1; --muted: #98a99c; --accent: #a9dc62; --accent-ink: #0b1410; --signal: #a9dc62; }
}
/* Ferrous Fitness pages take the app's iron-red as their accent. */
body.theme-ferrous { --accent: #c9273a; --accent-ink: #fff; --signal: #e0455a; }
@media (prefers-color-scheme: dark) { body.theme-ferrous { --accent: #e0455a; --accent-ink: #fff; --signal: #ee6477; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; font-size: 17px; font-family: var(--sans); overflow-x: hidden; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 720px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--signal); color: #0b1410; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.brand:hover svg .vein { stroke-dashoffset: 0; }
nav a { margin-left: 24px; color: var(--muted); text-decoration: none; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; position: relative; }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
nav a:hover { color: var(--text); }
nav a:hover::after { transform: scaleX(1); }

/* hero */
.hero { position: relative; padding: 96px 0 72px; isolation: isolate; overflow-x: clip; }
.hero::before { content: ""; position: absolute; inset: -64px -50vw 0; z-index: -1; background: var(--topo);
  -webkit-mask: url(/topo.svg) center / cover no-repeat; mask: url(/topo.svg) center / cover no-repeat;
  clip-path: circle(0% at 72% 38%); animation: spread 2.6s var(--ease) .1s forwards, drift 40s ease-in-out 2.7s infinite alternate; transform: translate(var(--px, 0), var(--py, 0)); }
.hero::after { content: ""; position: absolute; left: -50vw; right: -50vw; bottom: 0; height: 160px; z-index: -1; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
@keyframes spread { to { clip-path: circle(140% at 72% 38%); } }
@keyframes drift { from { translate: 0 0; scale: 1; } to { translate: -1.5% 1%; scale: 1.04; } }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(42px, 8vw, 84px); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 24px; font-variation-settings: "opsz" 144; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.02em; line-height: 1.15; margin: 64px 0 16px; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -.01em; margin: 28px 0 8px; }
.lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 33em; margin: 0 0 32px; }
.meta { color: var(--muted); font-size: 14px; }
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.page-head { padding: 72px 0 8px; }
.page-head h1 { font-size: clamp(36px, 6vw, 60px); }

/* word-by-word headline */
.js .hero h1 .w { display: inline-block; opacity: 0; transform: translateY(.45em); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.js .hero .lede, .js .hero .actions, .js .hero .eyebrow { opacity: 0; animation: rise 1s var(--ease) .75s forwards; }
.js .hero .eyebrow { animation-delay: .05s; }
.js .hero .actions { animation-delay: .95s; }

/* buttons */
.button { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); padding: 13px 22px; border-radius: 4px; font-family: var(--mono); font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); transition: transform .25s var(--ease), background .25s; }
.button:hover { transform: translateY(-2px); text-decoration: none; }
.button .arrow { transition: transform .25s var(--ease); }
.button:hover .arrow { transform: translateX(4px); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.badge { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 var(--signal); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }

/* product panel (home) */
.product { text-decoration: none; color: inherit; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; overflow: hidden; transition: border-color .3s, transform .4s var(--ease); }
.product:hover { border-color: var(--accent); transform: translateY(-3px); }
.product .copy { padding: 36px; }
.product .copy h3 { font-size: 30px; margin: 8px 0 12px; }
.product .copy p { color: var(--muted); margin: 0 0 24px; }
.product .viz { background: var(--surface-alt); padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 16px; border-left: 1px solid var(--line); }
@media (max-width: 720px) { .product { grid-template-columns: 1fr; } .product .viz { border-left: 0; border-top: 1px solid var(--line); } .product .copy, .product .viz { padding: 26px; } }

/* readiness bars (weights come from the app's scoring model) */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; width: 0;  background: var(--accent); border-radius: 3px; transition: width 1.4s var(--ease); transition-delay: calc(var(--i, 0) * 120ms); }
.in .fill, html:not(.js) .fill { width: calc(var(--v) * 1%); }
.v5 { --v: 5; }
.v15 { --v: 15; }
.v25 { --v: 25; }
.v30 { --v: 30; }
.bar-row.i0 { --i: 0; }
.bar-row.i1 { --i: 1; }
.bar-row.i2 { --i: 2; }
.bar-row.i3 { --i: 3; }
.bar-row.i4 { --i: 4; }

.bar-row b { color: var(--text); font-weight: 600; text-align: right; }

/* principles / feature rows */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 72px 1fr 1.4fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: background .3s; }
.row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.row .n { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.row h3 { margin: 0; font-size: 22px; }
.row p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .row { grid-template-columns: 40px 1fr; } .row p { grid-column: 2; } }

/* reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* document pages */
main.doc { padding-bottom: 96px; }
.doc p, .doc li { max-width: 68ch; }
.doc h2 { margin-top: 48px; font-size: 26px; }
.summary { border-left: 2px solid var(--accent); background: var(--surface); padding: 18px 22px; margin: 28px 0; max-width: 68ch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 16px 0; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 400; }
.toc { columns: 2; column-gap: 32px; padding-left: 20px; font-family: var(--mono); font-size: 14px; }
.toc a { text-decoration: none; }
@media (max-width: 560px) { .toc { columns: 1; } nav a:last-child { display: none; } .brand { font-size: 16px; } .hero { padding-top: 56px; } .bar-row { grid-template-columns: 82px 1fr 30px; } }
details { border-bottom: 1px solid var(--line); padding: 18px 0; max-width: 68ch; }
summary { cursor: pointer; font-family: var(--serif); font-size: 19px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--mono); color: var(--accent); transition: transform .3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details[open] > :not(summary) { animation: rise .5s var(--ease); }
details p { margin: 12px 0 0; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); text-decoration: none; margin-right: 18px; font-family: var(--mono); font-size: 13px; }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .hero::before { clip-path: none; }
}

.hero.page-head { padding: 64px 0 16px; }
.hero.page-head .meta { margin: 0; }

.bars.narrow { max-width: 560px; }
main { padding-bottom: 72px; }
main.doc { padding-bottom: 96px; }

/* app screenshots */
.gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x proximity; padding: 8px max(24px, calc((100vw - 1040px) / 2 + 24px)) 28px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; -webkit-overflow-scrolling: touch; }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.shot { margin: 0; flex: 0 0 auto; width: clamp(220px, 24vw, 280px); scroll-snap-align: center; }
.shot img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .35); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.shot:hover img { transform: translateY(-8px); box-shadow: 0 24px 44px -16px rgba(0, 0, 0, .45); }
.js .gallery .shot { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--n, 0) * 70ms); }
.js .in .gallery .shot { opacity: 1; transform: none; }
.shot:nth-child(1){--n:0}.shot:nth-child(2){--n:1}.shot:nth-child(3){--n:2}.shot:nth-child(4){--n:3}.shot:nth-child(5){--n:4}.shot:nth-child(6){--n:5}.shot:nth-child(7){--n:6}.shot:nth-child(8){--n:7}
.duo { position: relative; min-height: 340px; overflow: hidden; padding: 0; display: block; }
.duo img { position: absolute; width: 46%; height: auto; border-radius: 18px; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .4); transition: transform .6s var(--ease); }
.duo .d1 { left: 10%; top: 28px; }
.duo .d2 { right: 8%; top: 72px; }
.product:hover .d1 { transform: translateY(-8px); }
.product:hover .d2 { transform: translateY(8px); }
@media (max-width: 720px) { .duo { min-height: 300px; } }
