/* ground.css | The shared ground (19 Nov 2026, the site Standard). Any page opts in through build_site.page(..., ground="<wash>"): the body gets class `gr` (and `gr-<wash>`), the one small
   partial templates/v3/ground.html is laid first in <main>, and this file is linked before the page's own CSS. Taken from the Files page (the reference implementation), which now uses it too.
   What a page gets: 1 the living layer (`.f3-live`: slow fog, a scroll-driven colour wash, film grain, a vignette; fixed, behind everything, CSS only, transform and opacity only), 2 the section
   scaffold (`.f3s` open sections on the ground, `.f3-wrap`, the hairline heading block `.f3-sh`, kicker `.f3-kk`, headline `.f3-kh`, lede `.f3-lede`, and `.wash` to give one section its own faint tint),
   3 the folding triptych (`.f3-tri`, triptych.js), 4 reduced motion and ?freeze (a finished still).
   Per-page wash: the wash drifts through six stops, --gr-w0 to --gr-w5 (alpha-tinted colours). The default is olive, moss, bone, olive. A page picks another set with a body class:
   gr-moss (greener, cooler), gr-bone (warmer, paper) or gr-deep (the darkest; nearly still). Add a set here, never in a page's CSS. Section tints: `.f3s.wash` plus --tint (default olive);
   `.t-bone`, `.t-moss` and `.t-sand` set it. Colour stays in the olive / night / paper family: no blue, purple or red-brown washes. Amber is never used here. */

/* ---------- 1. the living layer: fixed, behind everything, very slow; transform and opacity only ---------- */
body.gr{--gr-w0:rgba(143,160,116,.16);--gr-w1:rgba(108,124,84,.16);--gr-w2:rgba(143,160,116,.06);--gr-w3:rgba(201,184,138,.12);--gr-w4:rgba(143,160,116,.14);--gr-w5:rgba(108,124,84,.14);--gr-still:rgba(143,160,116,.12)}
body.gr-moss{--gr-w0:rgba(108,124,84,.2);--gr-w1:rgba(86,102,66,.18);--gr-w2:rgba(108,124,84,.08);--gr-w3:rgba(143,160,116,.12);--gr-w4:rgba(108,124,84,.16);--gr-w5:rgba(86,102,66,.16);--gr-still:rgba(108,124,84,.14)}
body.gr-bone{--gr-w0:rgba(201,184,138,.14);--gr-w1:rgba(143,160,116,.12);--gr-w2:rgba(230,226,207,.07);--gr-w3:rgba(201,184,138,.16);--gr-w4:rgba(184,176,138,.12);--gr-w5:rgba(143,160,116,.1);--gr-still:rgba(201,184,138,.12)}
body.gr-deep{--gr-w0:rgba(143,160,116,.08);--gr-w1:rgba(108,124,84,.08);--gr-w2:rgba(143,160,116,.04);--gr-w3:rgba(108,124,84,.08);--gr-w4:rgba(143,160,116,.06);--gr-w5:rgba(108,124,84,.06);--gr-still:rgba(143,160,116,.07)}
@property --wa{syntax:'<color>';inherits:true;initial-value:rgba(143,160,116,.16)}
body.gr{background:var(--bg);--hl:rgba(230,232,216,.16);overflow-x:clip}
.gr main{overflow-x:clip}
.f3-live{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden;contain:paint;background:var(--bg)}
.f3-live i{position:absolute;display:block}
.f3-fog{inset:-25%;will-change:transform}
.f3-fog.a{background:
 radial-gradient(38% 34% at 18% 24%,rgba(143,160,116,.26),transparent 72%),
 radial-gradient(34% 30% at 82% 58%,rgba(108,124,84,.2),transparent 72%),
 radial-gradient(30% 26% at 46% 92%,rgba(230,226,207,.06),transparent 72%);animation:f3fa 95s ease-in-out infinite alternate}
.f3-fog.b{background:
 radial-gradient(32% 30% at 70% 14%,rgba(201,184,138,.13),transparent 72%),
 radial-gradient(40% 34% at 26% 70%,rgba(143,160,116,.16),transparent 72%);animation:f3fb 140s ease-in-out infinite alternate}
@keyframes f3fa{to{transform:translate3d(7%,5%,0) scale(1.14)}}
@keyframes f3fb{to{transform:translate3d(-8%,-4%,0) scale(1.08) rotate(3deg)}}
/* the colour wash drifts from one section's hue to the next as you scroll: olive, moss, bone, olive (static olive where scroll timelines are not supported) */
.f3-wash{--wa:var(--gr-w0);inset:0;background:radial-gradient(80% 60% at 72% 28%,var(--wa),transparent 72%)}
@supports (animation-timeline:scroll()){
 .f3-wash{animation:f3wash linear both;animation-timeline:scroll(root)}
 @keyframes f3wash{0%{--wa:var(--gr-w0)}22%{--wa:var(--gr-w1)}45%{--wa:var(--gr-w2)}66%{--wa:var(--gr-w3)}86%{--wa:var(--gr-w4)}100%{--wa:var(--gr-w5)}}
}
.f3-grn{inset:-200px;background:url(img/noise.svg);background-size:200px;opacity:.07;mix-blend-mode:screen;animation:f3g 48s linear infinite;will-change:transform}
@keyframes f3g{to{transform:translate3d(-200px,200px,0)}}
.f3-vig{inset:0;background:radial-gradient(120% 90% at 50% 40%,transparent 55%,rgba(0,0,0,.5))}
.gr .foot2{position:relative;z-index:2}

/* ---------- 2. section scaffold: open on the ground ---------- */
.f3s{position:relative;isolation:isolate;padding:clamp(76px,9.4vw,150px) 0 0}
.f3s[class*="f3-"]:before{content:"";position:absolute;left:0;right:0;top:-170px;bottom:-170px;z-index:-1;pointer-events:none;opacity:0}
.f3s.wash{--tint:#8FA074}
.f3s.wash.t-bone{--tint:#C9B88A}
.f3s.wash.t-moss{--tint:#6C7C54}
.f3s.wash.t-sand{--tint:#B8B08A}
.f3s.wash:before{opacity:1!important;background:radial-gradient(58% 50% at 24% 50%,color-mix(in srgb,var(--tint) 14%,transparent),transparent 72%),radial-gradient(46% 40% at 88% 28%,color-mix(in srgb,var(--tint) 8%,transparent),transparent 72%)}
.f3-wrap{max-width:1440px;margin-inline:auto;padding-inline:clamp(20px,4.2vw,72px)}
.f3-sh{border-top:1px solid var(--hl);padding-top:22px;margin-bottom:clamp(30px,3.6vw,56px)}
.f3-hrow{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px 48px}
.f3-kk{margin:0 0 14px;font:500 12.5px/1.3 var(--font-mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted-n)}
.f3-kk b{margin-right:12px;font:400 20px/1 var(--font-screen);letter-spacing:.06em;color:var(--ink-n);vertical-align:-2px}
.f3-kh{margin:0;font:600 clamp(36px,4.6vw,68px)/1.01 var(--font-display);letter-spacing:-.04em;text-wrap:balance;text-transform:none;color:var(--ink-n)}
.f3-kh.sm{font-size:clamp(30px,3.4vw,48px)}
.f3-kh .ser{letter-spacing:-.01em}
.f3-lede{margin:0;max-width:36ch;font:400 17px/1.5 var(--font-body);color:color-mix(in srgb,var(--ink-n) 82%,transparent)}

/* ---------- 3. the: the folding triptych (a rounded container; shared by Files and the home, triptych.js) ---------- */
.f3-tri{display:flex;gap:14px;height:clamp(520px,74vh,690px);margin-inline:clamp(12px,3.4vw,56px)}
.f3-tri .tp{position:relative;flex:1 1 0;min-width:0;overflow:hidden;isolation:isolate;border-radius:var(--r-lg);background:#0B0E08;border:1px solid rgba(255,255,255,.09);box-shadow:0 34px 60px -34px rgba(0,0,0,.95)}
.f3-tri .tpim{position:absolute;inset:0;z-index:-1}
.f3-tri .tpim picture{display:contents}
.f3-tri .tpim img{width:100%;height:100%;object-fit:cover;filter:brightness(.8) saturate(.92)}
.f3-tri .tp:nth-child(2) .tpim img{object-position:30% 50%}
.f3-tri .tp:nth-child(3) .tpim img{object-position:78% 40%}
.f3-tri .tpim:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(0deg,rgba(0,0,0,.14) 0 1px,transparent 1px 3px),linear-gradient(0deg,#0B0E08 4%,rgba(11,14,8,.72) 34%,rgba(11,14,8,.1) 68%,rgba(11,14,8,.5))}
.f3-tri .th{position:absolute;inset:0 0 auto 0;z-index:3;width:100%;min-height:56px;padding:22px 26px;text-align:left;background:none;border:0;color:var(--ink-n);cursor:pointer;font:500 12.5px/1 var(--font-mono);letter-spacing:.14em;text-transform:uppercase}
.f3-tri .tn{display:inline-flex;align-items:center;gap:14px}
.f3-tri .tn b{font:400 30px/.8 var(--font-screen);letter-spacing:.04em}
.f3-tri .tn i{font-style:normal}
.f3-tri .tnum{position:absolute;z-index:1;right:30px;top:6px;font:600 clamp(150px,17vw,260px)/.85 var(--font-display);letter-spacing:-.07em;color:rgba(230,232,216,.13);pointer-events:none}
.f3-tri .tb{position:absolute;left:0;bottom:0;z-index:2;width:min(620px,100%);padding:30px 32px 34px;display:grid;gap:16px;justify-items:start}
.f3-tri .tb h3{margin:0;max-width:13ch;font:600 clamp(32px,3.6vw,56px)/.98 var(--font-display);letter-spacing:-.05em;text-transform:none;color:var(--ink-n)}
.f3-tri .tb p{margin:0;max-width:40ch;font:400 17.5px/1.45 var(--font-body);color:color-mix(in srgb,var(--ink-n) 92%,transparent)}
.f3-tri .tst{display:flex;flex-wrap:wrap;gap:10px}
.f3-tri .tst .sx{display:inline-flex}
.f3-tri .tst .stamp{font-size:15px}
.f3-tri .go{display:inline-flex;align-items:center;gap:10px;min-height:44px;font:600 16px/1 var(--font-display);text-decoration:underline;text-underline-offset:5px;color:var(--ink-n)}
.f3-tri .go svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.f3-tri.on .tp{flex-grow:.34}
.f3-tri.on .tp.is-open{flex-grow:3.4}
.f3-tri.on .tp:not(.is-open) .tb,.f3-tri.on .tp:not(.is-open) .tnum{opacity:0;visibility:hidden}
.f3-tri.on .tp:not(.is-open) .th{inset:0;height:100%;display:flex;align-items:flex-end;justify-content:center;padding:24px 0}
.f3-tri.on .tp:not(.is-open) .tn{writing-mode:vertical-rl;rotate:180deg;gap:12px}
.f3-tri.on .tp:not(.is-open):hover .th,.f3-tri.on .tp:not(.is-open) .th:focus-visible{color:#fff}
.f3-tri.on .tp:not(.is-open) .tpim img{filter:brightness(.55) saturate(.7)}
@media (prefers-reduced-motion:no-preference){
 .f3-tri .tp{transition:flex-grow 650ms var(--ease-out,cubic-bezier(.2,.8,.2,1))}
 .f3-tri .tb,.f3-tri .tnum{transition:opacity 320ms ease,translate 600ms var(--ease-out,cubic-bezier(.2,.8,.2,1)) 120ms}
 .f3-tri.on .tp:not(.is-open) .tb{translate:0 16px}
 .f3-tri .tpim img{transition:filter .5s}
}

/* ---------- phones and small tablets (under 900px) ---------- */
@media (max-width:900px){
 .f3s{padding-top:clamp(64px,12vw,96px)}
 .f3-tri{flex-direction:column;height:auto;gap:10px;margin-inline:12px}
 .f3-tri .tp{flex:none;min-height:430px}
 .f3-tri.on .tp{flex-grow:0;min-height:0;height:84px}
 .f3-tri.on .tp.is-open{height:520px}
 .f3-tri.on .tp:not(.is-open) .th{inset:0;height:100%;display:flex;align-items:center;justify-content:flex-start;padding:0 22px}
 .f3-tri.on .tp:not(.is-open) .tn{writing-mode:horizontal-tb;rotate:none}
 .f3-tri.on .tp:not(.is-open) .tb{translate:0 0}
 .f3-tri .tb{padding:24px 22px 26px}
 .f3-tri .tnum{font-size:150px;right:18px}
 .f3-tri .tb h3{font-size:clamp(30px,9vw,40px)}
 .f3-tri .tb p{font-size:16px}
 .f3-lede{max-width:none}
}

/* ---------- 4. reduced motion and ?freeze: a finished still ---------- */
@media (prefers-reduced-motion:reduce){
 .f3-fog,.f3-grn,.f3-wash{animation:none}
 .f3-wash{--wa:var(--gr-still)}
}
html[data-freeze] .f3-fog,html[data-freeze] .f3-grn,html[data-freeze] .f3-wash{animation:none}
html[data-freeze] .f3-wash{--wa:var(--gr-still)}
