/* Hallmark · genre: atmospheric · macrostructure: Marquee Hero · theme: Lumen (Night Foundry) · tone: technical, after-hours · anchor hue: 265 / accent 50
 * nav: N9 edge-aligned minimal · footer: Ft1 mast-headed · hero: name + three real screenshots · enrichment: real media only, square corners
 * fonts: Instrument Serif (display, roman, lowercase) + Geist (body) + JetBrains Mono (UPPERCASE labels)
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5
 */

/* ---------- base: normal-case prose, lowercase display headings, UPPERCASE mono labels ---------- */
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--color-paper); color: var(--color-ink-2);
  font: 400 var(--text-base)/1.6 var(--font-body); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-style: normal; color: var(--color-ink); overflow-wrap: anywhere; min-width: 0; }
h1, h2, .nav__brand { text-transform: lowercase; }
h2 { font: 400 var(--text-xl)/1.04 var(--font-display); letter-spacing: -0.025em; max-width: 22ch; }
h3 { font: 600 var(--text-base)/1.3 var(--font-body); }
em { font-style: normal; }
.label, .eyebrow {
  font-family: var(--font-label); font-size: var(--text-label); letter-spacing: var(--tracking-micro);
  text-transform: uppercase; line-height: 1.5;
}
.eyebrow { color: var(--color-ink); opacity: 0.55; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
::selection { background: var(--color-accent); color: var(--color-accent-ink); }
section[id], article[id] { scroll-margin-top: var(--space-2xl); }

/* ---------- buttons (8 states) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 40px; padding: 0 var(--space-lg); border-radius: var(--radius-pill);
  font: 500 var(--text-sm)/1 var(--font-body); text-transform: lowercase; text-decoration: none; white-space: nowrap; cursor: pointer;
  border: var(--rule-hair) solid transparent;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn--lg { min-height: 52px; padding: 0 var(--space-xl); font-size: var(--text-base); }
.btn--accent { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--accent:hover { background: var(--color-accent-hover); }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-rule-2); }
.btn--ghost:hover { border-color: var(--color-ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn[data-state="loading"] { cursor: progress; color: var(--color-muted); }
.btn[data-state="success"] { border-color: var(--color-accent); color: var(--color-accent); }
.btn[data-state="error"] { border-color: var(--color-accent-2); color: var(--color-accent-2); }

/* ---------- nav · N9 ---------- */
.nav {
  position: absolute; inset: 0 0 auto; z-index: var(--z-sticky);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--page-gutter);
}
.nav__brand { font: 400 1.375rem/1 var(--font-display); color: var(--color-ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.nav__brand:hover { color: var(--color-accent); }
.nav__links { display: flex; gap: var(--space-lg); margin-left: auto; margin-right: var(--space-lg); }
.nav__links a { color: var(--color-muted); text-decoration: none; white-space: nowrap; }
.nav__links a:hover { color: var(--color-ink); }
@media (max-width: 47.99rem) { .nav__links { display: none; } }

/* ---------- hero: name, short text, three real screenshots ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); align-items: end;
  padding: calc(var(--space-3xl) + var(--space-lg)) var(--page-gutter) var(--space-2xl);
  max-width: calc(var(--page-max) + 2 * var(--page-gutter)); margin: 0 auto;
}
.hero__text { display: grid; gap: var(--space-lg); align-content: end; }
.hero__title { font: 400 var(--text-display)/0.95 var(--font-display); letter-spacing: -0.032em; }
.hero__lede { font-size: 1.125rem; line-height: 1.55; max-width: 34em; }
.hero__avail { color: var(--color-muted); }
.dot { display: inline-block; width: 6px; height: 6px; background: var(--color-accent); margin-right: var(--space-xs); vertical-align: 1px; }
.hero__shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.hero__shots .shot:first-child { grid-column: 1 / -1; }
.shot { position: relative; display: block; overflow: hidden; border: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; transition: transform var(--dur-long) var(--ease-out); }
.shot:first-child img { aspect-ratio: 16 / 8; }
.shot .label { position: absolute; left: 0; bottom: 0; padding: var(--space-2xs) var(--space-xs); background: var(--color-scrim); color: var(--color-ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.shot:hover img { transform: scale(1.02); }
.shot:hover { border-color: var(--color-rule-2); }
@media (max-width: 59.99rem) { .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); } }

/* ---------- work entries: media-first, annotated ---------- */
.work, .other, .how, .contact { max-width: var(--page-max); margin: 0 auto; padding: var(--space-3xl) var(--page-gutter) var(--space-xl); }
.work + .work { padding-top: var(--space-2xl); border-top: var(--rule-hair) solid var(--color-rule); }
.work__head { display: grid; gap: var(--space-sm); margin-bottom: var(--space-xl); }
.work__meta { color: var(--color-muted); }

.stage {
  position: relative; margin: 0; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-md); overflow: hidden;
  background: var(--color-paper-2); box-shadow: var(--shadow-depth);
}
.stage video, .stage img, .stage canvas { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.stage[data-lightbox] { cursor: zoom-in; }
.tag {
  position: absolute; left: var(--x); top: var(--y); color: var(--color-ink); white-space: nowrap;
  padding: var(--space-2xs) var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-sm);
  background: var(--color-scrim); pointer-events: none;
}
.tag--right { left: auto; right: var(--x); }
.tag::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--color-accent); border-radius: 1px; margin-right: var(--space-xs); vertical-align: 0; }
.soundbtn {
  position: absolute; right: var(--space-sm); bottom: var(--space-sm); cursor: pointer; white-space: nowrap;
  color: var(--color-ink); background: var(--color-scrim); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill);
  padding: var(--space-2xs) var(--space-sm);
}
.soundbtn:hover { border-color: var(--color-ink-2); }
.soundbtn[aria-pressed="true"] { color: var(--color-accent); border-color: var(--color-accent); }
@media (max-width: 47.99rem) {
  .stage video, .stage img, .stage canvas { aspect-ratio: 4 / 3; }
  .tag--right { display: none; }
}

.work__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-xl); margin-top: var(--space-xl); }
.work__lede { font-size: 1.0625rem; max-width: 36em; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg) var(--space-xl); }
.facts li { font-size: var(--text-sm); line-height: 1.55; padding-top: var(--space-sm); border-top: var(--rule-hair) solid var(--color-rule); }
.facts b { display: block; font: 400 1.75rem/1.1 var(--font-display); color: var(--color-ink); margin-bottom: var(--space-2xs); }
@media (max-width: 59.99rem) { .work__body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 39.99rem) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* cards: hairline + inner emission */
.card {
  margin: 0; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-md); overflow: hidden;
  background: radial-gradient(80% 70% at 50% 0%, var(--color-card-emit), transparent 70%), var(--color-paper-2);
}
.card[data-lightbox] { cursor: zoom-in; }
.card img { width: 100%; height: auto; }
.card figcaption { padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); color: var(--color-muted); border-top: var(--rule-hair) solid var(--color-rule); }
.pair { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: var(--space-md); margin-top: var(--space-xl); align-items: start; }
.pair .card:not(.card--wide) img { aspect-ratio: 9 / 13; object-fit: cover; }
@media (max-width: 47.99rem) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair .card:not(.card--wide) img { aspect-ratio: 4 / 3; }
}


/* ---------- 04 index ---------- */
.other > h2, .how h2 { margin: var(--space-sm) 0 var(--space-xl); }
.index__list { list-style: none; margin: 0; padding: 0; border-top: var(--rule-hair) solid var(--color-rule); }
.index__list li {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 3fr); gap: var(--space-lg); align-items: baseline;
  padding: var(--space-md) 0; border-bottom: var(--rule-hair) solid var(--color-rule);
}
.index__name { font: 400 1.625rem/1.1 var(--font-display); color: var(--color-ink); }
.index__what { font-size: var(--text-sm); }
.index__list .label { color: var(--color-muted); text-align: end; }
@media (max-width: 47.99rem) {
  .index__list li { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
  .index__list .label { text-align: start; }
}

/* ---------- how I work: plain list ---------- */
.how__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg) var(--space-xl); margin: 0; }
.how__list div { padding-top: var(--space-sm); border-top: var(--rule-hair) solid var(--color-rule); }
.how__list dt { font: 400 1.375rem/1.2 var(--font-display); color: var(--color-ink); margin-bottom: var(--space-2xs); }
.how__list dd { margin: 0; font-size: var(--text-sm); }
@media (max-width: 59.99rem) { .how__list { grid-template-columns: minmax(0, 1fr); } }
.stack__list { margin: 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.stack__list div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--space-md); align-items: baseline; padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.stack__list dt { color: var(--color-muted); }
.stack__list dd { margin: 0; color: var(--color-ink-2); }
@media (max-width: 39.99rem) { .stack__list div { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); } }

/* ---------- 06 contact ---------- */
.contact { padding-bottom: var(--space-3xl); }
.contact__line { font-size: var(--text-display); line-height: 0.98; letter-spacing: -0.032em; max-width: 14ch; margin: var(--space-sm) 0 var(--space-xl); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }

/* ---------- footer · Ft1 ---------- */
.foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-lg); align-items: center;
  max-width: var(--page-max); margin: 0 auto; padding: var(--space-lg) var(--page-gutter) var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.foot__word { font: 400 1.375rem/1.1 var(--font-display); color: var(--color-ink); }
.foot__tag { font-size: var(--text-sm); color: var(--color-muted); }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--space-lg); }
.foot__links a { font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; white-space: nowrap; background: linear-gradient(var(--color-accent), var(--color-accent)) 0 100% / 0 1px no-repeat; transition: background-size var(--dur-short) var(--ease-out); }
.foot__links a:hover { background-size: 100% 1px; }
@media (max-width: 47.99rem) { .foot { grid-template-columns: minmax(0, 1fr); } .foot__links { grid-column: 1 / -1; } }

/* ---------- lightbox ---------- */
.lightbox { border: var(--rule-hair) solid var(--color-rule-2); padding: var(--space-md); background: var(--color-paper-2); color: var(--color-ink-2); max-width: min(96vw, 1600px); max-height: 96dvh; border-radius: var(--radius-md); }
.lightbox::backdrop { background: var(--color-scrim); }
.lightbox img { max-width: 100%; max-height: 80dvh; margin: 0 auto; border-radius: var(--radius-sm); }
.lightbox__cap { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); }
.lightbox__close { float: right; margin-bottom: var(--space-sm); }

/* ---------- reveal: fade + 12px rise, section heads first ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 700ms var(--ease-out) both; }
  .rise:nth-child(2) { animation-delay: 60ms; }
  .rise:nth-child(3) { animation-delay: 120ms; }
  .rise:nth-child(4) { animation-delay: 180ms; }
  .rise--late { animation-delay: 200ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 150ms !important; animation-duration: 150ms !important; animation-iteration-count: 1 !important; }
  .btn:active { transform: none; }
}

/* links: pressed state */
.nav__brand:active, .apparatus__list a:active, .foot__links a:active { color: var(--color-accent); }

/* ---------- quiet proof: claim stays in the text, evidence on hover / focus ---------- */
.work__lede { position: relative; }
.proof { color: var(--color-ink); text-decoration: underline dotted var(--color-rule-2); text-underline-offset: 0.25em; cursor: help; outline: none; }
.proof:hover, .proof:focus-visible { text-decoration-color: var(--color-accent); }
.proof__tip {
  position: absolute; left: 0; bottom: calc(100% + var(--space-xs)); z-index: var(--z-raised); width: min(26rem, 100%);
  padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-sm);
  background: var(--color-paper-3); box-shadow: var(--shadow-depth); color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.5;
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.proof:hover .proof__tip, .proof:focus .proof__tip { opacity: 1; transform: none; }

/* ---------- duo: chart + MCP ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-md); align-items: stretch; }
.duo .card { display: grid; grid-template-rows: auto 1fr auto; }
@media (max-width: 47.99rem) { .duo { grid-template-columns: minmax(0, 1fr); } }
.card__head { display: grid; gap: var(--space-2xs); padding: var(--space-md) var(--space-md) 0; }
.card__title { font: 400 1.375rem/1.15 var(--font-display); color: var(--color-ink); }

.bars { position: relative; display: grid; gap: var(--space-md); align-content: center; padding: var(--space-xl) var(--space-md) var(--space-lg); }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: var(--space-2xs) var(--space-sm); outline: none; }
.bar__name { grid-area: name; font-size: var(--text-sm); color: var(--color-ink-2); }
.bar__val { grid-area: val; font: 500 var(--text-sm)/1.4 var(--font-label); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.bar__track { grid-area: track; display: block; height: 10px; }
.bar__fill { display: block; width: var(--w); height: 100%; background: var(--color-rule-2); transition: background var(--dur-short) var(--ease-out); }
.bar--hi .bar__fill { background: var(--color-accent); box-shadow: 0 0 18px var(--color-glow); }
.bar:hover .bar__fill, .bar:focus-visible .bar__fill { background: var(--color-muted); }
.bar--hi:hover .bar__fill, .bar--hi:focus-visible .bar__fill { background: var(--color-accent-hover); }
.bars__budget { position: absolute; top: var(--space-sm); bottom: var(--space-lg); border-left: var(--rule-hair) dashed var(--color-accent); left: calc(var(--space-md) + (100% - 2 * var(--space-md)) * var(--at-n)); }
.bars__budget .label { position: absolute; top: 0; left: var(--space-xs); color: var(--color-accent); white-space: nowrap; }

.mcp__cmd { margin: var(--space-md) var(--space-md) 0; padding: var(--space-sm) var(--space-md); overflow-x: auto; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-paper); }
.mcp__cmd code { font: 400 0.75rem/1.6 var(--font-label); color: var(--color-ink-2); white-space: pre; }
.mcp__tools { margin: 0; padding: var(--space-md); font: 400 0.75rem/1.7 var(--font-label); color: var(--color-ink-2); }

/* the diffuza reel has text burned in: show the full 16:9 frame */
.stage--wide video { aspect-ratio: 16 / 9; object-fit: contain; background: var(--color-paper); }

/* ---------- screenshots: plain grids ---------- */
.stage__cap { position: absolute; left: 0; bottom: 0; padding: var(--space-2xs) var(--space-xs); background: var(--color-scrim); color: var(--color-ink); }
.grid2, .grid3 { display: grid; gap: var(--space-md); margin-top: var(--space-xl); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 img, .grid3 img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.grid3 figure, .phones figure { margin: 0; cursor: zoom-in; border: var(--rule-hair) solid var(--color-rule); overflow: hidden; background: var(--color-paper-2); }
@media (max-width: 47.99rem) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.work__body--top { margin-top: 0; }
.work__note { font-size: var(--text-sm); color: var(--color-muted); max-width: 40em; }
.work__note b { color: var(--color-ink); font-weight: 500; }

/* ---------- other projects ---------- */
.proj { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-xl); padding: var(--space-xl) 0; border-top: var(--rule-hair) solid var(--color-rule); align-items: start; }
.proj__text { display: grid; gap: var(--space-xs); }
.proj__text h3 { font: 400 1.75rem/1.1 var(--font-display); color: var(--color-ink); }
.proj__text .label { color: var(--color-muted); }
.proj__text p:last-child { font-size: var(--text-sm); }
.proj .grid3 { margin-top: 0; }
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.phones img { display: block; width: 100%; height: auto; }
@media (max-width: 59.99rem) { .proj { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); } }
@media (max-width: 39.99rem) { .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.other .index__list { margin-top: var(--space-md); }
