/* ── THE WORK BINDER ─────────────────────────────────────────────────
   The portfolio side of the site, drawn on the same desk as the landing
   page: graph-paper table, boiling ink lines, taped prints, index cards,
   a ruled notebook page. Shared by portfolio.html and work/*.html. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-brush: 'Caveat Brush', 'Segoe Print', 'Comic Sans MS', cursive;
  --font-hand:  'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --max-w: 72rem;
}
:root, [data-theme="dark"] {
  color-scheme: dark;
  --paper:    #1a1f2e;
  --paper-2:  #252c41;
  --ink:      #f1ecdf;
  --ink-rgb:  241 236 223;
  --ink-soft: #cfcabd;
  --ink-dim:  #9a9588;
  --grid:     rgb(150 180 255 / 0.075);
  --rule:     rgb(150 180 255 / 0.16);
  --margin:   rgb(255 127 166 / 0.35);
  --shadow:   rgb(0 0 0 / 0.5);
  --tape:     rgb(255 214 120 / 0.32);
  --grain:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o:  0.10;
  --vignette: rgb(0 0 0 / 0.38);
  --print:    #f3eee2;
  --sticky:   #e8c95a;
  --on-sticky: #241e18;
  --c-play: #7ba3ff;
  --c-try:  #ffa650;
  --c-read: #6edba8;
  --c-yel:  #ffd54a;
  --c-pink: #ff7fa6;
  --on-yel: #241e18;
  --c-hair: #b58f6e;
  --c-skin: #f0c4a6;
  --c-coat: #b98b62;
  --c-shirt: #dcc7a1;
  --c-grass: #7fcf8a;
  --c-wsu: #e0566d;
}
[data-theme="light"] {
  color-scheme: light;
  --paper:    #f1e8d2;
  --paper-2:  #fbf6e9;
  --ink:      #2a2420;
  --ink-rgb:  42 36 32;
  --ink-soft: #55493f;
  --ink-dim:  #7d7266;
  --grid:     rgb(70 110 170 / 0.16);
  --rule:     rgb(70 110 170 / 0.22);
  --margin:   rgb(217 71 122 / 0.4);
  --shadow:   rgb(42 36 32 / 0.24);
  --tape:     rgb(232 186 80 / 0.6);
  --grain:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .18  0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o:  0.30;
  --vignette: rgb(120 80 30 / 0.20);
  --print:    #fffdf7;
  --sticky:   #f7dc6f;
  --on-sticky: #2a2420;
  --c-play: #3a68d8;
  --c-try:  #e07a1f;
  --c-read: #2c8f63;
  --c-yel:  #f4bd25;
  --c-pink: #d9477a;
  --on-yel: #2a2420;
  --c-hair: #38271b;
  --c-skin: #e6b392;
  --c-coat: #7a5434;
  --c-shirt: #ecdcbc;
  --c-grass: #4f9a4a;
  --c-wsu: #981e32;
}

html { scroll-behavior: smooth; font-size: clamp(16px, 1.15vw, 21px); }
body {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.12rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}
a { color: inherit; }
strong, b { font-weight: 400; color: var(--ink); }

/* the table, the grain, and the pencil trail */
.table, .grain { position: fixed; inset: 0; pointer-events: none; }
.table {
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 52%, var(--vignette) 100%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 30px 30px;
}
.grain { z-index: 60; background-image: var(--grain); opacity: var(--grain-o); }
#ink { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
header.top, main, footer { position: relative; z-index: 2; }

/* every line wobbles: see paper.js, which steps the filter's seed */
.boil, .doodle { filter: url(#boil); overflow: visible; }
.doodle { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.doodle * { transform-box: fill-box; transform-origin: center; }
.hp, .ht, .hr, .hy, .hk, .hh, .hs, .hc { stroke: none; opacity: 0.8; }
.hp { fill: url(#h-play); } .ht { fill: url(#h-try); } .hr { fill: url(#h-read); }
.hy { fill: url(#h-yel); } .hk { fill: url(#h-pink); } .hh { fill: url(#h-hair); }
.hs { fill: url(#h-skin); } .hc { fill: url(#h-coat); }
.cp { stroke: var(--c-play); } .ct { stroke: var(--c-try); } .cr { stroke: var(--c-read); } .cy { stroke: var(--c-yel); } .ck { stroke: var(--c-pink); }

@keyframes wobsq {
  0%   { border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px; }
  33%  { border-radius: 12px 8px 16px 7px / 8px 14px 7px 15px; }
  66%  { border-radius: 16px 5px 15px 8px / 5px 18px 8px 11px; }
}
@keyframes wob {
  0%   { border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px; }
  33%  { border-radius: 235px 17px 245px 12px / 12px 245px 17px 235px; }
  66%  { border-radius: 245px 12px 230px 17px / 17px 230px 12px 245px; }
}
@keyframes spin  { to { rotate: 360deg; } }
@keyframes blink { 0%, 93%, 100% { scale: 1 1; } 95% { scale: 1 0.1; } }
@keyframes wave  { 0%, 100% { rotate: 0deg; } 50% { rotate: -24deg; } }
@keyframes bob   { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* things settle onto the page as you scroll to them */
html.js .reveal { opacity: 0; translate: 0 18px; }
.reveal.in { opacity: 1 !important; translate: 0 0 !important; transition: opacity 0.6s ease, translate 0.7s cubic-bezier(0.2, 1.3, 0.4, 1); }

/* ── TOP ─────────────────────────────────────────────────────────── */
header.top {
  width: 100%; max-width: var(--max-w); margin: 0 auto;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem) 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1.5rem;
}
.logo { font-family: var(--font-brush); font-size: 1.75rem; text-decoration: none; display: inline-block; rotate: -2deg; transition: rotate 0.2s; white-space: nowrap; }
.logo:hover { rotate: 1.5deg; }
.top-right { display: flex; align-items: center; gap: 1.4rem; }
.links { display: flex; align-items: center; gap: 1.3rem; list-style: none; }
.links a, .back {
  font-size: 1.15rem; white-space: nowrap; text-decoration: none; color: var(--ink-soft); padding: 0.1rem 0.15rem; transition: color 0.15s;
}
.links a:hover, .back:hover { color: var(--ink); text-decoration: underline wavy var(--c-play) 2px; text-underline-offset: 4px; }
.links .home { color: var(--ink); padding: 0.05rem 0.7rem; border: 2.4px solid var(--c-yel); border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px; rotate: -2deg; display: inline-block; animation: wob 1.4s steps(1) infinite; }
.links .home:hover { text-decoration: none; background: color-mix(in srgb, var(--c-yel) 30%, transparent); }
.mode {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  background: var(--paper-2); border: 2.4px solid var(--ink);
  border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%;
  cursor: pointer; color: var(--ink); box-shadow: 2px 3px 0 var(--shadow);
  transition: transform 0.15s; animation: wob 1.6s steps(1) infinite;
}
.mode:hover { transform: rotate(14deg) scale(1.08); }
.mode svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: url(#boil); overflow: visible; }
.mode .moon { display: none; }
[data-theme="dark"] .mode .sun { display: none; }
[data-theme="dark"] .mode .moon { display: block; }
.mode .rays { animation: spin 14s steps(28) infinite; transform-box: fill-box; transform-origin: center; }
a:focus-visible, button:focus-visible { outline: 2px dashed var(--c-play); outline-offset: 4px; }

main { flex: 1; width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }

/* ── SHARED PIECES ───────────────────────────────────────────────── */
.kicker { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; color: var(--ink-soft); rotate: -1.5deg; }
.stamp {
  display: inline-block; font-family: var(--font-brush); font-size: 1.15rem; line-height: 1;
  padding: 0.25rem 0.6rem 0.3rem; color: var(--c-read);
  border: 2.4px solid currentColor; border-radius: 10px 4px 12px 5px / 5px 11px 4px 12px;
  rotate: -5deg; animation: wobsq 1.6s steps(1) infinite;
}
.mark {
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--c-yel) 70%, transparent) 58% 92%, transparent 92%) no-repeat 0 0 / 0% 100%;
  padding: 0 0.12em; margin: 0 -0.12em;
}
html.go .mark { animation: swipe 0.7s ease-out 0.9s forwards; }
html:not(.js) .mark { background-size: 100% 100%; }
@keyframes swipe { to { background-size: 100% 100%; } }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-brush); font-size: 1.45rem; line-height: 1.1; text-decoration: none;
  color: var(--on-yel); background: var(--c-yel);
  padding: 0.4rem 1.2rem 0.45rem;
  border: 2.6px solid var(--ink); border-radius: 16px 7px 18px 7px / 7px 16px 7px 18px;
  box-shadow: 4px 5px 0 var(--ink); rotate: -1.5deg;
  transition: transform 0.14s, box-shadow 0.14s; animation: wob 1.3s steps(1) infinite;
}
.btn:hover { transform: translate(2px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 5px); box-shadow: 0 0 0 var(--ink); }
.btn.ghost { background: var(--paper-2); color: var(--ink); rotate: 1.5deg; }
.btn .arrow { display: inline-block; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(4px); }

.sec-title { position: relative; display: inline-block; font-family: var(--font-brush); font-weight: 400; font-size: 2.6rem; line-height: 1.1; }
.scribble { position: absolute; left: -2%; bottom: -8px; width: 104%; height: 11px; fill: none; stroke-width: 3.2; stroke-linecap: round; filter: url(#boil); overflow: visible; }

.tape {
  position: absolute; top: -14px; left: 50%; z-index: 3;
  width: 92px; height: 26px; margin-left: -46px;
  background: var(--tape); rotate: -3deg;
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 0, 100% 4%, 96% 28%, 100% 52%, 95% 76%, 100% 96%, 12% 100%, 7% 88%, 0 100%, 3% 52%);
  pointer-events: none;
}

/* status stickers */
.sticker {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-brush); font-size: 1.05rem; line-height: 1; white-space: nowrap;
  padding: 0.25rem 0.65rem 0.3rem;
  color: var(--paper); background: var(--c-read);
  border-radius: 999px 600px 800px 700px / 700px 900px 600px 800px;
  box-shadow: 2px 2px 0 var(--shadow); rotate: 3deg;
}
.sticker::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; opacity: 0.85; }
.sticker.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.sticker.store { background: var(--c-play); }
.sticker.wip { background: var(--c-try); }
[data-theme="dark"] .sticker { color: #1a1f2e; }

/* a photo print, taped down. A drawn title card sits behind the photo in
   case the image is missing. */
.print {
  position: relative; display: block;
  background: var(--print);
  padding: 0.7rem 0.7rem 0.75rem;
  box-shadow: 3px 5px 0 var(--shadow), 0 0 0 1.5px rgb(var(--ink-rgb) / 0.18);
  rotate: var(--rot, -1.2deg);
  transition: rotate 0.35s cubic-bezier(0.3, 1.5, 0.5, 1), translate 0.35s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.3s;
  text-decoration: none; color: var(--ink);
}
.print .frame { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #1c1712; }
.print img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.print .card {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.2rem;
  padding: 1rem 1.2rem; color: #f3eee2; background: radial-gradient(circle at 70% 30%, #4a3424, #1c1712 70%);
}
.print .card b { font-family: var(--font-brush); font-size: 2rem; color: inherit; }
/* Lodestar: the phone screenshot is its own little print, taped over the photo */
.print .device {
  position: absolute; z-index: 2; right: 7%; top: 8%; width: 25%;
  background: var(--print); padding: 0.35rem 0.35rem 0.6rem;
  box-shadow: 3px 4px 0 var(--shadow); rotate: 4deg;
}
.print .device img { position: static; height: auto; }
.print .device .tape { width: 54px; height: 18px; margin-left: -27px; top: -10px; rotate: 6deg; }

/* a portrait print, for a phone screenshot */
.print--app { width: min(17rem, 78%); align-self: center; justify-self: center; }
.print--app .frame { aspect-ratio: 3 / 4; background: #ecebf7; }
.print--app img { object-position: 50% 0; }

/* a pencil note in the margin, with an arrow */
.pnote { display: flex; align-items: flex-start; gap: 0.35rem; font-size: 1rem; line-height: 1.3; color: var(--ink-dim); rotate: -1.5deg; }
.pnote svg { width: 2.2rem; height: 1.6rem; flex: none; fill: none; stroke: var(--ink-dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: url(#boil); overflow: visible; }

/* ── PORTFOLIO: HERO ─────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem; align-items: center;
  padding: clamp(1.6rem, 6vh, 4rem) 0 clamp(1.4rem, 5vh, 3rem);
}
.hero-title { font-family: var(--font-brush); font-weight: 400; font-size: clamp(3rem, 6.4vw, 5.2rem); line-height: 1; margin: 0.6rem 0 0.9rem; }
.hero-sub { font-size: 1.4rem; line-height: 1.4; color: var(--ink-soft); max-width: 32rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 1.5rem; }

/* the polaroid of me */
.me {
  justify-self: center; position: relative; width: min(17rem, 100%);
  background: var(--print); padding: 0.8rem 0.8rem 0.4rem;
  box-shadow: 4px 6px 0 var(--shadow), 0 0 0 1.5px rgb(var(--ink-rgb) / 0.18);
  rotate: 3deg;
}
.me .frame { position: relative; aspect-ratio: 1; overflow: hidden; background: color-mix(in srgb, var(--c-play) 12%, var(--paper-2)); }
.me .frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 18px 18px; pointer-events: none; }
.me svg.buddy {
  position: absolute; left: 50%; bottom: -4%; width: 82%; translate: -50% 0;
  fill: none; stroke: #2a2420; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round;
  filter: url(#boil); overflow: visible;
}
.me svg.buddy * { transform-box: fill-box; transform-origin: center; }
.me .paper-fill { fill: #fbf6e9; }
.me .base { stroke: none; }
.me .skin-base { fill: var(--c-skin); opacity: 0.45; }
.me .hair-base { fill: var(--c-hair); opacity: 0.6; }
.me .shirt { fill: var(--c-shirt); stroke: none; }
.me .pupil { fill: #2a2420; stroke: none; transition: translate 0.08s linear; }
.me .eye { animation: blink 5s steps(1) infinite; }
.me .wave { transform-origin: 0% 100%; animation: wave 2.6s ease-in-out infinite; }
.me figcaption { font-family: var(--font-brush); font-size: 1.35rem; text-align: center; color: #2a2420; padding-top: 0.35rem; }
.me .tape { rotate: 4deg; }

/* where I am: two taped cards with drawn logos */
.creds { display: flex; flex-wrap: wrap; gap: 1.2rem 1.6rem; margin-top: 1.9rem; }
.cred {
  position: relative; display: flex; align-items: center; gap: 0.8rem;
  background: var(--paper-2); padding: 0.7rem 1.1rem 0.65rem;
  border: 2.4px solid var(--ink); border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px;
  box-shadow: 3px 4px 0 var(--shadow); rotate: -1deg; max-width: 25rem;
  animation: wobsq 1.6s steps(1) infinite;
}
.cred:nth-child(2) { rotate: 1.2deg; }
.cred .tape { width: 58px; height: 18px; margin-left: -29px; top: -10px; }
.logo-d { flex: none; width: 3.5rem; height: 3.5rem; overflow: visible; filter: url(#boil-lite); }
.logo-d .lf { fill: var(--brand); opacity: 0.94; }
.logo-d .lo { fill: none; stroke: rgb(0 0 0 / 0.55); stroke-width: 1.1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.logo-d.rose { --brand: #ff6319; }
.logo-d.wsu  { --brand: #981e32; }
[data-theme="dark"] .logo-d.wsu { --brand: #c13450; }
.wordmark { text-transform: uppercase; color: var(--ink); line-height: 1; }
.wordmark.rp { font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; letter-spacing: 0.06em; }
.wordmark.ws { display: flex; flex-direction: column; gap: 0.18rem; font-family: 'Helvetica Neue', Arial, sans-serif; }
.wordmark.ws b { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }
.wordmark.ws small { font-size: 0.62rem; letter-spacing: 0.42em; text-align: center; }

/* ── PORTFOLIO: PROJECTS ─────────────────────────────────────────── */
#work { padding: 1.5rem 0 1rem; scroll-margin-top: 1rem; }
.work-head { margin-bottom: 2.2rem; }
.r-play .scribble { stroke: var(--c-play); }
.r-try .scribble { stroke: var(--c-try); }
.r-read .scribble { stroke: var(--c-read); }
.project {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5rem; align-items: center;
  margin-bottom: 4.2rem;
}
.project:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.project:nth-child(even) .shot { order: 2; }
.project:nth-child(even) .print { --rot: 1.4deg; }
.shot { display: flex; flex-direction: column; gap: 0.7rem; }
.project:hover .print, .print:focus-visible { rotate: 0deg; translate: 0 -4px; box-shadow: 6px 9px 0 var(--shadow), 0 0 0 1.5px rgb(var(--ink-rgb) / 0.18); }
.idx {
  position: relative;
  background: var(--paper-2);
  border: 2.6px solid var(--ink); border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px;
  box-shadow: 4px 6px 0 var(--shadow);
  padding: 1.3rem 1.5rem 1.4rem;
  rotate: 0.8deg;
  animation: wobsq 1.5s steps(1) infinite;
  background-image: linear-gradient(transparent calc(2.6rem - 1px), var(--rule) calc(2.6rem - 1px), var(--rule) 2.6rem, transparent 2.6rem);
}
.project:nth-child(even) .idx { rotate: -0.8deg; }
.idx-top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.9rem; }
.num { font-family: var(--font-brush); font-size: 1.6rem; color: var(--ink-dim); }
.idx .doodle { position: absolute; right: -1.4rem; top: -2rem; width: 4.4rem; height: 4.4rem; rotate: 8deg; }
.idx h3 { font-family: var(--font-brush); font-weight: 400; font-size: 2.5rem; line-height: 1.05; margin: 0.2rem 0 0.55rem; }
.idx h3 a { text-decoration: none; }
.idx .logline { font-size: 1.3rem; line-height: 1.38; color: var(--ink-soft); }
.read {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.1rem;
  font-family: var(--font-brush); font-size: 1.35rem; text-decoration: none; color: var(--ink);
}
.read svg { width: 2.4rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: url(#boil); overflow: visible; transition: translate 0.2s; }
.read:hover { text-decoration: underline wavy var(--c-play) 2px; text-underline-offset: 5px; }
.read:hover svg { translate: 5px 0; }
/* a little life in the doodles */
.conch-glint { animation: bob 2.4s ease-in-out infinite; }
.star-spin { animation: spin 9s steps(36) infinite; }
.gear { animation: spin 6s steps(30) infinite; }
.beltflow { stroke-dasharray: 5 5; animation: beltflow 0.9s linear infinite; }
@keyframes beltflow { to { stroke-dashoffset: -10; } }

/* ── PORTFOLIO: ABOUT (a ruled notebook page and a sticky note) ───── */
#credits { padding: 1.5rem 0 3.5rem; scroll-margin-top: 1rem; }
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.6rem; align-items: start; }
.about .sec-title { margin-bottom: 1.6rem; }
.sticky {
  position: relative; background: var(--sticky); color: var(--on-sticky);
  padding: 1.6rem 1.4rem 1.8rem; rotate: -3deg;
  box-shadow: 3px 7px 0 var(--shadow);
  font-family: var(--font-brush); font-size: 1.9rem; line-height: 1.2;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 90% 100%, 0 100%);
}
.sticky::after { content: ''; position: absolute; right: 0; bottom: 0; width: 10%; height: 12%; background: color-mix(in srgb, var(--sticky) 70%, #000); clip-path: polygon(0 0, 100% 0, 0 100%); }
.notebook {
  position: relative;
  background-color: var(--paper-2);
  background-image:
    linear-gradient(90deg, transparent 2.9rem, var(--margin) 2.9rem, var(--margin) calc(2.9rem + 2px), transparent calc(2.9rem + 2px)),
    linear-gradient(transparent calc(2.1rem - 1.5px), var(--rule) calc(2.1rem - 1.5px), var(--rule) 2.1rem);
  background-size: 100% 100%, 100% 2.1rem;
  background-position: 0 0, 0 0.78rem;
  border: 2.6px solid var(--ink); border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px;
  box-shadow: 4px 6px 0 var(--shadow);
  padding: 1.25rem 2rem 1.6rem 4rem;
  isolation: isolate;
  line-height: 2.1rem; font-size: 1.28rem;
  animation: wobsq 1.7s steps(1) infinite;
}
.notebook p + p { margin-top: 2.1rem; }
.notebook::before {   /* the punched holes */
  content: ''; position: absolute; left: 1rem; top: 1.6rem; bottom: 1.6rem; width: 0.9rem;
  background: radial-gradient(circle, var(--paper) 0.36rem, rgb(var(--ink-rgb) / 0.5) 0.38rem, transparent 0.42rem) 0 0 / 0.9rem 4.2rem repeat-y;
}
.notebook strong { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--c-yel) 55%, transparent) 55% 90%, transparent 90%); padding: 0 0.1em; }
[data-theme="dark"] .notebook strong { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--c-yel) 32%, transparent) 62% 92%, transparent 92%); }

/* ── CASE STUDY ──────────────────────────────────────────────────── */
.study-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.6rem; align-items: center; padding: clamp(1.4rem, 5vh, 3rem) 0 2rem; }
.study-title { font-family: var(--font-brush); font-weight: 400; font-size: clamp(3rem, 6vw, 4.8rem); line-height: 1; margin: 0.5rem 0 0.7rem; }
.study-logline { font-size: 1.4rem; line-height: 1.4; color: var(--ink-soft); }
.facts {
  position: relative; margin-top: 1.5rem;
  background: var(--paper-2); border: 2.6px solid var(--ink); border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px;
  box-shadow: 4px 6px 0 var(--shadow); padding: 0.6rem 1.2rem 0.7rem; rotate: -0.6deg;
  animation: wobsq 1.5s steps(1) infinite;
}
.facts div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.8rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1.5px dashed rgb(var(--ink-rgb) / 0.25); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--font-brush); font-size: 1.15rem; color: var(--ink-dim); }
.facts dd { font-size: 1.2rem; }
.facts .tape { left: 18%; rotate: -6deg; }

.study-body { max-width: 50rem; margin: 1.5rem auto 0; }
.study-body h2 {
  position: relative; display: inline-block;
  font-family: var(--font-brush); font-weight: 400; font-size: 2rem; line-height: 2.1rem;
  margin: 2.1rem 0 0; padding-bottom: 0;
}
.study-body h2:first-child { margin-top: 0; }
.study-body h2::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: 0.1rem; height: 0.42rem;
  background: color-mix(in srgb, var(--hl, var(--c-play)) 45%, transparent); z-index: -1; rotate: -1deg; border-radius: 3px;
}
.study-body h2:nth-of-type(3n+2) { --hl: var(--c-try); }
.study-body h2:nth-of-type(3n+3) { --hl: var(--c-read); }
.study-body h2 + p, .study-body h2 + ul { margin-top: 0; }
.study-body ul { list-style: none; margin-top: 0; }
.study-body li { position: relative; padding-left: 1.6rem; }
.study-body li::before {      /* a hand-drawn tick */
  content: ''; position: absolute; left: 0.1rem; top: 0.55rem; width: 0.9rem; height: 0.55rem;
  border-left: 2.6px solid var(--c-read); border-bottom: 2.6px solid var(--c-read);
  rotate: -48deg; border-radius: 0 0 0 3px;
}
.study-body a:not(.btn) { text-decoration: underline wavy var(--c-play) 2px; text-underline-offset: 4px; }
.study-cta { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 2.1rem; padding-bottom: 0.4rem; }

.study-nav { display: flex; justify-content: space-between; gap: 1.5rem; max-width: 50rem; margin: 2.6rem auto 3rem; }
.study-nav a {
  position: relative; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0;
  padding: 0.7rem 1.2rem 0.8rem; text-decoration: none;
  background: var(--paper-2); border: 2.4px solid var(--ink); border-radius: 14px 6px 18px 5px / 6px 16px 5px 13px;
  box-shadow: 3px 4px 0 var(--shadow); rotate: -1.5deg;
  transition: translate 0.2s cubic-bezier(0.3, 1.6, 0.5, 1), rotate 0.2s;
  animation: wobsq 1.6s steps(1) infinite;
}
.study-nav .next { text-align: right; rotate: 1.5deg; margin-left: auto; }
.study-nav a:hover { translate: 0 -3px; rotate: 0deg; }
.study-nav .dir { font-size: 1rem; color: var(--ink-dim); }
.study-nav .name { font-family: var(--font-brush); font-size: 1.6rem; line-height: 1.1; }

/* ── FOOTER: the ground, with signposts ──────────────────────────── */
footer.ground-foot { position: relative; margin-top: 2rem; height: 5.4rem; }
.ground { position: absolute; left: 0; bottom: 0; width: 100%; height: 1.4rem; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; filter: url(#boil); overflow: visible; }
.ground .hg2 { fill: url(#h-grass); fill-opacity: 0.55; stroke: none; }
.signs { position: absolute; inset: 0 0 auto; height: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.signs .row { display: flex; align-items: flex-end; gap: 0.9rem; flex-wrap: wrap; justify-content: flex-end; }
.sign {
  position: relative; display: inline-block; margin-bottom: 1.85rem;
  padding: 0.08rem 0.6rem 0.12rem; white-space: nowrap; text-decoration: none; line-height: 1.25; font-size: 1.05rem;
  background: var(--paper-2); color: var(--ink-soft);
  border: 2.2px solid var(--ink); border-radius: 12px 5px 14px 5px / 5px 12px 5px 14px;
  box-shadow: 2px 2px 0 var(--shadow); rotate: -2deg;
  animation: wobsq 1.7s steps(1) infinite;
}
.sign:nth-child(even) { rotate: 2deg; }
.sign::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2.4px; height: 1.05rem; margin-left: -1.2px; background: var(--ink); }
.sign b { color: var(--ink); }
a.sign:hover { color: var(--ink); background: color-mix(in srgb, var(--c-yel) 30%, var(--paper-2)); }
.tuft { position: absolute; bottom: 0.82rem; width: 1.5rem; height: 0.9rem; fill: none; stroke: var(--c-grass); stroke-width: 2; stroke-linecap: round; filter: url(#boil); overflow: visible; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero, .study-hero, .about { grid-template-columns: 1fr; gap: 2rem; }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; gap: 1.6rem; margin-bottom: 3.2rem; }
  .project:nth-child(even) .shot { order: 0; }
  .me { width: min(13rem, 70%); justify-self: start; margin-left: 1rem; }
  .sticky { max-width: 22rem; }
}
@media (max-width: 680px) {
  html { font-size: 15px; }
  header.top { padding-top: 0.7rem; row-gap: 0.2rem; }
  .top-right { display: contents; }
  .logo { order: 1; font-size: 1.6rem; }
  .mode { order: 2; width: 40px; height: 40px; }
  .links, .back { order: 3; }
  .links { flex-basis: 100%; gap: 1rem; flex-wrap: wrap; }
  .links a { font-size: 1.1rem; }
  .idx .doodle { right: -0.4rem; top: -1.8rem; width: 3.6rem; height: 3.6rem; }
  .idx h3 { font-size: 2.2rem; }
  .notebook { padding-left: 3.2rem; padding-right: 1.2rem; }
  .notebook::before { left: 0.7rem; }
  .notebook { background-image:
    linear-gradient(90deg, transparent 2.3rem, var(--margin) 2.3rem, var(--margin) calc(2.3rem + 2px), transparent calc(2.3rem + 2px)),
    linear-gradient(transparent calc(2.1rem - 1.5px), var(--rule) calc(2.1rem - 1.5px), var(--rule) 2.1rem); }
  footer.ground-foot { height: auto; padding-bottom: 1.4rem; }
  .signs { position: relative; flex-direction: column; align-items: flex-start; gap: 0; padding-top: 0.5rem; }
  .signs .row { justify-content: flex-start; gap: 0.6rem; }
  .sign { margin-bottom: 1.45rem; }
  .sign::after { height: 0.7rem; }
  .study-nav { flex-direction: column; }
  .study-nav .next { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; translate: none; }
  html.js .mark, .mark { background-size: 100% 100%; }
}
