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

html { -webkit-text-size-adjust: 100%; }

body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; background-image: var(--bg-glow); background-repeat: no-repeat; }

h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.label { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }

/* ---------- Nav ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.02em; }
.logo-mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; color: var(--text); }
.logo-mark svg { width: 32px; height: 32px; }
.logo-mark path { fill: none; stroke: currentColor; stroke-width: 23px; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 1.5; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: var(--fs-16); transition: background var(--duration-quick), color var(--duration-quick); }
.nav-links a:hover { background: var(--chip-bg); color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--chip-bg); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; transition: background var(--duration-quick), color var(--duration-quick), border-color var(--duration-quick), transform var(--duration-quick) var(--ease-smooth-out); }
.theme-toggle:hover { background: var(--chip-bg); color: var(--text); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle:active { transform: scale(0.92); }
.theme-icon { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--duration-fast), transform var(--duration-slow) var(--ease-smooth-out); }
.theme-icon--sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon--moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
  :root:not([data-theme="light"]) .theme-icon--sun { opacity: 1; transform: none; }
}
:root[data-theme="dark"] .theme-icon--moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
:root[data-theme="dark"] .theme-icon--sun { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .theme-icon { transition: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 999px; font-size: var(--fs-16); font-weight: 500; white-space: nowrap; /* <button>s don't inherit these from the page (dark mode showed black-on-black) */ font-family: inherit; color: inherit; border: 0; cursor: pointer; transition: background var(--duration-quick), transform var(--duration-quick) var(--ease-smooth-out); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--btn-primary-bg) var(--btn-primary-gradient); color: var(--btn-primary-text); box-shadow: var(--shadow-btn); transition: filter var(--duration-quick), transform var(--duration-quick) var(--ease-smooth-out); }
.btn--primary:hover { filter: brightness(1.08) saturate(1.05); }
.btn--ghost { background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow-1), var(--highlight); }
.btn--ghost:hover { background: var(--chip-bg); }
.btn--sm { height: 34px; padding: 0 16px; font-size: var(--fs-12); }
.btn .arrow { transition: transform var(--duration-fast) var(--ease-smooth-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { padding: var(--space-hero-top) 0 var(--space-hero-bottom); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-split); align-items: center; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow-1), var(--highlight); font-size: var(--fs-12); color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.status strong { color: var(--text); font-weight: 500; }
.hero h1 { margin: 24px 0 20px; font-size: var(--text-hero); font-weight: 600; letter-spacing: -0.04em; }
.hero h1 em { display: block; font-style: normal; color: var(--muted); }   /* own line, so the cycling word always ends its line */
/* Cycling word: all words share one grid cell (as wide as the longest), so swapping never reflows the heading. */
.hero-words { display: inline-grid; }
.hero-words > span {
  grid-area: 1 / 1; opacity: 0; translate: 0 0.4em;
  transition: opacity var(--duration-slow) var(--ease-smooth-out), translate 500ms var(--ease-smooth-out);
}
.hero-words > .is-active { opacity: 1; translate: none; }
.hero-words > .is-leaving { opacity: 0; translate: 0 -0.4em; }
@media (prefers-reduced-motion: reduce) { .hero-words > span { transition: none; } }
.lead { max-width: 34rem; font-size: var(--text-lead); color: var(--muted); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Hero face: the tile portrait (tools/face/face.html) drawn by hero-face.js. Its colours
   (and the chin fade) are tuned for a dark ground, so the script paints a dark silhouette
   of the head (--face-ground) behind the tiles — in the light theme too. */
.face { --face-ground: #111112; position: relative; width: 100%; max-width: 304px; aspect-ratio: 640 / 1025; justify-self: center; margin: 0; }
/* The canvas bleeds past the portrait so scattered and pushed tiles aren't clipped. */
.face canvas { position: absolute; left: -16%; top: -10%; width: 132%; height: 120%; cursor: pointer; }

.face-bubble { position: absolute; top: calc(58% + 100px); left: 78%; z-index: 1; width: max-content; max-width: 13rem; padding: 8px 12px; border-radius: 14px 14px 14px 3px; background: var(--primary-bg); color: var(--primary-text); box-shadow: var(--shadow-3); font-size: var(--fs-12); line-height: 1.4; font-weight: 500; opacity: 0; transform: translate(-6px, 8px) scale(0.92); transform-origin: 0 100%; transition: opacity var(--duration-fast), transform var(--duration-slow) var(--ease-smooth-out); pointer-events: none; }
.face-bubble.is-open { opacity: 1; transform: none; }
.face-bubble-text::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 4px; vertical-align: -2px; background: var(--accent); animation: face-caret 1s steps(1) infinite; }
@keyframes face-caret { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .face-bubble { transition: none; }
  .face-bubble-text::after { animation: none; }
}

/* tile mini-visuals */
.v-code { display: grid; gap: 4px; width: 58%; }
.v-code i { display: block; height: 6px; border-radius: 3px; background: var(--chip-bg-hover); }
.v-code i:nth-child(2) { width: 70%; margin-left: 12%; }
.v-code i:nth-child(3) { width: 85%; margin-left: 12%; background: color-mix(in srgb, var(--crit) 55%, transparent); }
.v-code i:nth-child(4) { width: 50%; }
.v-swatches { display: grid; grid-template-columns: repeat(3, 18px); gap: 4px; }
.v-swatches i { height: 18px; border-radius: 5px; }
.v-swatches i:nth-child(1) { background: #0b3d91; }
.v-swatches i:nth-child(2) { background: #1f6fd1; }
.v-swatches i:nth-child(3) { background: #7fb2f0; }
.v-swatches i:nth-child(4) { background: #9a3412; }
.v-swatches i:nth-child(5) { background: #ea7a2d; }
.v-swatches i:nth-child(6) { background: #fbc58f; }
.v-gauge { width: 58%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--ok) 0 92%, var(--chip-bg) 92% 100%); display: grid; place-items: center; }
.v-gauge span { width: 76%; aspect-ratio: 1; border-radius: 50%; background: var(--card-bg); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-16); letter-spacing: -0.03em; }
.v-agent { display: grid; gap: 8px; width: 64%; }
.v-agent i { display: block; height: 16px; border-radius: 8px; background: var(--chip-bg); }
.v-agent i:nth-child(1) { width: 70%; justify-self: end; background: var(--accent); box-shadow: 0 4px 10px -3px rgba(0, 174, 239, 0.55); }
.v-agent i:nth-child(2) { width: 90%; }
.v-agent i:nth-child(3) { width: 45%; animation: typing 1.6s var(--ease-smooth-out) infinite alternate; transform-origin: left; }
.v-icons { display: grid; grid-template-columns: repeat(3, 16px); gap: 8px; }
.v-icons i { width: 16px; height: 16px; border: 2px solid var(--text); border-radius: 4px; }
.v-icons i:nth-child(2n) { border-radius: 50%; }
.v-icons i:nth-child(3) { border-color: var(--accent); }
/* Neo Charts: columns drawn with plain divs, like the library itself */
.v-bars { display: flex; align-items: flex-end; gap: 6px; height: 88px; }
.v-bars i { width: 16px; height: var(--h); border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, transparent), color-mix(in srgb, var(--accent) 55%, transparent)); transform-origin: bottom; }
.v-bars i:nth-child(even) { background: linear-gradient(180deg, #f2665c, color-mix(in srgb, #f2665c 55%, transparent)); }
.card:hover .v-bars i { animation: bars-grow 700ms var(--ease-smooth-out) calc(var(--i, 0) * 40ms) both; }
@keyframes bars-grow { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }
.v-pkg { font-family: var(--font-mono); font-size: var(--fs-12); line-height: 1.7; color: var(--muted); }
.v-pkg b { color: var(--ok); font-weight: 500; }
.v-pkg s { color: var(--crit); text-decoration: none; }

@keyframes typing { from { transform: scaleX(0.35); } to { transform: scaleX(1); } }

/* ---------- Logos ---------- */
.logos { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.logos-row { display: flex; justify-content: center; padding-block: 28px; }
.logos-row ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px 106px; }
.logos-row li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-16); letter-spacing: -0.02em; color: var(--text); }
/* Brand-colour logos, inlined: each one's neutral parts (wordmarks) use currentColor. */
.client-logo { display: block; height: var(--h, 22px); width: auto; aspect-ratio: var(--ratio); }
.client-logo--raster { object-fit: cover; object-position: top; }
/* Tenzai's symbol is pale cyan (#88FFFF), made for dark grounds; on the light page it uses the brand's deeper teal. */
.client-logo--tenzai { --tz-light: #00a8bf; --tz-deep: #007f91; }
.client-logo--tenzai .tz-light { fill: var(--tz-light); stop-color: var(--tz-light); }
.client-logo--tenzai .tz-deep { stop-color: var(--tz-deep); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .client-logo--tenzai { --tz-light: #88ffff; --tz-deep: #00a8bf; }
}
:root[data-theme="dark"] .client-logo--tenzai { --tz-light: #88ffff; --tz-deep: #00a8bf; }

/* ---------- Sections ---------- */
.section { padding: var(--space-section) 0 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.section-head h2 { margin-top: 12px; font-size: var(--text-h2); font-weight: 600; }
.section-head p { max-width: 26rem; color: var(--muted); }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow-2), var(--highlight); border-radius: var(--radius-l); padding: 8px; overflow: hidden; transition: transform var(--duration-fast) var(--ease-smooth-out), box-shadow var(--duration-fast); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3), var(--highlight); }
.card-stage { position: relative; flex: 1; min-height: 200px; border-radius: 13px; background: var(--stage-bg); box-shadow: var(--stage-inset); overflow: hidden; display: grid; place-items: center; }
.card-meta { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 16px 12px 12px; }
.card-title { font-size: var(--fs-16); font-weight: 600; letter-spacing: -0.015em; }
.card-subtitle { margin-top: 4px; font-size: var(--fs-16); color: var(--muted); }
.chip { flex-shrink: 0; padding: 4px 8px; border-radius: 999px; background: var(--chip-bg); font-family: var(--font-mono); font-size: var(--fs-12); color: var(--muted); }
.chip--accent { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px rgba(0, 174, 239, 0.25); }

/* Selected work — bento */
.bento { display: grid; grid-template-columns: 1fr; gap: 16px; }
.bento .card-stage { min-height: 200px; }
.bento .card:first-child .card-stage { min-height: 320px; }

/* Color Forklift — a perceptual ramp, light to dark */
.v-ramp { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(78%, 280px); }
.v-ramp i { height: 64px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.v-ramp i:nth-child(1) { background: oklch(0.93 0.05 150); }
.v-ramp i:nth-child(2) { background: oklch(0.84 0.12 150); }
.v-ramp i:nth-child(3) { background: oklch(0.75 0.17 150); }
.v-ramp i:nth-child(4) { background: oklch(0.65 0.18 150); transform: translateY(-8px); box-shadow: var(--shadow-2); }
.v-ramp i:nth-child(5) { background: oklch(0.52 0.14 150); }
.v-ramp i:nth-child(6) { background: oklch(0.38 0.10 150); }
.v-ramp i:nth-child(7) { background: oklch(0.24 0.06 150); }
.v-ramp span { grid-column: 1 / -1; margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-12); color: var(--muted); text-align: center; }

/* Iveeo — screen, webcam bubble and recording bar as separate layers */
.v-rec { position: relative; width: min(74%, 260px); padding-bottom: 24px; }
.v-rec-screen { display: grid; gap: 8px; padding: 20px 16px 36px; border-radius: 9px; background: #1a1a1d; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: var(--shadow-2); }
.v-rec-screen i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.v-rec-screen i:nth-child(1) { width: 70%; background: linear-gradient(90deg, #ff2d55 18%, rgba(255, 255, 255, 0.16) 18%); }
.v-rec-screen i:nth-child(2) { width: 88%; }
.v-rec-screen i:nth-child(3) { width: 54%; }
.v-rec-cam { position: absolute; right: -14px; bottom: 30px; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #9a9aa3 0 22%, transparent 23%), radial-gradient(circle at 50% 100%, #9a9aa3 0 42%, #3b3b42 43%); border: 2px solid var(--card-bg); box-shadow: var(--shadow-3); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.card:hover .v-rec-cam { transform: translate(-6px, -4px); }
.v-rec-bar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: #0d0d0d; color: #ededed; font-family: var(--font-mono); font-size: var(--fs-12); box-shadow: var(--shadow-2); }
.v-rec-bar em { width: 7px; height: 7px; border-radius: 50%; background: #ff2d55; animation: rec-blink 1.4s steps(1) infinite; }
@keyframes rec-blink { 50% { opacity: 0.25; } }

.stat { text-align: center; }
.stat-num { font-size: var(--text-stat); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.stat-num span { color: var(--accent); text-shadow: 0 6px 24px rgba(0, 174, 239, 0.45); }
.stat .label { display: block; margin-top: 12px; }

.mock-ide { width: 78%; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow-3); font-family: var(--font-mono); font-size: var(--fs-12); overflow: hidden; }
.mock-ide-bar { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.mock-ide-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-bg-hover); }
.mock-ide pre { margin: 0; padding: 12px 16px; line-height: 1.7; color: var(--muted); white-space: pre-wrap; }
.mock-ide .del { color: var(--crit); }
.mock-ide .add { color: var(--ok); }
.mock-ide .fix { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 6px; background: var(--accent); color: #04222e; box-shadow: var(--accent-glow); }

.mock-term { width: 82%; font-family: var(--font-mono); font-size: var(--fs-12); line-height: 1.8; color: var(--muted); }
.mock-term b { color: var(--text); font-weight: 500; }
.mock-term .sev { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 8px; }

.mock-matrix { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; width: min(80%, 300px); }
.mock-matrix i { aspect-ratio: 1; border-radius: 4px; background: var(--chip-bg); }
.mock-matrix i.h1 { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.mock-matrix i.h2 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.mock-matrix i.h3 { background: var(--accent); box-shadow: 0 0 12px rgba(0, 174, 239, 0.5); }

/* Projects — uniform grid */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.projects .card-stage { min-height: 170px; }
.projects .v-gauge { width: 96px; }
/* A short last row: stretch the final card instead of leaving a hole */
.projects .card:last-child:nth-child(3n + 2) { grid-column: span 2; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 24px; border-radius: var(--radius-l); background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--shadow-2), var(--highlight); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #04222e; box-shadow: var(--accent-glow); font-family: var(--font-mono); font-size: var(--fs-12); }
.step h3 { margin: 24px 0 8px; font-size: var(--fs-20); font-weight: 600; }
.step p { color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 150px 1fr auto; gap: 24px; align-items: baseline; padding: 20px 4px; border-bottom: 1px solid var(--line); transition: background var(--duration-quick); }
.timeline li:hover { background: color-mix(in srgb, var(--chip-bg) 60%, transparent); }
.timeline .role { font-weight: 500; }
.timeline .role span { color: var(--muted); font-weight: 400; }
.timeline .note { color: var(--muted); font-size: var(--fs-16); text-align: right; }

/* ---------- Recommendations ---------- */
.rec { margin: 0; }
.rec blockquote { margin: 0; color: var(--muted); font-size: var(--text-base); line-height: 1.65; }
.rec blockquote p + p { margin-top: 16px; }
.rec mark { background: none; color: var(--text); font-weight: 500; box-shadow: inset 0 -0.45em 0 var(--accent-soft); }
/* Avatar beside the name + role; the relation line sits under them, aligned with the name */
.rec figcaption { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 12px; align-content: start; font-size: var(--fs-16); font-weight: 500; }
.rec figcaption .rec-rel { grid-column: 2; }
.rec figcaption div span { display: block; color: var(--muted); font-size: var(--fs-12); font-weight: 400; }
.rec-rel { font-family: var(--font-mono); font-size: var(--text-label); font-weight: 400; color: var(--muted); }
.avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--chip-bg); font-family: var(--font-mono); font-size: var(--fs-12); color: var(--muted); }

/* One recommendation at a time, no card: author, role and relation on the left (vertically
   centred against the quote), quote on the right.
   recs.js eases the height between quotes. */
.rec-deck > .rec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rec-deck > .rec > figcaption { grid-column: 1; grid-row: 1; }
.rec-deck > .rec > blockquote { grid-column: 2; grid-row: 1; }
.rec-deck > .rec:not(.is-active) { display: none; }
.rec-deck > .rec.is-active { animation: rec-in var(--duration-reveal, 600ms) var(--ease-smooth-out) both; }
.rec-deck blockquote { max-width: 68ch; }
.rec-deck .avatar { background: var(--accent-soft); color: var(--accent-ink); }
@keyframes rec-in { from { opacity: 0; translate: 0 8px; } }

.rec-controls { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; }
.rec-icon { display: inline-block; transition: rotate var(--duration-normal, 300ms) var(--ease-smooth-out); }
[data-rec-next]:hover .rec-icon { rotate: 90deg; }
[data-rec-next]:active .rec-icon { rotate: 180deg; }

@media (prefers-reduced-motion: reduce) {
  .rec-deck > .rec.is-active { animation: none; }
  .rec-icon { transition: none; }
}

/* ---------- Writing ---------- */
.posts { border-top: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: baseline; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.posts h3 { font-size: var(--fs-16); font-weight: 500; letter-spacing: -0.015em; transition: color var(--duration-quick); }
.posts a:hover h3 { color: var(--accent-ink); }
.posts .arrow { color: var(--muted); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.posts a:hover .arrow { transform: translateX(4px); color: var(--accent-ink); }

/* ---------- CTA + footer ---------- */
/* Contact panel: neutral dark grey sheet (both themes) with the hero's dotted grid,
   an inner frame line and an isometric figure. */
.cta { --bp-bg: #141414; --bp-line: rgba(255, 255, 255, 0.22); --bp-ink: rgba(255, 255, 255, 0.62); margin-top: var(--space-section); padding: var(--space-panel); position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius-l); color: #fff; box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255, 255, 255, 0.1); background: var(--bp-bg); /* the hero's dotted grid (effects.css), in its dark-theme colours */ --grid-dot: rgba(255, 255, 255, 0.13); --grid-line: rgba(255, 255, 255, 0.045); display: grid; grid-template-columns: 1fr auto; gap: 32px; }
.cta-frame { position: absolute; inset: 16px; z-index: -1; border: 1px solid var(--bp-line); border-radius: 8px; pointer-events: none; }

/* The drawing reuses the process figures' isometric classes (.fig-art, effects.css),
   with their dark palette so it matches the grey sheet in both themes. */
.cta {
  --fig-stroke: rgba(255, 255, 255, 0.22);
  --fig-stroke-strong: rgba(255, 255, 255, 0.78);
  --fig-fill: var(--bp-bg);
  --fig-top: #1c1c1c;
  --text: #ededed;
}
.cta .cta-art { align-self: end; width: 200px; max-width: none; height: auto; aspect-ratio: 237 / 231; }
.cta-art .f-drop { animation: block-drop 4.8s var(--ease-smooth-out) infinite; }
.cta-art .f-drop .f-top { animation: block-land 4.8s linear infinite; }
@keyframes block-drop { 0% { translate: 0 -40px; opacity: 0; } 22%, 82% { translate: 0 0; opacity: 1; } 96%, 100% { translate: 0 -12px; opacity: 0; } }
@keyframes block-land { 0%, 22% { stroke: var(--fig-stroke-strong); } 26% { stroke: var(--accent); } 40%, 100% { stroke: var(--fig-stroke-strong); } }
@media (prefers-reduced-motion: reduce) {
  .cta-art .f-drop, .cta-art .f-drop .f-top { animation: none; }
}

.cta-body { align-self: end; }
.cta h2 { font-size: var(--text-h2); font-weight: 600; max-width: 18ch; }
.cta-body p { margin-top: 12px; max-width: 32rem; color: var(--bp-ink); }
.cta-body .btn { margin-top: 32px; }

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 48px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid p { color: var(--muted); max-width: 22rem; margin-top: 12px; font-size: var(--fs-16); }
.footer-grid h4 { font-family: var(--font-mono); font-size: var(--text-label); font-weight: 400; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; letter-spacing: 0.02em; }
.footer-grid li + li { margin-top: 8px; }
.footer-grid li a { font-size: var(--fs-16); transition: color var(--duration-quick); }
.footer-grid li a:hover { color: var(--accent-ink); }
.footer-base { display: flex; justify-content: space-between; margin-top: 48px; font-size: var(--fs-12); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .face { max-width: 240px; }
  .face-bubble { top: calc(6% + 100px); left: auto; right: -12px; max-width: 12rem; border-radius: 14px 14px 3px 14px; transform-origin: 100% 100%; }
  .projects { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: span 2; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav-links { display: none; }
  .nav-actions { gap: 4px; }
  .section-head { flex-direction: column; align-items: start; }
  .bento, .projects { grid-template-columns: 1fr; }
  .rec-deck > .rec { grid-template-columns: 1fr; gap: 24px; }
  .rec-deck > .rec > blockquote { grid-column: 1; grid-row: 2; }
  .bento .card:nth-child(n), .projects .card:nth-child(n) { grid-column: auto; }
  .bento .card:nth-child(1) .card-stage { min-height: 240px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .timeline .note { text-align: left; }
  .posts a { grid-template-columns: 1fr auto; }
  .posts .label { grid-column: span 2; }
  .cta { grid-template-columns: 1fr; }
  .client-logo { height: calc(var(--h, 22px) * 0.82); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
