@font-face { font-family: "Fraunces"; src: url(/fonts/fraunces.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(/fonts/fraunces-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url(/fonts/nunito-sans.woff2) format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --board: #fafdff; --grid: 171, 169, 166;
  --paper: #FAF6EF; --cream: #F3EBDD; --line: #E4DACA; --ink: #2B2724; --ink-soft: #6E6459;
  --crayon: #E0A400;
  --image: #F7B500; --video: #E5484D; --threed: #2D6AE3; --audio: #2FA866; --edit: #F2762E; --community: #8A63D2;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --serif: "Fraunces", Georgia, serif; --sans: "Nunito Sans", system-ui, sans-serif;
  --top: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased;
  /* the canvas background of the product: Seyès ruling (4 rows per big square), warm grey on bluish white */
  background-color: var(--board);
  background-image:
    linear-gradient(90deg, rgba(var(--grid), .26) 1px, transparent 1px),
    linear-gradient(rgba(var(--grid), .26) 1px, transparent 1px),
    linear-gradient(rgba(var(--grid), .12) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 120px 30px;
  background-position: -1px -1px;
  overflow-x: hidden;
}
.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; }

.strip { display: flex; height: 8px; position: relative; z-index: 3; }
.strip i { flex: 1; }
.strip i:nth-child(1) { background: var(--image); } .strip i:nth-child(2) { background: var(--video); }
.strip i:nth-child(3) { background: var(--threed); } .strip i:nth-child(4) { background: var(--audio); }
.strip i:nth-child(5) { background: var(--edit); } .strip i:nth-child(6) { background: var(--community); }
.strip i:nth-child(7) { background: var(--ink); }

/* ink is drawn on the page, under the box; while a tool is in hand a transparent pad above everything catches the pointer */
#doodle { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#doodle-input { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
body.drawing #doodle-input { pointer-events: auto; touch-action: none; }
body.drawing.has-tin #doodle-input { cursor: none; }

/* ---- top bar: centred menu, zipper on the right */
header.top { position: relative; z-index: 30; height: calc(var(--top) - 8px); display: flex; align-items: center; justify-content: center; padding: 0 clamp(14px, 3vw, 28px); }
.nav { display: flex; gap: clamp(18px, 3vw, 34px); font-weight: 800; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; transition: border-color .2s; }
.nav a:first-child { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--crayon); }
.zip { position: absolute; right: clamp(10px, 2.4vw, 24px); top: 2px; display: flex; align-items: flex-start; gap: 6px; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); }
.zip canvas { display: block; width: 150px; height: 70px; }
.zip .zl { font-size: 12px; font-weight: 900; letter-spacing: .08em; padding-top: 11px; opacity: .38; transition: opacity .3s; }
.zip .zl.on { opacity: 1; }
.zip:focus-visible { outline: 3px solid var(--crayon); outline-offset: 4px; border-radius: 8px; }
.zip.flat canvas { display: none; }
.zip.flat::before { content: ""; width: 34px; height: 18px; margin-top: 8px; border-radius: 999px; background: var(--cream); order: 1; }
.zipfx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1000; }

/* ---- stage: the box fills it, the title floats on top and fades when the box opens */
main.stage { position: relative; flex: none; height: calc(100svh - var(--top)); min-height: 560px; }
.stage .tin { position: absolute; inset: 0; margin: 0; }
.tin > canvas, .tin > .fallback, .tin noscript img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tin > .fallback, .tin noscript img { object-fit: contain; object-position: center 70%; }
.intro { position: absolute; z-index: 2; left: 0; right: 0; top: clamp(8px, 3vh, 34px); padding: 0 20px; text-align: center; pointer-events: none; transition: opacity .45s ease, transform .6s var(--spring); }
body.tin-open .intro { opacity: 0; transform: translateY(-18px); }
h1.title { margin: 0 auto; max-width: 18em; font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 4.4vw, 56px); letter-spacing: -.025em; line-height: 1.04; }
.lede { margin: 12px auto 0; max-width: 33em; color: var(--ink-soft); font-size: clamp(15px, 1.7vw, 18px); line-height: 1.5; font-weight: 600; }
.hint { position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(10px, 3vh, 26px); margin: 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-soft); pointer-events: none; transition: opacity .35s; }
body.tin-open .hint, body.tin-static .hint { opacity: 0; }
.picks button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }

/* ---- manifesto & legal */
main.prose { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(18px, 5vh, 56px) 20px 10px; position: relative; z-index: 1; }
.prose h1 { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 6vw, 62px); letter-spacing: -.025em; line-height: 1.05; }
.prose .intro-p { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; font-weight: 600; margin: 0 0 8px; }
.prose h2 { margin: 36px 0 8px; font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -.01em; display: flex; gap: 14px; align-items: baseline; }
.prose h2 .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--sans); font-size: 14px; font-weight: 900; color: #fff; transform: translateY(-3px); }
.prose h2:nth-of-type(6n+1) .n { background: var(--image); } .prose h2:nth-of-type(6n+2) .n { background: var(--video); }
.prose h2:nth-of-type(6n+3) .n { background: var(--threed); } .prose h2:nth-of-type(6n+4) .n { background: var(--audio); }
.prose h2:nth-of-type(6n+5) .n { background: var(--community); } .prose h2:nth-of-type(6n) .n { background: var(--ink); }
.prose p { margin: 0; line-height: 1.65; font-size: 17px; background: rgba(250, 253, 255, .82); }
.prose .intro { position: static; padding: 0; text-align: left; font-size: clamp(18px, 2vw, 21px); line-height: 1.55; font-weight: 600; pointer-events: auto; }
.prose .todo { background: #FCE7A6; border-radius: 4px; padding: 0 4px; font-weight: 800; }
.prose .back { margin-top: 40px; }
.prose a, footer a { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--crayon); text-underline-offset: 4px; }
.prose a:hover, footer a:hover { text-decoration-color: var(--video); }

footer { position: relative; z-index: 1; padding: 16px 20px 22px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; font-size: 14px; color: var(--ink-soft); font-weight: 600; text-align: center; }
body:not(.home) footer { margin-top: clamp(48px, 9vh, 90px); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--crayon); outline-offset: 3px; }

@media (max-width: 640px) {
  :root { --top: 70px; }
  header.top { justify-content: flex-start; }
  .nav { gap: 14px; font-size: 14px; }
  .zip canvas { width: 112px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
