/* =========================================================
   Oliver Lewis — portfolio
   Display: Archivo (variable, Google Fonts) · Accent: Instrument Serif italic
   Pixel: Silkscreen · Code: JetBrains Mono
   ========================================================= */

@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("assets/fonts/silkscreen-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("assets/fonts/silkscreen-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jersey"; src: url("assets/fonts/jersey-10.woff2") format("woff2"); font-weight: 400; font-display: swap; } /* agent-monitor's font (SIL OFL) */

:root {
  --paper: #f2efe7;
  --paper-2: #e8e4d8;
  --ink: #131312;
  --ink-2: #67645c;
  --hair: rgba(19, 19, 18, .14);
  --accent: #ff5a1f;
  --accent-soft: #ffd8c4;
  --accent-text: #b23a0a;   /* small orange text on light bg (AA) */
  --accent-strong: #df4a10; /* large orange text on light bg (AA large) */
  --sky: #c9dafb;
  --sage: #e4e6cf;
  --night: #141413;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --pad: clamp(18px, 3vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; } /* no sideways jump when the sheet locks scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
mark { background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1240px, 100% - var(--pad) * 2); margin-inline: auto; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 28px;
  font-family: var(--pixel); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow span { color: var(--accent-text); }
.eyebrow--light span { color: var(--accent); }
.eyebrow--light { color: rgba(242, 239, 231, .7); }

/* serif italic accents inside display type */
.hero-lede em, .h2 em, .kit-title em, .contact-title em, .assemble em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
}

/* pixel svgs built by JS */
[data-pix] svg { display: block; width: 100%; height: 100%; }

/* ---------- PRELOADER ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--pad);
  background: var(--ink); color: var(--paper);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease-io);
}
.loader.done { clip-path: inset(0 0 100% 0); }
.loader-top { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.loader-count { font-family: var(--pixel); font-size: clamp(110px, 24vw, 340px); line-height: .8; display: flex; align-items: flex-end; gap: .05em; }
.loader-count small { font-size: .3em; color: var(--accent); line-height: 1; }
.loader-bar { height: 8px; background: rgba(255, 255, 255, .1); }
.loader-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- CURSOR ---------- */
.cursor { display: none; }
/* the custom circle replaces the system pointer (only on mouse/trackpad, when script.js adds .has-cursor) */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor .cursor {
  display: block; position: fixed; left: 0; top: 0; z-index: 200;
  pointer-events: none; mix-blend-mode: difference;
}
.cursor-dot {
  position: absolute; left: 0; top: 0;
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), background .3s, opacity .3s;
}
.cursor-dot span { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); opacity: 0; transition: opacity .2s; }
.cursor.is-link .cursor-dot { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.cursor.is-label { mix-blend-mode: normal; }
.cursor.is-label .cursor-dot { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--accent); }
.cursor.is-label .cursor-dot span { opacity: 1; transition-delay: .1s; }
.cursor.is-label.on-accent .cursor-dot { background: var(--ink); }
.cursor.is-label.on-accent .cursor-dot span { color: var(--paper); }
.cursor.is-hidden .cursor-dot { opacity: 0; }

/* ---------- TOP BAR ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 24px; align-items: start;
  padding: 22px var(--pad);
  font-size: 15px; line-height: 1.3; font-weight: 500;
}
.js .topbar { opacity: 0; transform: translateY(-12px); transition: opacity .8s var(--ease) .6s, transform .8s var(--ease) .6s; }
.ready .topbar { opacity: 1; transform: none; }
.tb-item { display: flex; flex-direction: column; }
.mute { color: var(--ink-2); }
.hi-btn { display: flex; align-items: center; gap: 4px; transition: transform .45s var(--ease); }
.hi-face {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--ink);
  font-family: var(--pixel); font-size: 13px;
  transform: scale(0) rotate(-90deg);
  transition: transform .5s var(--ease);
}
.hi-label { height: 48px; padding: 0 26px; border-radius: 999px; display: flex; align-items: center; background: var(--ink); color: var(--paper); font-weight: 600; }
.hi-btn:hover .hi-face, .hi-btn:focus-visible .hi-face { transform: scale(1) rotate(0); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 128px 0 26px;
  overflow: hidden;
}
/* the cards keep to the right-hand side, clear of the headline (which stops at 56vw) */
.hero-cards { position: absolute; top: 0; bottom: 0; left: 62%; right: 0; pointer-events: none; }
.fcard { position: absolute; will-change: transform; }
.fc-a { right: 14%; top: 22%; }
.fc-c { left: 0; top: 46%; }
.fc-bob { animation: bob 7s ease-in-out infinite; animation-delay: var(--bd, 0s); }
@keyframes bob { 50% { transform: translateY(-12px); } }
.fc-in {
  pointer-events: auto;
  border: 2px solid var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(var(--r)) scale(.4);
  opacity: 0;
  transition: transform 1.2s var(--ease), opacity .6s;
}
.ready .fc-in { transform: rotate(var(--r)) scale(1); opacity: 1; transition-delay: calc(.55s + var(--i) * .09s); }
.ready .fc-in:hover { transform: rotate(0deg) scale(1.07); transition-delay: 0s; }

.fc-q { width: 150px; height: 176px; background: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.fc-q-pix { width: 84px; height: 84px; }
.fc-q span { font-family: var(--pixel); font-size: 14px; text-transform: uppercase; color: var(--paper); }
.fc-code { background: var(--ink); color: #d9d5ca; padding: 16px 20px; box-shadow: 6px 6px 0 var(--accent); }
.fc-code pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
.fc-code .k { color: var(--accent); } .fc-code .f { color: #9fc0ff; } .fc-code .s { color: #8fe3a8; }

.hero-mid { position: relative; z-index: 2; max-width: min(820px, 56vw); margin: 0 var(--pad); will-change: transform; }
.hero-mid .eyebrow { margin-bottom: 20px; }
.js .hero-mid .eyebrow { opacity: 0; transition: opacity .8s var(--ease) .8s; }
.ready .hero-mid .eyebrow { opacity: 1; }
.hero-lede { margin: 0; font-size: clamp(38px, 5vw, 76px); line-height: .98; letter-spacing: -.04em; font-weight: 700; text-wrap: balance; }
/* orange squiggle under "then build them better.", drawn once the words are in */
.hero-em { position: relative; display: inline-block; }
.doodle-hero { left: -1%; bottom: -.1em; width: 102%; height: .24em; stroke: var(--accent); stroke-width: 4; }
.ready .doodle-hero path { stroke-dashoffset: 0; transition-delay: 1.7s; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 30px 0 0; padding: 8px 15px 8px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fbfaf6; box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--pixel); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
}
.js .hero-kicker { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease) .9s, transform .8s var(--ease) .9s; }
.ready .hero-kicker { opacity: 1; transform: none; }
.dot { width: 9px; height: 9px; background: var(--accent); animation: blink 1.2s steps(1) infinite; }
.rotator { display: inline-block; color: var(--ink); transition: transform .35s var(--ease), opacity .3s, filter .3s; }
.rotator.out { transform: translateY(-60%); opacity: 0; filter: blur(3px); }

.hero-bottom { padding: 0 var(--pad); position: relative; z-index: 1; will-change: transform; }
.hero-row { display: flex; justify-content: space-between; gap: 16px; font-family: var(--pixel); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.js .hero-row { opacity: 0; transition: opacity 1s var(--ease) 1s; }
.ready .hero-row { opacity: 1; }
.hero-row--top span:nth-child(2) { color: var(--accent-text); }
.hero .pixtype { position: relative; z-index: 1; margin: calc(8px - var(--bleed-t, 0px)) 0 calc(10px - var(--bleed-b, 0px)); }

/* ---------- WORD REVEALS ---------- */
.wm { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.wi { display: inline-block; }
.js [data-split] .wi { transform: translateY(112%); transition: transform 1.1s var(--ease) var(--d, 0s); }
.js [data-split].in .wi { transform: none; }

.js [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease) var(--rd, 0s), transform 1.1s var(--ease) var(--rd, 0s); }
.js [data-reveal="card"] { transform: translateY(90px) scale(.94); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- ABOUT ---------- */
.about { padding: clamp(110px, 18vh, 200px) 0 clamp(90px, 14vh, 160px); }
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(36px, 6vw, 96px); align-items: start; }
.assemble { margin: 0; font-size: clamp(30px, 3.5vw, 52px); line-height: 1.1; letter-spacing: -.032em; font-weight: 600; }
.aw { display: inline-block; will-change: transform; }
.assemble mark .aw { transition: color .6s var(--ease); transition-delay: calc(var(--k, 0) * 60ms); }
.assemble.done mark .aw { color: var(--accent-strong); }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: .95em; padding: .12em 0; border-radius: 999px;
  vertical-align: -.06em; margin: 0 .02em;
}
.chip svg { width: auto; height: 100%; }
.chip--sun { background: var(--sky); }
.chip--bulb, .chip--q { background: var(--ink); }
.chip--check { background: #c9ecd4; }
.chip--code { background: var(--accent); color: var(--ink); font-family: var(--mono); font-size: .42em; font-weight: 400; letter-spacing: 0; width: 3.8em; height: 2.2em; vertical-align: .2em; }

.term {
  position: sticky; top: 90px; margin: 0;
  background: var(--ink); color: #e6e2d7;
  border-radius: 16px; overflow: hidden;
  box-shadow: 8px 8px 0 var(--accent);
}
.term-bar { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.term-body { margin: 0; padding: 18px 20px 6px; min-height: 238px; font-family: var(--mono); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.term-body .q { color: var(--accent); }
.term-body .s { color: #a9a597; }
.term-body .ok { color: #7fe3a3; }
.caret { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: -.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term figcaption { padding: 0 20px 16px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: rgba(255, 255, 255, .6); }

/* ---------- THINK (process) ---------- */
.think { position: relative; height: 360vh; }
.think-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; padding: 10px; }
.think-card {
  position: relative; height: 100%;
  display: flex; align-items: center;
  border-radius: clamp(18px, 2.4vw, 32px);
  background: var(--sage); overflow: hidden;
}
.think-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 100px); align-items: center; }
.h2 { margin: 0; font-size: clamp(40px, 5.4vw, 82px); line-height: .96; letter-spacing: -.04em; font-weight: 700; text-wrap: balance; }
.think-icon {
  position: relative; margin-top: clamp(28px, 5vh, 48px);
  width: 172px; height: 172px;
  display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.pixgrid { display: grid; grid-template-columns: repeat(12, 10px); grid-template-rows: repeat(12, 10px); }
.pixgrid i { background: var(--ink); transform: scale(0); transition: transform .2s steps(2); }
.pixgrid i.on { transform: scale(1.04); }
.pixgrid i.hot { background: var(--accent); }
.think-num { position: absolute; right: -2px; bottom: -34px; font-family: var(--pixel); font-size: 12px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 22px 0; border-top: 1px solid var(--hair); opacity: .3; transition: opacity .5s var(--ease); }
.step:last-child { border-bottom: 1px solid var(--hair); }
.step.on { opacity: 1; }
.step-n { padding-top: 9px; font-family: var(--pixel); font-size: 13px; color: var(--ink-2); transition: color .4s; }
.step.on .step-n { color: var(--accent-text); }
.step h3 { margin: 0; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.step p { margin: 0; max-width: 44ch; color: var(--ink-2); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .7s var(--ease), opacity .5s, margin .7s var(--ease); }
.step.on p { max-height: 140px; opacity: 1; margin-top: 10px; }
.think-progress {
  position: absolute; left: clamp(18px, 3vw, 40px); right: clamp(18px, 3vw, 40px); bottom: 26px; height: 8px;
  background: rgba(19, 19, 18, .08);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
          mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
}
.think-progress i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* ---------- WORK ---------- */
.work { padding: clamp(110px, 16vh, 180px) 0 clamp(60px, 8vh, 100px); }
.pixtype {
  display: block; width: 100%; height: auto; pointer-events: none; /* the mouse is read from window, nothing to click */
  margin: calc(-1 * var(--bleed-t, 0px)) 0 calc(clamp(36px, 6vw, 72px) - var(--bleed-b, 0px));
}
.projects { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 2.6vw, 40px); align-items: stretch; }
/* cards in the same row match heights: the card fills its cell and the picture grows to take up any slack */
.proj { display: flex; }
.proj--wide { grid-column: span 7; }
.proj--narrow { grid-column: span 5; }
.proj-link {
  position: relative; z-index: 0; /* own stacking context so the hit area below sits under the content */
  flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px;
  background: #fbfaf6; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.proj-link:hover, .proj-link:focus-visible { transform: translate(-4px, -4px); box-shadow: 10px 10px 0 var(--ink); }
.proj-link:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
/* invisible hit area: covers the drop shadow and the strip the card uncovers when it lifts or presses,
   so the edges never flicker between hover / not-hover and every visible part of the card is clickable */
.proj-link::after { content: ""; position: absolute; z-index: -1; inset: -4px -12px -12px -4px; }
/* the picture never makes a card taller than the screen: capped by viewport height (short laptop screens) */
.proj-visual { flex: 1 0 auto; max-height: max(220px, 100svh - 300px); container-type: size; position: relative; aspect-ratio: 16 / 11; overflow: hidden; perspective: 900px; display: grid; place-items: center; }
.proj--narrow .proj-visual { aspect-ratio: 80 / 77; }
/* backgrounds behind the screenshots: painted scenes with directional blurs, one ordered dither
   (generated by make_backgrounds.py; colour fallback underneath while they load) */
.v-sky { background: var(--sky) url("assets/img/bg-integrated.jpg") center / cover; }       /* zoom burst */
.v-sage { background: #3a2f74 url("assets/img/bg-gorillas.jpg") center 70% / cover; }        /* horizontal pan */
.v-peach { background: #7dbb68 url("assets/img/bg-agent.jpg") center / cover; }              /* diagonal pan */
.proj-visual::before { content: ""; position: absolute; inset: 0; background: inherit; transition: transform 1s var(--ease); }
.proj-link:hover .proj-visual::before { transform: scale(1.08); }
.proj-visual > .mock { position: relative; z-index: 1; }
.mock { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--ms, 1)); transition: transform .6s var(--ease); }
.proj-link:hover .mock { --ms: 1.04; }

.proj-strip { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; overflow: hidden; background: var(--ink); color: var(--paper); transform: translateY(101%); transition: transform .5s var(--ease); }
.proj-strip div { display: inline-block; white-space: nowrap; padding: 9px 0; font-family: var(--pixel); font-size: 11px; letter-spacing: .06em; animation: strip 14s linear infinite; }
@keyframes strip { to { transform: translateX(-50%); } }
.proj-link:hover .proj-strip { transform: none; }

.proj-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 18px 8px 8px; }
.proj-body .proj-head { align-self: stretch; }
.proj-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.proj-head h3 { margin: 0; font-size: clamp(26px, 2.5vw, 38px); line-height: 1; letter-spacing: -.035em; font-weight: 700; }
.proj-tags { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: var(--ink-2); }
.proj-body .proj-a { margin-top: 12px; }
.proj-more { display: inline-flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; /* sits at the bottom so buttons in a row line up */ font-family: var(--pixel); font-size: 12px; text-transform: uppercase; }
.proj-more i { position: relative; flex: none; width: 24px; height: 24px; border: 2px solid var(--ink); font-size: 0; transition: transform .45s var(--ease), background .3s, color .3s; }
.proj-more i::before, .proj-more i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: currentColor; } /* a drawn plus, so it sits dead centre whatever the font */
.proj-more i::after { transform: rotate(90deg); }
.proj-link:hover .proj-more i { transform: rotate(90deg); background: var(--accent); }

/* mock: real screenshots in a window / phone frame */
.m-shot { width: min(84%, (86cqh - 36px) * 1.69); background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 50px -28px rgba(19, 19, 18, .6); }
.m-shot img, .m-phone img { display: block; width: 100%; height: auto; }
.m-phone { width: min(74%, (86cqh - 18px) * 2.16 + 18px); padding: 9px; background: #101010; border-radius: 26px; box-shadow: 0 34px 60px -30px rgba(122, 42, 10, .7), inset 0 0 0 2px #2b2b2b; }
.m-phone img { border-radius: 18px; }
.proj-a { margin: 0; max-width: 54ch; color: var(--ink-2); font-size: 16px; }

/* mock: dashboard */
.m-dash { width: 80%; height: 70%; display: flex; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 50px -30px rgba(19, 19, 18, .55); }
.md-side { width: 22%; background: var(--ink); padding: 14px 12px; display: flex; flex-direction: column; gap: 9px; }
.md-side b { width: 60%; height: 10px; border-radius: 3px; background: var(--accent); margin-bottom: 8px; }
.md-side i { height: 7px; border-radius: 3px; background: rgba(255, 255, 255, .18); }
.md-side i:nth-child(3) { width: 80%; } .md-side i:nth-child(5) { width: 65%; }
.md-main { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.md-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.md-top em { font-style: normal; font-family: var(--mono); font-size: 10px; color: #157a40; white-space: nowrap; }
.md-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.md-cards div { border: 1px solid #ece9e0; border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.md-cards small { font-family: var(--pixel); font-size: 8px; text-transform: uppercase; color: var(--ink-2); }
.md-cards b { height: 12px; width: 55%; border-radius: 3px; background: var(--ink); }
.md-chart { flex: 1; display: flex; align-items: flex-end; gap: 6%; padding: 8px 4px 0; border-top: 1px dashed #e4e0d5; }
.md-chart i { flex: 1; height: var(--h); background: var(--sky); border-top: 3px solid #4a76d8; transform-origin: bottom; transform: scaleY(.3); transition: transform .8s var(--ease); }
.md-chart i:nth-child(odd) { transition-delay: .05s; }
.proj.in .md-chart i { transform: scaleY(1); }
.proj-link:hover .md-chart i:last-child { background: var(--accent-soft); border-top-color: var(--accent); }

/* mock: taste vault */
.m-vault { width: 74%; background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 30px 50px -30px rgba(122, 42, 10, .55); }
.mv-search { font-family: var(--mono); font-size: 11px; color: var(--ink-2); padding: 8px 10px; border-radius: 8px; background: var(--paper); margin-bottom: 10px; white-space: nowrap; overflow: hidden; }
.mv-grid { columns: 3; column-gap: 6px; }
.mv-grid i { display: block; height: var(--h); margin-bottom: 6px; border-radius: 6px; background: var(--c); break-inside: avoid; transition: transform .6s var(--ease); border: 1px solid rgba(0, 0, 0, .06); }
.proj-link:hover .mv-grid i:nth-child(2) { transform: translateY(-6px) rotate(-3deg); }
.proj-link:hover .mv-grid i:nth-child(5) { transform: translateY(4px) rotate(3deg); }
.mv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-family: var(--pixel); font-size: 9px; text-transform: uppercase; }
.mv-sw { display: flex; gap: 4px; }
.mv-sw i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }

/* mock: flashcard */
.m-esp { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.flash { position: relative; width: 210px; height: 130px; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.proj-link:hover .flash, .proj-link:focus-visible .flash { transform: rotateY(180deg); }
.fl-front, .fl-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--ink);
}
.fl-back { transform: rotateY(180deg); background: var(--accent); }
.flash small { font-family: var(--pixel); font-size: 9px; text-transform: uppercase; color: var(--ink-2); }
.fl-back small { color: var(--ink); }
.flash b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 38px; line-height: 1; }
.week { display: flex; gap: 6px; }
.week span { width: 28px; height: 28px; display: grid; place-items: center; font-family: var(--pixel); font-size: 11px; border: 2px solid var(--ink); background: #fff; }
.week span.on { background: var(--ink); color: var(--paper); }

/* mock: client site */
.ms-bar { display: flex; align-items: center; gap: 5px; padding: 9px 12px; background: #e9e5dc; }
.ms-bar i { width: 8px; height: 8px; border-radius: 50%; background: #cfcac0; }
.ms-bar span { margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: #fff; font-family: var(--mono); font-size: 10px; color: var(--ink-2); }

/* ---------- TOOLKIT ---------- */
.kit { position: relative; height: clamp(600px, 82vh, 720px); overflow: hidden; }
.kit-center { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(460px, 86vw); transform: translate(-50%, -50%); text-align: center; }
.kit-center .eyebrow { justify-content: center; }
.kit-title { margin: 0 0 14px; font-size: clamp(42px, 5vw, 72px); line-height: .92; letter-spacing: -.045em; font-weight: 700; }
.kit-title em { color: var(--accent-strong); }
.kit-sub { margin: 0 auto; max-width: 40ch; color: var(--ink-2); }
.kit-hint { font-family: var(--serif); font-style: italic; font-size: 1.15em; color: var(--ink); }
.pills { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.pill {
  position: absolute; left: 0; top: 0;
  font-weight: 600; font-size: 16px; white-space: nowrap;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  will-change: transform;
}
.pill > span {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border-radius: 999px;
  background: var(--sky); color: #172a5c; border: 2px solid var(--ink);
}
.pill-ico { flex: none; width: 34px; height: 34px; padding: 5px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.pill.t3 .pill-ico { border-color: #fff; }
.pill-txt { display: flex; flex-direction: column; line-height: 1.1; }
.pill-txt b { font-weight: 700; font-size: 16px; }
.pill-txt small { margin-top: 2px; font-family: var(--pixel); font-size: 11px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; opacity: .85; }
.pill--wip > span { border-style: dashed; }
.pill--wip .pill-txt small::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #e0a100; vertical-align: 0; }
.pill::before { /* hatched "3D" offset */
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: 999px;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--ink) 0 1.6px, var(--paper) 1.6px 5px);
  transform: translate(5px, 5px); transition: transform .3s var(--ease);
}
.pill.t2 > span { background: var(--accent-soft); color: #6e2508; }
.pill.t3 > span { background: var(--ink); color: var(--paper); }
.pill.t4 > span { background: #fbfaf6; color: var(--ink); }
.pill:hover::before { transform: translate(7px, 7px); }
.pill.dragging { cursor: grabbing; z-index: 3; }
.pill.dragging::before { transform: translate(10px, 10px); }

/* ---------- OUTRO ---------- */
.outro { padding: clamp(40px, 8vh, 90px) var(--pad) clamp(90px, 14vh, 160px); }
.outro .pixtype { margin: calc(-1 * var(--bleed-t, 0px)) 0 calc(-1 * var(--bleed-b, 0px)); }

/* ---------- CONTACT ---------- */
.contact {
  position: relative; overflow: hidden;
  padding-top: clamp(110px, 18vh, 200px);
  background: var(--night); color: var(--paper);
  perspective: 700px; perspective-origin: 50% 55%;
  border-radius: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px) 0 0;
}
/* perspective grid floor, drawn on a canvas by script.js: smooth lines that fade out with distance
   (a 3D-tilted CSS grid flickered: far lines got thinner than a pixel and snapped on and off as it moved) */
.grid-floor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact-inner { position: relative; }
.contact-title { margin: 0 0 28px; max-width: 13ch; font-size: clamp(52px, 8.4vw, 140px); line-height: .9; letter-spacing: -.05em; font-weight: 800; }
.contact-title em { color: var(--accent); }
.contact-sub { margin: 0 0 40px; max-width: 46ch; font-size: clamp(18px, 1.5vw, 21px); color: rgba(242, 239, 231, .65); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.big-btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 22px 34px; border-radius: 999px;
  background: var(--accent); color: var(--ink);
  font-size: clamp(19px, 2vw, 26px); font-weight: 700; letter-spacing: -.02em;
  transition: transform .5s var(--ease), background .3s;
}
.big-btn:hover { background: #ff7a45; }
/* copy icon swaps to a tick for a moment after the email is copied */
.big-ic { position: relative; display: block; width: .95em; height: .95em; }
.big-ic svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .25s, transform .4s var(--ease); }
.big-ic .ic-done { opacity: 0; transform: scale(.4); }
.big-btn.copied .ic-copy { opacity: 0; transform: scale(.4); }
.big-btn.copied .ic-done { opacity: 1; transform: none; }
.round-btn { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .22); transition: transform .5s var(--ease), background .3s, border-color .3s, color .3s; }
.round-btn:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .5); color: var(--accent); }
.foot {
  position: relative; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(140px, 26vh, 260px); padding: 26px var(--pad) 130px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-family: var(--pixel); font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: rgba(242, 239, 231, .66);
}
.foot a:hover { color: var(--accent); }

/* ---------- BADGE + DOODLES ---------- */
.badge { position: absolute; right: 0; top: -40px; width: clamp(180px, 19vw, 260px); aspect-ratio: 1; }
.badge-svg { width: 100%; height: 100%; overflow: visible; }
.badge-spin { transform-origin: 110px 110px; transform-box: view-box; }
.badge-star { fill: var(--accent); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.badge-shadow { fill: url(#hatch); stroke: var(--paper); stroke-width: 3; stroke-linejoin: round; }
.badge-inner { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 5; }
.badge-text { font-family: var(--pixel); font-size: 12.5px; fill: var(--ink); letter-spacing: .02em; }
.badge-core { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); transition: transform .5s var(--ease); }
.badge:hover .badge-core { transform: translate(-50%, -50%) rotate(-14deg) scale(1.15); }
.js .badge { opacity: 0; transform: scale(.6) rotate(-40deg); transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.js .badge.in { opacity: 1; transform: none; }

.doodle { position: absolute; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.doodle path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.65, 0, .35, 1); }
.circled { position: relative; display: inline-block; }
.doodle-circle { left: -6%; top: -14%; width: 112%; height: 130%; stroke: var(--paper); stroke-width: 3.5; }
.contact-title.in .doodle-circle path { stroke-dashoffset: 0; transition-delay: .9s; }
.squig-wrap { position: relative; }
.doodle-squig { left: 0; bottom: -.08em; width: 100%; height: .22em; stroke: var(--accent-strong); stroke-width: 3; }
.assemble.done .doodle-squig path { stroke-dashoffset: 0; transition-delay: .3s; }
.kit-center { --x: 0; }
.doodle-arrow { right: -150px; bottom: -110px; width: 150px; height: 112px; stroke: var(--ink); stroke-width: 2.6; }
.doodle-arrow.in path { stroke-dashoffset: 0; }
.doodle-arrow.in .d2 { transition-delay: .9s; transition-duration: .4s; }

/* ---------- PROJECT SHEET ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(19, 19, 18, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .5s var(--ease); }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 10px; right: 10px; bottom: 0; top: 4vh;
  overflow: hidden;
  background: var(--paper); border-radius: clamp(18px, 2.4vw, 32px) clamp(18px, 2.4vw, 32px) 0 0;
  transform: translateY(102%); transition: transform .8s var(--ease-io);
}
.sheet.open .sheet-panel { transform: none; }
.sheet-scroll {
  height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  /* native fallback (touch screens, no JS): thin, no track, so it sits inside the rounded corner */
  scrollbar-width: thin; scrollbar-color: rgba(19, 19, 18, .32) transparent;
}
@supports not (scrollbar-color: auto) {
  .sheet-scroll::-webkit-scrollbar { width: 12px; }
  .sheet-scroll::-webkit-scrollbar-track { background: transparent; margin: 28px 0 10px; }
  .sheet-scroll::-webkit-scrollbar-thumb { background: rgba(19, 19, 18, .32); border: 4px solid transparent; border-radius: 12px; background-clip: padding-box; }
}
/* custom scrollbar (mouse / trackpad): native one hidden, rail drawn by script.js */
.sheet.has-rail .sheet-scroll { scrollbar-width: none; }
.sheet.has-rail .sheet-scroll::-webkit-scrollbar { display: none; }
.sheet-rail { display: none; }
.sheet.has-rail .sheet-rail {
  display: block; position: absolute; z-index: 3; right: 4px; top: calc(clamp(18px, 2.4vw, 32px) + 8px); bottom: 12px; width: 16px;
}
.sheet-rail.off { visibility: hidden; }
.sheet-thumb {
  position: absolute; top: 0; right: 4px; width: 6px; min-height: 40px;
  border-radius: 6px; background: var(--ink); opacity: .28;
  transition: opacity .35s, width .25s var(--ease), background .25s;
}
.sheet-rail.awake .sheet-thumb { opacity: .55; }
.sheet-rail:hover .sheet-thumb, .sheet-rail.drag .sheet-thumb { width: 10px; opacity: 1; }
.sheet-rail.drag .sheet-thumb { background: var(--accent); }
.sheet-top {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px clamp(18px, 3vw, 40px);
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase;
}
.sheet-close { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform .5s var(--ease), background .3s; }
.sheet-close:hover { transform: rotate(90deg); background: var(--accent); }
.sheet-close span { position: absolute; left: 16px; right: 16px; top: 25px; height: 2px; background: currentColor; transform: rotate(45deg); }
.sheet-close span + span { transform: rotate(-45deg); }
.sheet-body { width: min(1180px, 100% - var(--pad) * 2); margin: 0 auto; padding: 10px 0 140px; }
.sheet-body > * { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .9s var(--ease); transition-delay: calc(.25s + var(--s, 0) * .07s); }
.sheet.open .sheet-body.in > * { opacity: 1; transform: none; }
.sh-frame .md-chart i { transform: none; }

.sh-title { margin: 6px 0 18px; font-size: clamp(56px, 10vw, 150px); font-weight: 900; line-height: .85; letter-spacing: -.05em; overflow-wrap: anywhere; }
.sh-lede { max-width: 30ch; margin: 0 0 30px; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.2; letter-spacing: -.02em; font-weight: 500; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: clamp(36px, 6vw, 64px); }
.sh-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 700; background: #fbfaf6; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
}
.sh-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.sh-btn--gh { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }
.sh-btn--gh:hover { box-shadow: 6px 6px 0 var(--accent); }
.sh-btn--main { background: var(--accent); }
.sh-btn svg { width: 18px; height: 18px; }
.sh-note { align-self: center; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: var(--ink-2); }

.sh-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-bottom: clamp(40px, 6vw, 72px); }
.sh-gallery figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sh-gallery figure:only-child { grid-column: 1 / -1; }
.sh-frame { display: grid; place-items: center; padding: clamp(16px, 3vw, 40px); border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--c, var(--sage)); background-size: cover; background-position: center; }
.sh-frame.px { image-rendering: pixelated; }
.sh-frame img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 24px 40px -26px rgba(0, 0, 0, .6); }
.sh-frame .mock { width: min(100%, 720px); aspect-ratio: 16 / 9; height: auto; }
.sh-gallery figcaption { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: var(--ink-2); }

.sh-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.sh-meta { margin: 0; display: grid; gap: 18px; }
.sh-meta div { padding-top: 14px; border-top: 1px solid var(--hair); }
.sh-meta dt { margin-bottom: 6px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: var(--accent-text); }
.sh-meta dd { margin: 0; font-weight: 600; }
.sh-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-stack span { padding: 4px 10px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 600; background: #fbfaf6; }
.sh-text p { margin: 0; padding-top: 16px; border-top: 1px solid var(--hair); max-width: 60ch; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }

/* ---------- DOCK: two corners ----------
   Bottom-left: the "?" (back to top). Bottom-right: a tag that says which section you're in and opens the menu.
   It tucks away while you're at the very top, where the hero's own bottom row sits in those corners. */
.dock {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: flex-end; justify-content: space-between;
  pointer-events: none; /* only the two pieces take the mouse; the space between them stays clickable */
  transform: translateY(160%);
  transition: transform .8s var(--ease);
  color: var(--paper);
}
.ready .dock:not(.tucked), .dock.open { transform: none; }
.dock-av, .dock-tag { pointer-events: auto; }
.dock-av {
  flex: none; width: 48px; height: 48px; padding: 11px; border-radius: 12px;
  background: #000; box-shadow: 3px 3px 0 var(--accent); transition: transform .4s var(--ease);
}
.dock-av:hover { transform: rotate(-8deg) scale(1.05); }
.dock-av span { display: block; width: 100%; height: 100%; }
.dock-tag {
  position: relative; display: flex; align-items: center; height: 44px; padding-left: 16px;
  background: var(--ink); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
}
.dock-tag::after { /* scroll progress along the bottom of the tag */
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  background: var(--accent); transform-origin: left; transform: scaleX(var(--prog, 0));
}
.dock-where { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; white-space: nowrap; }
.dock-where b { font-weight: 400; color: var(--accent); }
.dock-btn {
  flex: none; position: relative; width: 44px; height: 44px; margin-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, .1); border-radius: 0 12px 12px 0; transition: background .3s;
}
.dock-btn:hover { background: rgba(255, 255, 255, .07); }
.dock-btn > span:not(.sr-only) { position: absolute; left: 13px; right: 13px; height: 2px; background: currentColor; transition: transform .5s var(--ease); }
.dock-btn > span:nth-child(1) { top: 18px; }
.dock-btn > span:nth-child(2) { top: 24px; }
.dock.open .dock-btn > span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.dock.open .dock-btn > span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }
.dock-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); width: min(300px, calc(100vw - 32px));
  display: grid; gap: 2px; padding: 10px;
  background: var(--ink); border-radius: 16px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
  clip-path: inset(100% 0 0 0 round 16px);
  visibility: hidden;
  transition: clip-path .6s var(--ease), visibility 0s .6s;
}
.dock.open .dock-menu { clip-path: inset(0 0 0 0 round 16px); visibility: visible; transition: clip-path .6s var(--ease), visibility 0s; }
.dock-menu a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  opacity: 0; transform: translateY(18px);
  transition: transform .55s var(--ease), opacity .4s, background .2s, color .2s;
}
.dock.open .dock-menu a { opacity: 1; transform: none; transition-delay: calc(.08s + var(--i) * .045s), calc(.08s + var(--i) * .045s), 0s, 0s; }
.dock-menu a span { font-family: var(--pixel); font-size: 11px; font-weight: 400; color: var(--accent); letter-spacing: 0; }
.dock-menu a:hover { background: rgba(255, 255, 255, .06); color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 60;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--ink);
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform .4s var(--ease), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .fc-c { display: none; }
}
@media (max-width: 900px) {
  .hero-cards { display: none; }
  .hero-mid { max-width: none; }
  .topbar { grid-template-columns: 1fr 1fr auto; }
  .topbar .tb-item:nth-child(3) { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .sh-grid, .sh-gallery { grid-template-columns: 1fr; }
  .sheet-panel { left: 0; right: 0; top: 6vh; }
  .term { position: relative; top: 0; }
  .think { height: auto; padding: 0 10px; }
  .think-sticky { position: relative; height: auto; padding: 0; }
  .think-card { padding: 80px 0 70px; }
  .think-grid { grid-template-columns: 1fr; }
  .think-icon, .think-progress { display: none; }
  .step { opacity: 1; }
  .step-n { color: var(--accent-text); }
  .step p { max-height: none; opacity: 1; margin-top: 10px; }
  .proj--wide, .proj--narrow { grid-column: 1 / -1; }
  .proj--narrow .proj-visual { aspect-ratio: 16 / 11; }
  .kit { height: auto; padding: 110px var(--pad); }
  .kit-center { position: static; transform: none; margin: 0 auto 40px; }
  .pills { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .pill { position: relative; transform: none !important; opacity: 1 !important; }
  .doodle-arrow { display: none; }
  .badge { position: relative; top: 0; margin: 0 0 30px auto; width: 150px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { grid-template-columns: 1fr auto; font-size: 14px; }
  .topbar .tb-item:nth-child(2) { display: none; }
  .hi-label { height: 42px; padding: 0 18px; }
  .hero { padding-bottom: 104px; }
  .hero-kicker { border-radius: 14px; font-size: 11px; } /* it wraps on phones: a squarer tag reads better than a stretched pill */
  .hero-row { font-size: 11px; }
  .hero-row:not(.hero-row--top) span:last-child { display: none; }
  .m-dash { width: 90%; height: 80%; }
  .md-top em { display: none; }
  .dock { left: 12px; right: 12px; bottom: 12px; }
  .dock-av { width: 44px; height: 44px; padding: 10px; }
  .big-btn { padding: 18px 24px; }
  .foot { flex-direction: column; }
}

/* =========================================================
   v3 additions: AI agents section, phone-app card, footer,
   contact underline, small-screen project sheet
   ========================================================= */

/* ---------- AI AGENTS ---------- */
.ai { padding: clamp(110px, 16vh, 180px) 0 clamp(30px, 5vh, 60px); }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.ai-lede { margin: 28px 0 0; max-width: 46ch; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.5; }
.ai-note { margin: 16px 0 0; max-width: 46ch; color: var(--ink-2); }
/* agent board: a pretend agent-monitor, with the same font, colours and card states as the real one */
.board {
  margin: 0;
  --am-orange: #d97757; --am-amber: #e2a03a; --am-blue: #5d8fc4; --am-green: #6f8a4e;
  --am-ink: #141413; --am-ink-2: #3d3d3a; --am-muted: #76746c; --am-line: #cfccc1;
}
.board-screen {
  position: relative; margin: 3px; padding: 12px 14px 14px; container-type: inline-size;
  font-family: "Jersey", var(--pixel); letter-spacing: .3px; color: var(--am-ink);
  background: radial-gradient(rgba(20, 20, 19, .07) 1px, transparent 1.3px) 0 0 / 8px 8px, #f0eee6;
  /* notched pixel border + hard shadow, built from box-shadows like agent-monitor's */
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 9px 9px 0 0 var(--ink);
}
/* needs you: a soft amber glow breathing in from the edge */
.board-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 26px 2px var(--am-amber); opacity: 0; transition: opacity 1s var(--ease); }
.board.needs .board-screen::after { opacity: 1; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.board-top { display: flex; align-items: center; gap: 14px; height: 26px; margin: 0 2px 10px; }
.bt-brand { flex: none; display: flex; align-items: center; gap: 7px; font-size: 23px; }
.bt-logo { display: grid; width: 15px; height: 15px; color: var(--am-orange); }
.bt-logo svg { width: 100%; height: 100%; }
.bt-counts { flex: 1; min-width: 0; display: flex; gap: 13px; overflow: hidden; white-space: nowrap; font-size: 19px; color: var(--am-muted); }
.bc { display: inline-flex; align-items: center; gap: 5px; transition: color .5s; }
.bc i { width: 8px; height: 8px; background: var(--c); }
.bc.hot { color: var(--am-ink); }
.bc.hot i { animation: blink .7s steps(1) infinite; }
.bt-clock { flex: none; font-size: 21px; }
.board-list { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 152px; gap: 10px; }
.agent {
  --sc: var(--am-orange); --on: #fff;
  position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 7px;
  padding: 9px 12px 8px; background: #fff;
  transition: background-color .8s var(--ease);
}
.agent.s-permission { --sc: var(--am-amber); --on: var(--am-ink); }
.agent.s-question { --sc: var(--am-blue); }
.agent.s-done { --sc: var(--am-green); background: #eaeee3; }
.ag-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 27px; font-weight: 400; line-height: 1; }
.ag-pill {
  flex: none; display: inline-flex; align-items: center; gap: 5px; margin: 0 2px; padding: 1px 6px 2px 4px;
  font-size: 15px; white-space: nowrap; color: var(--on); background: var(--sc);
  box-shadow: 0 -2px 0 0 var(--sc), 0 2px 0 0 var(--sc), -2px 0 0 0 var(--sc), 2px 0 0 0 var(--sc);
  transition: background-color .5s, box-shadow .5s, color .5s;
}
.ag-ic { display: grid; place-items: center; width: 10px; height: 10px; }
.ag-ic svg { width: auto; height: 10px; }
.ag-time { margin-left: auto; flex: none; font-size: 25px; line-height: 1; transition: color .5s; }
.s-permission .ag-time, .s-question .ag-time { color: var(--sc); }
.ag-stage { position: relative; flex: 1; min-height: 0; }
.ag-body { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-h { margin: 1px 0 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--sc); }
.agent.s-permission .ag-h { color: #b47a1d; }
.ag-cmd { padding: 5px 9px 6px 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 18px; background: #fbf1e0; box-shadow: inset 4px 0 0 var(--sc); }
.ag-q { margin: 0; font-size: 19px; line-height: 1.1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ag-opts { display: flex; gap: 9px; padding: 3px 2px 0; overflow: hidden; }
.ag-opts span { padding: 0 7px 1px; font-size: 16px; white-space: nowrap; box-shadow: 0 -2px 0 0 var(--sc), 0 2px 0 0 var(--sc), -2px 0 0 0 var(--sc), 2px 0 0 0 var(--sc); }
.ag-pips { display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.ag-pips i { width: 10px; height: 5px; background: var(--am-line); }
.ag-pips i.c { background: var(--am-green); }
.ag-pips i.p { background: var(--sc); animation: blink 1s steps(1) infinite; }
.ag-pips b { margin-left: 4px; font-size: 15px; font-weight: 400; color: var(--am-muted); }
.ag-goal { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 19px; line-height: 1.15; }
.g-ic { flex: none; display: grid; place-items: center; width: 11px; height: 11px; background: var(--sc); }
.g-ic i { width: 5px; height: 5px; background: #fff; animation: blink 1s steps(1) infinite; }
.g-t, .ag-doing > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ag-doing { display: flex; align-items: flex-end; gap: 6px; min-width: 0; font-size: 17px; line-height: 1.1; color: var(--am-ink-2); }
.am-dots { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; padding-bottom: .25em; }
.am-dots i { width: 3px; height: 3px; background: currentColor; animation: hopdot 1s steps(1) infinite; }
.am-dots i:nth-child(2) { animation-delay: .15s; }
.am-dots i:nth-child(3) { animation-delay: .3s; }
.ag-ic .am-dots { gap: 1px; padding: 0; }
.ag-ic .am-dots i { width: 2px; height: 2px; }
@keyframes hopdot { 0%, 60%, 100% { transform: translateY(0); } 20% { transform: translateY(-3px); } }
.ag-fin { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.fin-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: var(--am-green); }
.fin-ic svg { width: 55%; height: auto; }
.ag-fin b { display: block; font-size: 21px; font-weight: 400; line-height: 1.05; }
.ag-fin small { font-size: 15px; color: var(--am-muted); }
@container (max-width: 470px) {
  .bt-clock { display: none; }
  .ag-name { font-size: 23px; }
  .ag-time { font-size: 21px; }
  .ag-pill { gap: 0; padding: 3px 5px; }
  .ag-lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* narrow: the pill keeps its colour and icon */
}
@container (max-width: 400px) {
  .board-list { grid-template-columns: 1fr; grid-auto-rows: 124px; }
  .bt-counts { font-size: 17px; gap: 10px; }
}
.board figcaption { margin-top: 20px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: var(--ink-2); }
.ai-rules { list-style: none; margin: clamp(56px, 8vw, 100px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 32px); }
.ai-rules li { padding-top: 18px; border-top: 2px solid var(--ink); }
.ai-n { font-family: var(--pixel); font-size: 12px; color: var(--accent-text); }
.ai-rules h3 { margin: 10px 0 8px; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.05; letter-spacing: -.03em; }
.ai-rules p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ---------- PHONE APP (in the works) ---------- */
.proj--full { grid-column: 1 / -1; }
.proj--full .proj-link { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 3vw, 44px); align-items: center; }
/* fixed height, not an aspect ratio: with a min-height, an aspect ratio forces the picture wider than its column and under the text */
.proj--full .proj-visual { min-width: 0; aspect-ratio: auto; height: clamp(330px, 30vw, 460px); max-height: max(330px, 100svh - 160px); } /* body sits beside it */
.proj--full .proj-body { padding: 18px clamp(16px, 2.4vw, 32px) 18px 0; }
.v-butter { background: #f5d36b url("assets/img/bg-phone-dither.png") center / cover; image-rendering: pixelated; } /* ordered dither */
.m-wip { display: grid; place-items: center; }
.wip-phone {
  position: relative; width: 150px; height: 290px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 36px 16px 16px;
  background: #fbfaf6; border: 8px solid var(--ink); border-radius: 28px;
  transform: rotate(-6deg); box-shadow: 10px 10px 0 rgba(19, 19, 18, .25);
}
.wip-notch { position: absolute; top: 8px; left: 50%; width: 44px; height: 8px; margin-left: -22px; border-radius: 6px; background: var(--ink); }
.wip-ico { width: 46px; height: 46px; margin-bottom: 4px; }
.wip-sk { width: 100%; height: 10px; border-radius: 4px; background: linear-gradient(90deg, #e8e4d8 25%, #f8f5ee 50%, #e8e4d8 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.wip-sk.s2 { width: 80%; } .wip-sk.s3 { width: 58%; }
.wip-bar { width: 100%; height: 12px; margin-top: auto; padding: 1px; border: 2px solid var(--ink); }
.wip-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 8px); animation: wipbar 4s steps(10) infinite; }
.wip-phone small { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes wipbar { 0% { width: 8%; } 100% { width: 92%; } }
.wip-tape {
  position: absolute; left: -8%; right: -8%; top: 64%; z-index: 1;
  overflow: hidden; transform: rotate(-7deg);
  background: var(--ink); color: #f5d36b;
  border-block: 7px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #f5d36b 0 8px, var(--ink) 8px 16px) 7;
}
.wip-tape span { display: inline-block; padding: 7px 0; white-space: nowrap; font-family: var(--pixel); font-size: 13px; letter-spacing: .08em; animation: strip 16s linear infinite; }
.wip-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 4px 10px; border: 1.5px dashed var(--ink); border-radius: 999px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; }
.wip-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e0a100; }
.sh-frame .m-wip { aspect-ratio: auto; padding: 20px 0; }

/* ---------- CONTACT underline (replaces the circle) ---------- */
.contact { padding-bottom: clamp(170px, 28vh, 300px); }
.underlined { position: relative; display: inline-block; }
.doodle-under { left: -2%; bottom: -.04em; width: 104%; height: .22em; stroke: var(--accent); stroke-width: 4; }
.contact-title.in .doodle-under path { stroke-dashoffset: 0; transition-delay: 1s; }

/* ---------- FOOTER ---------- */
.site-foot {
  position: relative; z-index: 1; overflow: hidden;
  margin-top: calc(-1 * clamp(20px, 3vw, 40px));
  padding: clamp(64px, 10vh, 110px) 0 0;
  background: var(--accent); color: var(--ink);
  border-radius: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px) 0 0;
}
.sf-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(28px, 4vw, 64px); }
.sf-big { margin: 0 0 26px; max-width: 12ch; font-size: clamp(30px, 3.4vw, 52px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.sf-top {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 10px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); font-weight: 700; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .45s var(--ease), box-shadow .3s var(--ease);
}
.sf-top:hover { box-shadow: 6px 6px 0 var(--ink); }
.sf-top > span { display: block; width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: var(--ink); }
.sf-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sf-col h3 { margin: 0 0 8px; font-family: var(--pixel); font-size: 12px; font-weight: 400; text-transform: uppercase; }
.sf-col a { font-size: 17px; font-weight: 600; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.sf-col a:hover { background-size: 100% 2px; }
.sf-col small { margin-left: 6px; padding: 2px 6px; vertical-align: 2px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase; color: #f5d36b; background: var(--ink); }
.sf-word { margin-top: clamp(48px, 8vw, 100px); padding: 0 var(--pad); overflow: hidden; line-height: .82; }
.sf-word-in { display: block; width: max-content; font-size: 15vw; font-weight: 900; letter-spacing: -.055em; white-space: nowrap; transform: translate3d(0, var(--wy, 0%), 0); will-change: transform; }
.sf-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; padding: 20px 0 118px; border-top: 2px solid var(--ink); font-family: var(--pixel); font-size: 11px; text-transform: uppercase; }

/* ---------- SHEET: drag handle (phones) ---------- */
.sheet-handle { display: none; }
.sheet-panel.dragging { transition: none; }

@media (max-width: 1100px) {
  .ai-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
}
@media (max-width: 900px) {
  .ai-grid { grid-template-columns: 1fr; }
  .proj--full .proj-link { grid-template-columns: 1fr; }
  .proj--full .proj-visual { aspect-ratio: 16 / 10; height: auto; max-height: max(330px, 100svh - 300px); } /* body sits below it */
  .proj--full .proj-body { padding: 18px 8px 8px; }
  .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sf-intro { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ai-rules { grid-template-columns: 1fr; }
  .board-screen { padding: 10px; box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 6px 6px 0 0 var(--ink); }
  .wip-phone { width: 120px; height: 230px; padding-top: 30px; border-width: 6px; }
  .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .sf-bottom { flex-direction: column; }

  .sheet-panel { top: 10px; border-radius: 20px 20px 0 0; }
  .sheet-handle { display: block; position: absolute; left: 50%; top: 6px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(19, 19, 18, .28); }
  .sheet-top { padding: 16px 16px 10px; }
  .sheet-close { width: 44px; height: 44px; }
  .sheet-close span { left: 13px; right: 13px; top: 21px; }
  .sheet-body { padding-bottom: 72px; }
  .sh-lede { font-size: 20px; margin-bottom: 24px; }
  .sh-actions { flex-direction: column; align-items: stretch; margin-bottom: 32px; }
  .sh-btn { justify-content: center; }
  .sh-note { text-align: center; }
  .sh-gallery { gap: 18px; margin-bottom: 36px; }
  .sh-frame { padding: 12px; border-radius: 12px; }
  .sh-text p { font-size: 16px; padding-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}

