:root {
  --paper: #f6f7f4;
  --paper-2: #eceee9;
  --ink: #1f2a44;          /* blue-black fountain-pen ink */
  --pencil: #5f6676;
  --line: #c9cdd3;
  --wash: #3e6fb0;         /* blueprint blue */
  --on-wash: #ffffff;
  --grid: rgba(62, 111, 176, .10);
  --night: #0f1420;        /* the black sketchbook page */
  --night-ink: #eef1f6;
  --hand: "Nanum Pen Script", cursive;
  --body: "Karla", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141a26; --paper-2: #1b2230; --ink: #e6e9ef; --pencil: #a3abba;
    --line: #2e3748; --wash: #86a9dc; --on-wash: #141a26; --grid: rgba(134, 169, 220, .08);
    --night: #0a0e16;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.7 var(--body); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--wash); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 20; }
.skip:focus { top: 1rem; }
h2 { margin: 0; font: 400 clamp(2.5rem, 5vw, 3.5rem)/1.05 var(--hand); }
h3 { margin: 0 0 .375rem; font-size: 1.375rem; line-height: 1.25; }

/* ---------- top nav ---------- */
.topnav {
  position: fixed; inset: 0 0 auto; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; font-size: .9375rem;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(8px);
  transform: translateY(-100%); transition: transform .3s;
}
.topnav.show { transform: none; }
.topnav a { text-decoration: none; margin-left: 1.25rem; }
.topnav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.topnav .mark { margin: 0; font: 400 1.75rem/1 var(--hand); }
@media (max-width: 600px) { .topnav div a:not(:first-child) { display: none; } }

/* ---------- hero: the self-drawing signature is the one loud thing ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; padding: 5rem 1rem 3rem; overflow: hidden; }
.grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.grid path { stroke: var(--grid); stroke-width: 1; }
.hero-inner { position: relative; z-index: 2; width: min(720px, 100%); margin: 0 auto; text-align: center; }
.sig { width: 100%; height: auto; overflow: visible; transform: rotate(-3deg); transform-origin: center bottom; }
.sig-text { font: 400 205px/1 var(--hand); fill: var(--ink); stroke: var(--ink); stroke-width: 1.4; }
.lede { max-width: 30em; margin: 1rem auto 2rem; font-size: clamp(1.125rem, 2.2vw, 1.375rem); line-height: 1.6; font-weight: 300; text-wrap: pretty; }
.facts { list-style: none; margin: 0 auto; padding: 0; max-width: 42rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; font-size: .9375rem; line-height: 1.45; color: var(--pencil); }
.facts li { flex: 1 1 9rem; max-width: 14rem; }
.facts strong { display: block; color: var(--ink); font-weight: 600; }
.scroll-cue { display: none; position: absolute; z-index: 2; bottom: 1.5rem; left: 50%; translate: -50% 0; margin: 0; font: 400 1.5rem/1 var(--hand); color: var(--pencil); white-space: nowrap; }

/* the desk: loose sketchbook pages around the name (phones and tablets get a small pile under the text) */
.desk { position: relative; width: min(100%, 640px); height: min(68vw, 440px); margin: 2.5rem auto 0; }
.page { position: absolute; rotate: var(--r, 0deg); }
.page:hover, .page:focus-within { z-index: 4; }
.sheet { all: unset; display: block; cursor: zoom-in; }
.sheet:focus-visible { outline: 2px solid var(--wash); outline-offset: 6px; }
.sheet img { width: 100%; height: auto; box-shadow: 0 18px 30px -18px rgb(0 0 0 / .6), 0 2px 5px rgb(0 0 0 / .16); }
.landed .sheet img { transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s cubic-bezier(.16, 1, .3, 1); }
.landed .sheet:hover img, .landed .sheet:focus-visible img { transform: scale(1.05); box-shadow: 0 36px 50px -24px rgb(0 0 0 / .6), 0 6px 14px rgb(0 0 0 / .18); }
.motion .sheet img, .motion .sig { opacity: 0; }
.p1 { left: -2%; top: 6%; width: 50%; --r: -6deg; }
.p4 { left: 38%; top: 0; width: 20%; --r: 5deg; z-index: 2; }
.p5 { right: -3%; top: 16%; width: 42%; --r: 4deg; }
.p6 { left: 10%; bottom: 2%; width: 58%; --r: -2deg; z-index: 3; }
.p2, .p3 { display: none; }

@media (min-width: 1000px) and (min-height: 600px) {
  .hero { padding-bottom: 4rem; }
  .hero-inner { width: min(720px, 56vw); }
  .scroll-cue { display: block; }
  .desk { position: absolute; inset: 0; z-index: 1; width: auto; height: auto; margin: 0; pointer-events: none; }
  .page { pointer-events: auto; z-index: auto; }
  .p1 { left: -3%; top: 9%; width: 24vw; --r: -5deg; }
  .p2 { display: block; left: 4%; top: 40%; width: 12vw; --r: 4deg; }
  .p3 { display: block; left: -1%; top: auto; bottom: 5%; width: 23vw; --r: -2deg; }
  .p4 { left: auto; right: 5%; top: 6%; width: 10vw; --r: 6deg; }
  .p5 { right: -2%; top: 42%; width: 19vw; --r: -4deg; }
  .p6 { left: auto; right: 3%; bottom: 4%; width: 21vw; --r: 3deg; }
}
@media (prefers-reduced-motion: reduce) { .landed .sheet img { transition: none; } }

/* ---------- horizontal reel ---------- */
.reel { background: var(--night); color: var(--night-ink); overflow: hidden; }
.reel-track { display: flex; gap: 3vw; align-items: center; height: 100svh; padding: 0 6vw; width: max-content; }
.reel-intro { width: min(26rem, 80vw); flex: none; }
.reel-intro h2 { color: var(--night-ink); }
.reel-intro p { color: #aeb6c6; }
.reel figure { margin: 0; flex: none; }
.reel figure button { all: unset; cursor: zoom-in; display: block; }
.reel figure button:focus-visible { outline: 2px solid #86a9dc; outline-offset: 6px; }
.reel img { height: min(62svh, 560px); width: auto; max-width: none; box-shadow: 0 30px 60px -30px #000; }
.reel figcaption { margin-top: .75rem; font-size: .9375rem; color: #aeb6c6; max-width: 40ch; }
.reel figcaption strong { display: block; color: var(--night-ink); font-weight: 600; }
@media (max-width: 700px), (prefers-reduced-motion: reduce) {
  .reel-track { height: auto; padding: 4rem 1rem; overflow-x: auto; width: auto; scroll-snap-type: x mandatory; }
  .reel figure { scroll-snap-align: start; }
  .reel img { height: 46svh; }
}

/* ---------- gallery wall ---------- */
main { width: min(1240px, 100%); margin: 0 auto; padding: 6rem 1rem 5rem; }
.bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .25rem; }
.filters button {
  font: inherit; font-size: .9375rem; color: var(--pencil); background: none; border: 1px solid transparent;
  padding: .375rem .875rem; border-radius: 2rem; cursor: pointer;
}
.filters button:hover { color: var(--ink); border-color: var(--line); }
.filters button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }

.wall { list-style: none; margin: 0; padding: 0; columns: 3 300px; column-gap: 1.5rem; }
.wall li { break-inside: avoid; }
.wall li[hidden] { display: none; }
.piece { all: unset; display: block; width: 100%; cursor: zoom-in; }
.piece:focus-visible { outline: 2px solid var(--wash); outline-offset: 4px; }
.piece .img { overflow: hidden; background: var(--paper-2); }
.piece img { width: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.piece:hover img { transform: scale(1.035); }
.meta { padding: .625rem 0 1.75rem; display: grid; gap: .125rem; font-size: .9375rem; line-height: 1.45; }
.meta strong { font-weight: 600; }
.meta span { color: var(--pencil); }

/* ---------- story ---------- */
.story { width: min(1100px, 100%); margin: 0 auto; padding: 5rem 1rem; display: grid; grid-template-columns: 5fr 6fr; gap: 3rem 5rem; }
.story-head { position: sticky; top: 6rem; align-self: start; }
.story-head p { max-width: 32em; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 2rem 1.75rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .65rem; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--wash); }
.timeline .yr { font: 400 1.75rem/1.2 var(--hand); color: var(--wash); }
.timeline p { margin: .125rem 0 0; max-width: 34em; }
@media (max-width: 820px) { .story { grid-template-columns: 1fr; } .story-head { position: static; } }

/* ---------- USk ---------- */
.usk { background: var(--paper-2); padding: 5rem 1rem; }
.usk > * { width: min(1100px, 100%); margin-left: auto; margin-right: auto; }
.usk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem 3rem; margin-top: 2.5rem; }
.usk-grid p { margin: 0; color: var(--pencil); }
.challenge { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.one-line { width: min(600px, 100%); height: auto; overflow: visible; }
.one-line path { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.challenge blockquote { margin: 1rem 0 .5rem; }
.challenge blockquote p { margin: 0; font: 400 clamp(2rem, 4.5vw, 3.25rem)/1.1 var(--hand); max-width: 22em; }
.challenge figcaption { color: var(--pencil); font-size: .9375rem; }

/* ---------- contact ---------- */
.contact { width: min(1100px, 100%); margin: 0 auto; padding: 6rem 1rem 4rem; }
.contact p { max-width: 32em; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 1.5rem; }
.btn { display: inline-block; padding: .875rem 1.375rem; background: var(--wash); color: var(--on-wash); text-decoration: none; border-radius: 2px; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.link { text-underline-offset: 4px; }
footer { padding: 2rem 1rem 3rem; text-align: center; color: var(--pencil); font-size: .875rem; }

/* ---------- viewer ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: var(--ink); }
dialog::backdrop { background: color-mix(in srgb, var(--paper) 96%, transparent); }
dialog[open] { display: grid; grid-template-columns: 4rem 1fr 4rem; align-items: center; }
dialog figure { margin: 0; display: grid; justify-items: center; gap: .75rem; }
dialog .frame img { max-height: 80vh; max-width: min(1400px, calc(100vw - 8rem)); width: auto; }
dialog figcaption { text-align: center; padding: 0 1rem; }
dialog figcaption small { display: block; color: var(--pencil); }
dialog button { font: 300 2.5rem/1 var(--body); color: var(--ink); background: none; border: 0; cursor: pointer; padding: .5rem; }
.close { position: fixed; top: .75rem; right: 1rem; }
@media (max-width: 600px) {
  dialog[open] { grid-template-columns: 2.5rem 1fr 2.5rem; }
  dialog .frame img { max-width: calc(100vw - 5rem); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .piece img { transition: none; } }
