/* =========================================================
   Dan McKay — Portfolio
   Neo-industrial / grid system. Palette from ColourRef:
   charcoal, sage, signal orange, concrete paper.
   ========================================================= */

:root {
  --ink: #222322;
  --ink-2: #2d2e2d;
  --silver: #b9bdbc;
  --sage: #c5d8c4;
  --sage-2: #a8bca8;
  --grey: #7b847b;
  --orange: #ff6a33;
  --paper: #e5e5e1;
  --white: #f4f4f1;

  /* Mobotato sub-palette */
  --m-teal: #4ab6b4;
  --m-teal-2: #2f9a98;
  --m-red: #e2232f;
  --m-red-2: #a5141d;
  --m-cream: #efe8dc;
  --m-grey: #8f8f8b;
  --m-clay: #dcd8d0;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --nav-h: 76px;
  --hud-h: 92px;
  --gut: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.2, .7, .15, 1);
  --box-r: 5px; /* corner radius on case study + press cards; 0 = square */
}

/* ---------- Colour themes (swatches, top left) ---------- */
:root[data-theme="coral"] {         /* Thunder Thighs stationery: cream F2EADD / mint CDE1D5 / coral FF675C; charcoal kept for reel + mobotato */
  --ink: #2b2b2b; --ink-2: #383838; --silver: #f2eadd;
  --sage: #cde1d5; --sage-2: #b4cfc0; --grey: #7d978a;
  --orange: #ff675c; --paper: #f2eadd; --white: #faf6ef;
  --m-teal: #cde1d5; --m-teal-2: #7d978a; --m-red: #ff675c;
  --charcoal: #2b2b2b;
}
/* Light pages in this theme: the "dark" pages swap ink and silver locally, so everything inside them flips to dark-on-light */
:root[data-theme="coral"] #index  { --ink: #f2eadd; --silver: #2b2b2b; --white: #2b2b2b; --noise: var(--noise-dark); }
:root[data-theme="coral"] #resume { --ink: #cde1d5; --silver: #2b2b2b; --white: #2b2b2b; --sage: #2b2b2b; --noise: var(--noise-dark); }
:root[data-theme="coral"] #contact { --sage: #f2eadd; }
:root[data-theme="coral"] #index .grid-fx { color: #7fb39b; --cell-hot: #ff675c; } /* mint cells that warm to coral under the pointer */
:root[data-theme="coral"] #index .bignum-v span { color: #cde1d5; } /* the big "026" in mint */
:root[data-theme="coral"] { /* softer grain so the cream stays cream */
  --noise-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
}
:root[data-theme="coral"] #index .ticker,
:root[data-theme="coral"] #resume .g-bar:not(.g-bar--hatch):not(.g-bar--sage),
:root[data-theme="coral"] #resume .pill--fill { color: var(--charcoal); }
:root[data-theme="coral"] #resume .pill--fill:hover { color: #cde1d5; }
:root[data-theme="coral"] body[data-tone="dark"] { --fg: #2b2b2b; --bg: #f2eadd; --line: color-mix(in srgb, #2b2b2b 20%, transparent); --chip: #ff675c; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--ink);
  color: var(--silver);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-synthesis: none;
  transition: background-color .6s var(--ease);
}
button, input { font-kerning: inherit; font-feature-settings: inherit; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.45;
}
.mono-lg {
  font-family: var(--mono);
  font-size: clamp(12px, min(1.4vw, 2.1vh), 22px);
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ---------- Tone system (fixed chrome follows active panel) ---------- */
:root {
  --noise-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  --noise-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
body { --fg: var(--silver); --bg: var(--ink); --line: color-mix(in srgb, var(--silver) 22%, transparent); --chip: var(--orange); }
body[data-tone="sage"]  { --fg: var(--ink); --bg: var(--sage);  --line: color-mix(in srgb, var(--ink) 20%, transparent); --chip: var(--orange); }
body[data-tone="paper"] { --fg: var(--ink); --bg: var(--paper); --line: color-mix(in srgb, var(--ink) 20%, transparent); --chip: var(--orange); }
body[data-tone="orange"] { --fg: var(--ink); --bg: var(--orange); --line: color-mix(in srgb, var(--ink) 28%, transparent); --chip: var(--ink); }
body[data-tone="reel"]  { --bg: #0f0f0f; } /* showreel: fixed dark grey in every colour scheme */
body[data-tone="mobo"]  { --fg: var(--silver); --bg: var(--ink); --line: color-mix(in srgb, var(--silver) 22%, transparent); --chip: var(--m-red); }

/* =========================================================
   FIXED NAV
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  padding: 0 var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  color: var(--fg);
  transition: color .6s var(--ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav, .hud { transition: color .6s var(--ease), background-color .4s var(--ease); }
body.under-top .nav { background: var(--bg); }
.nav::after {
  content: ""; position: absolute; left: var(--gut); right: var(--gut); bottom: 0;
  height: 1px; background: currentColor; opacity: .22;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px;
  font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.brand-mark i, .corners i {
  position: absolute; width: 9px; height: 9px; border: 0 solid currentColor;
}
.brand-mark i:nth-child(1), .corners i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.brand-mark i:nth-child(2), .corners i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.brand-mark i:nth-child(3), .corners i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.brand-mark i:nth-child(4), .corners i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.brand-mark--sm { width: 34px; height: 34px; font-size: 12px; }

.brand-name {
  display: flex; flex-direction: column;
  font-weight: 700; font-size: 17px; letter-spacing: -.01em; line-height: 1.05;
}
.brand-name small { font-size: 9.5px; opacity: .7; margin-top: 3px; }

/* light / dark switch (top left): two segments, the active one filled */
.mode {
  display: flex; margin-right: auto; margin-left: clamp(4px, 1.5vw, 24px);
  border: 1.5px solid currentColor; border-radius: 999px; padding: 2px;
}
.mode button {
  padding: 5px 11px; border-radius: 999px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  opacity: .6; transition: background .3s, color .3s, opacity .3s;
}
.mode button:hover { opacity: 1; }
.mode button[aria-pressed="true"] { background: var(--fg); color: var(--bg); opacity: 1; cursor: default; }

.nav-links { display: flex; gap: clamp(14px, 2vw, 30px); }
.nav-links a {
  position: relative;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 0;
  opacity: .62;
  transition: opacity .3s;
}
.nav-links a span { opacity: .55; margin-right: 6px; }
.nav-links a:hover, .nav-links a.is-current { opacity: 1; }
.lc, .nav-links a.lc { text-transform: none; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--chip); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease), background .6s;
}
.nav-links a.is-current::after { transform: scaleX(1); }

.nav-meta { display: flex; align-items: center; gap: 22px; }
.nav-clock { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--chip); transition: background .6s;
  animation: blink 1.6s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.nav-count b { font-weight: 700; }
.menu-btn { display: none; padding: 8px 12px; border: 1px solid currentColor; }

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--ink); color: var(--silver);
  padding: calc(var(--nav-h) + 24px) var(--gut) 40px;
  display: flex; flex-direction: column; gap: 4px;
}
.menu[hidden] { display: none; }
.menu a {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(34px, 10vw, 56px); font-weight: 700; letter-spacing: -.04em;
  padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--silver) 18%, transparent);
}
.menu a span { color: var(--orange); }
body.menu-open .nav { color: var(--silver); }

/* =========================================================
   STAGE + PANELS
   ========================================================= */
.stage {
  position: fixed; inset: 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}
body.is-dragging .stage { cursor: grabbing; }
body.is-dragging, body.is-dragging * { user-select: none; -webkit-user-select: none; }
.stage img, .stage video { -webkit-user-drag: none; user-select: none; }

.panel {
  position: absolute; inset: 0;
  width: 100vw; height: 100%;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  will-change: transform;
  contain: layout paint;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
.panel::-webkit-scrollbar { display: none; }
.panel [data-depth] { will-change: transform; }

/* film-grain texture on every page (same as the Press page): dark grain on light pages, light grain on dark ones */
.panel { --noise: var(--noise-dark); }
.tone-dark, .tone-mobo { --noise: var(--noise-light); }
.panel[class], .case-sheet { background-image: var(--noise); }
.case-sheet { --noise: var(--noise-dark); }
.tone-dark   { background: var(--ink);    color: var(--silver); --line: color-mix(in srgb, var(--silver) 16%, transparent); }
.tone-sage   { background: var(--sage);   color: var(--ink);    --line: color-mix(in srgb, var(--ink) 16%, transparent); }
.tone-orange { background: var(--orange); color: var(--ink);    --line: color-mix(in srgb, var(--ink) 24%, transparent); }
.tone-paper  {
  background-color: var(--paper); color: var(--ink); --line: color-mix(in srgb, var(--ink) 14%, transparent);
}

.p-inner {
  position: relative; z-index: 2;
  min-height: 100%;
  padding: calc(var(--nav-h) + clamp(20px, 4vh, 48px)) var(--gut) calc(var(--hud-h) + clamp(16px, 3vh, 32px));
}

/* Dashed construction grid (generated by JS) */
.gridlines {
  position: absolute; inset: 0 var(--gut); z-index: 1; pointer-events: none;
  display: grid;
}
.gridlines span { border-left: 1px dashed var(--line); }
.gridlines span:last-child { border-right: 1px dashed var(--line); }
.gridlines::before, .gridlines::after {
  content: ""; position: absolute; left: calc(var(--gut) * -1); right: calc(var(--gut) * -1);
  border-top: 1px dashed var(--line);
}
.gridlines::before { top: 34%; }
.gridlines::after  { top: 72%; }

.crosses { position: absolute; inset: 0 var(--gut); z-index: 1; pointer-events: none; }
.crosses i { position: absolute; width: 13px; height: 13px; transform: translate(-50%, -50%); }
.crosses i::before, .crosses i::after { content: ""; position: absolute; background: currentColor; }
.crosses i::before { left: 6px; top: 0; width: 1.5px; height: 13px; }
.crosses i::after  { top: 6px; left: 0; height: 1.5px; width: 13px; }


/* Decorative giant type is clipped to the panel so it never makes the page scroll */
.deco-clip { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

/* Giant background numerals */
.bignum {
  position: absolute; z-index: 0; pointer-events: none;
  font-weight: 800; letter-spacing: -.07em; line-height: .78;
  white-space: nowrap;
}
/* Landing "026": rotated -90deg, oversized so it bleeds off the right, top and bottom, behind the dashed grid */
.bignum-v {
  position: absolute; z-index: 0; pointer-events: none;
  top: 0; bottom: 0; right: calc(min(100dvh / 1.38, 125vw) * -.2);
  display: flex; align-items: center;
}
.bignum-v span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: min(100dvh / 1.38, 125vw);
  font-weight: 800; letter-spacing: -.06em; line-height: .74;
  color: color-mix(in srgb, var(--ink) 86%, var(--silver)); white-space: nowrap;
}

.bignum--reel { /* "SHOWREEL", sized to span the full width of the page */
  left: -1vw; bottom: -0.16em;
  font-size: 20.8vw;
  color: color-mix(in srgb, var(--sage) 78%, var(--ink));
}
.bignum-v--contact span { color: color-mix(in srgb, var(--sage) 78%, var(--ink)); }

/* Reveal-on-enter */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity .8s var(--ease) calc(var(--d, 0) * 1ms + 120ms),
    transform 1s var(--ease) calc(var(--d, 0) * 1ms + 120ms);
}
.is-active [data-reveal] { opacity: 1; transform: none; }

/* Shared type */
.h-xxl { font-size: clamp(54px, 9.2vw, 168px); font-weight: 700; letter-spacing: -.05em; line-height: .88; }
.h-xl  { font-size: clamp(44px, 6.4vw, 112px); font-weight: 700; letter-spacing: -.045em; line-height: .9; }
.h-lg  { font-size: clamp(32px, 3.8vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: .95; }
.sub   { font-size: clamp(15px, 1.25vw, 20px); font-weight: 600; letter-spacing: -.01em; margin-top: 14px; }
.body  { font-size: clamp(14px, 1.02vw, 16px); line-height: 1.6; max-width: 46ch; }

.hexdot {
  display: inline-block; width: .2em; height: .2em; margin-left: .08em; vertical-align: super;
  border: .055em solid currentColor;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  background: transparent;
  outline: 0;
  position: relative;
}
.hexdot { border: 0; background: currentColor; -webkit-mask: radial-gradient(circle, transparent 32%, #000 34%); mask: radial-gradient(circle, transparent 32%, #000 34%); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 22px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.btn svg { width: 11px; height: 11px; fill: currentColor; }
.btn--ink { background: var(--ink); color: var(--sage); }
.btn--ink:hover { background: var(--orange); color: var(--ink); }

.pill-row { display: flex; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; padding: 11px 20px;
  border: 1.5px solid currentColor; border-radius: 999px;
  transition: background .3s, color .3s;
}
.pill:hover { background: var(--silver); color: var(--ink); }
.pill--ink { border-color: var(--ink); color: var(--ink); }
.pill--ink:hover { background: var(--ink); color: var(--sage); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill--fill { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.pill--fill:hover { background: var(--sage); border-color: var(--sage); }

/* =========================================================
   MEDIA (video slot + animated placeholder)
   ========================================================= */
.media {
  position: relative; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 75%, #000); color: var(--silver);
  isolation: isolate;
}
.media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .6s; z-index: 2;
}
.media.has-video video { opacity: 1; }
.media.has-video .media-ph { opacity: 0; }

.media-ph {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(color-mix(in srgb, var(--silver) 7%, transparent) 1px, transparent 1px) 0 0 / 100% 12.5%,
    linear-gradient(90deg, color-mix(in srgb, var(--silver) 7%, transparent) 1px, transparent 1px) 0 0 / 8.333% 100%,
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--ink) 88%, var(--silver)) 0%, color-mix(in srgb, var(--ink) 75%, #000) 70%);
  transition: opacity .6s;
}
.ph-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; } /* dimmed until hover */
.media-ph > span { z-index: 1; }
.media:hover .ph-poster, .media:focus-visible .ph-poster { opacity: 1; }
.ph-poster { transition: opacity .6s var(--ease); }
/* Showreel cover and case study card images: dark and black & white until hover, then bright and
   in colour. Touch screens can't hover, so there they simply stay in full colour. */
.media--reel .ph-poster, .media--reel video, .media--card .ph-poster { transition: opacity .6s var(--ease), filter .6s var(--ease); }
@media (hover: hover) {
  .media--reel .ph-poster, .media--reel video, .media--card .ph-poster { filter: grayscale(1) brightness(.55); }
  .media--reel:hover .ph-poster, .media--reel:focus-visible .ph-poster,
  .media--reel:hover video, .media--reel:focus-visible video,
  .card-in:hover .ph-poster, .card-in:focus-visible .ph-poster { filter: none; opacity: 1; }
}
@media (hover: none) { .media--reel .ph-poster, .media--card .ph-poster { opacity: 1; } }
/* Nothing to show yet: an orange X corner to corner + "Coming soon" */
.media-ph--soon::before {
  content: ""; position: absolute; inset: 0;
  opacity: .25; /* X lines only; the "Coming soon" label stays full strength */
  --x: var(--orange);
  background:
    linear-gradient(to top right, transparent calc(50% - .8px), var(--x) calc(50% - .8px), var(--x) calc(50% + .8px), transparent calc(50% + .8px)),
    linear-gradient(to bottom right, transparent calc(50% - .8px), var(--x) calc(50% - .8px), var(--x) calc(50% + .8px), transparent calc(50% + .8px));
}
.ph-soon {
  position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
  padding: 8px 14px; white-space: nowrap;
  background: color-mix(in srgb, var(--ink) 80%, #000); color: var(--silver);
  border: 1px solid var(--orange);
}
.media--soon { cursor: default; }
.ph-cross { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.ph-cross::before, .ph-cross::after { content: ""; position: absolute; background: var(--orange); }
.ph-cross::before { left: 50%; top: 0; bottom: 0; width: 1.5px; }
.ph-cross::after  { top: 50%; left: 0; right: 0; height: 1.5px; }
.ph-rec, .ph-file, .ph-tc, .ph-fmt { position: absolute; font-size: 10px; opacity: .85; }
.ph-rec { left: 18px; top: 16px; display: flex; align-items: center; gap: 8px; color: var(--orange); }
.ph-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: blink 1.2s steps(2, start) infinite; }
.ph-file { right: 18px; top: 16px; }
.ph-tc   { left: 18px; bottom: 16px; font-variant-numeric: tabular-nums; }
.ph-fmt  { right: 18px; bottom: 16px; }
.ph-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(84px, 8vw, 116px); aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: var(--orange); color: var(--ink); font-weight: 700;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  transition: transform .4s var(--ease);
}
.ph-play svg { width: 16px; height: 16px; fill: currentColor; margin-left: 3px; /* optical centring of the triangle */ }
.media:hover .ph-play { transform: translate(-50%, -50%) scale(1.06); }

.media .corners { position: absolute; inset: 10px; z-index: 3; pointer-events: none; color: var(--silver); }
.media .corners i { width: 16px; height: 16px; }

/* =========================================================
   00 — INDEX / HERO
   ========================================================= */
.hero { height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(16px, 3vh, 32px); padding-bottom: calc(var(--hud-h) + 36px + clamp(16px, 3vh, 32px)); }
/* The hero text is split across layers: blocks marked .lift sit above the voronoi cells, the rest
   sit under them like the "026". #index's .p-inner drops its own layer so its blocks can interleave
   with the canvas. */
#index .p-inner { z-index: auto; }
.hero .lift { position: relative; z-index: 2; }
/* text under the cells is dimmed towards the background, like the "026" (higher --sink = fainter) */
.hero { --sink: 78%; }
.hero-title .line--sub { --sink: 50%; } /* "makes things move." stays easier to read */
.hero-division, .hero-title .line--sub, .hero-sys { color: color-mix(in srgb, var(--ink) var(--sink), var(--silver)); }
.hero-title .line--sub em { color: color-mix(in srgb, var(--ink) var(--sink), var(--orange)); }
.hero-top { display: grid; grid-template-columns: repeat(6, 1fr); align-items: start; }
.slot-brand { grid-column: 1 / span 2; justify-self: start; }
.bracket-box {
  position: relative;
  display: flex; flex-direction: column;
  padding: 16px 22px;
  font-family: var(--mono); font-weight: 500; font-size: clamp(20px, min(2.6vw, 4vh), 44px); line-height: 1.15; letter-spacing: .02em;
}
.bracket-box::before, .bracket-box::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 14px;
  border: 3px solid currentColor;
}
.bracket-box::before { left: 0; border-right: 0; }
.bracket-box::after  { right: 0; border-left: 0; }
.hero-division { grid-column: 3 / span 3; padding-top: 10px; }

.hero-title {
  font-size: clamp(52px, min(10.4vw, 14.5vh), 196px);
  font-weight: 700; letter-spacing: -.055em; line-height: .86;
  color: var(--silver);
}
/* voronoi cells that light up under the pointer (drawn by JS, between the hero's text layers) */
.grid-fx { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; pointer-events: none; color: var(--silver); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .2em; margin-bottom: -.16em; }
/* second line, scaled so its full stop lines up with the far edge of the "K" above */
.hero-title .line--sub { font-size: .455em; letter-spacing: -.055em; white-space: nowrap; }
.hero-title .line > span { display: inline-block; }
.hero-title .line [data-reveal] { transform: translate3d(0, 105%, 0); }
.is-active .hero-title .line [data-reveal] { transform: none; }
.hero-title em { font-style: normal; color: var(--orange); }
.hero-title .reg {
  font-size: .34em; margin-left: .35em; vertical-align: top; position: relative; top: .25em;
  font-weight: 500; letter-spacing: 0;
}

.hero-foot { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 0; }
.hero-hint { grid-column: 1 / span 2; opacity: .75; }
.hint-arr { display: inline-block; animation: hint 1.8s var(--ease) infinite; }
@keyframes hint { 0%, 100% { transform: none; } 50% { transform: translateX(7px); } }
.hero-sys { grid-column: 3 / span 3; }
.slot-status { grid-column: 6; justify-self: end; }
.status { display: flex; flex-direction: column; }
.status-label { background: var(--silver); color: var(--ink); padding: 3px 8px; margin-bottom: 6px; }
.status strong { font-size: clamp(30px, min(3.6vw, 6vh), 60px); letter-spacing: -.05em; line-height: .9; }

.vert {
  position: absolute; z-index: 2; right: calc(var(--gut) + 4px); top: calc(var(--nav-h) + 24px);
  writing-mode: vertical-rl;
  display: flex; gap: 6px; font-size: 11px;
}
.vert span { white-space: nowrap; }
.vert-bar {
  display: block; width: 14px; height: clamp(60px, 18vh, 200px); margin-top: 20px;
  background: repeating-linear-gradient(to bottom, var(--silver) 0 18px, var(--ink) 18px 19px);
}

.ticker {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: var(--hud-h);
  height: 36px; overflow: hidden;
  background: var(--orange); color: var(--ink);
  display: flex; align-items: center;
}
/* JS repeats the words to cover the strip and sets --set-w (one set's width) so the loop is seamless */
.ticker-track { display: flex; flex: none; width: max-content; white-space: nowrap; animation: tick 38s linear infinite; font-weight: 700; font-size: 12px; }
.ticker-track span { padding: 0 22px; position: relative; }
.ticker-track span::after {
  content: ""; position: absolute; right: -2.5px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: currentColor;
}
@keyframes tick { to { transform: translateX(calc(-1 * var(--set-w, 50%))); } }

/* =========================================================
   01 — SHOWREEL
   ========================================================= */
.reel { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; column-gap: 0; }
.reel-meta { grid-column: 1 / span 4; padding-right: clamp(20px, 3vw, 56px); display: flex; flex-direction: column; align-items: flex-start; }
.logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-row .mono { font-size: 10.5px; line-height: 1.25; }
.tri-bar { display: grid; grid-template-columns: 5fr 5fr 1.5fr; width: 100%; height: 5px; margin-bottom: clamp(24px, 5vh, 56px); }
.tri-bar i:nth-child(1) { background: var(--ink); }
.tri-bar i:nth-child(2) { background: var(--grey); }
.tri-bar i:nth-child(3) { background: var(--orange); }
.reel-meta .body { margin: 22px 0 28px; }
.tone-mobo .btn--ink:hover { background: var(--ink-2); color: var(--white); }

.reel-frame-wrap { grid-column: 5 / span 8; }
.media--reel {
  width: min(100%, calc((100dvh - var(--nav-h) - var(--hud-h) - 230px) * 16 / 9));
  aspect-ratio: 16 / 9;
  margin-left: auto;
}

.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 22px; margin-left: auto;
  width: min(100%, calc((100dvh - var(--nav-h) - var(--hud-h) - 230px) * 16 / 9));
  border: 1.5px solid var(--ink);
}
.stat { display: flex; flex-direction: column; padding: 4px 4px 12px; border-right: 1.5px solid var(--ink); }
.stat:last-child { border-right: 0; }
.stat .stat-k { position: absolute; transform: translateY(-26px); margin-left: -4px; }
.stat { position: relative; }
.stat-bar { display: block; height: 10px; background: var(--ink); margin-bottom: 18px; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease) .5s; }
.is-active .stat-bar { transform: scaleX(1); }
.stat-bar--grey { background: var(--grey); }
.stat-bar--orange { background: var(--orange); }
.stat strong { font-size: clamp(26px, 2.8vw, 46px); letter-spacing: -.045em; line-height: 1; padding: 0 12px; }
.stat > .mono:last-child { padding: 6px 12px 0; font-size: 9.5px; }
.stat-row { margin-top: 44px; }

/* dark showreel: a fixed 94% black whatever the colour scheme, with the ink-coloured details swapped for silver */
#reel { --ink: #0f0f0f; --ink-2: #1a1a1a; }
#reel .bignum--reel { color: color-mix(in srgb, var(--ink) 86%, var(--silver)); }
#reel .tri-bar i:nth-child(1), #reel .stat-bar:not([class*="--"]) { background: var(--silver); }
#reel .stat-row, #reel .stat { border-color: var(--silver); }
#reel .stat-row { background: rgb(0 0 0 / .55); } /* darker panel, still lets "SHOWREEL" show through */
/* the tools list is long, so it shrinks to fit its cell on one line (the text is ~15.2em wide) */
.stat--tools { container-type: inline-size; }
.stat--tools strong { white-space: nowrap; font-size: calc((100cqi - 32px) / 15.2); line-height: clamp(26px, 2.8vw, 46px); } /* same row height as the other cells */
#reel .btn--ink { background: var(--silver); color: var(--ink); }
#reel .btn--ink:hover { background: var(--orange); color: var(--ink); }

/* =========================================================
   02 — CASE STUDIES
   ========================================================= */
.work { display: flex; flex-direction: column; height: 100%; min-height: 100%; }
.work-head {
  display: grid; grid-template-columns: repeat(12, 1fr); align-items: end;
  padding-bottom: 20px; margin-bottom: clamp(16px, 3vh, 28px);
  border-bottom: 2px solid var(--ink);
}
.work-head .h-xl { grid-column: 1 / span 7; }
.work-head .mono-lg { grid-column: 8 / span 3; font-size: clamp(11px, 1vw, 14px); }
.work-note { grid-column: 11 / span 2; justify-self: end; text-align: right; opacity: .6; }

.cards { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.4vw, 22px); }
.card { min-height: 0; }
.card-in {
  height: 100%; display: flex; flex-direction: column;
  border-radius: var(--box-r);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 18px 40px -22px rgba(0,0,0,.45);
  transition: transform .5s var(--ease);
}
.card:hover .card-in { transform: translateY(-6px); }
.card-head { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1.5px solid currentColor; margin-bottom: 12px; }
.media--card { flex: 1; min-height: 140px; }
.media--card .ph-cross { width: 26%; }
.card-in[data-case] { cursor: pointer; }
.card h3 { font-size: clamp(20px, 1.9vw, 32px); letter-spacing: -.04em; line-height: 1; margin-top: 16px; }
.tags { margin-top: 8px; opacity: .75; font-size: 10px; }
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 10px; border-top: 1.5px solid currentColor;
}
.arr { display: inline-block; transition: transform .4s var(--ease); }
/* cards and the contact ticket lean towards the pointer (JS sets --rx / --ry on [data-tilt]) */
@media (hover: hover) and (pointer: fine) {
  .is-active .card[data-tilt]:hover .card-in {
    transform: perspective(900px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .25s ease-out;
  }
  .ticket-tilt[data-tilt] .ticket { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s ease-out; }
}
.card:hover .arr, .socials a:hover .arr { transform: translateX(6px); }

.card--orange .card-in { background: var(--orange); color: var(--ink); }
.card--ink .card-in    { background: var(--ink); color: var(--silver); }
.card--ink .media--card { outline: 1px solid color-mix(in srgb, var(--silver) 20%, transparent); }
.card--white .card-in  { background: var(--white); color: var(--ink); }
.card--white .card-head span:first-child { color: var(--orange); }
.card--sage .card-in   { background: var(--sage); color: var(--ink); }


/* =========================================================
   03 — mobotato (dark, live objkt loop collage)
   ========================================================= */
.tone-mobo {
  background: var(--ink); color: var(--silver);
  --line: color-mix(in srgb, var(--silver) 16%, transparent);
  --orange: var(--m-red); --grey: var(--m-teal-2);
}
.tone-mobo .tri-bar i:nth-child(1) { background: var(--silver); }
/* M O B O tile grid behind the page (drawn by JS). Change these to recolour it. */
.mobo-fx {
  position: absolute; top: 0; left: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; /* JS sets the height to the full scroll height */
  --tile: #161716;      /* tile face */
  --tile-edge: #0b0b0b; /* gaps between tiles */
  --tile-ink: #232423;  /* letters at rest */
  --tile-lit: #f2f2f2;  /* hover highlight */
  --tile-glow: #ff6a1f; /* click glow with ?glow=orange (by default each letter picks a random colour) */
}
/* dark panels that sit over the tile grid, behind the text and the loops. The backing is a
   ::before that JS stretches (--bl/--bt/--br/--bb) out to the nearest tile edges, so the panels
   line up with the grid instead of cutting across tiles. */
#mobotato { --mobo-panel: #0e0f0e; --mobo-panel-soft: rgb(14 15 14 / .8); --mobo-pad: clamp(14px, 1.6vw, 24px); }
#mobotato .reel-meta { position: relative; padding: var(--mobo-pad); margin-right: clamp(20px, 3vw, 56px); }
#mobotato .reel-meta::before, .mobo-box::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(-1 * var(--bt, 0px)) calc(-1 * var(--br, 0px)) calc(-1 * var(--bb, 0px)) calc(-1 * var(--bl, 0px));
  background: var(--mobo-panel); border-radius: 3px;
}
#mobotato .reel-meta::before { background: var(--mobo-panel-soft); } /* 80%: a hint of the grid shows through */
.h-fit { font-size: clamp(40px, 5vw, 92px); }

.btn--accent { background: var(--orange); color: var(--ink); }
.btn--accent svg { width: 14px; height: 14px; }
.btn--accent:hover { background: var(--silver); }
/* same shape as Shuffle, filled a step darker than the page behind it */
.btn--deep { background: color-mix(in srgb, var(--ink) 55%, #000); color: var(--silver); }
.btn--deep svg { width: 14px; height: 14px; }
.btn--deep:hover { background: var(--silver); color: var(--ink); }

.mobo-wrap {
  grid-column: 5 / span 8;
  --sz: min(100% - 2 * var(--mobo-pad), calc(100dvh - var(--nav-h) - var(--hud-h) - 130px - 2 * var(--mobo-pad)));
  display: flex; flex-direction: column; align-items: center; /* centred between the info column and the edge */
}
.mobo-box { position: relative; width: var(--sz); padding: var(--mobo-pad); box-sizing: content-box; }
.mobo-box > * { width: 100%; }
.mobo-grid {
  --cols: 4;
  --tile-r: 14px; /* tile corner radius; set to 0 for square tiles */
  aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px;
}
.mobo-grid:empty {
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--silver) 30%, transparent);
}
.mobo-grid:empty::before {
  content: attr(data-status);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .6;
}
.mobo-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; opacity: .7; }

.mobo-cell {
  position: relative; overflow: hidden; padding: 0;
  border-radius: var(--tile-r);
  isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); /* keeps corners clipped while the video scales (Safari) */
  background: var(--ink-2);
  animation: cellIn .8s var(--ease) both; animation-delay: calc(var(--i) * 40ms);
}
@keyframes cellIn { from { opacity: 0; transform: scale(.88); } }
.mobo-cell img, .mobo-cell video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mobo-cell img { opacity: .7; filter: grayscale(.35); transition: opacity .5s, filter .5s, transform .8s var(--ease); }
.mobo-cell video { opacity: 0; transition: opacity .6s; }
.mobo-cell.is-playing video { opacity: 1; }
.mobo-cell.is-frame video { opacity: .7; filter: grayscale(.35); }
.mobo-cell img:not([src]) { display: none; }
.mobo-cell:hover img { opacity: 1; filter: none; }
.mobo-cell:hover img, .mobo-cell:hover video { transform: scale(1.04); }
.mobo-cell video { transition: opacity .6s, transform .8s var(--ease); }
.mobo-cell-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 22px 8px 7px; text-align: left; font-size: 9px; text-transform: none;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s var(--ease);
}
.mobo-cell:hover .mobo-cell-label, .mobo-cell:focus-visible .mobo-cell-label { opacity: 1; transform: none; }
.mobo-cell .corners { position: absolute; inset: 9px; z-index: 2; color: #fff; opacity: 0; transition: opacity .3s; }
.mobo-cell .corners i { width: 10px; height: 10px; }
.mobo-cell:hover .corners { opacity: 1; }
/* shutter wipe when a tile swaps to a new loop */
.mobo-cell::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  background: var(--orange);
  transform: scaleX(0); transform-origin: right;
  transition: transform .38s cubic-bezier(.7, 0, .3, 1);
}
.mobo-cell.is-out::after { transform: scaleX(1); transform-origin: left; }

/* =========================================================
   04 — PRESS (masonry wall; cards size to their content)
   ========================================================= */
.press-wall { display: flex; align-items: flex-start; gap: clamp(10px, 1.4vw, 20px); }
.press-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: clamp(10px, 1.4vw, 20px); }

.pcard {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--box-r);
  padding: 14px;
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 18px 40px -24px rgba(0,0,0,.45);
  transition: transform .5s var(--ease);
}
a.pcard:hover { transform: translateY(-5px); }
.pcard-head, .pcard-foot { display: flex; justify-content: space-between; gap: 10px; }
.pcard-head { padding-bottom: 10px; border-bottom: 1.5px solid currentColor; margin-bottom: 12px; }
.pcard-foot { margin-top: 16px; padding-top: 10px; border-top: 1.5px solid currentColor; }
a.pcard:hover .arr { transform: translate(3px, -3px); }

.pcard-img { position: relative; overflow: hidden; margin-bottom: 14px; background: var(--ink-2); }
.pcard-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
a.pcard:hover .pcard-img img { transform: scale(1.04); }
.pcard-img--ph {
  background:
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) 10%, transparent) 0 2px, transparent 2px 10px),
    var(--paper);
}
.pcard-kicker { align-self: flex-start; background: var(--orange); color: var(--ink); padding: 3px 8px; margin-bottom: 10px; font-weight: 700; }
.pcard h3 { font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
.pcard--l h3 { font-size: clamp(26px, 2.5vw, 44px); }
.pcard--m h3 { font-size: clamp(21px, 1.75vw, 30px); }
.pcard--s h3 { font-size: clamp(17px, 1.3vw, 22px); line-height: 1.1; }
.pcard-text { font-size: 14px; line-height: 1.55; margin-top: 10px; opacity: .8; }

.pcard--award { background: var(--orange); }
.award-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.pcard--award .award-icon { flex: none; width: clamp(36px, 3vw, 48px); height: auto; aspect-ratio: 1; }
.award-result { font-size: clamp(34px, 3.4vw, 60px); font-weight: 800; letter-spacing: -.055em; line-height: .88; }

.pcard--quote { background: var(--ink); color: var(--silver); }
.pcard--quote .qmark { display: block; height: .5em; font-size: 96px; font-weight: 800; line-height: .9; color: var(--orange); }
.pcard--quote blockquote { font-size: clamp(20px, 1.7vw, 28px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin-top: 18px; }

.pcard-example {
  position: absolute; top: -9px; right: 12px; z-index: 1;
  padding: 3px 7px; font-size: 9px; background: var(--ink); color: var(--white);
}
.pcard--quote .pcard-example { background: var(--orange); color: var(--ink); }

/* =========================================================
   05 — ABOUT
   ========================================================= */
.tone-orange .crosses { color: var(--ink); }
.about {
  display: grid; grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr auto; gap: clamp(14px, 2vw, 24px) 0;
  height: auto; min-height: 100%;
  padding-top: calc(var(--nav-h) + clamp(12px, 2.4vh, 36px));
}
.about-main { grid-column: 1 / span 7; padding-right: clamp(14px, 2vw, 24px); }
.about-side { grid-column: 8 / span 5; }
/* text on the left of the About box, photo slot on the right */
.about-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(18px, 2.2vw, 32px); margin: clamp(8px, 1.4vh, 18px) 0 8px; }
/* the headline sets the column width; the text is held to exactly that measure */
.about-copy { min-width: 0; width: fit-content; max-width: 100%; display: flex; flex-direction: column; }
.about-copy .h-lg { white-space: nowrap; }
.about-copy .h-lg { margin: 0 0 10px; font-size: clamp(30px, min(4vw, 6.2vh), 66px); }
.about-split .about-text { columns: 1; margin-bottom: 0; }
.about-split .about-text { width: 0; min-width: 100%; }
.about-split .about-text p:last-child { margin-bottom: 0; } /* shorter lines, more vertical rhythm */
.about-split .about-text p { font-size: clamp(12px, min(.9vw, 1.6vh), 14.5px); line-height: 1.55; margin-bottom: .75em; }
.about-photo-frame { margin: 0; min-height: 0; }
.about-photo-frame .media, .about-photo { display: block; width: 100%; height: 100%; min-height: 200px; object-fit: cover; object-position: 50% 100%; border-radius: var(--box-r); }
.about-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--ink); background: var(--orange); }

.box { height: 100%; padding: clamp(16px, min(2.2vw, 3vh), 32px); display: flex; flex-direction: column; }
.box--white { background: var(--white); color: var(--ink); }
.box--ink { background: var(--ink); color: var(--silver); }
.box-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1.5px solid currentColor; margin-bottom: auto; }
.box--white .box-head span:nth-child(2) { background: var(--orange); padding: 2px 10px; }
.box .h-lg { margin: clamp(20px, 4vh, 48px) 0 18px; }
.about-text { columns: 2; column-gap: clamp(20px, 2.4vw, 36px); margin-bottom: 16px; }
.about-text p { font-size: clamp(13px, .98vw, 15.5px); line-height: 1.55; break-inside: avoid; margin-bottom: .8em; }
.about-chat { font-weight: 700; border-bottom: 1.5px solid currentColor; }
.about-chat:hover { color: var(--orange); filter: brightness(.85); }
.about-chat:hover .arr { transform: translateX(5px); }
.box-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1.5px solid currentColor; font-size: 10px; }

.big-id { font-size: clamp(90px, 12vw, 220px); font-weight: 800; letter-spacing: -.07em; line-height: .8; margin: 18px 0 10px; color: var(--silver); }
.big-id sup { font-size: .18em; font-weight: 500; vertical-align: top; position: relative; top: .3em; margin-left: .1em; letter-spacing: 0; }
.caps { margin-top: auto; }
.caps li { display: flex; gap: 14px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--silver) 20%, transparent); }
.caps li span { color: var(--orange); }
.tag { align-self: flex-start; margin-top: 16px; padding: 8px 12px; background: var(--orange); color: var(--ink); font-weight: 700; }

.tstat { display: flex; flex-direction: column; padding: 10px 14px 12px; border-right: 2px solid var(--ink); }
.tstat:last-child { border-right: 0; }
.tstat i { display: block; height: 8px; background: var(--ink); margin: 8px 0 12px; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease) .55s; }
.tstat i.g { background: var(--grey); }
.tstat i.w { background: var(--white); }
.is-active .tstat i { transform: scaleX(1); }
.tstat strong { font-size: clamp(28px, min(3.4vw, 5vh), 64px); letter-spacing: -.05em; line-height: .9; }
.tstat .mono:last-child { margin-top: 6px; font-size: 9.5px; }

/* =========================================================
   06 — RESUME
   ========================================================= */
.resume { display: flex; flex-direction: column; gap: clamp(18px, 3.5vh, 40px); }
.resume-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding-bottom: 18px; border-bottom: 3px solid var(--sage);
}
.resume-head .h-xl { color: var(--sage); margin-top: 10px; }
.resume-head .sub { color: var(--orange); margin-top: 0; }
.resume-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; }

.gantt { display: flex; flex-direction: column; gap: 8px; }
.g-row {
  display: grid; grid-template-columns: minmax(200px, 24%) repeat(var(--years), minmax(0, 1fr));
  align-items: stretch; position: relative;
}
.g-label { display: flex; flex-direction: column; justify-content: center; padding-right: 14px; }
.g-label b { font-size: clamp(13px, 1.1vw, 17px); font-weight: 600; color: var(--white); letter-spacing: -.01em; }
.g-label small { opacity: .6; margin-top: 2px; font-size: 9.5px; }
.g-phase { gap: 0; }
.g-ph { font-size: clamp(12px, 1vw, 15px); font-weight: 600; padding-bottom: 8px; border-bottom: 5px solid; }
.g-ph--a { color: var(--orange); border-color: var(--orange); margin-right: 8px; }
.g-ph--b { color: var(--sage); border-color: var(--sage); }
.g-years { border: 1.5px solid color-mix(in srgb, var(--silver) 35%, transparent); border-left: 0; border-right: 0; }
.g-years span:not(.g-label) { padding: 8px 0; text-align: center; letter-spacing: 0; border-left: 1px solid color-mix(in srgb, var(--silver) 20%, transparent); font-size: 10px; opacity: .7; }
.g-row:not(.g-years):not(.g-phase) {
  min-height: clamp(44px, 7vh, 64px);
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc((100% - 0px) / 1), transparent 100%);
}
.g-bar {
  grid-row: 1; display: flex; align-items: flex-end; padding: 8px 10px;
  background: var(--orange); color: var(--ink);
  transform-origin: left; transform: scaleX(0);
  transition: transform 1s var(--ease) calc(var(--d, 0) * 1ms + 300ms);
}
.g-row[data-reveal] .g-bar { transition-delay: calc(var(--d, 0) * 1ms + 350ms); }
.is-active .g-bar { transform: scaleX(1); }
.g-bar .mono { font-size: 9.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar--sage { background: var(--sage); }
.g-bar--hatch {
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--orange) 90%, transparent) 0 2px, transparent 2px 9px);
  outline: 1.5px solid var(--orange); outline-offset: -1.5px; color: var(--orange);
}
.g-bar--hatch .mono { background: var(--ink); padding: 2px 6px; }
.g-label { grid-column: 1; grid-row: 1; }

.skills { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(12px, 2vw, 28px); padding-top: 18px; border-top: 1.5px solid color-mix(in srgb, var(--silver) 35%, transparent); }
.skill { display: flex; flex-direction: column; justify-content: flex-end; } /* bars line up even when a label wraps */
.skill .mono { display: block; margin-bottom: 10px; }
.skill i {
  display: block; height: 14px; position: relative;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--silver) 18%, transparent) 0 6px, transparent 6px 8px);
}
.skill i::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--sage) 0 6px, transparent 6px 8px);
  transform-origin: left; transform: scaleX(0);
  transition: transform 1.2s var(--ease) .8s;
}
.is-active .skill i::after { transform: scaleX(var(--v)); }

/* =========================================================
   05 — CONTACT
   ========================================================= */
.contact { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; }
.contact-main { grid-column: 1 / span 7; }
.contact-main .h-xxl { margin: 18px 0 clamp(20px, 4vh, 44px); }
.email {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: clamp(20px, 2.4vw, 40px); font-weight: 600; letter-spacing: -.03em;
  padding-bottom: 6px; border-bottom: 3px solid var(--ink);
  transition: color .3s, border-color .3s;
}
.email:hover { color: var(--orange); border-color: var(--orange); }
.email span { font-size: .7em; }
.selectable { user-select: text; }

.socials { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; margin-top: clamp(22px, 4vh, 40px); max-width: 620px; }
.socials a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1.5px solid var(--ink);
  font-size: clamp(16px, 1.3vw, 20px); font-weight: 600;
}
.socials a .arr { margin-left: auto; }
.soc-ico { flex: none; width: 20px; height: 20px; fill: currentColor; margin-right: 2px; }
.socials a:hover { color: var(--orange); }

.ticket-wrap { grid-column: 9 / span 4; justify-self: end; width: min(100%, 340px); }
/* tilt + shadow live on a wrapper around the ticket */
.ticket-tilt { position: relative; transform: rotate(2deg); filter: drop-shadow(0 18px 22px rgba(0,0,0,.32)); }
.is-active .ticket-tilt[data-reveal] { transform: rotate(2deg); }
.ticket {
  background: var(--orange); color: var(--ink);
  padding: 16px 16px 18px;
  border-radius: var(--box-r); overflow: hidden; /* white panels inside run to the edge, so clip them to the corners */
}
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; background: var(--white); margin: -16px -16px 0; padding: 16px; }
.ticket-icon { width: 44px; height: 44px; color: var(--orange); }
.ticket-name { font-size: 18px; font-weight: 700; text-align: right; line-height: 1; letter-spacing: -.02em; }
.ticket-big {
  background: var(--white); margin: 0 -16px; padding: 0 16px 10px;
  font-size: clamp(90px, 10vw, 150px); font-weight: 800; letter-spacing: -.08em; line-height: .82;
}
.ticket-card { background: var(--white); margin-top: 14px; padding: 14px; border-radius: 6px; }
.barcode {
  height: 46px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px);
  border-bottom: 1.5px dashed var(--ink); padding-bottom: 8px; margin-bottom: 12px;
}
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ticket-grid span { display: block; font-size: 9px; opacity: .7; }
.ticket-grid strong { font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -.04em; line-height: 1; }
.ticket-foot { margin-top: 12px; font-size: 8.5px; opacity: .7; }

.legal { position: absolute; z-index: 2; left: var(--gut); bottom: calc(var(--hud-h) + 8px); opacity: .55; font-size: 9.5px; }

/* =========================================================
   FIXED HUD (bottom)
   ========================================================= */
/* the same near-black bar on every page; its top meets the home page ticker */
.hud {
  --fg: var(--silver); --chip: var(--orange);
  background: rgba(0,0,0,.75);
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: var(--hud-h);
  padding: 0 var(--gut) max(0px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: clamp(14px, 2vw, 28px);
  color: var(--fg); transition: color .6s var(--ease), background-color .4s var(--ease);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.arrow {
  position: relative; flex: none;
  width: 58px; height: 58px; display: grid; place-items: center;
  transition: color .3s, opacity .3s;
}
.arrow::before {
  content: ""; position: absolute; inset: 7px;
  background: var(--chip); transform: scale(0); transition: transform .4s var(--ease), background .6s;
}
.arrow svg { position: relative; width: 22px; height: 22px; transition: transform .4s var(--ease); }
.arrow .corners { position: absolute; inset: 0; }
.arrow .corners i { width: 12px; height: 12px; }
.arrow:hover:not(:disabled)::before { transform: scale(1); }
.arrow:hover:not(:disabled) { color: var(--ink); }
.arrow--next:hover:not(:disabled) svg { transform: translateX(3px); }
.arrow--prev:hover:not(:disabled) svg { transform: translateX(-3px); }
.arrow:disabled { opacity: .25; cursor: default; }

.hud-center { flex: 1; min-width: 0; }
.hud-label { display: flex; justify-content: space-between; margin-bottom: 10px; }
.hud-label b { font-weight: 700; }
.hud-hint { opacity: .6; }
/* "Next — Showreel →": names the next page and takes you there */
.hud-next { text-transform: inherit; letter-spacing: inherit; white-space: nowrap; transition: opacity .3s, color .3s; }
.hud-next:hover, .hud-next:focus-visible { opacity: 1; color: var(--chip); }
.hud-next:hover .arr { transform: translateX(4px); }
.progress { position: relative; height: 4px; display: grid; gap: 4px; }
.progress button { position: relative; height: 4px; padding: 0; background: currentColor; opacity: .22; transition: opacity .3s; }
.progress button::after { content: ""; position: absolute; inset: -10px 0; }
.progress button:hover { opacity: .5; }
.progress button.is-past { opacity: .9; }
.progress button { transition: opacity .3s, transform .4s var(--ease); }
.progress button.is-current { opacity: 1; background: var(--chip); transform: scaleY(2); transition: opacity .3s, background .6s, transform .4s var(--ease); } /* current page: orange, double height */
.progress-fill { display: none; }

/* =========================================================
   5px CORNERS ON BOXES SITE-WIDE (radius set by --box-r at the top)
   ========================================================= */
.media, .cs-img, .pcard-img, .modal-body,
.box, .about-stats, .stat-row, .g-bar,
.btn, .menu-btn, .case-bar button, .modal-close, .modal-link,
.tag, .pcard-kicker, .pcard-example, .mobo-label, .status-label, .ph-soon,
.cs-meta span:first-child { border-radius: var(--box-r); }
.modal-body { overflow: hidden; }

/* =========================================================
   CASE STUDY PAGES (slide up over the site)
   ========================================================= */
.case-sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  transform: translateY(100%);
  transition: transform .75s var(--ease);
}
.case-sheet[hidden] { display: none; }
.case-sheet.is-open { transform: none; }
.case-bar {
  position: relative; flex: none;
  height: 60px; padding: 0 var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink); color: var(--silver);
}
.case-bar button { padding: 8px 12px; border: 1px solid currentColor; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.case-bar button:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.case-bar-title { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 700; white-space: nowrap; }
.case-bar-right { display: flex; align-items: center; gap: 16px; }
.case-progress { position: absolute; left: 0; bottom: -3px; height: 3px; width: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); z-index: 1; }
.case-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.cs { max-width: 1280px; margin: 0 auto; padding: clamp(32px, 7vh, 80px) var(--gut) 0; }
.cs > * + * { margin-top: clamp(40px, 8vh, 96px); }
.cs-hero-in { will-change: transform, opacity; }
.cs-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.cs-meta span:first-child { background: var(--orange); padding: 2px 8px; }
.cs-title { font-size: clamp(52px, 9vw, 160px); font-weight: 700; letter-spacing: -.05em; line-height: .88; margin: clamp(20px, 4vh, 40px) 0 clamp(16px, 3vh, 28px); }
.cs-lede { font-size: clamp(20px, 2vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.3; max-width: 34ch; }

.cs-fig { margin-inline: 0; margin-bottom: 0; }
.cs-grid .cs-fig { margin: 0; }
.cs-fig .media, .cs-fig .cs-img { display: block; width: 100%; aspect-ratio: var(--ar, 16/9); object-fit: cover; }
.cs-fig figcaption { margin-top: 10px; opacity: .65; }
.cs-fig--portrait { max-width: min(100%, 560px); margin-inline: auto; } /* tall single images, centred */
/* embedded film (YouTube) filling a figure */
.media--embed { cursor: auto; }
.media--embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.cs-facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.cs-facts > div { padding: 14px 16px 0 0; }
.cs-facts dt { opacity: .6; margin-bottom: 6px; }
.cs-facts dd { font-size: clamp(11px, 1.05vw, 14px); font-weight: 600; letter-spacing: -.01em; line-height: 1.35; white-space: nowrap; } /* small, one line each */

.cs-sec { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 clamp(16px, 2vw, 32px); }
.cs-h { grid-column: 1 / span 4; font-size: clamp(28px, 2.8vw, 46px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.cs-h .mono { display: block; margin-bottom: 10px; color: var(--orange); filter: brightness(.85); }
.cs-body { grid-column: 5 / span 7; }
.cs-body p { font-size: clamp(16px, 1.15vw, 19px); line-height: 1.65; max-width: 62ch; }
.cs-body p + p { margin-top: 1em; }

.cs-grid { display: grid; gap: clamp(12px, 1.6vw, 24px); }
.cs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cs-grid--3 { grid-template-columns: repeat(3, 1fr); }

.cs-quote { position: relative; padding-left: clamp(40px, 6vw, 96px); }
.cs-quote::before { content: "“"; position: absolute; left: 0; top: -.08em; font-size: clamp(80px, 9vw, 150px); font-weight: 800; line-height: 1; color: var(--orange); }
.cs-quote p { max-width: 20ch; font-size: clamp(30px, 3.6vw, 60px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; }
.cs-quote footer { margin-top: 18px; opacity: .65; }

.cs-next {
  display: block; margin-top: clamp(56px, 10vh, 120px);
  padding: clamp(40px, 8vh, 90px) max(var(--gut), calc((100% - 1280px) / 2 + var(--gut)));
  background: var(--ink); color: var(--silver);
  transition: background .4s;
}
.cs-next .mono { display: block; margin-bottom: 14px; opacity: .7; }
.cs-next strong { font-size: clamp(44px, 7vw, 120px); font-weight: 700; letter-spacing: -.05em; line-height: .9; }
.cs-next:hover { background: var(--orange); color: var(--ink); }
.cs-next:hover .arr { transform: translateX(10px); }

/* scroll-in reveal (added by JS as each block enters view) */
.cs-r { opacity: 0; transform: translate3d(0, 36px, 0); transition: opacity .8s var(--ease), transform 1s var(--ease); }
.cs-r.cs-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .case-bar-title, .case-count { display: none; }
  .cs-facts { grid-template-columns: repeat(2, 1fr); gap: 0 0; }
  .cs-facts > div { padding-bottom: 14px; }
  .cs-sec { grid-template-columns: 1fr; gap: 16px; }
  .cs-h, .cs-body { grid-column: 1; }
  .cs-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cs-grid--2, .cs-grid--3 { grid-template-columns: 1fr; }
  .cs-facts dd { white-space: normal; } /* too narrow on phones: let long facts wrap */
}

/* =========================================================
   VIDEO MODAL
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--gut); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,21,20,.92); backdrop-filter: blur(6px); animation: fade .4s var(--ease); }
.modal-frame { position: relative; width: min(1280px, 100%, calc((100dvh - 120px) * 16 / 9)); color: var(--silver); animation: rise .6s var(--ease); }
.modal-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 0 12px; }
.modal-bar > span { display: inline-flex; align-items: center; gap: 10px; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
.modal-link { padding: 8px 12px; border: 1px solid currentColor; font-size: 11px; }
.modal-link:hover { background: var(--silver); color: var(--ink); }
.modal-close { padding: 8px 12px; border: 1px solid currentColor; font-size: 11px; }
.modal-close:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.modal-body { position: relative; aspect-ratio: 16 / 9; background: #111; }
.modal-body iframe, .modal-body video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.modal-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.modal-empty p { max-width: 46ch; line-height: 1.7; }
.modal-empty code { color: var(--orange); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.98); } }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1240px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-block; }
  .nav-clock { display: none; }
}

@media (max-width: 900px), (max-height: 620px) and (max-width: 1100px) {
  :root { --nav-h: 64px; --hud-h: 78px; }
  .arrow { width: 48px; height: 48px; }
  .hud-hint { display: none; }
  /* panels scroll vertically on small screens, so the chrome gets a solid backing */
  .nav { background: var(--bg); transition: color .6s var(--ease), background-color .6s var(--ease); }

  .gridlines span:nth-child(n+4) { display: none; }

  .hero-top { grid-template-columns: 1fr; gap: 18px; }
  .slot-brand, .hero-division { grid-column: 1; }
  .hero-foot { grid-template-columns: 1fr; gap: 18px; }
  .hero-hint, .hero-sys, .slot-status { grid-column: 1; justify-self: start; }
  .vert { display: none; }

  .reel, .contact { grid-template-columns: 1fr; gap: 32px; }
  .reel-meta, .reel-frame-wrap, .contact-main, .ticket-wrap, .mobo-wrap { grid-column: 1; }
  .mobo-wrap { --sz: calc(100% - 2 * var(--mobo-pad)); }
  .reel-meta { padding-right: 0; }
  #mobotato .reel-meta { padding-right: var(--mobo-pad); margin-right: 0; }
  .media--reel, .stat-row { width: 100%; }
  .stat-row { margin-top: 40px; }
  .ticket-wrap { justify-self: start; }

  .work { height: auto; }
  .work-head { grid-template-columns: 1fr; gap: 8px; }
  .work-head > * { grid-column: 1 !important; justify-self: start !important; text-align: left !important; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .media--card { aspect-ratio: 4 / 5; flex: none; }

  .about { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .about-main, .about-side, .about-stats { grid-column: 1; padding-right: 0; }
  .about-text { columns: 1; }
  .about-split { grid-template-columns: 1fr; }
  .about-photo-frame .media, .about-photo { aspect-ratio: 4 / 5; height: auto; }
  .about-stats { grid-template-columns: 1fr; }
  .tstat { border-right: 0; border-bottom: 2px solid var(--ink); }
  .tstat:last-child { border-bottom: 0; }

  .resume-head { flex-direction: column; align-items: flex-start; }
  .gantt { overflow-x: auto; padding-bottom: 6px; }
  .g-row { min-width: 820px; }
  .skills { grid-template-columns: repeat(2, 1fr); }

  .legal { position: static; padding: 0 var(--gut) calc(var(--hud-h) + 16px); margin-top: -16px; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .media--card { aspect-ratio: 16 / 10; }
  .socials { grid-template-columns: 1fr; }
  .stat .stat-k { font-size: 9px; }
  .stat strong { font-size: 24px; padding: 0 8px; }
  .stat > .mono:last-child { padding: 6px 8px 0; font-size: 8.5px; }
  .brand-name small { display: none; }
  .nav-count { display: none; }
  .mode { margin-left: 4px; }
  .mode button { padding: 4px 8px; }
}

/* =========================================================
   POINTER FRAME (desktop): a viewfinder bracket that trails the cursor (built by JS)
   ========================================================= */
.cursor {
  --s: 24px; --sx: var(--s); /* frame height and width */
  position: fixed; left: 0; top: 0; z-index: 200; width: 0; height: 0;
  pointer-events: none; opacity: 0; transition: opacity .3s;
  color: #fff; mix-blend-mode: difference; /* stays visible on light and dark pages */
}
.cursor.is-on { opacity: .9; }
.cursor.is-link { --s: 40px; }
.cursor.is-big { --s: 64px; }
.cursor.is-down { --s: 18px; }
body.is-dragging .cursor { --s: 22px; --sx: 76px; }
.cursor i {
  --hx: calc(var(--sx) / 2); --hy: calc(var(--s) / 2);
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px;
  border: 0 solid currentColor; transition: transform .4s var(--ease);
}
.cursor i:nth-child(1) { border-width: 1.5px 0 0 1.5px; transform: translate(calc(4px - var(--hx)), calc(4px - var(--hy))); }
.cursor i:nth-child(2) { border-width: 1.5px 1.5px 0 0; transform: translate(calc(var(--hx) - 4px), calc(4px - var(--hy))); }
.cursor i:nth-child(3) { border-width: 0 0 1.5px 1.5px; transform: translate(calc(4px - var(--hx)), calc(var(--hy) - 4px)); }
.cursor i:nth-child(4) { border-width: 0 1.5px 1.5px 0; transform: translate(calc(var(--hx) - 4px), calc(var(--hy) - 4px)); }
.cursor-tag { /* names what a click will do, just under the frame */
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none;
  margin: 42px 0 0 -32px; min-width: 64px; padding: 3px 6px; text-align: center;
  background: #111; color: #f2f2f2; border-radius: 3px;
  font-size: 9.5px; font-weight: 700; white-space: nowrap;
  opacity: 0; transition: opacity .25s;
}
.cursor-tag.is-on { opacity: 1; }
body.is-dragging .cursor-tag { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .dot, .hint-arr { animation: none; }
  [data-reveal] { transition-duration: .01s; transform: none; }
}
