/* Studio Sapling: shared look for every page.
   Design source: plan/design.md in the std-sapling repo ("Poster direction").
   Sizes are in rem; the root size grows a little on big screens. Pixel art is
   only ever scaled by whole numbers (--spx) with image-rendering: pixelated. */

:root {
    --paper: #f4f1e8;
    --ink: #151513;
    --muted: #5e5b52;
    --rule: #bdb8a8;
    --dots: rgba(180, 174, 156, 0.6);
    --lime: #9cff88;
    --card: #fffdf7;
    --slate: 24, 55, 63;
    --mono: "Geist Mono", ui-monospace, monospace;
    --sans: "Figtree", system-ui, sans-serif;
    /* the column: 1248px on a laptop, about 68% of the window on bigger screens */
    --frame-w: min(calc(100vw - 24px), max(1248px, 68vw), 1800px);
    --band: min(72px, calc((100vw - var(--frame-w)) / 2));
    --inset: 2.5rem;
    --header-h: 5.9375rem;
    --spx: 4;
    --dash-x: repeating-linear-gradient(to right, var(--rule) 0 4px, transparent 4px 8px);
    --dash-y: repeating-linear-gradient(to bottom, var(--rule) 0 4px, transparent 4px 8px);
}
@media (min-width: 1800px) { :root { --spx: 5; } }
@media (min-width: 2300px) { :root { --spx: 6; } }
@media (max-width: 900px) { :root { --frame-w: calc(100vw - 2 * clamp(12px, 4vw, 48px)); } }
@media (max-width: 640px) { :root { --inset: 1.25rem; --header-h: 4.75rem; } }

html { font-size: clamp(16px, calc(0.9vw + 3px), 20px); background: var(--paper); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- the frame: the column, dashed rules down both edges ---- */
.frame { position: relative; width: var(--frame-w); margin: 0 auto; }
.frame::before, .frame::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; z-index: 3; background: var(--dash-y); }
.frame::before { left: -1px; }
.frame::after { right: -1px; }
/* the dot texture: a narrow band hugging each column rule, with its own dashed edge */
.band {
    position: absolute; top: 0; bottom: 0; width: var(--band); pointer-events: none;
    background: radial-gradient(circle, var(--dots) 0.8px, transparent 1.1px) 0 0 / 8px 8px;
}
.band.left { right: 100%; }
.band.right { left: 100%; }
.band::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--dash-y); }
.band.left::after { left: -1px; }
.band.right::after { right: -1px; }
/* a rule that runs edge to edge of the window, Cloudflare-style */
.rule-full { position: relative; height: 1px; }
.rule-full::before { content: ""; position: absolute; top: 0; height: 1px; left: calc(50% - 50vw); width: 100vw; background: var(--dash-x); }
/* registration crosses where rules meet */
.cross { position: absolute; width: 13px; height: 13px; margin: -6px 0 0 -6px; z-index: 4; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--ink); }
.cross::before { left: 0; right: 0; top: 6px; height: 1px; }
.cross::after { top: 0; bottom: 0; left: 6px; width: 1px; }

/* ---- header ---- */
.site-header { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--inset); }
.wordmark img { display: block; height: 2.75rem; width: auto; }
.status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; letter-spacing: 0.04em; }
.status-light { width: 0.75rem; height: 0.75rem; background: var(--lime); border: 1px solid var(--ink); animation: blink 2.4s steps(1, end) infinite; }
@media (max-width: 640px) {
    .wordmark img { height: 2.125rem; }
    .status { font-size: 0.6875rem; }
}

/* ---- the small footer bar: copyright left, links right ---- */
.site-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: 1.5rem var(--inset) 2.5rem; font-size: 0.6875rem; }
.site-footer .copyright { color: var(--muted); opacity: 0.8; }
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a, .link { color: var(--ink); text-underline-offset: 3px; }
.site-footer a:hover, .link:hover { background: var(--lime); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- pixel sprites: the growth stages, from one 4-frame strip ---- */
.sprite {
    width: calc(16px * var(--spx)); height: calc(16px * var(--spx)); flex: none; image-rendering: pixelated;
    background: url("/assets/sprout.png") no-repeat 0 0 / calc(64px * var(--spx)) calc(16px * var(--spx));
    background-position-x: calc(var(--frame) * -16px * var(--spx));
}

@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .status-light { animation: none; } }
