/* ==========================================================================
   Public site
   Editorial flat composition for type and imagery; tactile material only on
   things you can press.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, iframe { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent-ui); color: var(--accent-ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-ui);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--accent-ui); color: var(--accent-ink);
  padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--motion-normal) var(--ease-out);
}
.skip:focus { top: 12px; }

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

/* ---------- Type roles ---------- */
.t-display {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' var(--display-wdth);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.94;
}
.t-title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 104;
  font-weight: 560;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.t-statement {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 100;
  font-weight: 420;
  font-size: clamp(28px, 3.5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.t-lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--text-1); }
.t-body { color: var(--text-1); max-width: 64ch; }
.t-body p + p, .t-body ul + p, .t-body p + ul { margin-top: 1em; }
.t-meta {
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.t-label {
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.t-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.md-list { display: grid; gap: 0.5em; margin-top: 0.4em; }
.md-list li { position: relative; padding-left: 1.2em; }
.md-list li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1px; background: var(--accent-dim); }

.text-link {
  color: var(--text-0);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  background-image: linear-gradient(var(--accent-dim), var(--accent-dim));
  transition: background-size var(--motion-normal) var(--ease-out), color var(--motion-fast);
}
.text-link:hover { background-image: linear-gradient(var(--accent-ui), var(--accent-ui)); color: var(--accent-ui); }

/* Underline that draws in from the left */
.u-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.u-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform var(--motion-normal) var(--ease-out);
}
.u-link:hover::after, .u-link:focus-visible::after { transform: scaleX(1); }

.ico { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tactile controls ---------- */
.btn {
  --lx: 50%; --ly: 0%;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border: 0; border-radius: var(--r-md);
  background: var(--face);
  color: var(--text-0);
  font: 500 15px/1 var(--font-body);
  letter-spacing: 0.005em;
  box-shadow: var(--sh-raised);
  cursor: pointer;
  isolation: isolate;
  transition:
    transform var(--motion-spring) var(--ease-spring),
    box-shadow var(--motion-normal) var(--ease-out),
    background-color var(--motion-normal);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.btn::before {
  /* pointer-following specular highlight; hidden until hover */
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(140px circle at var(--lx) var(--ly), rgba(255, 253, 246, 0.9), transparent 70%);
  opacity: 0; transition: opacity var(--motion-normal);
}
.btn:hover { transform: translate3d(var(--mx, 0), calc(var(--my, 0px) - 1px), 0); box-shadow: var(--sh-raised-hi); background: var(--face-hi); }
.btn:hover::before { opacity: 1; }
.btn:active, .btn.is-pressed {
  transform: translate3d(var(--mx, 0), calc(var(--my, 0px) + 1px), 0) scale(0.985);
  box-shadow: var(--sh-pressed);
  transition-duration: var(--motion-fast), var(--motion-fast), var(--motion-fast);
  transition-timing-function: var(--ease-out);
}
.btn .ico { transition: transform var(--motion-normal) var(--ease-out); }
.btn:hover .ico--arrow { transform: translateX(3px); }

.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-ui) 88%, white) 0%, var(--accent-ui) 55%, color-mix(in srgb, var(--accent-ui) 88%, black) 100%);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 240, 0.35),
    inset 0 -1px 0 rgba(30, 36, 8, 0.3),
    5px 7px 16px var(--sd),
    -2px -2px 8px var(--hl-soft);
}
.btn--primary::before { background: radial-gradient(140px circle at var(--lx) var(--ly), rgba(255, 255, 240, 0.28), transparent 70%); }
.btn--primary:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-ui) 80%, white) 0%, var(--accent-ui) 60%, color-mix(in srgb, var(--accent-ui) 90%, black) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 240, 0.4), inset 0 -1px 0 rgba(30, 36, 8, 0.3), 7px 11px 22px rgba(70, 80, 25, 0.32), -4px -4px 12px var(--hl-soft);
}
.btn--primary:active, .btn--primary.is-pressed {
  box-shadow: inset 2px 3px 7px rgba(25, 30, 6, 0.45), inset -1px -1px 0 rgba(255, 255, 240, 0.2);
}
.btn--quiet { background: transparent; box-shadow: none; color: var(--text-1); padding-inline: 4px; min-height: 40px; }
.btn--quiet:hover { background: transparent; box-shadow: none; color: var(--text-0); }
.btn--quiet:active { box-shadow: none; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--icon { width: 44px; padding: 0; }

.chip {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 8px;
  border-radius: var(--r-xs);
  background: var(--bg-1);
  box-shadow: var(--sh-inset);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--metal);
  white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-ui); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-ui) 18%, transparent); flex: none; }
.led--off { background: #C8BBA0; box-shadow: 0 0 0 2px rgba(92, 68, 38, 0.06); }
.led--live { animation: led 2.8s var(--ease-in-out) infinite; }
@keyframes led { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-ui) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .led--live { animation: none; } }

/* ---------- Images ---------- */
.img-missing, img.img-failed {
  display: block; width: 100%; height: 100%;
  background:
    linear-gradient(135deg, transparent 49.6%, var(--line-2) 50%, transparent 50.4%) 0 0 / 100% 100%,
    var(--bg-1);
}
img { background: var(--bg-1); }
img[loading='lazy'] { opacity: 0; transition: opacity var(--motion-slow) var(--ease-out); }
img[loading='lazy'].img-ready, img[loading='lazy'].img-failed { opacity: 1; }

/* ---------- Boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--bg-0);
  transition: opacity var(--motion-slow) var(--ease-out), visibility 0s linear var(--motion-slow);
}
.boot__mark { font: 600 13px/1 var(--font-mono); letter-spacing: 0.3em; color: var(--text-2); }
.boot.is-done { opacity: 0; visibility: hidden; }
.boot--error { place-items: center start; padding: var(--gutter); }
.fatal { max-width: 560px; }
.fatal h1 { font: 600 28px/1.1 var(--font-display); margin: 12px 0; }
.fatal p { color: var(--text-1); margin-bottom: 20px; }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 68px;
  transition: background-color var(--motion-normal), box-shadow var(--motion-normal), transform var(--motion-slow) var(--ease-out);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-0) 97%, transparent);
  box-shadow: 0 1px 0 var(--line);
}
.nav__in { height: 100%; display: flex; align-items: center; gap: var(--space-5); }
.nav__brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; }
.nav__mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--face); box-shadow: var(--sh-raised);
  font: 600 13px/1 var(--font-display); font-variation-settings: 'wdth' 110; letter-spacing: 0.02em;
  color: var(--text-0);
}
.nav__name { font: 560 15px/1 var(--font-display); font-variation-settings: 'wdth' 112; letter-spacing: 0.01em; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__link { position: relative; font-size: 14px; color: var(--text-1); padding: 8px 0; transition: color var(--motion-fast); }
.nav__link:hover, .nav__link[aria-current='true'] { color: var(--text-0); }
.nav__link::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent-ui);
  transform: scale(0); transition: transform var(--motion-spring) var(--ease-spring);
}
.nav__link[aria-current='true']::after { transform: scale(1); }
.nav__menu { display: none; }

.sheet {
  position: fixed; inset: 0; z-index: 99;
  background: var(--bg-0);
  padding: 88px var(--gutter) 32px;
  display: flex; flex-direction: column;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path var(--motion-slow) var(--ease-in-out), visibility 0s linear var(--motion-slow);
}
.sheet.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path var(--motion-slow) var(--ease-in-out); }
.sheet__links { display: grid; border-top: 1px solid var(--line); }
.sheet__links a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  font: 560 30px/1 var(--font-display); font-variation-settings: 'wdth' 108; letter-spacing: -0.01em;
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--motion-normal) var(--ease-out), transform var(--motion-spring) var(--ease-spring);
}
.sheet.is-open .sheet__links a { opacity: 1; transform: none; transition-delay: calc(80ms + var(--i) * 40ms); }
.sheet__links a span { font: 500 12px var(--font-mono); color: var(--text-2); }
.sheet__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-1); font-size: 14px; }

.menu-btn { gap: 10px; }
.menu-btn__bars { position: relative; width: 16px; height: 10px; }
.menu-btn__bars::before, .menu-btn__bars::after {
  content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 1px;
  transition: transform var(--motion-normal) var(--ease-out), top var(--motion-normal) var(--ease-out);
}
.menu-btn__bars::before { top: 1px; }
.menu-btn__bars::after { top: 7.5px; }
[aria-expanded='true'] .menu-btn__bars::before { top: 4.25px; transform: rotate(45deg); }
[aria-expanded='true'] .menu-btn__bars::after { top: 4.25px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__menu { display: inline-flex; }
  .nav { height: 60px; }
}
body.menu-open { overflow: hidden; }

/* ==========================================================================
   Sections
   ========================================================================== */
.sec { padding-block: var(--section-y); position: relative; }
.sec[data-spacing='compact'] { padding-block: clamp(48px, 6vw, 88px); }
.sec[data-spacing='standard'] { padding-block: clamp(72px, 10vw, 136px); }
.sec[data-spacing='generous'] { padding-block: clamp(96px, 13vw, 184px); }
.sec + .sec { border-top: 1px solid var(--line); }
.sec__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-5); margin-bottom: clamp(32px, 5vw, 64px); }
.sec__eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
/* Chapters: visible sections are numbered in reading order */
main { counter-reset: chapter; }
.sec:not(.hero):not([data-hidden]) { counter-increment: chapter; }
.sec__eyebrow::before {
  content: counter(chapter, decimal-leading-zero);
  padding-right: 30px; color: var(--accent-ui);
  background: linear-gradient(var(--accent-dim), var(--accent-dim)) right center / 20px 1px no-repeat;
}
.sec__intro { margin-top: 14px; max-width: 52ch; color: var(--text-1); }
.sec__aside { text-align: right; }

/* Reveal system — only elements explicitly marked with data-reveal move */
[data-reveal] { transition: opacity var(--motion-slow) var(--ease-out), transform var(--motion-spring) var(--ease-spring), clip-path var(--motion-emphasis) var(--ease-in-out); transition-delay: calc(var(--i, 0) * 60ms); }
.js [data-reveal='rise']:not(.is-in) { opacity: 0; transform: translateY(var(--reveal-y)); }
.js [data-reveal='fade']:not(.is-in) { opacity: 0; }
.js [data-reveal='clip']:not(.is-in) { clip-path: inset(0 0 100% 0); }
.js [data-reveal='clip'].is-in { clip-path: inset(0 0 0 0); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(64px, 8vw, 112px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero__name { font-size: clamp(46px, 7.6vw, 112px); }
.hero__name .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__name .line > span { display: block; }
.js .hero__name .line > span { transform: translateY(105%); transition: transform var(--motion-emphasis) var(--ease-in-out); transition-delay: calc(var(--i, 0) * 90ms); }
.hero.is-in .hero__name .line > span { transform: none; }
.has-scenes .hero__name .line > span { transition: none; }
.hero__roles { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 22px; }
.hero__roles li { display: inline-flex; align-items: center; gap: 14px; }
.hero__roles li + li::before { content: ''; width: 5px; height: 5px; background: var(--accent-dim); transform: rotate(45deg); }
.hero__statement { margin-top: 26px; max-width: 34ch; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; color: var(--text-1); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 36px; }
.hero__cta .u-link { margin-left: 8px; color: var(--text-1); font-size: 15px; }
.hero__cta .u-link:hover { color: var(--text-0); }
.status {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 48px; padding: 10px 14px 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg-1); box-shadow: var(--sh-inset);
  max-width: 100%;
}
.status__text { font-size: 14px; color: var(--text-0); overflow-wrap: anywhere; }
.status .t-label { color: var(--accent-ui); white-space: nowrap; }

@media (max-width: 1023px) {
  .hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sec__head { grid-template-columns: 1fr; }
  .sec__aside { text-align: left; }
  .hero__statement { font-size: 18px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__cta .u-link { flex-basis: 100%; margin: 4px 0 0; }
  .status { margin-top: 32px; flex-wrap: wrap; gap: 6px 12px; }
}

/* ==========================================================================
   Work
   ========================================================================== */
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: clamp(28px, 4vw, 48px); }

/* Segmented control: inset track, raised thumb that slides */
.seg {
  --tx: 0px; --tw: 0px;
  position: relative; display: inline-flex; padding: 4px; gap: 2px;
  border-radius: var(--r-md); background: var(--bg-1); box-shadow: var(--sh-inset);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--tw);
  transform: translateX(var(--tx));
  border-radius: calc(var(--r-md) - 3px);
  background: var(--face-hi); box-shadow: var(--sh-raised);
  transition: transform var(--motion-spring) var(--ease-spring), width var(--motion-spring) var(--ease-spring);
}
.seg__btn {
  position: relative; z-index: 1;
  height: 34px; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font: 500 12px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-2); white-space: nowrap;
  transition: color var(--motion-fast);
}
.seg__btn:hover { color: var(--text-1); }
.seg__btn[aria-pressed='true'] { color: var(--text-0); }
.seg__btn sup { font-size: 9px; margin-left: 4px; color: var(--accent-ui); vertical-align: 4px; }

.search {
  position: relative; display: flex; align-items: center;
  width: min(320px, 100%);
  border-radius: var(--r-md); background: var(--bg-1); box-shadow: var(--sh-inset);
}
.search .ico { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 36px 0 36px;
  border: 0; background: none; font-size: 15px;
}
.search input::placeholder { color: var(--text-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { position: absolute; right: 4px; width: 34px; height: 34px; border: 0; background: none; color: var(--text-2); cursor: pointer; border-radius: var(--r-sm); display: grid; place-items: center; }
.search__clear:hover { color: var(--text-0); }
.search__clear[hidden] { display: none; }
.results-note { width: 100%; font: 500 12px var(--font-mono); color: var(--text-2); letter-spacing: 0.04em; min-height: 1em; }

.projects { display: grid; gap: clamp(64px, 9vw, 128px); }
.projects.has-compact-run { gap: clamp(64px, 9vw, 128px); }
.pj { position: relative; }
.pj[hidden] { display: none; }
.pj__num { font: 500 13px var(--font-mono); color: var(--text-2); letter-spacing: 0.04em; }
.pj__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.pj__meta .sep { width: 3px; height: 3px; background: var(--text-2); border-radius: 50%; }
.pj__feat { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ui); }
.pj__feat .led { width: 5px; height: 5px; box-shadow: none; }
.pj__title { overflow-wrap: anywhere; font-family: var(--font-display); font-variation-settings: 'wdth' 106; font-weight: 560; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; font-size: clamp(28px, 3.2vw, 46px); }
.pj__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--motion-normal) var(--ease-out); }
.pj__title a:hover { background-size: 100% 1px; }
.pj--featured .pj__title { font-size: clamp(32px, 3.8vw, 56px); }
.pj__summary { color: var(--text-1); max-width: 46ch; }
.pj__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.pj__actions .u-link { font-size: 14px; color: var(--text-1); }
.pj__actions .u-link:hover { color: var(--text-0); }
.pj__text { display: grid; gap: 18px; align-content: start; }

/* Media frame — the tactile part of a project */
.frame {
  --lx: 50%; --ly: 0%;
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  box-shadow: var(--sh-frame);
  transform: translateY(0);
  transition: transform var(--motion-spring) var(--ease-spring), box-shadow var(--motion-slow) var(--ease-out);
  cursor: pointer;
  isolation: isolate;
}
.frame img, .frame .img-missing { width: 100%; height: 100%; object-fit: cover; transition: transform var(--motion-emphasis) var(--ease-out); }
.frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(92, 68, 38, 0.1);
  background: radial-gradient(600px circle at var(--lx) var(--ly), rgba(255, 253, 246, 0.14), transparent 50%);
  opacity: 0; transition: opacity var(--motion-slow);
}
button.frame { width: 100%; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; }
.frame:hover { transform: translateY(-3px); }
.frame:hover::after { opacity: 1; }
.frame:hover img { transform: scale(1.02); }
.frame:active { transform: translateY(1px) scale(0.995); transition-duration: var(--motion-fast); }
.frame:active img { transform: scale(1.005); }
.frame__cue {
  position: absolute; right: 14px; top: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--r-sm);
  background: rgba(43, 36, 28, 0.9); color: var(--panel-ink);
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--motion-normal) var(--ease-out), transform var(--motion-normal) var(--ease-out);
}
.frame:hover .frame__cue, .frame:focus-visible .frame__cue { opacity: 1; transform: none; }
@media (hover: none) { .frame__cue { display: none; } }

/* Split */
.pj--split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.pj--split .frame { aspect-ratio: 16 / 10; }
.pj--split.is-flip .frame { order: 2; }
.pj--split .pj__text > .pj__meta { margin-top: 4px; }

/* Wide */
.pj--wide .frame { aspect-ratio: 16 / 8; }
.pj--wide .pj__below { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) auto; gap: 24px 48px; margin-top: 28px; align-items: start; }

/* Editorial */
.pj--editorial { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.pj--editorial .pj__big { grid-column: 1 / span 7; }
.pj--editorial .pj__index { display: block; font: 300 clamp(64px, 9vw, 132px)/0.8 var(--font-mono); color: var(--line-2); letter-spacing: -0.04em; margin-bottom: 20px; }
.pj--editorial .pj__title { font-size: clamp(34px, 4.6vw, 68px); }
.pj--editorial .pj__summary { margin-top: 20px; }
.pj--editorial .pj__meta { margin-top: 20px; }
.pj--editorial .pj__actions { margin-top: 26px; }
.pj--editorial .frame { grid-column: 7 / span 6; aspect-ratio: 4 / 3; margin-top: clamp(24px, 6vw, 96px); }

/* Immersive — breaks out of the column */
@media (min-width: 1400px) { .pj--immersive { margin-inline: calc((var(--maxw) - 2 * var(--gutter) - min(100vw - 2 * var(--gutter), 1560px)) / 2); } }
.pj--immersive .frame { aspect-ratio: 21 / 9; border-radius: var(--r-lg); }
.pj--immersive .frame::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(35, 29, 22, 0.86) 0%, rgba(35, 29, 22, 0.42) 45%, transparent 70%),
    linear-gradient(0deg, rgba(35, 29, 22, 0.96) 0%, rgba(35, 29, 22, 0.7) 30%, transparent 62%);
}
.pj--immersive .pj__over {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px;
  padding: clamp(20px, 3.4vw, 48px);
  pointer-events: none;
}
.pj--immersive .pj__over a, .pj--immersive .pj__over button { pointer-events: auto; }
.pj--immersive .pj__over .pj__text { gap: 14px; max-width: 640px; }
.pj--immersive .pj__summary { color: var(--metal); }
.pj--immersive .frame:hover { transform: none; }

/* Compact */
.pj--compact {
  display: grid; grid-template-columns: 56px minmax(0, 4fr) minmax(0, 5fr) 140px 64px 40px; align-items: center; gap: 20px;
  padding: 22px 12px; margin-inline: -12px;
  border-radius: var(--r-md);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--motion-fast), box-shadow var(--motion-normal);
}
.pj--compact + .pj--compact { margin-top: calc(clamp(64px, 9vw, 128px) * -1 - 1px); }
.pj--compact:hover { background: var(--bg-1); box-shadow: var(--sh-inset); border-color: transparent; }
.pj--compact .pj__title { font-size: clamp(22px, 2vw, 28px); }
.pj--compact .pj__summary { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
.pj--compact .go { justify-self: end; color: var(--text-2); transition: transform var(--motion-normal) var(--ease-out), color var(--motion-fast); }
.pj--compact:hover .go { transform: translateX(4px); color: var(--accent-ui); }
.pj--compact .thumb {
  position: absolute; right: 90px; top: 50%; width: 180px; aspect-ratio: 16 / 10; z-index: 3;
  border-radius: var(--r-sm); overflow: hidden; pointer-events: none; box-shadow: var(--sh-frame);
  clip-path: inset(50% 0 50% 0); transform: translateY(-50%);
  transition: clip-path var(--motion-slow) var(--ease-in-out);
}
.pj--compact .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pj--compact:hover .thumb { clip-path: inset(0 0 0 0); }
@media (hover: none) { .pj--compact .thumb { display: none; } }

.empty { padding: 48px 0; border-top: 1px solid var(--line); color: var(--text-1); }
.empty strong { display: block; color: var(--text-0); font-size: 18px; font-weight: 500; margin-bottom: 4px; }

@media (max-width: 900px) {
  .pj--split, .pj--editorial { grid-template-columns: 1fr; }
  .pj--split.is-flip .frame { order: 0; }
  .pj--editorial .pj__big, .pj--editorial .frame { grid-column: auto; }
  .pj--editorial .frame { aspect-ratio: 16 / 10; margin-top: 8px; order: -1; }
  .pj--editorial .pj__index { font-size: 56px; margin-bottom: 8px; }
  .pj--wide .frame { aspect-ratio: 16 / 10; }
  .pj--wide .pj__below { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .pj--immersive { margin-inline: 0; }
  .pj--immersive .frame { aspect-ratio: auto; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
  .pj--immersive .frame > img, .pj--immersive .frame > .img-missing { aspect-ratio: 16 / 10; height: auto; }
  .pj--immersive .frame::before { display: none; }
  .pj--immersive .pj__over { position: static; grid-template-columns: 1fr; padding: 20px 18px 22px; }
  .pj--compact { grid-template-columns: 36px minmax(0, 1fr) auto 24px; gap: 4px 12px; padding: 18px 8px; margin-inline: -8px; }
  .pj--compact .pj__summary { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
  .pj--compact .cat { display: none; }
}

/* ==========================================================================
   Project detail
   ========================================================================== */
.detail { padding-top: clamp(24px, 4vw, 48px); padding-bottom: var(--section-y); }
.back { display: inline-flex; margin-bottom: clamp(28px, 4vw, 48px); }
.detail__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 80px); align-items: end; }
.detail__title { font-size: clamp(40px, 6.4vw, 96px); margin-top: 18px; overflow-wrap: anywhere; }
.detail__title.is-long { font-size: clamp(32px, 4.2vw, 60px); line-height: 1.02; }
.detail__summary { margin-top: 24px; max-width: 40ch; }
.facts { display: grid; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 11px/1.9 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.facts dd { color: var(--text-0); font-size: 15px; overflow-wrap: anywhere; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.detail__hero { margin-top: clamp(40px, 6vw, 80px); }
.detail__hero .frame { aspect-ratio: 16 / 9; cursor: zoom-in; }
.detail__hero .frame:hover { transform: none; }
.story { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); margin-top: clamp(56px, 8vw, 112px); }
.toc { position: sticky; top: 96px; align-self: start; display: grid; gap: 2px; }
.toc a { display: flex; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--text-2); transition: color var(--motion-fast); }
.toc a .t-num { font-size: 11px; padding-top: 3px; }
.toc a:hover, .toc a[aria-current='true'] { color: var(--text-0); }
.toc a[aria-current='true'] .t-num { color: var(--accent-ui); }
.story__body { display: grid; gap: clamp(48px, 7vw, 88px); min-width: 0; }
.block h2 { font: 560 clamp(24px, 2.4vw, 32px)/1.1 var(--font-display); font-variation-settings: 'wdth' 104; letter-spacing: -0.015em; margin: 10px 0 18px; }
.block .t-body { font-size: 18px; }
.features { counter-reset: f; display: grid; border-top: 1px solid var(--line); max-width: 72ch; }
.features li { counter-increment: f; display: grid; grid-template-columns: 44px minmax(0, 1fr); padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-1); }
.features li::before { content: counter(f, decimal-leading-zero); font: 500 12px/1.9 var(--font-mono); color: var(--accent-ui); }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-list .chip { height: 30px; padding: 0 10px; font-size: 12px; }
.tech-list .chip small { margin-left: 8px; color: var(--text-2); font-size: 10px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gallery figure:first-child:nth-last-child(odd), .gallery figure:only-child { grid-column: 1 / -1; }
.gallery .frame { aspect-ratio: 16 / 10; cursor: zoom-in; }
.gallery figcaption { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--sh-frame); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.link-list { display: grid; border-top: 1px solid var(--line); max-width: 72ch; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); transition: color var(--motion-fast), padding var(--motion-normal) var(--ease-out); }
.link-list a:hover { color: var(--accent-ui); padding-left: 6px; }
.link-list small { color: var(--text-2); font: 500 12px var(--font-mono); overflow-wrap: anywhere; }

.next {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: center; gap: 32px;
  margin-top: clamp(72px, 10vw, 144px); padding-top: 32px; border-top: 1px solid var(--line);
}
.next__title { font-size: clamp(30px, 4.4vw, 64px); margin-top: 12px; transition: color var(--motion-fast); }
.next:hover .next__title { color: var(--accent-ui); }
.next .frame { aspect-ratio: 16 / 10; }

@media (max-width: 900px) {
  .detail__head { grid-template-columns: 1fr; align-items: start; }
  .story { grid-template-columns: 1fr; }
  .toc { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .next { grid-template-columns: 1fr; }
  .next .frame { display: none; }
  .detail__hero .frame { aspect-ratio: 4 / 3; }
}

/* ==========================================================================
   About
   ========================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__statement { max-width: 18ch; }
.about__body { margin-top: clamp(28px, 4vw, 48px); columns: 2 280px; column-gap: 40px; }
.about__body p { break-inside: avoid; margin-bottom: 1em; }
.about__side { display: grid; gap: 28px; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--sh-frame);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; background: transparent; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.stat { padding: 20px 20px 4px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat__v { display: block; font: 400 clamp(36px, 4vw, 56px)/1 var(--font-mono); letter-spacing: -0.04em; color: var(--text-0); }
.stat__l { display: block; margin-top: 10px; }
.about-more { margin-top: 28px; }
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about__side { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: start; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat { padding-bottom: 16px; }
}
@media (max-width: 520px) { .about__side { grid-template-columns: 1fr; } .portrait { max-width: 260px; } }

/* ==========================================================================
   Skills
   ========================================================================== */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px clamp(24px, 4vw, 56px); }
.skill-group h3 { padding-bottom: 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.skill { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skill__name { font-size: 17px; }
.skill__name .led { width: 5px; height: 5px; box-shadow: none; margin-left: 8px; vertical-align: 3px; }
.skill__use { font: 500 11px/1.9 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.skill__use.has { color: var(--accent-ui); }
.skill__desc { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; }

/* ==========================================================================
   Journey
   ========================================================================== */
.journey { position: relative; display: grid; }
.jr { display: grid; grid-template-columns: minmax(80px, 2fr) 28px minmax(0, 8fr); gap: 0 20px; }
.jr__date { font: 400 clamp(20px, 2.1vw, 30px)/1.15 var(--font-mono); letter-spacing: -0.04em; color: var(--text-2); padding-top: 2px; transition: color var(--motion-normal); }
.jr:hover .jr__date { color: var(--text-0); }
.jr__rail { position: relative; display: flex; justify-content: center; }
.jr__rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.jr:first-child .jr__rail::before { top: 12px; }
.jr:last-child .jr__rail::before { bottom: auto; height: 12px; }
.jr__node { position: relative; margin-top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg-0); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.jr[data-cat='milestone'] .jr__node, .jr[data-cat='competition'] .jr__node { box-shadow: inset 0 0 0 1.5px var(--accent-ui); background: var(--accent-wash); }
.jr__body { padding-bottom: clamp(36px, 5vw, 56px); }
.jr__body h3 { font-size: 20px; font-weight: 500; line-height: 1.3; margin: 6px 0 8px; }
.jr__body .t-body { font-size: 16px; }
.jr__body .u-link { margin-top: 12px; font-size: 14px; color: var(--text-1); }
@media (max-width: 640px) {
  .jr { grid-template-columns: 20px minmax(0, 1fr); gap: 0 14px; }
  .jr__date { grid-column: 2; grid-row: 1; font-size: 22px; }
  .jr__rail { grid-column: 1; grid-row: 1 / span 2; }
  .jr__body { grid-column: 2; }
}

/* ==========================================================================
   Lab — a tray of specimens, deliberately different from finished work
   ========================================================================== */
.tray-wrap { position: relative; }
.tray {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 16px;
  padding: 16px; margin-inline: -4px;
  border-radius: var(--r-lg);
  background: var(--bg-1); box-shadow: var(--sh-inset);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.spec {
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 300px; padding: 18px;
  border-radius: var(--r-md);
  background: var(--bg-0);
  box-shadow: 0 0 0 1px var(--line);
  position: relative;
}
a.spec { background: var(--face); box-shadow: var(--sh-raised); transition: transform var(--motion-spring) var(--ease-spring), box-shadow var(--motion-normal); }
a.spec:hover { transform: translateY(-3px); box-shadow: var(--sh-raised-hi); }
a.spec:active { transform: translateY(1px); box-shadow: var(--sh-pressed); transition-duration: var(--motion-fast); }
.spec__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stamp { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px dashed var(--text-2); border-radius: var(--r-xs); font: 500 10px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-1); }
.stamp[data-s='exhibited'], .stamp[data-s='prototype'] { border-color: var(--accent-dim); color: var(--accent-ui); }
.spec__img { aspect-ratio: 16 / 10; border-radius: var(--r-sm); overflow: hidden; }
.spec__img img { width: 100%; height: 100%; object-fit: cover; }
.spec__yr { font: 300 56px/0.9 var(--font-mono); letter-spacing: -0.05em; color: var(--line-2); }
.spec h3 { font: 560 21px/1.15 var(--font-display); font-variation-settings: 'wdth' 104; }
.spec p { font-size: 15px; color: var(--text-1); }
.spec .chips { margin-top: auto; }
.spec__go { position: absolute; right: 18px; bottom: 18px; color: var(--text-2); }
.tray-nav { display: flex; gap: 8px; }
.tray-nav[hidden] { display: none; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact__head .t-display { font-size: clamp(40px, 6vw, 88px); line-height: 0.98; }
.contact__head .dim { color: var(--text-2); }
.contact__note { margin-top: 28px; max-width: 42ch; color: var(--text-1); }
.channels { display: grid; gap: 10px; }
.channel {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 58px; padding: 8px 8px 8px 16px;
  border-radius: var(--r-md);
  background: var(--face); box-shadow: var(--sh-raised);
  transition: transform var(--motion-spring) var(--ease-spring), box-shadow var(--motion-normal);
}
a.channel:hover { transform: translateY(-2px); box-shadow: var(--sh-raised-hi); }
a.channel:active { transform: translateY(1px); box-shadow: var(--sh-pressed); transition-duration: var(--motion-fast); }
.channel__v { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .ico { margin-right: 10px; color: var(--text-2); }
.channel--row { padding-right: 6px; }
.channel__acts { display: flex; gap: 6px; }
.form { margin-top: 36px; display: grid; gap: 14px; }
.form h3 { margin-bottom: 4px; }
.field { display: grid; gap: 6px; }
.field label { font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 0; border-radius: var(--r-md);
  background: var(--bg-1); box-shadow: var(--sh-inset); font-size: 16px;
  transition: box-shadow var(--motion-normal);
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: var(--sh-inset), 0 0 0 1.5px var(--accent-dim); }
.field [aria-invalid='true'] { box-shadow: var(--sh-inset), 0 0 0 1.5px var(--danger); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form__msg { font-size: 14px; color: var(--text-1); }
.form__msg[data-tone='error'] { color: var(--danger); }
.form__msg[data-tone='ok'] { color: var(--ok); }
@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .channel { grid-template-columns: minmax(0, 1fr) auto; }
  .channel > .t-label { grid-column: 1 / -1; margin-top: 4px; }
  .form__row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Custom pages, 404, footer
   ========================================================================== */
.page { padding-top: clamp(32px, 6vw, 80px); padding-bottom: var(--section-y); }
.page__title { font-size: clamp(44px, 7vw, 104px); margin: 16px 0 clamp(32px, 5vw, 64px); }
.page__blocks { display: grid; gap: 32px; max-width: 760px; }
.page__blocks h2 { font: 560 clamp(24px, 2.6vw, 34px)/1.1 var(--font-display); font-variation-settings: 'wdth' 104; margin-top: 16px; }
.page__blocks .frame { aspect-ratio: 16 / 9; cursor: default; }
.page__blocks .frame:hover { transform: none; }
.page__blocks figcaption { margin-top: 10px; color: var(--text-2); font-size: 14px; }

.nf { min-height: calc(100svh - 68px); display: grid; align-content: center; padding-block: 64px; }
.nf__code { font: 300 clamp(120px, 26vw, 360px)/0.8 var(--font-mono); letter-spacing: -0.07em; color: var(--bg-3); display: flex; }
.nf__code span { display: inline-block; transition: transform var(--motion-spring) var(--ease-spring); }
.nf__code span:nth-child(2) { color: var(--line-2); }
.nf h1 { font-size: clamp(32px, 4.6vw, 64px); margin-top: 24px; }
.nf p { margin-top: 16px; color: var(--text-1); max-width: 44ch; }
.nf__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.foot { border-top: 1px solid var(--line); padding-block: 48px 32px; }
.foot__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.foot__name { font-size: clamp(28px, 4vw, 52px); }
.foot__tag { margin-top: 10px; color: var(--text-1); }
.foot__links { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; font-size: 14px; color: var(--text-1); }
.foot__links a:hover { color: var(--text-0); }
.foot__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .foot__top { grid-template-columns: 1fr; } .foot__links { justify-content: flex-start; } }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lb { position: fixed; inset: 0; z-index: 400; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(8, 8, 8, 0.97); opacity: 0; visibility: hidden; transition: opacity var(--motion-normal) var(--ease-out), visibility 0s linear var(--motion-normal); }
.lb.is-open { opacity: 1; visibility: visible; transition: opacity var(--motion-normal) var(--ease-out); }
.lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gutter); }
.lb__stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; touch-action: pan-y; }
.lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); background: transparent; transition: opacity var(--motion-normal), transform var(--motion-slow) var(--ease-out); }
.lb__stage img.is-leaving { opacity: 0; transform: translateX(calc(var(--dir, 1) * -24px)); }
.lb__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter) 20px; }
.lb__cap { color: var(--text-1); font-size: 14px; }
.lb__nav { display: flex; gap: 8px; }
body.lb-open { overflow: hidden; }

/* ==========================================================================
   Page transitions (View Transitions API when available)
   ========================================================================== */
::view-transition-old(root) { animation: vt-out var(--motion-slow) var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in var(--motion-emphasis) var(--ease-out) both; }
::view-transition-group(pj-hero) { animation-duration: var(--motion-emphasis); animation-timing-function: var(--ease-in-out); }
::view-transition-group(pj-title) { animation-duration: var(--motion-emphasis); animation-timing-function: var(--ease-in-out); }
::view-transition-old(pj-hero), ::view-transition-new(pj-hero) { height: 100%; object-fit: cover; }
@keyframes vt-out { to { opacity: 0; transform: scale(0.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 1ms !important; }
}
.route-enter { animation: vt-in var(--motion-slow) var(--ease-out) both; }

/* ==========================================================================
   Dark "device" scope — code editor, terminals, lightbox, image overlays.
   Re-maps tokens so every component inside reads correctly on dark panels.
   ========================================================================== */
.on-dark, .ws-code, .ws-term, .stackterm, .pj--immersive .pj__over, .lb, .frame__cue {
  --text-0: var(--panel-ink);
  --text-1: var(--panel-ink-1);
  --text-2: var(--panel-ink-2);
  --metal: #D9CFB8;
  --line: var(--panel-line);
  --line-2: #4A3F30;
  --bg-0: var(--panel-2);
  --bg-1: #2F281F;
  --bg-2: #382F25;
  --bg-3: #43392C;
  --hl: rgba(255, 244, 214, 0.07);
  --hl-soft: rgba(255, 244, 214, 0.03);
  --sd: rgba(10, 7, 3, 0.5);
  --face: linear-gradient(180deg, #3A3127 0%, #30291F 100%);
  --face-hi: linear-gradient(180deg, #41372B 0%, #362E23 100%);
  --sh-inset: inset 2px 2px 5px rgba(0, 0, 0, 0.45), inset -1px -1px 0 rgba(255, 244, 214, 0.04);
  --sh-raised: inset 0 1px 0 rgba(255, 244, 214, 0.07), 4px 6px 14px rgba(10, 7, 3, 0.5);
  --sh-raised-hi: inset 0 1px 0 rgba(255, 244, 214, 0.08), 7px 11px 22px rgba(10, 7, 3, 0.55);
  --accent-hi: #B8C375;
  color: var(--text-0);
}
.pj--immersive .pj__feat { color: var(--accent-hi); }
.pj--immersive .pj__feat .led { background: var(--accent-hi); }
.lb { background: rgba(28, 23, 17, 0.97); }

/* ==========================================================================
   Developer scenes — workstation, stack terminal, circuit spine, ribbon
   ========================================================================== */
.hero { min-height: calc(100svh - 68px); display: flex; align-items: center; }
.hero > .wrap { width: 100%; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); } }
.hero__name .accent-dot { color: var(--accent-ui); }

.ws {
  --lx: 40%; --ly: 30%;
  position: relative; aspect-ratio: 1 / 0.92; width: 100%;
  transform-origin: 50% 40%;
}
.ws-traces { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ws-traces path {
  fill: none; stroke: var(--copper-dim); stroke-width: 2.2; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0;
}
.ws.is-done .ws-traces path { stroke: var(--copper); transition: stroke 1.2s var(--ease-out); }

.ws-code, .ws-term, .stackterm {
  border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: 0 0 0 1px rgba(43, 36, 28, 0.9), 14px 24px 50px rgba(92, 68, 38, 0.28), 3px 5px 10px rgba(92, 68, 38, 0.18);
}
.ws-code, .ws-term { position: absolute; }
.ws-code { top: 0; left: 0; width: 76%; z-index: 2; }
.ws-code__bar, .ws-term__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  height: 34px; padding: 0 12px; border-bottom: 1px solid var(--panel-line);
  background: rgba(0, 0, 0, 0.14);
}
.ws-code__bar .t-label, .ws-term__bar .t-label { color: var(--panel-ink-2); }
.ws-tab { font: 500 12px var(--font-mono); color: var(--panel-ink); display: inline-flex; align-items: center; gap: 8px; }
.ws-tab::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--syn-key); }
.ws-code__body, .ws-term__body, .stackterm__body {
  margin: 0; font: 400 clamp(11px, 0.95vw, 13.5px)/1.75 var(--font-mono); color: var(--panel-ink-1);
  white-space: pre; overflow: hidden;
}
.ws-code__body { padding: 14px 16px 18px 0; }
.ws-ln { --p: 1; position: relative; display: block; }
.has-scenes .ws:not(.is-done) .ws-ln { --p: 0; }
.ws-no { display: inline-block; width: 3.4ch; padding-right: 1.4ch; text-align: right; color: #6A5D48; user-select: none; }
.ws-tx { display: inline-block; vertical-align: top; clip-path: inset(0 calc(100% - var(--p) * var(--n) * 1ch) 0 0); }
.ws-caret {
  position: absolute; top: 0.3em; left: calc(3.4ch + var(--p) * var(--n) * 1ch); width: 0.55ch; height: 1.15em;
  background: var(--syn-key);
}
.ws:not(.is-done) .ws-caret { animation: caret 1s steps(1) infinite; }
.ws.is-done .ws-caret { position: relative; display: inline-block; left: 3.4ch; top: 0.2em; animation: caret 1s steps(1) 4; opacity: 0; }
@keyframes caret { 0% { opacity: 1; } 50% { opacity: 0; } }
.syn-key { color: var(--syn-key); }
.syn-str { color: var(--syn-str); }
.syn-prop { color: var(--syn-prop); }
.syn-com { color: var(--syn-com); font-style: italic; }
.syn-pun, .syn-id { color: var(--syn-pun); }
.syn-num { color: var(--syn-key); }
a.syn-link { text-decoration: underline; text-decoration-color: rgba(221, 176, 126, 0.35); text-underline-offset: 3px; transition: color var(--motion-fast), text-decoration-color var(--motion-fast); }
a.syn-link:hover { color: var(--panel-ink); text-decoration-color: currentColor; }

.ws-term { left: 4%; bottom: 0; width: 58%; z-index: 3; }
.ws-term__body { padding: 10px 14px 14px; }
.ws-tl { display: block; color: var(--syn-key); }
.ws-tl.is-cmd { color: var(--panel-ink); }

.ws-chip { position: absolute; right: 0; bottom: 3%; width: 32%; z-index: 4; }
.ws-chip__svg { width: 100%; height: auto; overflow: visible; }
.ws-board { fill: #4E5A26; stroke: #3B4419; stroke-width: 1; }
.ws-shield { fill: #CFC6B1; stroke: #A99E86; }
.ws-ant { fill: none; stroke: #D8B06F; stroke-width: 2; }
.ws-pins rect { fill: #B48A55; }
.ws-label { font: 600 17px var(--font-mono); fill: #3A3024; letter-spacing: 0.06em; }
.ws-sub { font: 400 8px var(--font-mono); fill: #6F624D; letter-spacing: 0.08em; }
.ws-led { fill: #7C8A44; transition: fill 1s var(--ease-out); }
.ws.is-done .ws-led { fill: #D7E58A; }
.ws-chip::after {
  /* contact shadow under the board (cheaper than an SVG filter) */
  content: ''; position: absolute; left: 8%; right: 4%; bottom: -8%; height: 18%;
  background: radial-gradient(closest-side, rgba(92, 68, 38, 0.32), transparent); z-index: -1;
}

@media (max-width: 1023px) {
  .hero { min-height: 0; }
  .ws { max-width: 640px; margin-top: 12px; aspect-ratio: 1 / 1.02; }
}
@media (max-width: 560px) {
  .ws { aspect-ratio: auto; display: grid; gap: 12px; }
  .ws-traces, .ws-chip { display: none; }
  .ws-code, .ws-term { position: relative; width: 100%; left: 0; }
  .ws-code__body, .ws-term__body { font-size: 11px; }
}

/* Stack ribbon — technologies drift with scroll */
.ribbon { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-1); padding: 18px 0; }
.ribbon__track { display: flex; gap: 48px; width: max-content; will-change: transform; }
.ribbon__item { display: inline-flex; align-items: center; gap: 48px; font: 500 clamp(22px, 3vw, 40px)/1 var(--font-display); font-variation-settings: 'wdth' 118; letter-spacing: -0.01em; color: var(--text-1); white-space: nowrap; }
.ribbon__item::after { content: ''; width: 10px; height: 10px; background: var(--accent-ui); transform: rotate(45deg); }
.ribbon__item.is-hi { color: var(--text-0); }

/* Scroll progress (brown, like the scrollbar) */
.progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 150; background: var(--brown); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* Stack terminal */
.skills-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.skills-split__term { position: sticky; top: 96px; }
.skills-split .skills { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stackterm__body { padding: 14px 16px; font-size: 13px; }
.st-l { display: block; color: var(--panel-ink-1); }
.st-l.is-cmd { color: var(--panel-ink); margin-top: 6px; }
.st-l.is-cmd:first-child { margin-top: 0; }
.st-l.is-hi { color: var(--syn-key); }
.has-scenes .st-l { opacity: 0; transform: translateX(-6px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
.has-scenes .st-l.is-on { opacity: 1; transform: none; }
.bgraph { display: flex; gap: 14px; align-items: flex-end; padding: 4px 16px 6px; }
.bgraph__col { display: grid; gap: 8px; justify-items: center; }
.bgraph__cells { display: flex; flex-direction: column-reverse; gap: 4px; }
.bgraph i { width: 16px; height: 16px; border-radius: 3px; background: #1E1913; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5); }
.bgraph i.on { background: #5B6629; }
.has-scenes .bgraph i.on { background: #1E1913; transition: background-color 0.6s var(--ease-out); }
.has-scenes .bgraph i.on.is-lit, .bgraph i.on.is-lit { background: var(--syn-key); box-shadow: none; }
.bgraph span { font: 500 11px var(--font-mono); color: var(--panel-ink-2); }
.bgraph__note { padding: 4px 16px 16px; font-size: 12px; color: var(--panel-ink-2); }
@media (max-width: 900px) {
  .skills-split { grid-template-columns: 1fr; }
  .skills-split__term { position: static; }
}

/* Journey progress line */
.journey { position: relative; }
.jr-progress { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-ui); transform-origin: 50% 0; pointer-events: none; }
.jr.is-lit .jr__node { background: var(--accent-ui); box-shadow: inset 0 0 0 1.5px var(--accent-ui), 0 0 0 4px var(--accent-wash); }
.jr.is-lit .jr__date { color: var(--text-0); }

/* Circuit spine */
.spine { position: absolute; left: 0; top: 0; width: 44px; pointer-events: none; overflow: visible; z-index: 0; }
.spine path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spine__base { stroke: var(--line-2); }
.spine__live { stroke: var(--copper); stroke-dasharray: 1; stroke-dashoffset: 1; }
.spine__via { fill: var(--bg-0); stroke: var(--line-2); stroke-width: 2; transition: fill 0.6s var(--ease-out), stroke 0.6s var(--ease-out); }
.spine__via.is-on { fill: var(--accent-ui); stroke: var(--accent-ui); }


/* ==========================================================================
   UX polish
   ========================================================================== */
p, li, dd, figcaption { text-wrap: pretty; }
.on-dark :focus-visible, .ws-code :focus-visible { outline-color: var(--accent-hi, #B8C375); }

/* Hero scroll cue — tells visitors the pinned hero continues */
.hero { position: relative; }
.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 28px;
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 4px; color: var(--text-2);
  transition: color var(--motion-fast);
}
.scroll-cue:hover { color: var(--text-0); }
.scroll-cue__track { position: relative; width: 2px; height: 40px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.scroll-cue__dot { position: absolute; left: 0; top: 0; width: 2px; height: 14px; border-radius: 2px; background: var(--brown); animation: cue 2.4s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: translateY(-14px); } 70%, 100% { transform: translateY(40px); } }
@media (min-width: 1400px) { .scroll-cue { left: calc((100vw - var(--maxw)) / 2 + var(--gutter)); } }
@media (max-width: 1023px) { .scroll-cue { display: none; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue__dot { animation: none; transform: translateY(13px); } }

/* Form: inline errors under each field, character count */
.field__err { min-height: 0; font-size: 13px; color: var(--danger); }
.field__err:empty { display: none; }
.field__row { display: flex; justify-content: space-between; gap: 12px; }
.field__count { margin-left: auto; font-size: 11px; }
.form .spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form[aria-busy='true'] { cursor: progress; }

/* Every pressable thing shows a pointer; disabled things don't */
a[href], button:not(:disabled), [data-href], summary, label[for] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

/* ==========================================================================
   Live circuit background
   ========================================================================== */
.bgfx { position: fixed; inset: 0 0 auto 0; z-index: -1; pointer-events: none; }
.bgfx canvas { position: absolute; left: 0; top: 0; }
.bgfx[hidden] { display: none; }
/* Keep long reading areas calm: a soft ivory veil sits behind text-heavy blocks. */
.about__body, .jr__body, .skill, .story__body .t-body, .page__blocks { position: relative; }
.about__body::before, .story__body .t-body::before {
  content: ''; position: absolute; inset: -12px -16px; z-index: -1; border-radius: 12px;
  background: color-mix(in srgb, var(--bg-0) 82%, transparent);
}
.bg-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 120;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; color: var(--text-1);
  background: var(--face); box-shadow: var(--sh-raised);
  opacity: 0.75; transition: opacity var(--motion-fast), transform var(--motion-spring) var(--ease-spring);
}
.bg-toggle:hover, .bg-toggle:focus-visible { opacity: 1; transform: translateY(-1px); }
.bg-toggle .ico { width: 14px; height: 14px; }
@media (max-width: 560px) { .bg-toggle { width: 36px; height: 36px; left: 10px; bottom: 10px; } }
