/* Chalkline website — paper by day, chalkboard by night. No external requests. */

:root {
  --bg: #f4efe4;
  --bg-2: #ebe4d3;
  --panel: #fbf8f0;
  --ink: #1b2236;
  --muted: #566074;
  --line: #d6ccb4;
  --grid: rgba(37, 50, 77, 0.07);
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 159, 28, 0.2);
  --shadow: #1b2236;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --wrap: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1614;
  --bg-2: #151e1b;
  --panel: #18221f;
  --ink: #ece8da;
  --muted: #a1ada5;
  --line: #2d3b37;
  --grid: rgba(236, 232, 218, 0.055);
  --accent: #ffb04a;
  --accent-ink: #1a1306;
  --accent-soft: rgba(255, 176, 74, 0.18);
  --shadow: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.lead { font-size: clamp(1.1rem, 1.7vw, 1.3rem); color: var(--muted); max-width: 40em; }
.eyebrow { font: 600 0.78rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.mono { font-family: var(--mono); }
code, kbd { font: 0.88em var(--mono); background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font: 700 1.45rem/1 var(--serif); letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand:hover { color: inherit; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.tools { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sun { display: none; }
:root[data-theme="dark"] .sun { display: block; }
:root[data-theme="dark"] .moon { display: none; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav { position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 18px; display: none; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 6px; font-size: 1.05rem; }
  .nav a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  .tools { margin-left: auto; }
  .bar .btn.small { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 10px; font: 600 1rem/1 var(--sans); text-decoration: none; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); cursor: pointer; box-shadow: 4px 4px 0 var(--shadow); transition: transform 0.12s, box-shadow 0.12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--shadow); color: var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--shadow); }
.btn.primary:hover { color: var(--accent-ink); }
.btn.small { padding: 10px 16px; font-size: 0.92rem; box-shadow: 3px 3px 0 var(--shadow); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* Layout bits */
section { padding: clamp(56px, 9vw, 110px) 0; }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
.grid-paper { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 34px 34px; }
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); position: relative; white-space: nowrap; }
.hero .lead { margin: 26px 0 32px; }
.hero small { display: block; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.page-head { padding: clamp(44px, 7vw, 84px) 0 clamp(30px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); max-width: 16em; }
.page-head .lead { margin-top: 20px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* The board illustration frame */
.board { background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 8px 8px 0 var(--shadow); overflow: hidden; }
.board-top { display: flex; gap: 7px; align-items: center; padding: 10px 14px; border-bottom: 2px solid var(--ink); background: var(--bg-2); font: 0.72rem var(--mono); color: var(--muted); }
.board-top i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); display: block; }
.board-top span { margin-left: auto; }
.board svg { width: 100%; height: auto; }
.cap { font: 0.78rem var(--mono); color: var(--muted); margin-top: 14px; }

/* Chalk strokes */
.sk { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sk.thin { stroke-width: 1.4; opacity: 0.55; }
.sk.dash { stroke-dasharray: 6 7; }
.ac { stroke: var(--accent); }
.fill-ac { fill: var(--accent); fill-opacity: 0.22; stroke: none; }
.fill-ac.solid { fill-opacity: 0.35; stroke: var(--accent); stroke-width: 2; }
.ink-fill { fill: currentColor; stroke: none; }
.ac-fill { fill: var(--accent); stroke: none; }
.txt { font-family: var(--serif); font-style: italic; fill: currentColor; }
.txt.m { font-family: var(--mono); font-style: normal; font-size: 13px; }
.draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.8s 0.2s cubic-bezier(0.5, 0, 0.2, 1) forwards; }
.draw.d2 { animation-delay: 1.2s; }
.draw.d3 { animation-delay: 1.9s; }
.fade-in { opacity: 0; animation: fade 0.8s 2.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* Facts strip */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.facts div { padding: 26px 22px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; padding-left: 0; }
.facts b { display: block; font: 700 clamp(2rem, 4vw, 2.9rem)/1 var(--serif); color: var(--accent); }
.facts span { font-size: 0.92rem; color: var(--muted); }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } .facts div:nth-child(3) { border-left: 0; padding-left: 0; } .facts div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Feature rows */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; padding: clamp(28px, 4vw, 48px) 0; }
.row + .row { border-top: 1px dashed var(--line); }
.row.flip .row-art { order: -1; }
.row h3 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); margin-bottom: 14px; }
.row ul, .ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.row li, .ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.row li::before, .ticks li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 11px; height: 6px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } .row.flip .row-art { order: 0; } }

.section-head { max-width: 44em; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin-bottom: 16px; }

/* Timetable list of boards */
.timetable { border-top: 2px solid var(--ink); }
.slot { display: grid; grid-template-columns: 64px 150px 1fr auto; gap: 8px 28px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.slot .no { font: 600 0.95rem var(--mono); color: var(--muted); }
.slot .sketch { color: var(--ink); width: 150px; }
.slot h3 { font-size: 1.7rem; }
.slot p { margin: 6px 0 0; color: var(--muted); font-size: 0.98rem; max-width: 34em; }
.slot.live .no { color: var(--accent); }
.stamp { display: inline-block; font: 700 0.74rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 9px 12px; border: 2px dashed var(--muted); color: var(--muted); border-radius: 6px; transform: rotate(-2.5deg); white-space: nowrap; }
.stamp.live { border: 2px solid var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 760px) {
  .slot { grid-template-columns: 110px 1fr; }
  .slot .no { display: none; }
  .slot .sketch { width: 110px; grid-row: span 2; }
  .slot .stamp { justify-self: start; grid-column: 2; }
}

/* Subject detail blocks */
.subject { display: grid; grid-template-columns: 280px 1fr; gap: clamp(24px, 5vw, 64px); padding: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.subject:first-of-type { border-top: 2px solid var(--ink); }
.subject .art { background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; padding: 18px; box-shadow: 5px 5px 0 var(--shadow); align-self: start; }
.subject h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin-bottom: 14px; }
.subject h4 { font: 600 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
@media (max-width: 760px) { .subject { grid-template-columns: 1fr; } .subject .art { max-width: 320px; } }

/* Download */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.dl { background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; padding: 28px; box-shadow: 6px 6px 0 var(--shadow); display: flex; flex-direction: column; }
.dl h2 { font-size: 2rem; }
.dl .tag { font: 600 0.78rem var(--mono); color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.dl p { color: var(--muted); }
.dl .btn { justify-content: center; margin-top: 8px; width: 100%; }
.dl .alt { margin-top: 18px; font-size: 0.95rem; }
.dl .alt a { font-weight: 600; }
.hash { font: 0.74rem/1.5 var(--mono); color: var(--muted); word-break: break-all; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.hash b { color: var(--ink); font-weight: 600; }
@media (max-width: 800px) { .dl-grid { grid-template-columns: 1fr; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); font: 700 1.9rem/1 var(--serif); color: var(--accent); }
.steps b { display: block; }
.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 28px 0; }
.note p:last-child { margin: 0; }

/* Tables and prose */
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 0.76rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.table-wrap { overflow-x: auto; }
.prose { max-width: 46em; }
.prose h2 { font-size: 1.9rem; margin: 2.2em 0 0.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.3rem; margin: 1.6em 0 0.5em; }
.prose li { margin-bottom: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
.two > div > h3 { margin-bottom: 12px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }

/* Roadmap */
.road { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--ink); }
.road li { position: relative; padding: 0 0 34px 24px; }
.road li::before { content: ""; position: absolute; left: -37px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--ink); }
.road li.done::before { background: var(--accent); border-color: var(--accent); }
.road .when { font: 600 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.road h3 { margin: 4px 0 6px; font-size: 1.35rem; }
.road p { margin: 0; color: var(--muted); }

/* CTA */
.cta { text-align: left; }
.cta .box { background: var(--ink); color: var(--bg); border-radius: 18px; padding: clamp(32px, 6vw, 64px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.cta h2 { color: var(--bg); }
.cta p { color: color-mix(in srgb, var(--bg) 75%, transparent); margin: 14px 0 0; }
.cta .btn { border-color: var(--bg); box-shadow: 4px 4px 0 var(--accent); justify-self: start; }
.cta .btn:hover { box-shadow: 6px 6px 0 var(--accent); }
@media (max-width: 800px) { .cta .box { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 36px; font-size: 0.93rem; color: var(--muted); }
.foot { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot h4 { font: 600 0.76rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin: 0 0 12px; }
.foot a { display: block; text-decoration: none; padding: 3px 0; }
.foot .brand { margin-bottom: 12px; color: var(--ink); }
.fine { margin-top: 36px; padding-top: 22px; border-top: 1px dashed var(--line); font-size: 0.85rem; }
@media (max-width: 800px) { .foot { grid-template-columns: 1fr 1fr; } .foot > div:first-child { grid-column: 1 / -1; } }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s, transform 0.6s; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .fade-in { animation: none; opacity: 1; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn:hover, .btn:active { transition: none; }
}
@media print { .site-header, .site-footer, .cta { display: none; } body { background: #fff; color: #000; } }

/* Screenshot gallery */
.shots { background: var(--bg-2); border-block: 1px solid var(--line); overflow: hidden; }
.window { background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 10px 10px 0 var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 11px 16px; border-bottom: 2px solid var(--ink); background: var(--bg-2); font: 0.76rem var(--mono); color: var(--muted); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); display: block; }
.window-bar span { margin: 0 auto; padding-right: 50px; }
.stage { position: relative; aspect-ratio: 1584 / 861; background: #fff; }
.slide { margin: 0; position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.45s, visibility 0.45s; }
.slide.on { opacity: 1; visibility: visible; }
.slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.slide figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stage .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity 0.2s; box-shadow: 3px 3px 0 var(--shadow); }
.stage:hover .nav, .stage .nav:focus-visible { opacity: 1; }
.stage .prev { left: 14px; }
.stage .next { right: 14px; }
.stage .nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.shot-caption { font: 0.9rem/1.5 var(--mono); color: var(--muted); margin: 22px 0 26px; min-height: 3em; max-width: 60em; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.thumb { padding: 0; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; overflow: hidden; text-align: left; color: var(--muted); font: 600 0.9rem var(--sans); transition: border-color 0.15s, transform 0.15s; }
.thumb img { width: 100%; height: auto; aspect-ratio: 1584 / 861; object-fit: cover; display: block; opacity: 0.6; transition: opacity 0.15s; border-bottom: 1px solid var(--line); }
.thumb span { display: block; padding: 10px 12px; }
.thumb:hover { border-color: var(--ink); transform: translateY(-2px); }
.thumb:hover img { opacity: 0.9; }
.thumb.on { border-color: var(--accent); color: var(--ink); box-shadow: 4px 4px 0 var(--accent); }
.thumb.on img { opacity: 1; }
html:not(.js) .stage { aspect-ratio: auto; }
html:not(.js) .slide { position: static; opacity: 1; visibility: visible; margin-bottom: 20px; }
html:not(.js) .slide figcaption { position: static; width: auto; height: auto; clip: auto; font: 0.9rem var(--mono); padding: 10px 14px; }
html:not(.js) .nav, html:not(.js) .thumbs { display: none; }
@media (max-width: 760px) {
  .thumbs { grid-template-columns: repeat(2, 1fr); }
  .stage .nav { opacity: 1; width: 40px; height: 40px; }
  .window { box-shadow: 6px 6px 0 var(--shadow); }
}
@media (prefers-reduced-motion: reduce) { .slide, .thumb, .thumb img, .stage .nav { transition: none; } }
