/* THE PALETTE: the one block to change for each post. Take it from the topic (Ramp: lime. Guinness: stout and cream).
   Greys here are Ben's house greys (~/bites/DESIGN.md). --accent is the topic's one colour. --c1 --c2 --c3 are supporting colours.
   The names are a contract with the scene scripts: change values, not names. Values are #rrggbb. */
:root{
  color-scheme:light dark;
  --ink:#0c0a08; --on-ink:#fff; --body:#57534f; --muted:#6e6a68; --grey:#8f8a86;
  --page:#ffffff; --surface:#ffffff; --soft:#faf9f7; --sunken:#f4f2f0; --hair:#d2cecb; --shadow:12 10 8;
  --accent:#e4f222; --on-accent:#0c0a08; --accent-soft:#f5ff78;
  --c1:#5683d2; --c1-soft:#e4ebf6; --c2:#e96516; --c2-soft:#fde9dc; --c3:#17332d; --c3-soft:#e1ebe7;
  --sans:"Inter",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  --hand:"Shantell Sans",cursive;
  --measure:55ch; --ease:cubic-bezier(.23,1,.32,1);
}
@media (prefers-color-scheme:dark){:root{
  --ink:#f4f2f0; --on-ink:#0c0a08; --body:#b3aeaa; --muted:#99948f; --grey:#8f8a86;
  --page:#0c0a08; --surface:#1a1919; --soft:#141210; --sunken:#221f1d; --hair:#34302d; --shadow:255 255 255;
  --accent:#e4f222; --on-accent:#0c0a08; --accent-soft:#3d4214;
  --c1:#7fa3e6; --c1-soft:#1c2638; --c2:#f07e3a; --c2-soft:#33200f; --c3:#8fcfb3; --c3-soft:#16302a;
}}
/* A weak accent (lime, yellow, gold: hard to read on the page): put class="marker" on <html>.
   Accent text then becomes dark letters on an accent marker, and accent lines get a dark core (draw the line twice: c-hl wide, c-acc thin). */
:root{--accent-core:var(--accent)}
:root.marker{--accent-core:var(--ink); --on-accent:var(--ink)}
@media (prefers-color-scheme:dark){:root.marker{--accent-core:var(--accent); --on-accent:#121212}}

/* THE PAGE: the same in every post */
::selection{background:var(--accent);color:var(--on-accent)}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--page);color:var(--body);font:400 16px/1.6 var(--sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
/* the focus ring shows only after the Tab key, never after a click or a tap (scene.js sets data-kbd) */
:focus{outline:none}
[data-kbd] :focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}
figure{margin:0}

.wordmark{position:absolute;top:20px;left:16px;display:block;line-height:0}
.wordmark img{height:24px;width:auto}
.subscribe{position:fixed;top:16px;right:16px;z-index:50;display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:9999px;
  background:var(--accent);color:var(--on-accent);font:500 14px/1 var(--sans);text-decoration:none;box-shadow:inset 0 0 0 1px rgb(12 10 8/.14),0 4px 12px -4px rgb(var(--shadow)/.18);
  transition:filter 150ms var(--ease),transform 150ms var(--ease)}
.subscribe::after{content:"";position:absolute;inset:-6px}
.subscribe:active{transform:scale(.96)}
@media (hover:hover) and (pointer:fine){.subscribe:hover{filter:brightness(.95)}}
@media (max-width:639px){.subscribe{top:12px;right:12px}.wordmark{top:16px}}

main{padding:92px 16px 64px}
@media (max-width:1023px){main{padding-top:72px}}
.col{max-width:var(--measure);margin:0 auto;position:relative}
h1,h2{color:var(--ink);font-weight:500;text-wrap:balance;margin:0}
h1{font-size:24px;line-height:1.25;letter-spacing:-.01em;margin:0 0 16px}
h2{font-size:20px;line-height:1.25;padding:64px 0 8px}
p{margin:1.6em 0;text-wrap:pretty}  /* one line apart */
.wide{margin:24px 0}
@media (min-width:1024px){.wide{margin-left:-32px;margin-right:-32px}}
/* links in the text: dark words on an accent underline, like a marker */
.col p a{color:var(--ink);text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:3px;text-underline-offset:3px;transition:text-decoration-color 150ms var(--ease)}
@media (hover:hover) and (pointer:fine){.col p a:hover{text-decoration-color:var(--ink)}}

/* a section whose drawing pins while the page scrolls past it */
.scrolly{position:relative;height:380vh;height:380svh}
.scrolly + .scrolly{margin-top:64px}
.pin{position:sticky;top:0;height:100vh;height:100svh;display:flex;flex-direction:column;justify-content:center}
.pin .wide{margin-top:0;margin-bottom:0}

/* DRAWINGS */
.host{position:relative;width:100%}
.ch{display:block;overflow:visible;max-width:100%}
.zc{display:block;width:100%}
.ch text{font-family:var(--hand)}
/* colour by class: lines and shapes use currentColor */
.c-ink{color:var(--ink)} .c-grey{color:var(--grey)}
.c-acc{color:var(--accent-core)} .c-hl{color:var(--accent)}
.c-1{color:var(--c1)} .c-2{color:var(--c2)} .c-3{color:var(--c3)}
.ch .pt{fill:currentColor}
.ch .head{fill:var(--page)}
.ch .tick{fill:var(--muted)}
.ch .hl{fill:var(--accent)}
:root.marker .ch g.c-acc text{fill:var(--on-accent);stroke:var(--accent);stroke-width:7px;stroke-linejoin:round;paint-order:stroke}
/* things that come and go with scroll: PK.on(node, true) adds .on */
.ch .lab{opacity:0;transition:opacity 260ms var(--ease)}
.ch .lab.on{opacity:1}
.ch .it{opacity:0;transform:translateY(-6px);transition:opacity 220ms var(--ease),transform 280ms var(--ease),color 220ms var(--ease)}
.ch .it.on{opacity:1;transform:none}
/* words in a drawing get a halo in the page colour, so they stay readable over lines */
.ch :is(.lab,.it) text{fill:currentColor;paint-order:stroke;stroke:var(--page);stroke-width:5px;stroke-linejoin:round}
.ch .pop{animation:pop 260ms var(--ease) both}
@keyframes pop{from{opacity:0;transform:translateY(4px) scale(.96)}}

/* DRAFT MARKS: only while Ben reviews a draft (posts/story.md, step 5). Take them out before the post ships.
   .yours: a line made from words Ben said. Edit mode takes it off when Ben types in the line.
   p.gap: a stop with no line from Ben yet, with a question for him. */
.yours{background:var(--c2-soft);border-radius:3px;padding:.1em .15em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.col p.gap{margin:28px 0;padding:14px 16px;border:2px dashed var(--hair);border-radius:12px;color:var(--muted);font-size:15px;line-height:1.5}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* THIS PAGE */
.ch .f-acc{fill:var(--accent)} .ch .f-1{fill:var(--c1-soft)} .ch .f-2{fill:var(--c2-soft)} .ch .f-3{fill:var(--c3-soft)} .ch .f-page{fill:var(--page)} .ch .f-sunken{fill:var(--sunken)}
.ch .fig{transition:color 300ms var(--ease)}
.big{font-variant-numeric:tabular-nums}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:32px 0}
.stats div{background:var(--soft);border-radius:12px;padding:14px 14px 12px;box-shadow:inset 0 0 0 1px var(--hair)}
.stats b{display:block;color:var(--ink);font:500 28px/1.1 var(--sans);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stats span{font-size:13px;line-height:1.35;display:block;margin-top:6px}
@media (max-width:479px){.stats{grid-template-columns:1fr 1fr}.stats div:last-child{grid-column:1/-1}}
table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums;margin:12px 0 0}
th,td{text-align:left;padding:6px 0;border-bottom:1px solid var(--hair)}
th{color:var(--ink);font-weight:500}
td:last-child,th:last-child{text-align:right}
h3{color:var(--ink);font:500 15px/1.3 var(--sans);margin:32px 0 0}
.small{font-size:14px;line-height:1.55}
.small li{margin:6px 0}
details{margin:40px 0 0;border-top:1px solid var(--hair);padding-top:16px}
summary{color:var(--ink);font-weight:500;cursor:pointer}
.ch text{fill:currentColor}
