/* wilco.io shared styles: tokens, type, top bar, footer, buttons, links, the marker. Loaded on every page.
   Page styles live next to it: home.css (home page), reading.css (story + year reviews), prints.css (year prints).
   Rule: pages use these tokens and classes and add nothing global. Design: round 6/7 briefs in
   work/website/wilco-io-2026-11/ ("One marker, one world": the yellow marker is the only accent). */

/* ---------- font: Bricolage Grotesque, variable, self-hosted (SIL OFL, see fonts/OFL.txt) ---------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url(/assets/fonts/bricolage.e69aa1b1.woff2) format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
/* Arial, resized to take the same room as Bricolage while the real font loads, so nothing jumps.
   Numbers come from tools/fonts.py (it prints them). */
@font-face {
  font-family: 'Bricolage fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 104.35%;
  ascent-override: 89.12%;
  descent-override: 25.87%;
  line-gap-override: 0%;
}

/* ---------- tokens ---------- */
:root {
  --ground: #F7F8FA;                    /* page */
  --ink: #101418;                       /* text, button */
  --ink-soft: rgba(16, 20, 24, .66);    /* small labels, dimmed text (4.9:1 on ground) */
  --hairline: rgba(16, 20, 24, .10);    /* lines */
  --marker: #F5B81C;                    /* the yellow marker fill (behind words, never as text colour) */
  --marker-deep: #E3A008;               /* small marks that must show on the ground: underlines, dots, lines */
  --white: #FFFFFF;                     /* prints and cards */
  --font: 'Bricolage Grotesque', 'Bricolage fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bar-h: 80px;                        /* height of the top bar (64px on phones, see below) */
  /* spacing scale: use only these */
  --s-8: 8px; --s-16: 16px; --s-24: 24px; --s-32: 32px; --s-48: 48px;
  --s-64: 64px; --s-96: 96px; --s-128: 128px; --s-160: 160px;
  --side: 64px;                         /* page side padding (24px under 700px) */
  --ease: cubic-bezier(.65, .05, .25, 1);
  color-scheme: light;
}
@media (max-width: 640px) { :root { --bar-h: 64px; } }
@media (max-width: 699px) { :root { --side: 24px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + var(--s-24)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-optical-sizing: auto; font-size: 20px; line-height: 1.4; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; min-width: 320px;
}
img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--marker); color: var(--ink); }

/* the container: 1312px of content, 64px sides, 24px under 700px */
.wrap { width: 100%; max-width: calc(1312px + 2 * var(--side)); margin-inline: auto; padding-inline: var(--side); }

/* focus ring: always visible for keyboard users */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

/* only for screen readers */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* skip link: hidden until focused */
.skip {
  position: absolute; left: 16px; top: -96px; z-index: 60; background: var(--ink); color: var(--white);
  padding: 16px 24px; border-radius: 999px; font-weight: 600; font-size: 18px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- links and buttons ---------- */
.link {
  text-decoration-line: underline; text-decoration-color: var(--marker-deep); text-decoration-thickness: 3px;
  text-underline-offset: .14em; text-decoration-skip-ink: none; transition: text-decoration-color .3s ease;
}
a.link:hover { text-decoration-color: var(--ink); }

.btn {
  -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer; text-decoration: none;
  font: 600 18px/1 var(--font); letter-spacing: 0; color: var(--white); background: var(--ink);
  border-radius: 999px; padding: 0 24px; height: 48px; display: inline-flex; align-items: center; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #000; }
.btn:active { transform: scale(.97); }
.btn-big { height: 64px; padding: 0 32px; font-size: 20px; }

/* ---------- the marker ---------- */
/* .mark: the felt-tip stroke behind words in running text. Add .pre to hide it; remove .pre to sweep it in. */
.mark {
  --ca: .4em; --cb: .54em;
  background-image:
    radial-gradient(closest-side, var(--marker) 90%, rgba(245, 184, 28, 0) 100%),
    linear-gradient(var(--marker), var(--marker)),
    radial-gradient(closest-side, var(--marker) 90%, rgba(245, 184, 28, 0) 100%);
  background-repeat: no-repeat;
  background-size: var(--ca) 58%, calc(100% - var(--ca) / 2 - var(--cb) / 2) 62%, var(--cb) 64%;
  background-position: 0 85.7%, calc(var(--ca) / 2) 89.5%, 100% 91.7%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; margin: 0 -3px;
  transition: background-size .6s var(--ease), background-position .6s var(--ease);
}
.mark.pre { background-size: 0 58%, 0 62%, 0 64%; background-position: 0 85.7%, calc(var(--ca) / 2) 89.5%, 0 91.7%; }

/* .mark-big: the hand-drawn display stroke under one big word ("Wilco", "twice"). Markup:
   <span class="mark-big">twice<svg class="mark-big-s" viewBox="0 0 240 60" preserveAspectRatio="none" aria-hidden="true" focusable="false">
   <path d="M8 15C40 9 92 13 140 9S212 7 232 12C238 21 237 38 232 49C196 52 150 50 104 53S32 55 10 51C4 41 3 25 8 15Z"/>
   <path class="m2" d="M12 45C70 47 150 44 229 43L230 48C150 50 70 52 12 50Z"/>
   <path class="m2" d="M8 15C30 11 52 11 70 11L68 15C50 15 30 16 9 19Z"/></svg></span>
   Add .sweep to draw it in once on load (skipped with reduced motion). */
.mark-big { position: relative; display: inline-block; isolation: isolate; line-height: .95; }
.mark-big-s {
  position: absolute; z-index: -1; left: -.07em; top: .3em; width: calc(100% + .16em); height: calc(100% - .33em);
  overflow: visible; transform: rotate(-1.2deg); transform-origin: 0 50%; clip-path: inset(-10% 0 -10% 0);
}
.mark-big-s path { fill: var(--marker); }
.mark-big-s .m2 { fill: rgba(227, 160, 8, .34); }
@media (prefers-reduced-motion: no-preference) {
  .mark-big.sweep .mark-big-s { animation: mark-sweep .6s var(--ease) .35s both; }
}
@keyframes mark-sweep { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% 0 -10% 0); } }

/* an emoji set next to big type */
.e { font-weight: 400; letter-spacing: 0; }

/* ---------- top bar (partials/header.html) ---------- */
.bar { position: sticky; top: 0; z-index: 50; background: var(--ground); }
.bar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hairline);
  opacity: 0; transition: opacity .25s ease;
}
.bar.scrolled::after { opacity: 1; }
.prog {
  position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--marker-deep);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; z-index: 1;
}
.nav { height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.name {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; white-space: nowrap;
  font-weight: 700; font-size: 20px; letter-spacing: -.01em; text-decoration: none;
}
.me {
  flex: none; display: block; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: #DDE3EA; box-shadow: 0 0 0 1px var(--hairline);
}
.me img { width: 100%; height: 100%; object-fit: cover; }
.menu { display: flex; align-items: center; gap: 32px; }
.links { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; }
.links a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 3px;
  text-underline-offset: .3em; transition: text-decoration-color .2s ease;
}
.links a:hover, .links a[aria-current] { text-decoration-color: var(--marker-deep); }
.dot { color: var(--ink-soft); }
@media (max-width: 820px) {
  .nav .links { display: none; }      /* the menu moves to the footer (.fmenu); home adds its own line */
}
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .name { font-size: 18px; gap: 10px; }
  .me { width: 32px; height: 32px; }
  .nav .btn { height: 44px; padding: 0 18px; font-size: 16px; }
  .btn-big { height: 56px; padding: 0 28px; font-size: 18px; }
}
@media (max-width: 360px) { .name { font-size: 17px; } }

/* ---------- footer (partials/footer.html) ---------- */
.foot { margin-top: var(--s-160); border-top: 1px solid var(--hairline); padding: 32px 0 48px; }
.fl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 4px; font-size: 18px; font-weight: 500; }
.fl a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.fmenu { display: none; margin-bottom: 8px; }
.fsmall { margin: 16px 0 0; padding: 0 4px; font-size: 16px; color: var(--ink-soft); }
.fsmall a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .2em; }
@media (max-width: 820px) { .fmenu { display: flex; } }
@media (max-width: 640px) { .foot { margin-top: var(--s-128); } }

/* ---------- motion: respect "reduce motion" everywhere ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
  .mark.pre { background-size: var(--ca) 58%, calc(100% - var(--ca) / 2 - var(--cb) / 2) 62%, var(--cb) 64%; background-position: 0 85.7%, calc(var(--ca) / 2) 89.5%, 100% 91.7%; }
}
