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

:root {
  --color-bg: oklch(0.14 0.012 70);
  --color-ink: oklch(0.96 0.012 80);
  --color-ink-dim: oklch(0.7 0.015 80);
  --color-ember: oklch(0.68 0.19 45);
  --color-ember-deep: oklch(0.45 0.15 40);
  --color-line: oklch(0.32 0.02 70);
  --page-pad: clamp(1rem, 3vw, 2rem);
}

html,
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: 'Handjet', sans-serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

/* ---------- loader ---------- */

.loading::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--color-bg);
}

.loading::after {
  content: '';
  position: fixed;
  z-index: 901;
  top: 50%;
  left: 50%;
  width: 8rem;
  height: 2px;
  margin-left: -4rem;
  background: var(--color-ember);
  animation: loadbar 1.2s cubic-bezier(0.85, 0, 0.15, 1) infinite alternate;
}

@keyframes loadbar {
  from {
    transform: scaleX(0);
    transform-origin: left center;
  }
  to {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

/* ---------- shell ---------- */

main {
  display: grid;
  grid-template-areas: 'stage';
  height: 100%;
}

main > * {
  grid-area: stage;
}

.frame {
  align-self: end;
  z-index: 600;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 2rem;
  padding: var(--page-pad);
  pointer-events: none;
  text-transform: uppercase;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.frame__memory {
  grid-column: 2;
  text-align: center;
  pointer-events: auto;
  transition: color 0.2s;
  opacity: 0.7;
}

/* Bottom-left chrome chip, same box language as the toggle. A direct
   stage child (not inside the home-only .frame) so it persists on
   subpages and over the open menu, mirroring the sound chip. */
.frame__resume {
  align-self: end;
  justify-self: start;
  z-index: 700;
  margin: var(--page-pad);
  pointer-events: auto;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.55rem 0.8rem;
  box-shadow: 4px 4px 0 var(--color-ember);
  transition: box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.frame__resume:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-ember);
}

.frame__resume:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--color-ember);
}

.frame__resume:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

.frame__memory:hover {
  color: var(--color-ember);
}

.frame__memory .frame__letter {
  display: inline-block;
  color: inherit;
}

.frame p {
  margin: 0;
}

/* ---------- wordmark ---------- */

.wordmark {
  align-self: start;
  justify-self: start;
  z-index: 700;
  margin: var(--page-pad);
  cursor: pointer;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: inherit;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.1em;
  padding: 0.65rem 0.9rem;
  /* Same box language as the toggle and resume chip: permanent hard
     offset shadow that grows on hover and presses on active. */
  box-shadow: 5px 5px 0 var(--color-ember);
  transition: box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s, border-color 0.2s;
}

.wordmark:hover {
  color: var(--color-ember);
  border-color: var(--color-ember);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--color-ember);
}

.wordmark:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--color-ember);
}

.wordmark:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

/* ---------- toggle ---------- */

.toggle {
  align-self: start;
  justify-self: end;
  z-index: 700;
  margin: var(--page-pad);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: inherit;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.65rem 1.1rem;
  box-shadow: 5px 5px 0 var(--color-ember);
  transition: box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--color-ember);
}

.toggle:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--color-ember);
}

.toggle:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

.toggle svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

/* ---------- sound chip ---------- */

/* Bottom-right chrome corner, same box language as the other chips.
   Persists across views (unlike the home-only .frame). */
.soundchip {
  align-self: end;
  justify-self: end;
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: var(--page-pad);
  cursor: pointer;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.55rem 0.8rem;
  box-shadow: 4px 4px 0 var(--color-ember);
  transition: box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.soundchip:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-ember);
}

.soundchip:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--color-ember);
}

.soundchip:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

/* Icon-only on phones: the label would crowd the Franky memory line on
   home and eat into card content on scrolling pages. */
@media (max-width: 760px) {
  .soundchip {
    gap: 0;
    padding: 0.6rem 0.65rem;
  }

  .soundchip__label {
    display: none;
  }
}

/* Three-bar mini equalizer: dances while sound is on, flatlines muted. */
.soundchip__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 0.85em;
}

.soundchip__bars i {
  width: 3px;
  height: 30%;
  background: var(--color-ember);
  transition: height 0.3s;
}

.soundchip.is-on .soundchip__bars i {
  animation: eq 0.9s ease-in-out infinite alternate;
}

.soundchip.is-on .soundchip__bars i:nth-child(2) {
  animation-duration: 0.7s;
  animation-delay: -0.25s;
}

.soundchip.is-on .soundchip__bars i:nth-child(3) {
  animation-duration: 1.1s;
  animation-delay: -0.6s;
}

@keyframes eq {
  from {
    height: 25%;
  }
  to {
    height: 100%;
  }
}

/* ---------- CRT overlay ---------- */

/* Whole-site scanlines + corner vignette, faint enough to read as
   texture, never as dirt on the photos. Sits above everything including
   the gate so the cabinet glass covers the full experience. */
.crt {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  background-image: repeating-linear-gradient(
      0deg,
      oklch(0 0 0 / 0.11) 0,
      oklch(0 0 0 / 0.11) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 62%, oklch(0 0 0 / 0.32) 100%);
}

/* ---------- polish ---------- */

::selection {
  background: var(--color-ember);
  color: var(--color-bg);
}

/* Terminal-thin scrollbars on the scrolling page views. */
.page::-webkit-scrollbar {
  width: 6px;
}

.page::-webkit-scrollbar-track {
  background: transparent;
}

.page::-webkit-scrollbar-thumb {
  background: var(--color-line);
  border-radius: 0;
}

.page::-webkit-scrollbar-thumb:hover {
  background: var(--color-ember);
}

/* ---------- cover tiles ---------- */

.cover {
  z-index: 300;
  display: grid;
  /* Definite percentage tracks rather than `1fr`: with `1fr` (which
     always includes an automatic minimum content-size contribution),
     aspect-ratio tiles here would feed back into the row/column
     track-sizing pass whenever a tile carried any vertical offset,
     ballooning both row heights and, cascading through the sizing
     algorithm, unrelated column widths. Percentage tracks resolve
     directly from the (definite) container size with no content-based
     negotiation, so they stay exactly 12.5%/25% regardless of any
     per-item offset. */
  grid-template-columns: repeat(8, 12.5%);
  grid-template-rows: repeat(4, 25%);
  overflow: hidden;
  pointer-events: none;
}

.cover__item {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  will-change: transform, opacity;
}

.cover__image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.72) contrast(1.3) grayscale(1) sepia(0.75) saturate(3.4) hue-rotate(-28deg) brightness(0.72) contrast(1.3);
  will-change: transform;
}

/* Wheat/poppy-field tile reads golden-lime under the standard duotone
   chain (its source highlights are too bright/warm-neutral to fully
   fold into the ember family). Redefine its filter chain with deeper
   pre-darkening and a stronger red-ward hue push so it lands in the
   same ember register as the rest of the grid. */
.cover__item:nth-child(10) .cover__image {
  filter: brightness(0.52) contrast(1.35) grayscale(1) sepia(0.75) saturate(3.4) hue-rotate(-34deg) brightness(0.58) contrast(1.35) saturate(1.15);
}

/* Large collage, ~2.5x the original tile scale (8x4 grid vs the old
   20x10), recomposed onto a balancing diagonal after the previous
   scatter piled up in the bottom-left and skewed left-heavy. Two 2x2
   anchor tiles (#3 bottom-left, #12 top-right) carry most of the visual
   weight on opposite corners; nine single-cell tiles fill the rest.
   Three tiles whose source photos read weakest/most washed under the
   ember duotone (#10, #11, #14) are hidden with `display: none` rather
   than placed - menu.js's scatter/reset tweens no-op harmlessly on
   display:none elements (zero-size rect, invisible either way).

   Each visible tile still gets its own vertical offset so same-row
   tiles don't share a top edge (organic scatter). This uses `top` on a
   `position: relative` item rather than margin-top or transform:
   margin-top on aspect-ratio items inside 1fr grid rows feeds back into
   the row/column track-sizing algorithm (rows and even column widths
   balloon), and `transform` gets clobbered because menu.js runs
   `gsap.set(coverItems, { x: 0, y: 0, ... })` on init, which writes an
   inline transform that permanently wins over any transform declared
   here. Relative-position `top` is a paint-time offset like transform
   (doesn't touch track sizing) but isn't a property GSAP ever touches,
   so it survives the scatter timeline's open/close cycles untouched.

   Column tracks have zero gap, so two single-cell tiles in
   directly-adjacent columns of the same row share a border with 0px of
   horizontal space between them by default; a `top` offset within the
   organic scatter range (a handful of vh) is far smaller than a tile's
   own height and can't pull their vertical spans apart enough to clear
   that shared border on its own. Row 1's four adjacent tiles (#2/#4/#5/#6,
   cols 3-6) instead get a graduated `margin-left` push - increasingly
   negative moving left, increasingly positive moving right - opening a
   real horizontal gap at each shared border while leaving #6 enough room
   before the top-right anchor's own bleed margin.

   The hero title's box covers roughly the middle third of the width and
   a wide central vertical band (well past both the row-2 and row-3
   bands), so any single-cell tile in row 2 or row 3 whose column falls
   anywhere near that horizontal band can't be pushed clear of the title
   vertically without an offset far outside the organic range - those
   rows are therefore only used at the far edges (col 8, clear of the
   title, and clear of the footer). Row 1 clears the title by staying
   pushed up; row 4 clears it by staying pushed down. Row 4's cols 4-5
   sit under the footer band instead, so its tiles use cols 3/6/7
   (footer- and title-clear once pushed down), with #13 (col 7) pushed
   down further still to clear col 8's row-3 tile above it as well as
   nudged right (margin-left) to clear col 6's tile beside it.

   Tiles #1/#2/#4/#5/#6 (row 1) keep top offsets staggered by >= 3vh
   between horizontal neighbours so the top edge never lines up. The two
   anchor tiles keep clear of both the hero title's central band and the
   bottom-center "Designing in memory of Franky" footer line via their
   offsets/margins. */
.cover__item:nth-child(1)  { grid-area: 1 / 1; top: -9vh; }
.cover__item:nth-child(2)  { grid-area: 1 / 3; margin-left: -4.5vw; top: -5vh; }
.cover__item:nth-child(3)  { grid-area: 3 / 1 / 5 / 3; margin-left: -3.5vw; top: 3vh; }
.cover__item:nth-child(4)  { display: none; }
.cover__item:nth-child(5)  { display: none; }
.cover__item:nth-child(6)  { grid-area: 1 / 6; margin-left: 1.5vw; top: -8.5vh; }
.cover__item:nth-child(7)  { grid-area: 3 / 8; top: 2vh; }
.cover__item:nth-child(8)  { grid-area: 4 / 3; top: 4vh; }
.cover__item:nth-child(9)  { grid-area: 4 / 6; top: 4vh; }
.cover__item:nth-child(10) { display: none; }
.cover__item:nth-child(11) { display: none; }
.cover__item:nth-child(12) { grid-area: 1 / 7 / 3 / 9; margin-left: 3.5vw; top: -4vh; }
.cover__item:nth-child(13) { grid-area: 4 / 7; margin-left: 2.5vw; top: 5.5vh; }
.cover__item:nth-child(14) { display: none; }

/* Sub-desktop collage: the desktop vh offsets push row-1 tiles up behind
   the wordmark and menu toggle on short viewports, and the row-4 pushes
   crowd the footer line. Keep a deliberate five-tile composition (the two
   2x2 anchors + the row-4 singles), drop the rest. */
@media (max-width: 1100px) {
  .cover__item:nth-child(1),
  .cover__item:nth-child(2),
  .cover__item:nth-child(4),
  .cover__item:nth-child(5),
  .cover__item:nth-child(6),
  .cover__item:nth-child(7) {
    display: none;
  }

  .cover__item:nth-child(12) {
    grid-area: 2 / 7 / 4 / 9;
    top: 0;
  }

  .cover__item:nth-child(8),
  .cover__item:nth-child(9),
  .cover__item:nth-child(13) {
    top: 0;
  }
}

/* ---------- hero title ---------- */

.title {
  align-self: center;
  justify-self: center;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-size: clamp(4rem, 17vw, 15rem);
  font-weight: 800;
  line-height: 0.82;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
  text-shadow: 0.04em 0.04em 0 var(--color-ember-deep);
}

.title__sub {
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: clamp(0.9rem, 1.6vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-ember);
  margin-bottom: 0.8em;
  text-shadow: none;
}

/* Professional credential block below the name: role in Handjet (current
   company in ember), then a mono "formerly" line that also carries the
   IIT Roorkee mention. */
.title__role {
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 1.9vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin-top: 0.85em;
  text-shadow: none;
}

.title__co {
  color: var(--color-ember);
}

.title__cred {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: clamp(0.68rem, 1vw, 0.82rem);
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-dim);
  margin-top: 0.7em;
  text-shadow: none;
}

/* ---------- pages ---------- */

.page {
  z-index: 350;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
}

.page__inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--page-pad) * 4) var(--page-pad) calc(var(--page-pad) * 3);
}

.page__inner--split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 1fr auto;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.page__inner--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page__kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 1.1rem;
  color: var(--color-ember);
}

.page__title {
  margin: 0 0 clamp(2rem, 5vh, 4rem);
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 800;
  line-height: 0.85;
  text-transform: uppercase;
  text-shadow: 0.04em 0.04em 0 var(--color-ember-deep);
}

.page__title--center {
  text-align: center;
}


/* ---------- work ---------- */

.workrows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* Tuned for the compact text-only cards (the tall visual bands are
     parked): more air than the inside padding, less than a void. */
  gap: clamp(2rem, 4.5vh, 3.25rem);
  counter-reset: work;
}

.workrows > li {
  counter-increment: work;
}

/* Full-width row panel: title/meta on the left, description on the right.
   The signature bordered box with a hard offset shadow (no rounded SaaS
   card), lifting into live ember on hover since the whole row is a link. */
.workrow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Column gap only: the visual band's own margin controls the vertical
     rhythm, so a row gap here would double it up. */
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: 0;
  align-items: start;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  box-shadow: 6px 6px 0 var(--color-ember-deep);
  color: var(--color-ink);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}

.workrow:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--color-ember);
}

/* Giant ghost index numeral in the card's bottom-right corner, behind
   the content: arcade cabinet serial numbers. Warms faintly on hover. */
.workrow::before {
  content: counter(work, decimal-leading-zero);
  position: absolute;
  right: 0.15em;
  bottom: 0;
  z-index: 0;
  font-family: 'Handjet', sans-serif;
  font-weight: 800;
  font-size: clamp(6rem, 11vw, 9.5rem);
  line-height: 0.75;
  letter-spacing: 0.02em;
  color: var(--color-ember-deep);
  opacity: 0.28;
  pointer-events: none;
  transition: opacity 0.3s;
}

.workrow:hover::before {
  opacity: 0.45;
}

/* Content sits above the ghost numeral (the ext arrow is absolutely
   positioned already and gets its z-index in its own rule). */
.workrow__head,
.workrow__desc {
  position: relative;
  z-index: 1;
}

/* Rows without a destination yet: same panel, none of the link
   affordances, so nothing fakes clickability. */
.workrow--static:hover {
  transform: none;
  box-shadow: 6px 6px 0 var(--color-ember-deep);
}

/* Doubled class beats the later `.workrow:hover .workrow__name` ember
   rule at equal source order. */
.workrow.workrow--static:hover .workrow__name {
  color: var(--color-ink);
}

.workrow__name {
  margin: 0;
  font-family: 'Handjet', sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.workrow:hover .workrow__name {
  color: var(--color-ember);
}

.workrow__desc {
  margin: 0;
  /* Keep the first line clear of the corner link arrow. */
  padding-right: 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: clamp(0.88rem, 1.1vw, 0.98rem);
  line-height: 1.65;
  color: var(--color-ink-dim);
}

/* External-link marker pinned to the panel's top-right corner (inset to
   match the panel padding), so it reads consistently no matter how the
   title wraps. A crisp stroked SVG (square caps, mitered joins) matching
   the toggle icon, not a pixel-font glyph. Nudges up-and-out on hover. */
/* Large UI showcase band spanning the full card under both text columns.
   Ember placeholder with diagonal hatching until real screenshots land;
   swap the inner span for an <img> (same wide frame) when they do. */
.workrow__visual {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  /* Matches the card padding so the band sits at a consistent inset from
     text above and border below. */
  margin-top: clamp(1.6rem, 3vw, 2.6rem);
  aspect-ratio: 21 / 8;
  background-color: var(--color-ember);
  background-image: repeating-linear-gradient(
    -45deg,
    oklch(0.45 0.15 40 / 0.35) 0,
    oklch(0.45 0.15 40 / 0.35) 2px,
    transparent 2px,
    transparent 14px
  );
}

.workrow__visual span {
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-ink);
}

/* Real UI screenshot on the hatched band: bottom-flush and centered,
   sized a touch taller than the band so the top edge crops through the
   browser chrome — the window peeps up from the card's bottom line. */
.workrow__visual {
  position: relative;
  overflow: hidden;
}

.workrow__shot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  /* At this width the window stands a hair taller than the band, so the
     band's top edge slices through the browser URL bar: cropped "a bit",
     peeping up from the bottom line. */
  width: 72%;
  border: 2px solid var(--color-ink);
  border-bottom: 0;
  filter: saturate(0.85) contrast(1.05);
}

/* PARKED per Tejas: visual bands hidden for now. Markup and the
   Presentations.ai dashboard shot stay in place — delete this rule to
   bring them back. Placed after every .workrow__visual rule so nothing
   (e.g. the display: grid above) outcascades it. */
.workrow__visual {
  display: none;
}

@media (max-width: 820px) {
  .workrow__visual {
    aspect-ratio: 16 / 9;
  }
}

.workrow__ext {
  position: absolute;
  top: clamp(1.6rem, 3vw, 2.6rem);
  right: clamp(1.6rem, 3vw, 2.6rem);
  z-index: 1;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--color-ember);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.workrow:hover .workrow__ext {
  transform: translate(0.2em, -0.2em);
}

.workrow:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

/* Stack to a single column on narrow screens: title block over
   description, matching how the pillars collapse. */
@media (max-width: 820px) {
  .workrow {
    grid-template-columns: 1fr;
    /* Title stacks over description here, so a row gap is wanted again —
       but only between the text blocks; the visual keeps its own margin. */
    row-gap: 1rem;
  }
}

/* ---------- about ---------- */

/* Writing list keeps the external-arrow flourish previously shared with
   the work rows, so its base style lives on here. */
.worklist__ext {
  display: inline-block;
  font-size: 0.55em;
  color: var(--color-ember);
  transform: translateY(-0.4em);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.writlist__link:hover .worklist__ext {
  transform: translate(0.25em, -0.65em);
}

/* About: left column carries name + role + portrait, right column the
   blurb and experience timeline. Narrower left than the shared split so
   the reading column has room. */
.page__inner--about {
  grid-template-columns: 0.85fr 1.15fr;
  column-gap: clamp(2.5rem, 6vw, 6rem);
}

.about__id {
  display: flex;
  flex-direction: column;
}

/* Top-align the right column's "About" heading with the top edge of the
   portrait, not the kicker above it. The offset equals the kicker block
   height (kicker + its margin + the photo's top margin); only applies
   while the columns sit side by side. */
@media (min-width: 761px) {
  .about__detail {
    margin-top: 44px;
  }
}

/* Small breath between the kicker and the portrait so the photo doesn't
   crowd the label. */
.about__id .about__photo {
  margin-top: 1rem;
}

/* Section headings on the right column: Handjet, sized between the page
   title and body so About / Experience read as peers. */
.about__h {
  margin: 0 0 1.5rem;
  font-family: 'Handjet', sans-serif;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.about__h--exp {
  margin-top: clamp(3.5rem, 7vh, 5.5rem);
}

.about__lead {
  max-width: 54ch;
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-ink-dim);
}

/* Experience timeline: hairline-ruled rows, company (Handjet) and role
   (mono) on the left, year pinned right. */
.exp {
  list-style: none;
  margin: 0;
  padding: 0;
}

.exp__row {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: clamp(1.15rem, 2.4vh, 1.7rem) 0.1rem;
  border-top: 1px solid var(--color-line);
}

.exp__row:last-child {
  border-bottom: 1px solid var(--color-line);
}

.exp__co {
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.exp__role {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

.exp__year {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ember);
  white-space: nowrap;
}

.about__photo {
  margin: 0;
}

.about__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* Standard site filter only: the real portrait is shot in warm
     lamplight and already sits in the ember palette, so the old sepia
     push (added for the cold blue-green stand-in) would overcook it. */
  filter: saturate(0.85) contrast(1.05);
  border: 2px solid var(--color-ink);
  box-shadow: 8px 8px 0 var(--color-ember-deep);
}

.about__photo figcaption {
  margin-top: 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

/* ---------- playground ---------- */

.playgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
}

.playgrid__card {
  display: block;
  color: var(--color-ink);
  text-decoration: none;
}

.playgrid__card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
  border: 2px solid var(--color-ink);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}

.playgrid__card span {
  display: block;
  margin-top: 0.6rem;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.playgrid__card:hover img,
.playgrid__card:focus-visible img {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--color-ember);
}

.playgrid__card:hover span {
  color: var(--color-ember);
}

.playgrid__card:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 3px;
}

/* ---------- writing ---------- */

.writlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 70ch;
}

.writlist li {
  border-top: 1px solid var(--color-line);
}

.writlist li:last-child {
  border-bottom: 1px solid var(--color-line);
}

.writlist__link {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 1.2rem 0.2rem;
  color: var(--color-ink);
  text-decoration: none;
}

.writlist__date {
  flex: 0 0 5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

.writlist__name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.05rem, 2vw, 1.7rem);
  font-weight: 600;
  line-height: 1.25;
  transition: color 0.2s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.writlist__link:hover .writlist__name,
.writlist__link:focus-visible .writlist__name {
  color: var(--color-ember);
  transform: translateX(0.3em);
}

.writlist__link:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 2px;
}

/* "Soon" rows (AI Experiments) reuse this class on a bare <span>, not
   an <a>: no href, nothing happens on click. Without this, they still
   pick up the link's hover color-shift and slide, faking clickability
   on a row that does nothing. */
span.writlist__link {
  cursor: default;
}

span.writlist__link:hover .writlist__name {
  color: var(--color-ink);
  transform: none;
}

/* ---------- ai experiments (content pillars) ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}

/* The signature object: one 2px ink border with a hard offset shadow, no
   rounded corners, no soft blur. Static (not a lift-on-hover button): these
   are display panels, not links, so nothing fakes clickability. */
.pillar {
  display: flex;
  flex-direction: column;
  padding: clamp(1.3rem, 2vw, 1.8rem);
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  box-shadow: 6px 6px 0 var(--color-ember-deep);
}

/* A pillar that links out gets the full interactive treatment: lift into
   live ember on hover, title warms, screen caption invites the click. */
a.pillar {
  color: var(--color-ink);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}

a.pillar:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--color-ember);
}

a.pillar:hover .pillar__title {
  color: var(--color-ember);
}

a.pillar:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

.pillar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.pillar__title {
  margin: 0;
  font-family: 'Handjet', sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Borderless status label so it stays chrome, never a nested card. */
.pillar__status {
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-ink-dim);
}

.pillar__status--wip {
  color: var(--color-ember);
}

.pillar__status--live {
  color: var(--color-bg);
  background: var(--color-ember);
}

/* Card-level hover tooltip (same chip language as the email tooltip);
   used to flag "documentation coming soon" on built-but-unwritten
   experiments and undocumented work rows. */
.pillar[data-tip],
.workrow[data-tip] {
  position: relative;
}

.pillar[data-tip]::after,
.workrow[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: -0.9rem;
  left: 50%;
  transform: translate(-50%, 6px);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  box-shadow: 3px 3px 0 var(--color-ember);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-ink);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.18s, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.pillar[data-tip]:hover::after,
.workrow[data-tip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pillar__body {
  margin: 0 0 1.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-ink-dim);
}

/* Terminal-style bullets: ember prompt caret instead of a disc. */
.pillar__points {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
}

.pillar__points li {
  position: relative;
  padding-left: 1.3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--color-ink);
}

.pillar__points li + li {
  margin-top: 0.4rem;
}

.pillar__points li::before {
  content: '\203A';
  position: absolute;
  left: 0;
  color: var(--color-ember);
  font-weight: 600;
}

/* CTA chip pinned to the card floor, in the chrome-button box language.
   On the linked card it invites the click (the whole card is the <a>);
   the --soon variant sits dim and inert until a link exists. */
.pillar__cta {
  margin-top: auto;
  align-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--color-ink);
  box-shadow: 4px 4px 0 var(--color-ember);
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-ink);
  transition: box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}

.pillar__cta-arrow {
  width: 0.85em;
  height: 0.85em;
  align-self: center;
  color: var(--color-ember);
}

a.pillar:hover .pillar__cta {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-ember);
  color: var(--color-ember);
}

.pillar__cta--soon {
  border-color: var(--color-line);
  box-shadow: 4px 4px 0 var(--color-ember-deep);
  color: var(--color-ink-dim);
}

@media (max-width: 820px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* ---------- contact ---------- */

.contact__mail {
  position: relative;
  margin: 1rem 0 2.5rem;
  padding: 0;
  background: none;
  border: none;
  border-bottom: 0.08em solid var(--color-ember);
  font-family: inherit;
  /* Min bumped from 1.8rem: Handjet's "@" glyph loses its inner swirl
     and reads as a blob at very small pixel sizes. A bit more room to
     render keeps it legible on narrow phones. */
  font-size: clamp(2.1rem, 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-ink);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.contact__mail:hover,
.contact__mail:focus-visible {
  color: var(--color-ember);
  outline: none;
}

/* Hover/focus tooltip in the signature bordered-box language. Text comes
   from data-tip so contact.js can flip it to "Copied!" on click. */
.contact__mail::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.9rem);
  left: 50%;
  transform: translate(-50%, 6px);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  box-shadow: 3px 3px 0 var(--color-ember);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact__mail:hover::after,
.contact__mail:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.contact__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem 3rem;
}

.contact__links a {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  color: var(--color-ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.contact__links a:hover,
.contact__links a:focus-visible {
  color: var(--color-ember);
  outline: none;
}

/* ---------- menu ---------- */

.menu {
  z-index: 500;
  clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
  will-change: clip-path;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(0.3rem, 1.2vh, 1rem);
  position: relative;
  overflow: hidden;
}

.menu__bg {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(40% 55% at 22% 28%, oklch(0.5 0.17 45 / 0.85), transparent 70%),
    radial-gradient(45% 60% at 78% 70%, oklch(0.38 0.13 25 / 0.8), transparent 70%),
    radial-gradient(35% 45% at 60% 20%, oklch(0.42 0.1 75 / 0.6), transparent 70%),
    oklch(0.17 0.02 50);
  animation: drift 14s ease-in-out infinite alternate;
}

.menu__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@keyframes drift {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(8deg) scale(1.12);
  }
}

.menu__item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.35em;
  color: var(--color-ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(2rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.25s, letter-spacing 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__item i {
  font-style: normal;
  font-size: 0.32em;
  font-weight: 400;
  letter-spacing: 0.2em;
  opacity: 0.55;
  transform: translateY(-1.2em);
}

.menu__item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.06em;
  width: 100%;
  height: 0.08em;
  background: var(--color-ember);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__item:hover,
.menu__item:focus-visible {
  color: var(--color-ember);
  letter-spacing: 0.06em;
}

/* Color-shift alone is identical to .is-current, so a keyboard user
   can't tell "focused" from "this is the current page" without a
   distinct marker. A visible outline (used by every other interactive
   element on the site) resolves the ambiguity. */
.menu__item:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 8px;
}

.menu__item:hover::after,
.menu__item:focus-visible::after {
  transform: scaleX(1);
}

.menu__item.is-current {
  color: var(--color-ember);
}

/* ---------- password gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  background: var(--color-bg);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gated {
  overflow: hidden;
}

.gate--open {
  opacity: 0;
  pointer-events: none;
}

.gate--shake .gate__box {
  animation: gateshake 0.4s;
}

@keyframes gateshake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.gate__box {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.8rem, 4vw, 2.8rem) clamp(1rem, 3vw, 1.6rem);
  border: 2px solid var(--color-ink);
  box-shadow: 8px 8px 0 var(--color-ember-deep);
  text-align: center;
}

.gate__logo {
  margin: 0;
  border: 2px solid var(--color-ink);
  padding: 0.5rem 0.75rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
}

.gate__hint {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--color-ink-dim);
}

.gate__form {
  display: flex;
  gap: 0.6rem;
}

.gate__input {
  background: transparent;
  border: 2px solid var(--color-ink-dim);
  color: var(--color-ink);
  font-family: 'Handjet', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  padding: 0.55rem 0.9rem;
  width: clamp(160px, 40vw, 240px);
}

.gate__input:focus {
  outline: none;
  border-color: var(--color-ember);
}

.gate__submit {
  cursor: pointer;
  border: 2px solid var(--color-ink);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.55rem 1.1rem;
  box-shadow: 4px 4px 0 var(--color-ember);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gate__submit:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-ember);
}

.gate__submit:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--color-ember);
}

.gate__submit:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 4px;
}

.gate__error {
  min-height: 1.3em;
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ember);
}

/* ---------- case studies ---------- */

.page__inner--case {
  max-width: 880px;
}

.case__back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--color-ink-dim);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  transition: color 0.2s;
}

.case__back:hover,
.case__back:focus-visible {
  color: var(--color-ember);
  outline: none;
}

.case__title {
  margin: 0 0 1.8rem;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0.04em 0.04em 0 var(--color-ember-deep);
}

.case__strap {
  margin: 0 0 1.6rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1.05rem;
  color: var(--color-ink-dim);
}

.case__facts {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem 2rem;
}

.case__facts li {
  border-top: 1px solid var(--color-line);
  padding: 0.55rem 0;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case__facts b {
  display: block;
  color: var(--color-ember);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.case__hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border: 2px solid var(--color-ink);
  box-shadow: 10px 10px 0 var(--color-ember-deep);
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
  filter: saturate(0.85) contrast(1.05) brightness(0.92);
}

.case__body {
  counter-reset: cs-section;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.05rem;
  line-height: 1.65;
  letter-spacing: 0;
}

.case__body h3 {
  counter-increment: cs-section;
  font-family: 'Handjet', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 2.8rem 0 0.9rem;
  color: var(--color-ember);
}

.case__body h3::before {
  content: counter(cs-section, decimal-leading-zero) '\00A0\00B7\00A0';
  color: var(--color-ember-deep);
  font-weight: 600;
}

.case__body p {
  margin: 0 0 1.1rem;
  max-width: 70ch;
}

.case__body strong {
  font-weight: 600;
  color: var(--color-ink);
}

.case__body a {
  color: var(--color-ember);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.2s;
}

.case__body a:hover,
.case__body a:focus-visible {
  color: var(--color-ink);
  outline: none;
}

.case__pull {
  margin: 2.2rem 0;
  padding: 1.4rem 1.6rem;
  border: 2px solid var(--color-ink);
  box-shadow: 6px 6px 0 var(--color-ember-deep);
  font-family: 'Handjet', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
}

.case__figure {
  margin: 2.2rem 0;
}

.case__figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--color-ink);
  box-shadow: 8px 8px 0 var(--color-ember-deep);
  filter: saturate(0.85) contrast(1.03) brightness(0.92);
}

.case__figure figcaption,
.case__viz figcaption {
  margin-top: 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-dim);
}

.case__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.case__stats div {
  border: 1px solid var(--color-line);
  padding: 1.1rem 1.2rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-dim);
}

.case__stats span {
  display: block;
  font-family: 'Handjet', sans-serif;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.4rem;
  color: var(--color-ink);
}

.case__hero--top {
  object-position: top;
}

.case__figure--full img {
  aspect-ratio: auto;
}

.case__duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 2.2rem 0;
}

.case__duo .case__figure {
  margin: 0;
}

.case__table-caption {
  margin: 0 0 0.6rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--color-ember);
}

.case__table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0;
}

.case__table {
  width: 100%;
  border-collapse: collapse;
}

.case__table th {
  padding: 0.55rem;
  border-bottom: 2px solid var(--color-ink);
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.case__table th:first-child {
  text-align: left;
}

.case__table td {
  padding: 0.55rem;
  border-top: 1px solid var(--color-line);
}

.case__table td:first-child {
  font-family: 'IBM Plex Mono', monospace;
  text-align: left;
}

.case__table td:not(:first-child) {
  text-align: center;
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.case__table .yes {
  color: var(--color-ember);
}

.case__table .no {
  color: var(--color-ink-dim);
}

.case__rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
  list-style: none;
  padding: 0;
}

.case__rules li {
  border-top: 1px solid var(--color-line);
  padding-top: 0.8rem;
}

.case__rules-num {
  display: block;
  font-family: 'Handjet', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-ember);
  text-shadow: 0.04em 0.04em 0 var(--color-ember-deep);
}

.case__rules-label {
  display: block;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink);
}

.case__audit {
  margin: 2rem 0;
}

.case__audit-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}

.case__audit-num {
  font-family: 'Handjet', sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--color-ember);
}

.case__audit-title {
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case__audit-label {
  display: block;
  margin-top: 0.9rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--color-ember);
}

.case__notes {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  padding: 0;
  margin: 1.6rem 0;
}

.case__notes li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  break-inside: avoid;
}

.case__notes li::before {
  content: '▪';
  color: var(--color-ember);
  position: absolute;
  left: 0;
}

/* ---------- status glyphs ---------- */

.g {
  display: inline-block;
  width: 13px;
  height: 13px;
  vertical-align: middle;
}

.g--yes {
  background: var(--color-ember);
}

.g--no {
  border: 2px solid var(--color-ink-dim);
  background: transparent;
}

.g--part {
  border: 2px solid var(--color-ink);
  background: linear-gradient(135deg, var(--color-ink) 50%, transparent 50%);
}

.g--na {
  width: 13px;
  height: 2px;
  background: var(--color-line);
  vertical-align: 0.35em;
}

.case__glyphkey {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin: 0 0 1.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-ink-dim);
}

.case__glyphkey-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* ---------- audit matrices ---------- */

.case__matrix {
  table-layout: fixed;
}

.case__matrix th:first-child {
  width: 30%;
}

.case__matrix th:not(:first-child) {
  width: 11.67%;
}

.case__matrix th[scope='row'] {
  max-width: 34ch;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.95rem;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-ink-dim);
}

.case__matrix tbody th {
  border-bottom: none;
  border-top: 1px solid var(--color-line);
}

/* ---------- native diagrams ---------- */

.case__viz {
  margin: 2.2rem 0;
}

.case__viz .arch + .arch {
  margin-top: 1.2rem;
}

.arch {
  border: 2px solid var(--color-ink);
  box-shadow: 6px 6px 0 var(--color-ember-deep);
  padding: 1.1rem 1.2rem;
}

.arch__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.arch__title {
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.arch__tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--color-ink-dim);
  text-align: right;
}

.arch__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arch__file {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--color-line);
  padding: 0.25rem 0.55rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.arch__file .g {
  width: 11px;
  height: 11px;
}

.arch__file--dim {
  color: var(--color-ink-dim);
}

.arch__badge {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--color-ink-dim);
}

.arch__file .arch__badge::before {
  content: '\00A0\00B7\00A0';
}

.arch__badge--ember {
  color: var(--color-ember);
}

.arch__sub {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-line);
}

.arch__sub-label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

.arch__folders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.arch__folder {
  border: 1px solid var(--color-line);
  padding: 0.7rem;
}

.arch__folder--private {
  border-style: dashed;
  opacity: 0.7;
}

.arch__folder-name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
}

.arch__file--mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  padding: 0.2rem 0;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

.arch__file--mini .g {
  width: 11px;
  height: 11px;
  background: var(--color-line);
}

.arch__drafts {
  margin-top: 0.8rem;
  border: 1px dashed var(--color-line);
  padding: 0.6rem 0.8rem;
}

.arch__drafts-label {
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-ink-dim);
}

.arch__drafts-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  text-transform: none;
  color: var(--color-ink-dim);
}

.arch__drafts-copy::before {
  content: '\00B7\00A0';
}

.cascade {
  max-width: 560px;
  margin: 2.2rem auto;
}

.cascade__banner {
  margin: 0 0 1rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-ember);
  text-align: center;
}

.cascade__tier {
  border: 2px solid var(--color-ink);
  box-shadow: 5px 5px 0 var(--color-ember-deep);
  padding: 0.9rem 1.1rem;
}

.cascade__level {
  display: block;
  margin-bottom: 0.25rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: var(--color-ember-deep);
}

.cascade__tier p {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--color-ink-dim);
}

.cascade__arrow {
  position: relative;
  width: 2px;
  height: 26px;
  margin: 0.35rem auto;
  background: var(--color-ember);
}

.cascade__arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--color-ember);
}

.pilebox,
.netbox {
  border: 2px solid var(--color-ink);
  box-shadow: 6px 6px 0 var(--color-ember-deep);
  padding: 1.1rem 1.2rem;
}

.pilebox__label,
.netbox__label {
  display: block;
  margin-bottom: 0.9rem;
  font-family: 'Handjet', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pilebox__label--before,
.netbox__label--before {
  color: var(--color-ink-dim);
}

.pilebox__label--after,
.netbox__label--after {
  color: var(--color-ember);
}

.pile {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.pile__doc {
  position: absolute;
  width: 16px;
  height: 20px;
  border: 2px solid var(--color-ink-dim);
  background: var(--color-bg);
}

.pile__doc:nth-child(1) { left: 8%; top: 18%; transform: rotate(-20deg); }
.pile__doc:nth-child(2) { left: 20%; top: 14%; transform: rotate(15deg); }
.pile__doc:nth-child(3) { left: 35%; top: 20%; transform: rotate(-8deg); }
.pile__doc:nth-child(4) { left: 50%; top: 12%; transform: rotate(22deg); }
.pile__doc:nth-child(5) { left: 65%; top: 18%; transform: rotate(-25deg); }
.pile__doc:nth-child(6) { left: 80%; top: 22%; transform: rotate(10deg); }
.pile__doc:nth-child(7) { left: 15%; top: 32%; transform: rotate(-18deg); }
.pile__doc:nth-child(8) { left: 28%; top: 35%; transform: rotate(12deg); }
.pile__doc:nth-child(9) { left: 40%; top: 30%; transform: rotate(-30deg); }
.pile__doc:nth-child(10) { left: 55%; top: 33%; transform: rotate(8deg); }
.pile__doc:nth-child(11) { left: 70%; top: 28%; transform: rotate(-12deg); }
.pile__doc:nth-child(12) { left: 88%; top: 35%; transform: rotate(20deg); }
.pile__doc:nth-child(13) { left: 46%; top: 58%; transform: rotate(0deg); border-color: var(--color-ember); z-index: 1; }
.pile__doc:nth-child(14) { left: 12%; top: 48%; transform: rotate(25deg); }
.pile__doc:nth-child(15) { left: 25%; top: 52%; transform: rotate(-22deg); }
.pile__doc:nth-child(16) { left: 33%; top: 60%; transform: rotate(14deg); }
.pile__doc:nth-child(17) { left: 44%; top: 46%; transform: rotate(-9deg); }
.pile__doc:nth-child(18) { left: 50%; top: 65%; transform: rotate(18deg); }
.pile__doc:nth-child(19) { left: 58%; top: 55%; transform: rotate(-16deg); }
.pile__doc:nth-child(20) { left: 65%; top: 62%; transform: rotate(27deg); }
.pile__doc:nth-child(21) { left: 75%; top: 50%; transform: rotate(-20deg); }
.pile__doc:nth-child(22) { left: 82%; top: 58%; transform: rotate(11deg); }
.pile__doc:nth-child(23) { left: 20%; top: 68%; transform: rotate(-28deg); }
.pile__doc:nth-child(24) { left: 30%; top: 72%; transform: rotate(19deg); }
.pile__doc:nth-child(25) { left: 40%; top: 75%; transform: rotate(-6deg); }
.pile__doc:nth-child(26) { left: 48%; top: 70%; transform: rotate(30deg); }
.pile__doc:nth-child(27) { left: 55%; top: 76%; transform: rotate(-14deg); }
.pile__doc:nth-child(28) { left: 62%; top: 72%; transform: rotate(22deg); }
.pile__doc:nth-child(29) { left: 70%; top: 78%; transform: rotate(-32deg); }
.pile__doc:nth-child(30) { left: 4%; top: 62%; transform: rotate(17deg); }

.pile__folders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  align-content: center;
  min-height: 220px;
}

.pile__row {
  display: block;
  height: 8px;
  margin: 0.35rem 0;
  background: var(--color-line);
}

.pile__row--ember {
  background: var(--color-ember);
}

.netbox svg {
  display: block;
}

/* ---------- franky ---------- */

/* Spotlight dim behind the reveal: above everything, chrome corners
   included (wordmark, menu toggle, sound chip), so the whole cabinet
   goes dark. Only the hovered memory line and Franky himself stay lit;
   franky.js lifts the frame via body.franky-active while hovering. */
.franky-dim {
  z-index: 750;
  background: var(--color-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.franky-active .frame {
  z-index: 770;
}

.franky {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
}

.franky__frame {
  width: 240px;
  /* Matches the pixel-art memorial's 3:4 canvas so the "forever in our
     hearts" caption at its foot never crops. */
  aspect-ratio: 3 / 4;
  border: 2px solid var(--color-ink);
  box-shadow: 8px 8px 0 var(--color-ember-deep);
  overflow: hidden;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.franky__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  will-change: transform;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .page__inner--split {
    grid-template-columns: 1fr;
  }

  /* Touch targets: menu rows measure ~32px tall at phone sizes; pad the
     top only so the hover underline (anchored to the box bottom) stays
     glued under the text while the hit area reaches ~44px. */
  .menu__item {
    padding-top: 0.75rem;
  }

  /* Stack name above meta instead of a tight two-column row: at this
     width the 40%-wide meta column wraps to a ragged 2-3 line block
     with a dangling middot. Full-width, left-aligned meta reads clean
     underneath the name instead. */
  .worklist__link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .worklist__meta {
    max-width: 100%;
    text-align: left;
  }

  /* The resume and sound chips own the bottom corners on phones, so the
     memory line rides one row above them, centered. */
  .frame {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--page-pad) + 3.4rem);
  }

  .frame__memory {
    grid-column: 1;
    text-align: center;
  }

  .case__duo {
    grid-template-columns: 1fr;
  }

  .case__rules {
    grid-template-columns: 1fr 1fr;
  }

  .case__notes {
    columns: 1;
  }

  .arch__folders {
    grid-template-columns: 1fr 1fr;
  }

  .pilebox .pile__folders {
    grid-template-columns: 1fr;
  }

  .cascade {
    max-width: 100%;
  }
}

/* Phone landscape (e.g. 844x390): the hero title and the five-row menu
   are both sized off `vw`, which is generous on a wide-but-short
   viewport and crowds the pinned-bottom footer line (hero title bottom
   edge and, worse, the menu's last item both encroach on "Designing in
   memory of Franky"). Re-clamp both off `vh` instead so they scale with
   the height that's actually scarce here; this is a real (if rare) edge
   case, not a device to design around, so the fix stays minimal. */
@media (max-height: 480px) and (orientation: landscape) {
  .title {
    font-size: clamp(2.2rem, 15vh, 6rem);
  }

  .menu {
    gap: clamp(0.1rem, 0.6vh, 0.4rem);
  }

  .menu__item {
    font-size: clamp(1.3rem, 5.6vh, 2.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu__bg {
    animation: none;
  }

  .soundchip.is-on .soundchip__bars i {
    animation: none;
    height: 70%;
  }
}
