/* ==========================================================================
   John Kenneth Moscosa — portfolio
   Ported from design/Me2.dc.html. Mobile is width < 760px.
   ========================================================================== */

@property --hole { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --bg: #0B0C0F;
  --surface: #121419;
  --line: #23262E;
  --line-soft: #1C1F25;
  --text: #E6E8EC;
  --text-soft: #B4B9C4;
  --muted: #8B919E;
  --sql-keyword: #7C8BA8;
  --accent: #3DDC97;   /* alternates kept in the design: #5B8CFF, #F5A524, #E6E8EC */
  --floor-lit: rgba(61, 220, 151, 0.10);

  /* extra greys used by the design */
  --bubble: #1E2128;
  --line-strong: #2E323C;
  --dim: #5E6675;
  --paper: #171A20;
  --well: #0F1014;
  --ink: #07080A;
  --list-text: #D3D6DD;

  --f-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --f-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'DM Mono', ui-monospace, monospace;
  --f-hand: 'Caveat', cursive;

  --top-h: 64px;
  --tab-h: 0px;
}

/* ---------- base ---------- */

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

html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--top-h);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: transparent;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- queries on the floor ---------- */

.site-bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none; contain: strict;
}
.site-bg-grid, .site-bg-glow, .site-bg-text { position: absolute; inset: 0; }
.site-bg-glow { opacity: 0; }
.site-bg-grid .site-bg-cell { stroke: var(--line); }
.site-bg-lit {
  fill: var(--floor-lit); stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1;
  animation: kenn-twinkle 1.4s ease-in-out infinite alternate;
}
.site-bg-lit:nth-child(even) { animation-delay: -0.7s; }
.site-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 52% 46% at 50% 50%, var(--bg) 0%, var(--bg) 42%, transparent 100%);
  opacity: calc(1 - var(--hole, 0)); will-change: opacity;
}
.site-bg-text { overflow: hidden; opacity: 0.5; }
.site-bg-plane {
  position: absolute; inset: 0;
  font: 15px var(--f-mono); color: var(--muted);
}
.site-bg.is-paused .site-bg-lit { animation-play-state: paused; }
.reduced .site-bg .site-bg-lit { animation: none; }

img, svg { max-width: none; }
button { -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
section:focus, section:focus-visible { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font: 700 14px var(--f-body); text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.accent { color: var(--accent); }
.kw { color: var(--sql-keyword); }

/* Breakpoint-only elements. !important so component display rules can't override it. */
@media (min-width: 760px) { .mobile-only { display: none !important; } }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 12, 15, 0.92);
}

.brand {
  flex: none; display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--text); cursor: pointer; font: inherit;
}
.brand-mark {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bubble); color: var(--text);
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
}
.brand-photo { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.brand-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.brand-name { font-family: var(--f-head); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

.sql-nav {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px;
  font-family: var(--f-mono); font-size: 13px; color: var(--muted);
}
.sql-nav a {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 10px; border-radius: 8px;
  background: transparent; color: var(--accent);
  font: 13px var(--f-mono); text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}
.sql-nav .comma { margin-left: -6px; }
.sql-nav a:hover { background: rgba(61, 220, 151, 0.1); }
.sql-nav a.is-active { background: var(--accent); color: var(--bg); }

.pill {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--text); text-decoration: none;
}
.pill:hover { border-color: #3A3F4A; }
.pill-resume { min-height: 40px; padding: 0 16px; font: 600 13px var(--f-body); }

.skip-intro {
  position: fixed; right: 24px; top: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(11, 12, 15, 0.8); color: var(--text-soft);
  font: 12px var(--f-mono); cursor: pointer;
}

/* ---------- intro track + sticky stage ---------- */

.intro-track { position: relative; height: 100vh; height: 100svh; }
.js:not(.reduced) .intro-track { height: 230vh; height: 230svh; }

.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding-top: var(--top-h);
  padding-bottom: var(--tab-h);
}

.hero {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: row; align-items: center; gap: 48px;
  padding: 16px 64px 0;
}
.hero-copy { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }

.name-box { display: inline-block; position: relative; z-index: 5; max-width: 100%; }
.name-fx { transform-origin: 50% 50%; will-change: transform; }
.name-load { transform-origin: 50% 50%; }

/* ---------- once-per-load query and floor flight ---------- */

.load-query, .load-flash, .load-vignette, .load-ripple, .load-result, .load-ghost {
  position: absolute; pointer-events: none; opacity: 0;
}
.load-query {
  left: 50%; top: 50%; width: max-content; translate: -50% -50%;
  z-index: 10; display: flex; align-items: center; justify-content: center;
  font: 24px var(--f-mono); color: var(--text); transform-origin: 50% 50%;
}
.load-prompt { margin-right: 14px; }
.load-query-run { display: inline-block; width: 0; overflow: hidden; white-space: nowrap; }
.load-cursor { flex: none; width: 0.55em; height: 1.1em; margin-left: 2px; background: var(--accent); }
.load-playing .load-cursor { animation: load-blink 0.7s steps(1) infinite; }
@keyframes load-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.load-flash { inset: 0; z-index: 7; background: radial-gradient(ellipse 55% 50% at 50% 50%, rgba(61,220,151,0.14), rgba(61,220,151,0) 70%); }
.load-vignette { inset: 0; z-index: 0; background: radial-gradient(ellipse 72% 68% at 50% 50%, rgba(7,8,10,0) 45%, rgba(7,8,10,0.55) 82%, rgba(7,8,10,0.9) 100%); }
.load-ripple {
  left: 50%; top: 50%; z-index: 2; width: 300px; height: 116px; margin: -58px 0 0 -150px;
  border-radius: 50%; border: 1px solid rgba(61,220,151,0.55);
  box-shadow: 0 0 26px 4px rgba(61,220,151,0.22), inset 0 0 26px 4px rgba(61,220,151,0.14);
}
.load-result { left: 0; right: 0; top: 66%; z-index: 6; text-align: center; font: 13px var(--f-mono); color: var(--accent); }
.load-ghost { z-index: 4; transform-origin: 50% 50%; filter: blur(1.5px); }
.load-ghost-name { transform-origin: 50% 50%; }
.load-playing .site-bg { opacity: 0; transform: scale(7); transform-origin: 50% 50%; }
.load-playing .name-load { opacity: 0; }
.load-playing .name-load, .load-playing .load-ghost, .load-playing .load-ripple { will-change: transform, opacity; }
.load-playing .cue, .load-playing .cue-url, .load-playing .eyebrow, .load-playing .eyebrow-line, .load-playing .sub { transition: none; }

.eyebrow {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  transition: opacity 700ms ease;
}
.eyebrow-text { min-width: 0; line-height: 1.5; }
.eyebrow-line {
  flex: 1 1 auto; min-width: 40px; height: 1px;
  background: var(--accent); opacity: 0.55;
  transform-origin: left center;
  transition: transform 1400ms cubic-bezier(0.2, 0.7, 0.2, 1) 250ms;
}

.name {
  position: relative; margin: 0;
  font-family: var(--f-mono); font-weight: 300;
  font-size: clamp(30px, 2.9vw, 44px);
  font-size: round(clamp(30px, 2.9vw, 44px), 1px);
  line-height: 1.16; letter-spacing: -0.035em; white-space: nowrap;
  color: var(--text);
}
.name-line { display: inline; }
.name-line-2 { margin-left: 0.565em; }

.sub {
  margin: 12px 0 0; font-size: 17px; color: var(--muted);
  transition: opacity 800ms ease 150ms, transform 800ms ease 150ms;
}

.lede { margin: 30px 0 0; max-width: 46ch; font-size: 18px; line-height: 1.6; color: var(--text-soft); }

.actions { margin-top: 32px; display: flex; align-items: center; align-self: stretch; gap: 10px 20px; }
.btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; border-radius: 999px; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn-primary { padding: 0 22px; border: 0; background: var(--accent); color: var(--bg); font: 700 15px var(--f-body); }
.btn-ghost { padding: 0 20px; border: 1px solid var(--line-strong); color: var(--text); font-size: 15px; font-weight: 500; }
.btn-ghost:hover { border-color: #3A3F4A; }

/* ---------- room ---------- */

/* Elements the intro fades/moves every scroll frame get their own layers, so
   scrolling the intro composites instead of repainting. */
.hero-illus, .lede, .actions, .strip, .topbar, .tabbar, .cue, .cue-url, .skip-intro { will-change: opacity, transform; }

.hero-illus {
  flex: 0 1 48%; min-width: 0; min-height: 0; max-width: 640px; width: 100%;
  align-self: center; display: flex; align-items: center; justify-content: center;
}
.room-box { position: relative; aspect-ratio: 520 / 500; max-width: 100%; max-height: 100%; width: 100%; }

/* lifted from assets/room-demo.html */
.room svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* Performance: everything that moves or fades in lives in .room-fx, a second SVG
   stacked on top of the static drawing with its own compositor layer. The static
   drawing (with its blur shadows) then isn't re-rasterised on every animation frame.
   The split was checked pixel-for-pixel against the single SVG. */
.room .room-fx { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
/* accent colour hooks */
.room [data-accent="fill"] { fill: var(--accent); }
.room [data-accent="stroke"] { stroke: var(--accent); }
/* ambient loops */
.room .fan-blades { animation: kenn-spin 0.9s linear infinite; }
.room .breeze { animation: kenn-breeze 1.4s linear infinite; }
.room .twinkle-a { animation: kenn-twinkle 1.4s ease-in-out infinite alternate; }
.room .twinkle-b { animation: kenn-twinkle 1.4s ease-in-out -0.7s infinite alternate; }
.room .murmur-arc-a { animation: kenn-pulse 0.7s steps(1) infinite; }
.room .murmur-arc-b { animation: kenn-pulse 0.7s steps(1) -0.35s infinite; }
.room .murmur { opacity: 0; }
@keyframes kenn-spin { to { transform: rotate(360deg); } }
@keyframes kenn-breeze { to { stroke-dashoffset: -32; } }
@keyframes kenn-twinkle { from { opacity: 1; } to { opacity: 0.35; } }
@keyframes kenn-pulse { 0% { opacity: 0.85; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .site-bg .site-bg-lit { animation: none; }
  .room * { animation: none !important; }
  .room .murmur { opacity: 0.8; }
  .room .kenn-hop.is-hopping { animation: none; }
}
/* pause the loops when the tab is hidden or the room is off screen */
.room.is-paused * { animation-play-state: paused !important; }

/* ---------- mini Kenn: leans toward the cursor and talks to visitors ---------- */

/* He pivots from his seat. Coordinates are in the SVG's units (viewBox 0 0 520 500). */
.room .kenn { transform-box: view-box; transform-origin: 136.4px 301.3px; }
.room .kenn-hop { transform-box: view-box; transform-origin: 136.4px 301.3px; }
.room .kenn-hop.is-hopping { animation: kenn-hop 420ms cubic-bezier(0.3, 0.7, 0.3, 1); }
@keyframes kenn-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-5px); } }
.room.is-talking .murmur { visibility: hidden; }
/* Two matched renders of him: working, and waving at the visitor. The wave fades in on
   top; the working one hides only once the wave is fully shown (and shows again at
   once when the wave goes), so his body never turns see-through mid-swap. */
.room .kenn-pose-wave { opacity: 0; transition: opacity 160ms ease; }
.room.is-waving .kenn-pose-wave { opacity: 1; }
.room .kenn-pose-work { transition: visibility 0s; }
.room.is-waving .kenn-pose-work { visibility: hidden; transition: visibility 0s linear 160ms; }
/* Idle breathing, from the seat. */
.room .kenn-breathe {
  transform-box: view-box; transform-origin: 136.4px 301.3px;
  animation: kenn-breathe 3.8s ease-in-out infinite;
}
@keyframes kenn-breathe { 0%, 100% { transform: none; } 50% { transform: translateY(-0.5px) scaleY(1.014); } }

/* Speech bubble: its tail sits just above his head (x 150, y 203 in SVG units). */
.kenn-talk {
  position: absolute; left: 28.8%; bottom: 59.4%; z-index: 3;
  width: max-content; max-width: 240px;
  pointer-events: none;
  opacity: 0; transform: translateY(6px) scale(0.96); transform-origin: 0 100%;
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.kenn-talk.is-on { opacity: 1; transform: none; }
.kenn-bubble {
  margin: 0; width: max-content; max-width: 100%;
  padding: 8px 12px; border-radius: 12px 12px 12px 3px;
  background: var(--bubble); border: 1px solid var(--line-strong);
  color: var(--text); font: 12px/1.45 var(--f-mono);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.kenn-rest { color: transparent; }

/* Invisible tap/click target over him (keyboard: Tab to it, Enter to talk). */
.kenn-hit {
  position: absolute; left: 15.3%; top: 40.8%; width: 16.5%; height: 21.2%;
  min-width: 44px; min-height: 44px; z-index: 2;
  padding: 0; border: 0; border-radius: 40% 40% 14px 14px;
  background: transparent; cursor: pointer;
}
.kenn-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* hand-written annotations (desktop only) */
.room-notes {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--f-hand); font-weight: 700; color: var(--muted);
}
.note { position: absolute; font-size: 21px; }
.note { will-change: opacity, transform; }
.note svg { display: block; color: var(--accent); overflow: visible; }
.note path { stroke-dasharray: 1; }
.note-sub { font-size: 17px; color: var(--dim); }
.note-tl { left: -1%; top: -4%; transform: rotate(-5deg); line-height: 1.05; }
.note-tl svg { margin: 0 0 0 120px; }
.note-tr { right: -3%; top: 1%; transform: rotate(4deg); text-align: right; line-height: 1.05; }
.note-tr svg { margin: 0 70px 0 auto; }
.note-bl { left: -3%; top: 80%; transform: rotate(-4deg); line-height: 1; }
.note-bl svg { margin: 0 0 2px 60px; }
.note-br { right: -4%; top: 86%; transform: rotate(4deg); text-align: right; line-height: 1; }
.note-br svg { margin: 0 60px 2px auto; }

/* ---------- "Into" strip + cues ---------- */

.strip {
  flex: 0 0 auto; margin: 0 64px 28px; padding: 0;
  display: flex; flex-wrap: wrap; overflow-x: auto; align-items: center; gap: 8px 10px;
}
.strip-label {
  flex: none; margin-right: 6px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-soft);
  font: 500 14px var(--f-body); cursor: pointer;
}
.chip svg { color: var(--accent); }
.chip:hover { border-color: var(--line-strong); color: var(--text); }

.cue {
  position: absolute; left: 32px; bottom: 24px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-hand); font-weight: 700; font-size: 21px; color: var(--muted);
  pointer-events: none;
  transition: opacity 700ms ease 500ms;
}
.cue-arrow { display: inline-block; color: var(--accent); transition: transform 650ms ease-in-out; }
.cue-url {
  position: absolute; right: 32px; bottom: 28px;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: 12px; color: var(--muted);
  transition: opacity 700ms ease 500ms;
}
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18); }

/* Intro start state before script.js runs (prevents a flash of the settled hero). */
.js:not(.reduced) .name-fx { opacity: 0; }
.js:not(.reduced) .eyebrow,
.js:not(.reduced) .sub,
.js:not(.reduced) .cue,
.js:not(.reduced) .cue-url { opacity: 0; }
.js:not(.reduced) .eyebrow-line { transform: scaleX(0); }
.js:not(.reduced) .lede,
.js:not(.reduced) .actions,
.js:not(.reduced) .strip,
.js:not(.reduced) .hero-illus,
.js:not(.reduced) .topbar,
.js:not(.reduced) .tabbar { opacity: 0; visibility: hidden; }
.js:not(.reduced) .room [data-reveal] { opacity: 0; }
.js:not(.reduced) .note { opacity: 0; }
.js:not(.reduced) .note path { stroke-dashoffset: 1; opacity: 0; }
.reduced .skip-intro, .reduced .cue, .reduced .cue-url { display: none; }

/* ---------- sections ---------- */

section {
  padding: 120px 64px;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: var(--top-h);
}
#me { border-top: 0; }

.query { margin: 0 0 12px; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

.h2 {
  margin: 0; font-family: var(--f-head); font-size: 64px; font-weight: 600;
  line-height: 1.02; letter-spacing: -0.035em;
}
.h2-me { max-width: 18ch; }
.h2-gap { margin-bottom: 40px; }
.intro-p { margin: 12px 0 0; max-width: 52ch; font-size: 19px; color: var(--muted); }

.label {
  margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.label-tight { letter-spacing: 0.12em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.card-pad { padding: 26px; }

/* me */
.hobbies { margin-top: 48px; display: grid; gap: 20px; align-items: stretch; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hobby { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.hobby p { margin: 0; color: var(--text-soft); }
.h3-card { margin: 0; font-family: var(--f-head); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }

.mini-chat {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
  border-radius: 14px; background: var(--ink); border: 1px solid var(--line-soft);
  font-family: var(--f-mono); font-size: 12px;
}
.bubble { padding: 6px 12px; }
.bubble-in { align-self: flex-start; border-radius: 12px 12px 12px 3px; background: var(--bubble); color: var(--text-soft); }
.bubble-out { align-self: flex-end; border-radius: 12px 12px 3px 12px; background: var(--accent); color: var(--bg); }

.hobby-yap { border-radius: 26px 26px 26px 6px; border-color: var(--line-strong); }
.hobby .quote-mark { font-family: var(--f-head); font-size: 60px; font-weight: 700; line-height: 0.75; color: var(--accent); }

.hobby-note {
  position: relative; padding: 28px 24px 24px; border-radius: 6px;
  background: var(--paper); transform: rotate(-1.2deg); gap: 12px;
}
.tape { position: absolute; background: rgba(180, 185, 196, 0.22); }
.hobby-note .tape { left: 50%; top: -9px; width: 64px; height: 18px; margin-left: -32px; transform: rotate(-2deg); }
.h3-hand { margin: 0; font-family: var(--f-hand); font-size: 38px; font-weight: 700; line-height: 1; color: var(--text); }
.hobby .hand-flow { margin: auto 0 0; font-family: var(--f-hand); font-size: 22px; font-weight: 500; color: var(--accent); }

.hobby-db { border-top: 2px solid var(--accent); }
.mini-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 12px; }
.mini-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--accent); font-weight: 500; }
.mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini-table td:first-child { color: var(--text-soft); }
.mini-table tr:last-child td { border-bottom: 0; }

.hobbies { position: relative; }
.hobby { position: relative; }
.hobby::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  border: 2px solid var(--accent); opacity: 0; pointer-events: none;
}
.hobby.is-flash::after { animation: kenn-flash 1.6s ease; }
@keyframes kenn-flash { 0% { opacity: 0; } 18% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }

/* the mini chat plays when it scrolls into view (class added by script.js) */
.mini-chat.will-play .bubble { opacity: 0; transform: translateY(6px); transition: opacity 420ms ease, transform 420ms ease; }
.mini-chat.will-play.is-in .bubble { opacity: 1; transform: none; }
.mini-chat.will-play.is-in .bubble:nth-child(2) { transition-delay: 650ms; }
.mini-chat.will-play.is-in .bubble:nth-child(3) { transition-delay: 1300ms; }

.carousel-ui { display: none; }
.swipe-hint { margin: 0; font-family: var(--f-mono); font-size: 11px; color: var(--muted); transition: opacity 200ms ease; }
.pager { display: flex; align-items: center; }
.pager button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
}
.pager button span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
  transition: transform 250ms ease, background-color 250ms ease;
}
.pager button[aria-current="true"] span { background: var(--accent); transform: scale(1.3); }

.edu {
  margin-top: 20px; padding: 22px 28px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--well);
  display: flex; flex-wrap: wrap; gap: 10px 40px; align-items: baseline;
}
.edu-body { margin: 0; flex: 1 1 280px; }
.edu-body b { font-weight: 600; }
.edu-course { font-size: 14px; color: var(--muted); }

/* projects */
.featured {
  margin-top: 48px; padding: 36px; border-radius: 24px; border: 1px solid var(--line); background: var(--well);
  display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr); gap: 24px 32px; align-items: center;
}
.featured + .featured { margin-top: 32px; }
.featured-copy { grid-column: 1; }
.featured-screen { grid-column: 2; grid-row: 1 / 4; min-width: 0; }
.featured-numbers { grid-column: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.featured-numbers > div { min-width: 0; padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.featured-numbers b { display: block; font: 700 32px/1.1 var(--f-head); color: var(--accent); }
.featured-numbers span { display: block; margin-top: 6px; font: 11px/1.5 var(--f-mono); color: var(--muted); }
.featured-action { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.h3-proj { margin: 10px 0 0; font-family: var(--f-head); font-size: 48px; font-weight: 600; line-height: 1; letter-spacing: -0.035em; }
.h3-proj-tail { color: var(--muted); font-weight: 500; }
.featured-meta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--f-mono); font-size: 12px;
}
.badge-sm { gap: 6px; padding: 4px 10px; font-size: 11px; }
.mono-meta { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.featured-desc { margin: 16px 0 0; max-width: 56ch; font-size: 19px; color: var(--text-soft); }

.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sticky { position: relative; padding: 20px 18px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.sticky .tape { top: -8px; width: 46px; height: 14px; }
.tape-l { left: 18px; transform: rotate(-3deg); }
.tape-r { right: 18px; transform: rotate(3deg); }
.sticky-h { margin: 0 0 6px; font-family: var(--f-hand); font-size: 24px; font-weight: 700; line-height: 1; color: var(--accent); }
.sticky-p { margin: 0; font-size: 15px; color: var(--text-soft); }

.h3-small { margin: 0 0 4px; font-family: var(--f-head); font-size: 20px; font-weight: 600; }
.built { list-style: none; margin: 0; padding: 0; }
.built li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; color: var(--list-text); }
.built .dot { flex: none; margin-top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.more.is-revealing { animation: kenn-reveal 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes kenn-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.more-btn {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--accent); font: 500 14px var(--f-body); cursor: pointer;
}
.more-btn-log { margin: 10px 0 0 44px; }

.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px 16px; }
.stat-num.will-count { min-width: 4.2ch; }
.stat-num { font-variant-numeric: tabular-nums; margin: 0; font-family: var(--f-head); font-size: 76px; font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.stat-text { margin: 0; color: var(--text-soft); font-size: 16px; }

/* thReady case study */
.browser-frame { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3); }
.browser-bar { min-height: 38px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.browser-dots { display: flex; gap: 5px; }
.browser-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.browser-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font: 10px/1.5 var(--f-mono); }
.browser-frame img, .gallery-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.browser-carousel { position: relative; aspect-ratio: 8 / 5; overflow: hidden; background: var(--paper); }
.browser-carousel-track {
  display: flex; width: 100%; height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.browser-carousel-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.browser-carousel-dots {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 5px 9px;
  border-radius: 999px; background: rgba(11, 12, 15, 0.62); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}
.browser-carousel-dots button {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(230, 232, 236, 0.35); cursor: pointer;
  transition: transform 250ms ease, background-color 250ms ease;
}
.browser-carousel-dots button[aria-current="true"] { background: var(--accent); transform: scale(1.25); }
@media (prefers-reduced-motion: reduce) {
  .browser-carousel-track { transition: none; }
}
.case-open, .case-open body { overflow: hidden; }
.case-study {
  --case-open-duration: 520ms; --case-close-duration: 360ms;
  position: fixed; inset: 48px 24px auto; margin: 0 auto; padding: 0; width: calc(100% - 48px); max-width: 1200px;
  max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px);
  overflow: hidden; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--well); color: var(--text);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.65);
  transform-origin: 0 0;
}
.case-study[open] { display: flex; flex-direction: column; }
.case-study::backdrop, .screen-viewer::backdrop { background: rgba(7, 8, 10, 0.82); }
.case-study.is-opening::backdrop { animation: case-backdrop-in var(--case-open-duration) cubic-bezier(.22, 1, .36, 1) both; }
.case-study.is-closing::backdrop { animation: case-backdrop-out var(--case-close-duration) cubic-bezier(.4, 0, .2, 1) both; }
@keyframes case-backdrop-in { from { opacity: var(--case-backdrop-from, 0); } to { opacity: 1; } }
@keyframes case-backdrop-out { from { opacity: var(--case-backdrop-from, 1); } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .case-study.is-opening::backdrop, .case-study.is-closing::backdrop { animation: none; }
}
.case-titlebar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; background: var(--well); border-bottom: 1px solid var(--line); }
.case-titlebar h2 { margin: 4px 0 0; font: 600 32px/1 var(--f-head); letter-spacing: -0.035em; }
.case-close { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--text); cursor: pointer; }
.case-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px; }
.case-summary { margin: 0; max-width: 72ch; color: var(--text-soft); font-size: 19px; }
.case-links { margin: 18px 0 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.case-links .pill { min-height: 44px; padding: 0 18px; font: 600 14px var(--f-body); }
.case-video { margin: 0 0 36px; }
.case-video .browser-frame { border-radius: 16px; }
.case-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: max(240px, calc(100vh - 300px)); max-height: max(240px, calc(100dvh - 300px)); background: var(--ink); }
.case-video figcaption { margin-top: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.case-video h3 { margin: 0 0 4px; font: 600 22px/1.2 var(--f-head); }
.case-video p { margin: 0; max-width: 76ch; font-size: 15px; color: var(--text-soft); }
.case-gallery { --gallery-stage-h: clamp(270px, calc(100vh - 280px), 560px); --gallery-stage-h: clamp(270px, calc(100dvh - 280px), 560px); }
.case-gallery .browser-frame { border-radius: 16px; }
.gallery-nav { flex: none; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.gallery-counter { margin-right: 4px; white-space: nowrap; font: 11px/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--well); color: var(--text);
  cursor: pointer; transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.gallery-step:hover { border-color: var(--accent); color: var(--accent); background: rgba(61, 220, 151, 0.08); }
.gallery-step:active { transform: scale(0.94); }
.gallery-stage { height: var(--gallery-stage-h); overflow: hidden; background: var(--ink); touch-action: pan-y; }
.gallery-stage .gallery-enlarge { height: 100%; }
.gallery-track {
  display: flex; width: 100%; height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.gallery-track > img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; aspect-ratio: auto; background: var(--ink); }
.app-stage {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: 24px;
  height: var(--gallery-stage-h); padding: 20px 32px; overflow: hidden; touch-action: pan-y;
  background:
    radial-gradient(ellipse 60% 55% at 24% 20%, rgba(61, 220, 151, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 50% at 78% 85%, rgba(127, 209, 164, 0.07), transparent 60%),
    linear-gradient(155deg, #101318 0%, #0b0d11 100%);
}
.app-stage-copy { display: flex; flex-direction: column; gap: 10px; min-width: 0; will-change: transform, opacity; }
.app-stage-eyebrow { margin: 0; font: 500 10px/1.4 var(--f-mono); letter-spacing: 0.14em; color: var(--accent); }
.app-stage-title { margin: 0; font: 600 clamp(20px, 2.2vw, 32px)/1.08 var(--f-head); letter-spacing: -0.03em; color: var(--text); }
.app-stage-sub { margin: 0; font-size: clamp(12.5px, 1.1vw, 14px); line-height: 1.48; color: var(--text-soft); }
.app-stage-legend { list-style: none; margin: 4px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.app-stage-legend li { display: flex; align-items: center; gap: 9px; font: 11.5px/1.35 var(--f-mono); color: var(--list-text); }
.app-stage-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 999px;
  background: rgba(61, 220, 151, 0.14); border: 1px solid rgba(61, 220, 151, 0.45);
  color: var(--accent); font-size: 10px; font-weight: 500;
}
.app-stage-pill {
  align-self: flex-start; margin-top: 4px; padding: 4px 10px; border-radius: 999px;
  border: 1px dashed var(--line-strong); font: 10px/1.4 var(--f-mono); color: var(--muted);
}
.app-stage-viewport { height: 100%; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.gallery-enlarge.app-stage-enlarge { height: 100%; background: transparent; text-align: left; }
.app-stage-track { height: 100%; align-items: stretch; }
.app-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 2px;
}
.app-phone {
  display: flex; height: 100%; max-height: 100%; max-width: calc(50% - 8px);
  width: auto; aspect-ratio: 520 / 1125; padding: 6px; border-radius: 22px;
  background: linear-gradient(160deg, #252933 0%, #161920 100%);
  border: 1px solid #353b4a;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.app-phone img {
  display: block; width: 100%; height: 100%; object-fit: contain; aspect-ratio: auto;
  border-radius: 16px; background: #fbf7f0;
}
@media (prefers-reduced-motion: reduce) {
  .gallery-track { transition: none; }
}
.gallery-enlarge { display: block; width: 100%; padding: 0; border: 0; background: var(--ink); cursor: default; }
.gallery-meta { margin: 18px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.gallery-meta h3 { margin: 0 0 4px; font: 600 22px/1.2 var(--f-head); }
.gallery-meta p { margin: 0; max-width: 76ch; font-size: 15px; color: var(--text-soft); }
.demo-label { flex: none; padding: 4px 10px; border: 1px dashed var(--line-strong); border-radius: 999px; color: var(--muted); font: 11px/1.5 var(--f-mono); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 4px; }
.gallery-thumb { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--muted); cursor: pointer; }
.gallery-thumb span { display: block; padding: 10px 6px; font: 11px/1.5 var(--f-mono); }
.gallery-thumb[aria-pressed="true"] { border: 2px solid var(--accent); color: var(--accent); }
.case-columns { margin-top: 36px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.case-column { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.test-run { margin: 0; padding: 24px; border: 1px solid var(--line-soft); border-radius: 20px; background: var(--ink); font: 12px/1.8 var(--f-mono); }
.test-run figcaption { color: var(--muted); margin-bottom: 16px; }
.test-run pre { margin: 0; overflow-x: auto; }
.test-run code { font: inherit; }
.case-database { margin-top: 32px; padding: 24px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 20px; }
.database-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.database-head h3 { margin: 0; font: 600 24px/1.2 var(--f-head); }
.database-head p { margin: 0; color: var(--muted); font: 11px/1.6 var(--f-mono); }
.database-count-mobile { display: none; }
.database-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.db-table { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); font: 12px/1.6 var(--f-mono); overflow-wrap: anywhere; }
.db-table h4 { margin: 0; padding: 12px; border-bottom: 1px solid var(--line-strong); font: 500 12px/1.6 var(--f-mono); color: var(--text-soft); }
.db-table-core { border-color: var(--accent); }
.db-table-core h4 { color: var(--accent); }
.db-table ul { list-style: none; margin: 0; padding: 12px; }
.db-table li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.db-key { flex: none; color: var(--accent); font-size: 10px; }
.db-key-fk { color: var(--sql-keyword); }
.db-table > p { margin: auto 0 0; padding: 10px 12px; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; }
.screen-viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--ink); color: var(--text); }
.screen-viewer[open] { display: flex; align-items: center; justify-content: center; }
.screen-viewer .case-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 1; }
.screen-viewer img { display: block; width: 100%; height: auto; max-height: 100%; aspect-ratio: 8 / 5; object-fit: contain; touch-action: pan-x pan-y pinch-zoom; }

.proj-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; gap: 12px; }
.h3-proj2 { margin: 0; font-family: var(--f-head); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.proj-p { margin: 0; font-size: 16px; color: var(--text-soft); }
.tags {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--f-mono); font-size: 12px; color: var(--text-soft);
}
.tags li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.proj-grid-single { grid-template-columns: minmax(0, 1fr); }
.proj-grid-single .proj-p { max-width: 62ch; }
.hand-cta { margin: auto 0 0; font-family: var(--f-hand); font-size: 22px; font-weight: 700; color: var(--accent); }
.proj-slot {
  border-radius: 20px; border: 1px dashed var(--line-strong);
  display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 180px;
}
.slot-text { margin: 0; font-family: var(--f-mono); font-size: 14px; color: var(--muted); }

/* skills */
.results { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.results table { width: 100%; border-collapse: collapse; }
.results thead tr { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.results thead th { text-align: left; padding: 16px 24px; border-bottom: 1px solid var(--line); font-weight: 500; }
.results .col-cat { width: 26%; }
.results tbody th {
  text-align: left; padding: 16px 24px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--f-mono); font-size: 13px; font-weight: 400; color: var(--text-soft);
}
.results tbody td { padding: 16px 24px; border-bottom: 1px solid var(--line-soft); color: var(--list-text); }
.results tbody th.accent { color: var(--accent); }
.results-foot { margin: 0; padding: 12px 24px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.results-m { margin: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.results-m div { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.results-m dt { font-family: var(--f-mono); font-size: 11px; color: var(--text-soft); }
.results-m dt.accent { color: var(--accent); }
.results-m dd { margin: 2px 0 0; font-size: 15px; color: var(--list-text); }

/* certs */
.cert-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cert { position: relative; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.cert-ring { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid var(--line-soft); }
.cert-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.cert-title { margin: 0; font-family: var(--f-head); font-size: 30px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; }
.cert-meta {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.cert-meta dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cert-meta dd { margin: 3px 0 0; font-size: 15px; }
.cert-meta .span-all { grid-column: 1 / -1; }
.cert-meta .cred-id { font-family: var(--f-mono); font-size: 14px; color: var(--text-soft); overflow-wrap: anywhere; }
.cert-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-cred { align-self: flex-start; min-height: 44px; padding: 0 18px; font: 600 14px var(--f-body); }

.in-progress {
  margin-top: 16px; padding: 22px 28px; border-radius: 18px; border: 1px dashed var(--line-strong);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
}
.in-progress .label { margin: 0 6px 0 0; }
.track {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--list-text);
}
.spinner { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; }

/* log */
.yaps { list-style: none; margin: 0; padding: 0; max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.yap { display: flex; gap: 12px; align-items: flex-end; }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bubble); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
}
.yap-bubble { min-width: 0; padding: 12px 16px; border-radius: 18px 18px 18px 5px; background: var(--surface); border: 1px solid var(--line); }
.yap.is-hot .yap-bubble { border-color: var(--accent); }
.yap-text { margin: 0; font-size: 16px; color: var(--text); }
.yap-date { margin: 3px 0 0; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.yap.is-hot .yap-date { color: var(--accent); }

/* contact */
.h2-contact { margin: 0; font-family: var(--f-head); font-size: 128px; font-weight: 700; line-height: 0.95; letter-spacing: -0.045em; }
.contact-p { margin: 14px 0 0; max-width: 50ch; font-size: 19px; color: var(--text-soft); }
.composer { margin-top: 24px; max-width: 760px; padding: 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-strong); }
.composer label { display: block; margin: 0 4px 8px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.composer textarea {
  display: block; width: 100%; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--f-body);
}
.composer textarea::placeholder { color: var(--muted); opacity: 1; }
.composer textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer-actions { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
  border: 0; background: none; color: var(--text-soft); font: 500 14px var(--f-body); cursor: pointer;
}
.copy-btn:hover { color: var(--text); }
.send-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--accent); color: var(--bg);
  font: 700 15px var(--f-body); text-decoration: none;
}
.contact-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 0 24px; }
.contact-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: 15px; text-decoration: none; }
.contact-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* footer */
.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px;
  padding: 18px 64px; border-top: 1px solid var(--line-soft);
  font-family: var(--f-mono); font-size: 12px; color: var(--muted);
}
.to-top {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--text); font: 12px var(--f-mono); cursor: pointer;
}

/* mobile tab bar */
.tabbar { display: none; }

/* ---------- narrow desktop: the full SQL query no longer fits the bar ---------- */

@media (min-width: 760px) and (max-width: 1139.98px) {
  .topbar { padding: 0 20px; }
  .sql-pre, .sql-post { display: none; }
  .sql-nav { gap: 4px; }
  .sql-nav a { padding: 0 7px; }
  .sql-nav .comma { margin-left: -4px; }
}

/* ---------- 2-column hobby grid under 1240px ---------- */

@media (max-width: 1239.98px) {
  .hobbies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- mobile: width < 760px ---------- */

@media (max-width: 759.98px) {
  .load-query { font-size: 20px; }
  :root { --top-h: 56px; --tab-h: 68px; }

  .desktop-only { display: none !important; }

  .topbar { padding: 0 12px 0 16px; }
  .sql-nav { display: none; }
  .pill-resume { margin-left: auto; }
  .skip-intro { right: 12px; }

  .js:not(.reduced) .intro-track { height: 175vh; height: 175svh; }

  .hero { flex-direction: column; align-items: stretch; gap: 8px; padding: 20px 20px 0; }
  .hero-copy { flex: 0 0 auto; }
  .hero-illus { flex: 1 1 0; }
  .room-box { width: auto; height: 100%; }
  .room-notes { display: none; }
  .kenn-talk { max-width: 200px; }
  .kenn-bubble { font-size: 11px; padding: 7px 10px; }

  .eyebrow { margin-bottom: 12px; }
  .name { font-size: clamp(28px, 8.5vw, 36px); font-size: round(clamp(28px, 8.5vw, 36px), 1px); }
  .name-line { display: block; }
  .name-line-2 { margin-left: 0; }
  .sub { margin-top: 8px; font-size: 14px; }
  .lede { margin-top: 14px; font-size: 15px; }
  .actions { margin-top: 16px; }
  .actions .btn { flex: 1 1 0; }

  .strip { margin: 4px 0 10px; padding: 0 20px; flex-wrap: nowrap; }
  .cue { left: 20px; }
  .cue-url { display: none; }

  section { padding: 44px 20px; }
  .query { font-size: 11px; }
  .h2 { font-size: 30px; }
  .h2-gap { margin-bottom: 20px; }
  .intro-p { font-size: 16px; }
  .card-pad { padding: 18px; }

  .hobbies {
    margin: 22px -20px 0; padding: 10px 20px 6px;
    display: flex; gap: 12px; overflow-x: auto;
    scroll-snap-type: x mandatory; scroll-padding-inline: 20px;
    overscroll-behavior-x: contain;
  }
  .hobby { flex: 0 0 82%; scroll-snap-align: start; }
  .hobby-note { transform: none; }
  .carousel-ui { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
  .edu { padding: 16px 18px; }

  .featured { margin-top: 22px; padding: 18px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .featured-copy, .featured-screen, .featured-numbers, .featured-action { grid-column: 1; grid-row: auto; }
  .featured-numbers { gap: 8px; }
  .featured-numbers b { font-size: 28px; }
  .featured-action { flex-direction: column; align-items: flex-start; }
  .h3-proj { font-size: 30px; }
  .featured-desc { font-size: 16px; }
  .sticky-p { font-size: 14px; }
  .built li { font-size: 15px; }
  .js .collapsible:not(.is-expanded) > .more { display: none; }
  .stat { flex-direction: row; align-items: center; }
  .stat-num { font-size: 44px; }
  .stat-text { font-size: 15px; }
  .case-study { inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .case-titlebar { padding: max(16px, env(safe-area-inset-top)) 20px 16px; }
  .case-content { padding: 20px 20px max(28px, env(safe-area-inset-bottom)); }
  .case-summary { font-size: 16px; }
  .case-video { margin-bottom: 28px; }
  .case-video .browser-frame, .case-gallery .browser-frame { border-radius: 14px; }
  .gallery-stage { height: auto; }
  .gallery-track > img { height: auto; aspect-ratio: 8 / 5; }
  .gallery-step { width: 36px; height: 36px; }
  .app-stage { grid-template-columns: minmax(0, 1fr); height: auto; aspect-ratio: auto; padding: 18px 16px 20px; gap: 16px; }
  .app-stage-viewport { order: -1; height: auto; display: block; }
  .app-stage-enlarge, .app-stage-track { height: auto; }
  .app-slide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; gap: 10px; padding: 2px; }
  .app-phone { height: auto; max-width: none; width: 100%; padding: 5px; border-radius: 16px; }
  .app-phone img { height: auto; aspect-ratio: 520 / 1125; border-radius: 12px; }
  .app-stage-title { font-size: 22px; }
  .app-stage-sub { font-size: 13px; }
  .app-stage-pill { display: none; }
  .case-video figcaption { flex-direction: column; gap: 12px; }
  .case-video h3 { font-size: 20px; }
  .case-video p { font-size: 14px; }
  .gallery-enlarge { cursor: zoom-in; }
  .gallery-meta { gap: 12px; }
  .gallery-meta h3 { font-size: 20px; }
  .gallery-meta p { font-size: 14px; }
  .gallery-thumbs { display: flex; overflow-x: auto; overscroll-behavior-x: contain; }
  .gallery-thumb { flex: 0 0 132px; }
  .case-columns { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .case-column .stat { flex-direction: column; align-items: flex-start; }
  .test-run { padding: 16px; font-size: 11px; }
  .case-database { padding: 16px; }
  .database-head { flex-direction: column; }
  .database-grid { grid-template-columns: minmax(0, 1fr); }
  .database-count-desktop, .db-table:nth-child(n+7) { display: none; }
  .database-count-mobile { display: inline; }
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-p { font-size: 15px; }

  .cert-grid { margin-top: 22px; grid-template-columns: minmax(0, 1fr); }
  .cert-title { font-size: 24px; }
  .in-progress { padding: 16px 18px; }

  .yap-text { font-size: 15px; }

  .h2-contact { font-size: 52px; }
  .contact-p { font-size: 16px; }

  .footer { padding: 16px 20px 92px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; padding: 6px 6px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: rgba(11, 12, 15, 0.96);
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0; min-height: 52px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 0; border-radius: 12px;
    color: var(--muted); font: 500 11px var(--f-body); text-decoration: none;
  }
  .tabbar a.is-active { background: var(--paper); color: var(--accent); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */

@media print {
  .load-query, .load-flash, .load-vignette, .load-ripple, .load-result, .load-ghost { display: none !important; }
  .name-load { opacity: 1 !important; transform: none !important; filter: none !important; }
  .site-bg { display: none !important; }
  .topbar, .tabbar, .skip-intro, .cue, .cue-url, .composer, .room-notes { display: none !important; }
  .intro-track, .stage { height: auto !important; position: static; }
  .name-fx, .lede, .actions, .strip, .hero-illus { opacity: 1 !important; visibility: visible !important; transform: none !important; }
}
