/* Consolas runs narrower than Geist Mono; matched up, text keeps its line breaks when the real font arrives */
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Consolas");
  size-adjust: 109%;
}

/* Dark (default): deep blue-black with a cold blue accent */
:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0d141f;
  --line: #26344a;
  --line-2: #3d5170;
  --text: #f2f6fd;
  --muted: #bccadf;
  --dim: #adbdd4;
  --accent: #6fd3ff;
  --glow: rgba(111, 211, 255, 0.12);
  /* Tron glows */
  --line-glow: rgba(111, 211, 255, 0.45);
  --text-glow: rgba(111, 211, 255, 0.28);
  --btn-glow: rgba(111, 211, 255, 0.3);
  --num-glow: rgba(111, 211, 255, 0.35);
  --accent-ink: var(--accent);
  --on-accent: var(--bg);
  /* Browser-drawn states: focus ring, caret, active field and label numbers */
  --focus: var(--accent);
  --label-num: #6e9cff;
  /* Filled controls and state text: separate from the accent so each theme can hold contrast */
  --fill: var(--accent);
  --fill-hover: color-mix(in srgb, var(--accent) 78%, white);
  --on-fill-hover: var(--bg);
  --ok: #3fb950;
  --error: #f85149;
  --neon: #3d7bff;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;
  --sans: var(--mono);
  --rail: 64px;
  --pad: clamp(16.74px, 3.35vw, 66.96px);
  --maxw: 1640px;
  /* Left edge of .wrap content, for full-bleed rows that should line up with it */
  --inset: max(var(--pad), calc((100vw - var(--rail) - var(--maxw)) / 2 + var(--pad)));
  --gap: clamp(13.39px, 1.34vw, 23.44px);
}

:root[data-theme="light"] {
  color-scheme: light;
  /* Warm pastel paper: soft cream ground, peach accents. Pastel fills carry dark text; small accent text uses a deeper clay to stay readable */
  --bg: #ebe2d6;
  --bg-2: #f1e9de;
  --line: #ddd0c0;
  --line-2: #c4ad98;
  --text: #3a3028;
  --muted: #5f5246;
  --dim: #6e5f50;
  --accent: #e8a684;
  --glow: rgba(232, 166, 132, 0.08);
  --neon: #8a5139;
  /* Glows stay faint on paper; text halos are off, they only smudge on a light ground */
  --line-glow: rgba(232, 166, 132, 0.18);
  --text-glow: transparent;
  --btn-glow: rgba(232, 166, 132, 0.3);
  --num-glow: transparent;
  --accent-ink: #8a5139;
  --on-accent: #3a2a20;
  /* Pastel peach is too faint for state (1.6:1), so states use clay */
  --focus: #8a5139;
  --label-num: #8a5139;
  --fill: #f0bfa3;
  --fill-hover: #e9a988;
  --on-fill-hover: #2e2119;
  --ok: #4f7a3a;
  --error: #a3352a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(13px, 0.75vw, 14.23px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Interactive dot field behind everything (drawn by script.js) */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Cross-page fade (browsers with View Transitions) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

/* Layout: slim rail on the left, content takes the rest */

.main {
  min-width: 0;
  margin-left: var(--rail);
}

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

.section {
  padding-block: clamp(44px, 4.6vw, 84px);
  border-top: 1px solid var(--line);
}

.skillbar + .section {
  border-top: 0;
}

/* Rail: icon + number per link; labels appear as tooltips so the rail never covers the page */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: var(--rail);
  padding: 20px 0;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}

.rail-brand {
  position: relative;
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.rail-brand img {
  width: 40px;
  height: auto;
  border: 1px solid var(--line-2);
}

.rail-nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link .icon {
  width: 20px;
  height: 20px;
  color: var(--dim);
  transition: color 0.2s;
}

.nav-num {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.rail-tip {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-6px, -50%);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

:is(.nav-link, .rail-brand):hover .rail-tip,
:is(.nav-link, .rail-brand):focus-visible .rail-tip {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Accent bar on the rail edge marks the current page or section */
.nav-link::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: var(--glow);
}

.nav-link:hover .icon,
.nav-link.is-active .icon,
.nav-link.is-active .nav-num {
  color: var(--accent-ink);
}

.nav-link:hover::before,
.nav-link.is-active::before {
  transform: scaleY(1);
}

.cmdk-btn {
  margin-top: auto;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon,
:root[data-theme="light"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: block;
}

:root[data-theme="light"] body {
  font-weight: 500;
  -webkit-font-smoothing: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  transition: color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Telemetry: location, live IST clock, status */

.blink {
  color: var(--accent-ink);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Frames: corner crop-marks instead of a full border */

.label {
  margin-bottom: 18px;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: max(12px, clamp(0.85rem, 0.79vw, 1rem));
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.label span {
  color: var(--dim);
}

h1 {
  font-size: clamp(2.8rem, 4.52vw, 6.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.9rem, 2.51vw, 3.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.1rem, 1vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.muted a,
.prose a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

.section-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: clamp(20.09px, 2.09vw, 33.48px);
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: transparent;
}

/* Hero: the 3D viewport fills the section; the intro sits over it bottom-left */

.viewport {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 60% at 68% 48%, var(--glow), transparent 70%);
}

/* Soft fade on the left so the intro text stays readable over the grid */
.viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 70%, transparent), transparent 55%);
  pointer-events: none;
}

.viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.5s;
}

.viewport.is-loaded canvas {
  opacity: 1;
}

.viewport canvas:active {
  cursor: grabbing;
}

.hud {
  position: absolute;
  z-index: 1;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.hud-tl {
  top: clamp(18.41px, 2.01vw, 33.48px);
  left: var(--inset);
}

.hud-tr {
  top: clamp(18.41px, 2.01vw, 33.48px);
  right: var(--inset);
  display: grid;
  justify-items: end;
  gap: 4px;
}

.hud-tr span:first-child {
  color: var(--accent-ink);
}

/* Copy lets drags fall through to the canvas; only its links stay clickable */
.hero-copy {
  position: relative;
  z-index: 1;
  grid-row: 2;
  pointer-events: none;
}

.hero-copy a {
  pointer-events: auto;
}

/* The rail's logo answers when a machine has something picked */
.rail-brand.is-ping {
  animation: brand-ping 0.9s ease-out;
}

@keyframes brand-ping {
  from {
    box-shadow: 0 0 0 0 var(--accent-ink);
  }

  to {
    box-shadow: 0 0 0 14px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rail-brand.is-ping {
    animation: none;
  }
}

.lede {
  max-width: 38ch;
  margin-top: 24px;
  color: var(--muted);
  font-size: max(14px, clamp(0.9rem, 0.95vw, 1.2rem));
  line-height: 1.5;
}

/* Skill bar: "what i know" button + scrolling tool strip */

.skillbar {
  display: flex;
  /* Lines run full width; the content sits in the same column as the sections */
  padding-inline: var(--inset);
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 45%, transparent);
}

.skill-open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  /* The hover fill runs to the edge of the bar; the label stays in the column */
  margin-left: calc(var(--inset) * -1);
  padding: 0 22px 0 var(--inset);
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.skill-open .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.skill-open:hover {
  background: var(--glow);
}

.skill-open:hover .icon {
  transform: translateX(4px);
}

.marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee span {
  padding: 16px 28px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marquee span::before {
  content: "+";
  margin-right: 28px;
  color: var(--accent-ink);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* About */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  align-items: start;
  gap: clamp(26.78px, 4.19vw, 80.35px);
}

.prose {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.prose p {
  max-width: 62ch;
  color: var(--text);
  font-size: clamp(1rem, 0.88vw, 1.15rem);
  line-height: 1.75;
}

/* Spotlight that follows the cursor (set by script.js) */

/* Experience: a vertical journey track. Each stop has a node on the line; the current one pulses */

.journey {
  position: relative;
  display: grid;
  gap: clamp(33.48px, 3.35vw, 53.57px);
  margin: 0;
  padding: 0 0 0 clamp(26.78px, 2.51vw, 40.18px);
  list-style: none;
}

/* The track: plain where it has been, lit leading into now */
.journey::before {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 0;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--line-2) 55%, transparent);
  box-shadow: 0 0 10px -2px var(--line-glow);
}

.journey::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 7px;
  height: 30px;
  border-left: 2px dashed var(--line-2);
}

.stop {
  position: relative;
}

/* A short branch from the track into each card */
.stop:not(.is-next)::before {
  content: "";
  position: absolute;
  top: calc(clamp(15.07px, 1.67vw, 25.11px) + 13px);
  left: calc(clamp(26.78px, 2.51vw, 40.18px) * -1 + 22px);
  width: calc(clamp(26.78px, 2.51vw, 40.18px) - 22px);
  height: 2px;
  background: var(--line-2);
}

.stop.is-now::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--line-glow);
}

/* Each stop is a panel: role on the left, results as tiles across the rest */
.stop-card {
  display: grid;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px clamp(20.09px, 2.51vw, 40.18px);
  padding: clamp(18.41px, 1.84vw, 28.46px);
}

.stop-node {
  position: absolute;
  top: clamp(15.07px, 1.67vw, 25.11px);
  left: calc(clamp(26.78px, 2.51vw, 40.18px) * -1 - 6px);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stop.is-now .stop-node {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  color: var(--accent-ink);
  box-shadow: 0 0 12px var(--line-glow);
  animation: node-pulse 2.4s ease-in-out infinite;
}

@keyframes node-pulse {
  50% {
    box-shadow: 0 0 22px var(--line-glow);
  }
}

.stop-why {
  margin-top: 14px;
  max-width: 32ch;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* Role column: a soft accent glow, date and duration chips, company in the accent colour */
.stop-meta {
  position: relative;
  background: radial-gradient(120% 70% at 0% 0%, var(--glow), transparent 70%);
  margin: calc(clamp(18.41px, 1.84vw, 28.46px) * -1) 0 calc(clamp(18.41px, 1.84vw, 28.46px) * -1) calc(clamp(18.41px, 1.84vw, 28.46px) * -1);
  padding-top: clamp(18.41px, 1.84vw, 28.46px);
  padding-bottom: clamp(18.41px, 1.84vw, 28.46px);
  padding-left: clamp(18.41px, 1.84vw, 28.46px);
}

.xp-when {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.xp-dates,
.xp-span {
  padding: 3px 6px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.xp-dates {
  color: var(--text);
}

.xp-span {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--glow);
  color: var(--accent-ink);
}

.stop-where strong {
  color: var(--accent-ink) !important;
}

.stop-why {
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.stop-next {
  gap: 8px;
}

.stop-next .icon {
  width: 15px;
  height: 15px;
}

.xp-when {
  margin-top: 4px;
  color: var(--dim);
  font-size: 13px;
}

.stop-meta {
  padding-right: clamp(11.72px, 1.17vw, 20.09px);
  border-right: 1px solid var(--line);
}

.stop h3 {
  text-shadow: 0 0 18px var(--text-glow);
  margin-top: 14px;
  font-size: clamp(1.15rem, 1.17vw, 1.5rem);
}

.stop-where {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.stop-where strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.xp-wins {
  display: grid;
  /* Always four in a row on laptops and up; two on tablets, one on phones */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10.04px, 1vw, 16.74px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.xp-wins li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  border-top: 2px solid var(--line-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), transparent 85%);
  transition: border-color 0.25s, background 0.3s, transform 0.3s;
}

.xp-wins li:hover {
  border-top-color: var(--accent);
  background: linear-gradient(180deg, var(--glow), transparent 85%);
  transform: translateY(-2px);
}

/* The measurement is the headline of each tile */
/* Stat on top: a big figure with a small label under it */
.xp-stat {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  color: var(--accent-ink);
  font-size: clamp(1.6rem, 1.67vw, 2.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px var(--text-glow);
}

.xp-stat span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: none;
}

.xp-what {
  font-size: clamp(0.98rem, 0.88vw, 1.08rem);
}

.xp-how {
  color: var(--muted);
  font-size: 14px;
}

/* 3D: endless carousel inside the page margins (drift, drag and arrow buttons in script.js) */

/* 3D tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--gap);
}

.tiles.is-masonry {
  display: block;
  columns: 3;
  column-gap: var(--gap);
  margin-bottom: 32px;
}

.tiles.is-masonry .tile {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

.tile {
  margin: 0;
}

.tile[hidden] {
  display: none;
}

.tile-link {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.tiles:not(.is-masonry) .tile-link {
  aspect-ratio: 4 / 3;
}

.tile-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s;
}

.tile-link:hover img {
  transform: scale(1.05);
}

.tile figcaption {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  font-size: 0.9em;
}

.tile figcaption span:last-child {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}

/* Page heads and filter chips */

.page-head h1 {
  font-size: clamp(1.9rem, 2.51vw, 3.2rem);
  line-height: 1.05;
}

.page-head .muted {
  max-width: 60ch;
  margin-top: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.chip {
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip.is-active {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--on-accent);
}

.chip sup {
  margin-left: 4px;
  font-size: 12px;
}

/* Contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(26.78px, 4.19vw, 80.35px);
}

.contact .muted {
  max-width: 44ch;
  margin-top: 28px;
  font-size: clamp(1rem, 0.88vw, 1.15rem);
  line-height: 1.75;
}

.mail {
  display: inline-flex;
  gap: 10px;
  margin-top: 28px;
  font-size: clamp(1.1rem, 1.34vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.mail:hover {
  color: var(--accent-ink);
}

/* What a client can hire for: plain rows, each one a way to the proof */
.hire {
  max-width: 44ch;
  margin-top: 28px;
}

.hire ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

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

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

.hire a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 12px 0;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.hire a:hover {
  color: var(--accent-ink);
}

.hire .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--dim);
  transition: color 0.2s, transform 0.2s;
}

.hire a:hover .icon {
  color: var(--accent-ink);
  transform: translateX(4px);
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 28px;
}

.mail-row .mail {
  margin-top: 0;
}

/* Contact form as a terminal */

.term-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.term-dots {
  display: flex;
  gap: 6px;
}

/* One light per field; all three lit means the message is ready to send */
.term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background 0.3s, box-shadow 0.3s;
}

.term-dots i.is-on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.term.is-ready .term-dots i {
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

.term-state {
  margin-left: auto;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.term.is-ready .term-state {
  color: var(--accent-ink);
}

.term-form {
  display: grid;
  padding: clamp(16.74px, 2.01vw, 30.13px);
}

.term-note {
  margin-bottom: 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 15px;
}

.term-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line-2);
  transition: border-color 0.2s;
}

.term-line > span {
  min-width: 11ch;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
  transition: color 0.2s;
}

.term-line:focus-within {
  border-bottom-color: var(--focus);
}

.term-line:focus-within > span {
  color: var(--accent-ink);
}

/* Terminal caret */
.term-line input,
.term-line textarea {
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  resize: none;
  caret-color: var(--neon);
}

.term-line input:focus,
.term-line textarea:focus {
  outline: none;
}

.form-end {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.form-status {
  display: grid;
  flex-basis: 100%;
  gap: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.form-status:empty {
  display: none;
}

.btn:disabled {
  opacity: 0.5;
}

.captcha-down {
  max-width: 52ch;
  color: var(--muted);
}

.captcha-down a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

.form-status span {
  overflow-wrap: anywhere;
  animation: line-in 0.3s ease-out;
}

.form-status .is-ok {
  color: var(--accent-ink);
}

.form-status .is-error {
  color: var(--error);
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}

/* Sent: every light on, a little brighter */
.term.is-sent .term-dots i {
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.term.is-sent .term-state {
  color: var(--accent-ink);
}

.form-status.is-ok {
  color: var(--ok);
}

.form-status.is-error {
  color: var(--error);
}

/* Previous / next bar at the top of sub-pages */

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.page-nav a:hover {
  color: var(--accent-ink);
}

.page-nav .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.25s;
}

.page-nav a:first-child:hover .icon {
  transform: translateX(-3px);
}

.page-nav a:last-child:hover .icon {
  transform: translateX(3px);
}

/* Sub-page header: title on the left, telemetry on the right */

.page-head {
  padding-top: clamp(20.09px, 2.18vw, 36.83px);
  padding-bottom: clamp(24px, 2.4vw, 40px);
  border-top: 0;
}

/* Case study pages */

.case-layout {
  display: grid;
  grid-template-areas: "intro side" "main side" "back side";
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  align-items: start;
  gap: clamp(20.09px, 2.01vw, 30.13px) clamp(26.78px, 3.35vw, 53.57px);
}

.case-intro {
  grid-area: intro;
}

.case-intro .actions:empty {
  display: none;
}

.case-side {
  position: sticky;
  top: 24px;
  grid-area: side;
  display: grid;
  gap: 20px;
}

.case-side h2 {
  margin-bottom: 10px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-shadow: none;
  text-transform: uppercase;
}

.case-meta,
.case-facts {
  margin: 0;
  padding: 6px 4px;
}

.case-meta div,
.case-facts div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 16px;
}

.case-meta div + div,
.case-facts div + div {
  border-top: 1px solid var(--line);
}

.case-meta dt,
.case-facts dt {
  color: var(--dim);
  font-size: 13px;
}

.case-meta dd,
.case-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.case {
  grid-area: main;
  display: grid;
  gap: clamp(23.44px, 2.51vw, 36.83px);
  min-width: 0;
}

.case-back {
  grid-area: back;
  justify-self: start;
}

.case-shot {
  max-width: 720px;
  margin: 0;
}

.case-shot img {
  width: 100%;
}

.case-block h2 {
  margin-bottom: 14px;
  font-size: clamp(1.25rem, 1.26vw, 1.6rem);
}

.case-block p {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.75;
}

.case-block p + p {
  margin-top: 14px;
}

.case-block .case-note {
  margin-top: 22px;
}

@media (max-width: 1000px) {
  .case-layout {
    grid-template-areas: "intro" "meta" "main" "facts" "back";
    grid-template-columns: minmax(0, 1fr);
  }

  /* Phones: project info up top, the longer facts after the write-up */
  .case-side {
    display: contents;
  }

  .case-meta {
    grid-area: meta;
  }

  .case-side-block {
    grid-area: facts;
  }
}

/* Numbered pipeline steps */
.steps {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 4ch 9ch minmax(0, 1fr);
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--neon);
  font-size: 15px;
}

.steps b {
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.steps span {
  color: var(--muted);
  line-height: 1.6;
}

/* Case study: one block per tool */
.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16.74px, 1.67vw, 23.44px) clamp(13.39px, 1.67vw, 23.44px);
}

.tool {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tool h3 {
  font-size: 16px;
}

.case-block .tool p {
  margin: 0;
}

@media (max-width: 760px) {
  .tools {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The way out of every sub-page: heading on the left, the ask on the right */
.closer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}

.closer .actions {
  margin-top: 0;
}

/* No 3D to show: the hero stays as text, and the machines step aside */
.no-3d :is(.viewport) {
  display: none;
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 20px var(--inset);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.foot a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.foot a:hover {
  color: var(--accent-ink);
}

/* Skills popup */

.skills {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding: clamp(23.44px, 2.51vw, 40.18px);
  border: 0;
  color: var(--text);
}

/* The dialog reuses .frame (crop-mark corners); give it a solid fill so it reads above the page */
.skills.panel {
  position: fixed;
  background: var(--bg-2);
}

.skills::-webkit-scrollbar {
  display: none;
}

.skills::backdrop {
  background: rgba(4, 6, 9, 0.7);
  backdrop-filter: blur(6px);
}

.skills[open] {
  animation: pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.skills h2 {
  margin: 12px 0 clamp(18.41px, 2.01vw, 28.46px);
}

/* One row per group: the name on the left, its tags on the right */
.skill-grid {
  display: grid;
  border-top: 1px solid var(--line);
}

.skill-group {
  display: grid;
  grid-template-columns: 17ch minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.skill-group h3 {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skill-group h3 span {
  margin-right: 8px;
  color: var(--dim);
}

.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Small outlined tag, shared by the skills popup and the 3D toolkit line */
.tag {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.3;
  transition: border-color 0.2s, color 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.made-with {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.made-with > span:first-child {
  margin-right: 6px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-head .made-with {
  margin-bottom: 22px;
}

.skills h2:focus {
  outline: none;
}

/* Skills: what I'm exploring, each with where I tried it */
.skill-explore {
  flex-direction: column;
  gap: 10px !important;
}

.skill-explore li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.skill-explore small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
}

.skill-explore small::before {
  content: "→  ";
  color: var(--accent-ink);
}

.skill-note {
  margin: 18px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
}

/* Image viewer */

.viewer {
  width: min(1400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--text);
}

.viewer[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.viewer::backdrop {
  background: rgba(4, 6, 9, 0.88);
  backdrop-filter: blur(6px);
}

.viewer-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  background: #000;
}

.viewer img {
  width: 100%;
  max-height: calc(100vh - 34px);
  object-fit: contain;
}

.viewer-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  border-left: 1px solid var(--line);
  overflow-y: auto;
}

.viewer-info .label {
  margin-bottom: 4px;
}

.viewer-info h3 {
  font-size: 1.3rem;
  line-height: 1.25;
}

.viewer-kind {
  color: var(--muted);
  font-size: 14px;
}

.viewer-sub {
  margin-top: 14px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.viewer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.viewer-info .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.viewer-controls {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}

.viewer-controls button {
  min-width: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
}

.viewer-controls button:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.viewer-hint {
  color: var(--dim);
  font-size: 13px;
}

/* Featured projects: a 2 x 2 grid of cards, screenshot on top */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(13.39px, 1.34vw, 23.44px);
}

.feature[hidden] {
  display: none;
}

/* No screenshot: a small terminal tile showing the project's tag */
.feature-shot.is-code {
  display: grid;
  text-decoration: none;
  place-items: center;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--line-2) 55%, transparent) 1px, transparent 1.4px) 0 0 / 18px 18px,
    radial-gradient(80% 80% at 50% 50%, var(--glow), transparent 70%),
    var(--bg);
}

.feature-shot.is-code span {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: clamp(1.4rem, 1.67vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px var(--text-glow);
}

.feature-shot.is-code span::before {
  content: "> ";
  color: var(--dim);
}

/* Line drawings on cards with no screenshot */
.thumb {
  width: 100%;
  height: 100%;
  min-height: 0;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--text-glow));
}

.thumb .t-dim {
  stroke: color-mix(in srgb, var(--accent-ink) 45%, var(--line-2));
}

.thumb .t-soft {
  fill: var(--glow);
  stroke: none;
}

.thumb .t-solid {
  fill: var(--bg);
}

.thumb .t-dot {
  fill: var(--accent-ink);
  stroke: none;
}

.thumb .t-thick {
  stroke-width: 3;
}

.thumb text {
  fill: var(--accent-ink);
  stroke: none;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
}

/* Card buttons: all the same outline, no glow */
.feature .actions {
  filter: none;
}

.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feature-shot {
  display: block;
  aspect-ratio: 16 / 9;
  margin: clamp(10.04px, 1vw, 15.07px) clamp(10.04px, 1vw, 15.07px) 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.feature-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feature:hover .feature-shot img {
  transform: scale(1.03);
}

.feature-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: clamp(16.74px, 1.67vw, 26.78px);
}

.feature-tag {
  color: var(--accent-ink);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-tag span {
  margin-right: 8px;
  color: var(--dim);
}

.feature-body h3,
.feature-body h2 {
  font-size: clamp(1.35rem, 1.51vw, 1.9rem);
}

.feature-body h3 a,
.feature-body h2 a {
  color: inherit;
  text-decoration: none;
}

/* The title link covers the whole card; the buttons sit above it */
.feature-body h3 a::after,
.feature-body h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.feature:hover .feature-body h3 a,
.feature:hover .feature-body h2 a {
  color: var(--accent-ink);
}

.feature-stack {
  color: var(--accent-ink);
  font-size: 14px;
}

.feature-stack span + span::before {
  content: " · ";
  color: var(--dim);
}

.feature .actions {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 8px;
  pointer-events: none;
}

.feature .actions a {
  pointer-events: auto;
}

/* Command menu */
.cmdk {
  overflow: hidden;
  width: min(560px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  margin-top: 12vh;
  padding: 0;
  border: 0;
  background: var(--bg-2);
  color: var(--text);
}

.cmdk.panel {
  position: fixed;
  background: var(--bg-2);
}

.cmdk[open] {
  display: flex;
  flex-direction: column;
  animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cmdk::backdrop {
  background: rgba(4, 6, 9, 0.6);
  backdrop-filter: blur(4px);
}

.cmdk-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-ink);
}

.cmdk-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 16px;
}

.cmdk-input input:focus {
  outline: none;
}

.cmdk kbd {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

.cmdk-list {
  flex: 1;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: none;
}

.cmdk-list::-webkit-scrollbar {
  display: none;
}

.cmdk-group {
  padding: 12px 10px 6px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.92rem;
  text-align: left;
  text-decoration: none;
}

.cmdk-item span {
  color: var(--dim);
  font-size: 12px;
}

.cmdk-item.is-active {
  border-left-color: var(--accent);
  background: var(--glow);
  color: var(--accent-ink);
}

.cmdk-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

.cmdk-foot kbd {
  margin-right: 4px;
}

/* ---------- Sci-fi layer ---------- */

/* Hero headline types out like console output; kept on one line so the cursor never wraps */
.console {
  font-family: var(--mono);
  font-size: clamp(calc(1.7rem - 1.67px), calc(2.18vw - 1.67px), calc(3.6rem - 1.67px));
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Soft glow on the console prompt and cursor */
.console::before {
  content: "> ";
  color: var(--accent-ink);
  text-shadow: 0 0 18px var(--accent);
}

.console::after {
  content: "";
  display: inline-block;
  width: 0.36em;
  height: 0.74em;
  margin-left: 0.06em;
  vertical-align: -0.02em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
  box-shadow: 0 0 14px var(--accent);
}

/* Boot sequence on the first visit of a session */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  padding: clamp(20.09px, 3.35vw, 53.57px);
  background: var(--bg);
  transition: opacity 0.2s, visibility 0.2s;
}

.is-booting .boot {
  display: flex;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot pre {
  margin: 0;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: clamp(0.75rem, 0.75vw, 0.95rem);
  line-height: 1.8;
  white-space: pre-wrap;
}

.boot pre .ok {
  color: var(--ok);
}

.boot pre .dim {
  color: var(--dim);
}

/* ---------- Cyberpunk layer: deeper blue second accent, cut corners, soft neon glow ---------- */
/* Selection: white on the theme's marker colour (Pilot Blue / clay) */
::selection {
  background: var(--neon);
  color: #fff;
}

/* Cut corners on controls and small panels. The clip removes two corners;
   ::after draws the diagonal edge so outlined shapes stay closed. */
:is(.btn, .chip, .icon-btn, .panel, .viewer-controls button) {
  --cut: 10px;
  --cut-c: var(--line-2);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

:is(.btn, .chip, .icon-btn, .viewer-controls button) {
  position: relative;
}

:is(.btn, .chip, .icon-btn, .panel, .viewer-controls button)::after {
  /* 2px wide so the diagonal survives fractional display scaling (125%, 150%) */
  --edge: linear-gradient(135deg, transparent calc(50% - 1px), var(--cut-c) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  content: "";
  position: absolute;
  inset: -1px;
  background:
    var(--edge) top left / var(--cut) var(--cut) no-repeat,
    var(--edge) bottom right / var(--cut) var(--cut) no-repeat;
  pointer-events: none;
}

:is(.btn, .chip, .icon-btn, .viewer-controls button):hover,
.chip.is-active,
.btn-primary {
  --cut-c: var(--fill);
}

/* Panels share one look: cut corners, translucent fill, lit edge */
.panel {
  position: relative;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg-2) 90%, transparent);
}

.panel {
  --cut: 14px;
}

/* Primary button flips to the deeper blue on hover */
.btn-primary:hover {
  --cut-c: var(--fill-hover);
  border-color: var(--fill-hover);
  background: var(--fill-hover);
  color: var(--on-fill-hover);
}

/* Section numbers and other small markers in the deeper blue */
.label span,
.skill-group h3 span {
  color: var(--label-num);
}

.marquee span::before {
  color: var(--neon);
}

/* Active and hover bars glow */
.nav-link::before {
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

/* A short neon segment where each section's divider line starts */
.section {
  position: relative;
}

/* Thin themed scrollbars */
html {
  scroll-behavior: auto;
  scrollbar-color: var(--line-2) var(--bg);
  scrollbar-width: thin;
}

/* ---------- Tron layer: light lines and soft glows (dark theme; faint or off in light) ---------- */

/* Headings carry a faint cyan halo */
h1,
h2 {
  text-shadow: 0 0 1px var(--text-glow), 0 0 24px var(--text-glow);
}

/* The rail edge is a light line */
.rail {
  border-right-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 1px 0 18px -8px var(--line-glow);
}

.nav-link.is-active .icon,
.nav-link:hover .icon {
  filter: drop-shadow(0 0 5px var(--accent));
}

/* The horizon under the hero */
.skillbar {
  border-top-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 -1px 26px -10px var(--line-glow);
}

/* Panels: lit edges, glowing from inside (the cut corners would clip an outer glow) */
.panel {
  --cut-c: color-mix(in srgb, var(--accent) 35%, var(--line-2));
  border-color: var(--cut-c);
  box-shadow: inset 0 0 26px -12px var(--line-glow);
}

.skills.panel {
  box-shadow: inset 0 0 40px -16px var(--line-glow);
}

/* Controls glow through their parent, since their cut corners clip their own shadows */
.actions,
.form-end,
.chips,
.mail-row,
.viewer-controls {
  filter: drop-shadow(0 0 6px var(--btn-glow));
}

/* Render frames pick up a lit edge on hover */
.tile-link {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.tile-link:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 28px -8px var(--line-glow);
}

/* ---------- More sci-fi: section numbers, HUD brackets, light sweeps ---------- */

/* HUD brackets snap onto a render on hover */
.tile-link::after {
  --b: color-mix(in srgb, var(--accent) 90%, white);
  content: "";
  position: absolute;
  inset: 10px;
  background:
    linear-gradient(var(--b), var(--b)) top left / 18px 2px,
    linear-gradient(var(--b), var(--b)) top left / 2px 18px,
    linear-gradient(var(--b), var(--b)) top right / 18px 2px,
    linear-gradient(var(--b), var(--b)) top right / 2px 18px,
    linear-gradient(var(--b), var(--b)) bottom left / 18px 2px,
    linear-gradient(var(--b), var(--b)) bottom left / 2px 18px,
    linear-gradient(var(--b), var(--b)) bottom right / 18px 2px,
    linear-gradient(var(--b), var(--b)) bottom right / 2px 18px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tile-link:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* A band of light sweeps across a button on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(120%);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Responsive */

@media (max-width: 1400px) {
  .tiles.is-masonry {
    columns: 3;
  }
}

@media (min-width: 1401px) {
  .tiles.is-masonry {
    columns: 4;
  }
}

@media (max-width: 1200px) {
  .about,
  .contact {
    grid-template-columns: 1fr;
  }

  
  .contact .term {
    margin-top: 0;
  }

  
  
}

/* Phones and small tablets: the rail becomes a bottom tab bar */
@media (max-width: 900px) {
  :root {
    --rail: 0px;
  }

  .rail {
    inset: auto 0 0 0;
    flex-direction: row;
    gap: 0;
    width: 100%;
    height: 62px;
    padding: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: color-mix(in srgb, var(--bg-2) 92%, transparent);
    box-shadow: none;
  }

  .rail-brand,
  .rail-tip,
  .nav-num {
    display: none;
  }

  .rail-nav {
    display: flex;
    flex: 1;
    gap: 0;
  }

  .nav-link {
    justify-content: center;
    height: 62px;
    padding: 0;
  }

  /* The menu takes the last slot: it holds Theme and About, which the bar has no room for */
  .cmdk-btn {
    flex: 0 0 56px;
    margin: 0;
    border-left: 1px solid var(--line);
  }

  .theme-btn,
  .rail-nav .nav-link[aria-label$="About"] {
    display: none;
  }

  /* No keyboard here, so no keyboard hints */
  .cmdk-foot,
  .cmdk-input kbd {
    display: none;
  }

  .viewer[open] {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .viewer img {
    max-height: 60vh;
  }

  .viewer-info {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .nav-link::before {
    top: 0;
    bottom: auto;
    left: 25%;
    width: 50%;
    height: 2px;
    transform: scaleX(0);
  }

  .nav-link:hover::before,
  .nav-link.is-active::before {
    transform: scaleX(1);
  }

  .main {
    padding-bottom: 62px;
  }

  
  .viewport {
    position: relative;
    inset: auto;
    order: 2;
    height: 320px;
    margin-inline: calc(var(--pad) * -1);
  }

  .viewport::after {
    display: none;
  }

  
  .console {
    white-space: normal;
  }

  
  /* Phones: results go under the role */
  .stop-card {
    grid-template-columns: 1fr;
  }

  .stop-meta {
    margin: 0;
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .steps li {
    grid-template-columns: 3ch minmax(0, 1fr);
    gap: 6px 14px;
  }

  .steps span {
    grid-column: 2;
  }

  .tiles.is-masonry {
    columns: 1;
  }

  
  .term-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track,
.blink,
.console::after,
.stop.is-now .stop-node {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (max-width: 600px) {
  .skill-group {
    grid-template-columns: 1fr;
  }
}

.feature .btn {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .xp-wins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .xp-wins {
    grid-template-columns: 1fr;
  }
}

/* Experience: client builds under the HMX stats, spanning the whole card */
.xp-builds {
  grid-column: 1 / -1;
  padding-top: clamp(15.07px, 1.67vw, 23.44px);
  border-top: 1px solid var(--line);
}

.build-card {
  display: grid;
  gap: 6px;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.3s, background 0.3s;
}

.build-card:hover {
  border-color: var(--accent);
  background: var(--glow);
  transform: translateY(-2px);
}

.build-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 4px;
  object-fit: cover;
  background: #dde0e6;
}

.build-name {
  padding-inline: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.build-meta {
  padding-inline: 4px;
  color: var(--dim);
  font-size: 12px;
}

.build-card:hover .build-meta span {
  color: var(--accent-ink);
}

.xp-also {
  max-width: 70ch;
  color: var(--muted);
  font-size: 14px;
}

/* Cursor: a sci-fi arrow in the accent blue, the same everywhere. It's the browser's
   own cursor (no script), so it never lags and works over popups. */
:root {
  --cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2226%22%20height%3D%2226%22%20viewBox%3D%220%200%2026%2026%22%3E%3Cpath%20d%3D%22M3%202%20L3%2019.5%20L7.6%2015.4%20L10.6%2022%20L13.6%2020.7%20L10.7%2014.3%20L16.6%2014.3%20Z%22%20fill%3D%22%236fd3ff%22%20fill-opacity%3D%220.22%22%20stroke%3D%22%236fd3ff%22%20stroke-width%3D%225%22%20stroke-opacity%3D%220.18%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M3%202%20L3%2019.5%20L7.6%2015.4%20L10.6%2022%20L13.6%2020.7%20L10.7%2014.3%20L16.6%2014.3%20Z%22%20fill%3D%22%236fd3ff%22%20stroke%3D%22%2305080d%22%20stroke-width%3D%221.4%22%20stroke-linejoin%3D%22miter%22/%3E%3Cpath%20d%3D%22M4.6%205.6%20L4.6%2015.2%22%20stroke%3D%22%2305080d%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.45%22/%3E%3C/svg%3E") 3 2, auto;
}

:root[data-theme="light"] {
  --cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2226%22%20height%3D%2226%22%20viewBox%3D%220%200%2026%2026%22%3E%3Cpath%20d%3D%22M3%202%20L3%2019.5%20L7.6%2015.4%20L10.6%2022%20L13.6%2020.7%20L10.7%2014.3%20L16.6%2014.3%20Z%22%20fill%3D%22%23d9926f%22%20fill-opacity%3D%220.22%22%20stroke%3D%22%23d9926f%22%20stroke-width%3D%225%22%20stroke-opacity%3D%220.18%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M3%202%20L3%2019.5%20L7.6%2015.4%20L10.6%2022%20L13.6%2020.7%20L10.7%2014.3%20L16.6%2014.3%20Z%22%20fill%3D%22%23d9926f%22%20stroke%3D%22%2305080d%22%20stroke-width%3D%221.4%22%20stroke-linejoin%3D%22miter%22/%3E%3Cpath%20d%3D%22M4.6%205.6%20L4.6%2015.2%22%20stroke%3D%22%2305080d%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.45%22/%3E%3C/svg%3E") 3 2, auto;
}

html,
body {
  cursor: var(--cursor);
}

/* One cursor everywhere: links, buttons, drag areas and text fields included */
*,
*::before,
*::after {
  cursor: var(--cursor) !important;
}

/* A card whose shot hasn't been added yet */
.build-blank {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  margin-bottom: 4px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--line-2) 55%, transparent) 1px, transparent 1.4px) 0 0 / 16px 16px,
    var(--bg);
  color: var(--accent-ink);
  font-size: 1.1rem;
}

.work-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.work-group {
  display: grid;
  grid-template-columns: 22ch minmax(0, 1fr);
  align-items: start;
  gap: 10px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.work-group h2 {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.work-group h2 span {
  color: var(--neon);
}

.work-group h2 em {
  white-space: nowrap;
  color: var(--dim);
  font-style: normal;
}

.work-group ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.build-card.is-small {
  padding: 6px 6px 10px;
}

.build-card.is-small .build-name {
  font-size: 13px;
}

.build-card.is-small .build-meta {
  font-size: 12px;
}

@media (max-width: 600px) {
  .work-group {
    grid-template-columns: 1fr;
  }
}

/* Closing line under the client work: brighter text, the count in the accent */
.xp-also {
  color: var(--text);
}

.xp-also b {
  color: var(--accent-ink);
  font-weight: 600;
  text-shadow: 0 0 14px var(--text-glow);
}

/* Client ranges in the popup: a big view, the stat, and the variants to point at */
.range {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(13.39px, 1.67vw, 23.44px);
}

.range-view {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dee2e8;
  background-position: center;
  background-size: cover;
}

.range-view img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.range-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 9px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.range-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.range-model {
  display: grid;
  gap: 2px;
  color: var(--text);
  font-size: 16px;
}

.range-model span {
  color: var(--dim);
  font-size: 13px;
}

.range-side .xp-stat {
  margin: 0;
}

.range-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-pick {
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.range-pick img {
  display: block;
  width: 84px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.range-pick.is-swatch {
  width: 30px;
  height: 30px;
  background: var(--sw);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.range-pick:hover,
.range-pick:focus-visible {
  border-color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.range-pick.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 10px -2px var(--line-glow);
}

.range-pick.is-swatch.is-on {
  box-shadow: inset 0 0 0 2px var(--bg), 0 0 10px -2px var(--line-glow);
}

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

/* Selected work launcher: the count on the left, a slow reel of the products on the right; the whole panel opens the gallery */
.work-reel {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: inherit;
  font: inherit;
  text-align: left;
  transition: border-color 0.25s, box-shadow 0.3s;
}

.work-reel:hover,
.work-reel:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 18px -6px var(--line-glow);
  outline: none;
}

.work-reel-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(13.39px, 1.34vw, 20.09px);
  border-right: 1px solid var(--line);
}

.work-reel-label {
  color: var(--accent-ink);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.work-reel .xp-stat {
  margin: 0;
  font-size: clamp(2.2rem, 2.51vw, 3rem);
  text-shadow: 0 0 18px var(--num-glow);
}

.work-reel-brands {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.work-reel-strip {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.work-reel-track {
  display: flex;
  width: max-content;
  padding: 14px 0;
  animation: marquee 60s linear infinite;
}

.work-reel-track img {
  display: block;
  height: clamp(108.81px, 10.88vw, 159.03px);
  aspect-ratio: 16 / 10;
  margin-right: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #dde0e6;
}

.xp-builds > .xp-also {
  margin-top: 16px;
}

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

@media (max-width: 700px) {
  .work-reel {
    grid-template-columns: 1fr;
  }

  .work-reel-info {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .work-reel-track img {
    height: 120px;
  }
}

/* Phones: two small cards per row in the client work popup, so the list stays short */
@media (max-width: 600px) {
  .work-group ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* About: the resume as a clear call to action */
.about-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 8px;
}

.about-cta .btn {
  gap: 10px;
}

.about-cta .icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.about-cta > span {
  color: var(--dim);
  font-size: 13px;
}

/* AI badges: the model next to the category */
.feature-tag em {
  color: var(--text);
  font-style: normal;
}

/* Case study and fact panels: labels in the accent, like the About panel */
.case-meta dt,
.case-facts dt {
  color: var(--accent-ink);
  font-family: var(--mono);
}

/* Sub-page pager: readable over the dot field */
.page-nav {
  font-size: 14px;
}

.page-nav a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.page-nav a {
  color: var(--text);
  font-weight: 500;
}

.page-nav a:hover {
  border-color: var(--accent);
}

/* Project cards on Home and Projects: compact and side by side, two to a row */
.features.is-compact .feature {
  flex-direction: row;
}

.features.is-compact .feature-shot {
  flex: 0 0 47%;
  align-self: center;
  aspect-ratio: 16 / 10;
  margin: 14px 0 14px 14px;
  padding: 6px;
}

.features.is-compact .feature-body {
  gap: 11px;
  min-width: 0;
  padding: 24px 26px 24px 28px;
}

.features.is-compact .feature-body h3,
.features.is-compact .feature-body h2 {
  font-size: clamp(1.25rem, 1.26vw, 1.6rem);
}

.features.is-compact .feature-body .muted {
  font-size: 14px;
  line-height: 1.6;
}

.features.is-compact .feature-stack,
.features.is-compact .feature-tag {
  font-size: 12px;
}

.features.is-compact .actions {
  gap: 8px;
  margin-top: auto;
}

.features.is-compact .btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
}

@media (max-width: 1500px) {
  .features.is-compact .feature-shot {
    flex-basis: 38%;
  }

  .features.is-compact .feature-body {
    padding: 20px 22px;
  }
}

@media (max-width: 1200px) {
  .features.is-compact .feature {
    flex-direction: column;
  }

  .features.is-compact .feature-shot {
    flex: none;
    aspect-ratio: 16 / 9;
    min-height: 0;
    margin: 12px 12px 0;
  }
}

/* Client work page: a little more room for each client */
.page-head + .section .work-list {
  margin-top: 4px;
}

/* The client work launcher is a link now: no underline */
.work-reel {
  text-decoration: none;
}

/* The About text colours its links; keep the resume button's own colours */
.about-cta .btn-primary {
  color: var(--on-accent);
  text-decoration: none;
}

.about-cta .btn-primary:hover {
  color: var(--on-fill-hover);
}

/* Contact form spam checks: the honeypot stays out of sight, the captcha sits above Send */
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.form-captcha {
  min-height: 78px;
  margin: 18px 0 4px;
}

/* Sub-page pager: the home link sits between previous and next */
.page-nav .page-home {
  display: inline-flex;
  align-items: center;
  color: var(--accent-ink);
}

.page-nav .page-home:hover {
  color: var(--text);
}

.page-nav .page-home .icon {
  width: 16px;
  height: 16px;
}

.page-nav .page-home:hover .icon {
  transform: none;
}

/* The captcha frame keeps its own colour scheme, so the browser paints no white box behind it */
.form-captcha iframe {
  color-scheme: normal;
}

/* Desktop runs at 84%; phones keep full-size text and tap targets */
@media (min-width: 901px) {
  html {
    font-size: 84%;
  }

  
  /* Layout stays at 84%; anything meant to be read sits at 14px */
  body {
    font-size: clamp(14px, 0.84vw, 15px);
  }

  .features.is-compact .feature-body .muted,
.xp-how,
.xp-what,
.xp-also,
.stop-where,
.stop-why,
.case-meta dd,
.case-facts dd,
.tool h3,
.term-note,
.term-line > span,
.term-line input,
.term-line textarea,
.about-cta > span,
.build-name,
.foot {
    font-size: 14px;
  }

  .prose p,
  .contact .muted {
    font-size: max(14px, clamp(1rem, 0.88vw, 1.15rem));
  }

  .btn {
    min-height: 40px;
    padding: 0 16px;
  }
}

/* Short laptop windows: the rail tightens up so Menu and Theme stay on screen */
@media (min-width: 901px) and (max-height: 720px) {
  .rail {
    gap: 12px;
    padding: 12px 0;
  }

  .nav-link {
    padding: 6px 0;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 14px;
  }

  .page-nav .page-home {
    min-height: 32px;
    align-items: center;
  }
}

/* Touch: targets are at least 44px, whatever the screen size */
@media (pointer: coarse) {
  .btn,
  .features.is-compact .btn,
  .chip,
  .cmdk-item,
  .viewer-controls button {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .page-nav a,
  .page-nav .page-home,
  .foot a,
  .mail {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .page-nav .page-home {
    justify-content: center;
    min-width: 44px;
  }

  .foot-links {
    row-gap: 0;
  }

  .range-picks {
    gap: 6px;
  }

  .range-pick.is-swatch {
    width: 44px;
    height: 44px;
  }
}

/* No hover to speak of: a tapped button goes back to normal instead of staying lit */
@media (hover: none) {
  .btn:hover {
    --cut-c: var(--line-2);
    border-color: var(--line-2);
    color: var(--text);
  }

  .icon-btn:hover,
  .chip:not(.is-active):hover {
    --cut-c: var(--line-2);
    border-color: var(--line-2);
    color: var(--muted);
  }

  .btn-primary:hover {
    --cut-c: var(--fill);
    border-color: var(--fill);
    background: var(--fill);
    color: var(--on-accent);
  }

  .btn:hover::before {
    transform: translateX(-120%);
    transition: none;
  }

  .btn:active {
    opacity: 0.75;
  }

  .viewer-hint {
    display: none;
  }
}

/* The narrowest phones: the pager's names give way before the page does */
@media (max-width: 480px) {
  .page-nav {
    gap: 8px;
    letter-spacing: 0.04em;
  }

  .page-nav a {
    min-width: 0;
    padding: 8px 10px;
  }

  .page-nav .page-home {
    flex: none;
  }
}

/* Light theme: small text on a tinted fill goes to full strength */
:root[data-theme="light"] :is(.nav-link.is-active .nav-num, .xp-span) {
  color: var(--text);
}

/* The dot field stops behind reading columns, where lit dots read as stray punctuation */
:is(.prose, .contact .muted, .hire, .page-head .muted, .case-intro .muted, .case-block) {
  background: var(--bg);
  /* Wide enough that the nearest dot doesn't sit beside the text like a bullet */
  box-shadow: 0 0 0 24px var(--bg);
}

/* Skip link: out of sight until a keyboard reaches it. Doubled up to outrank the shared button rules */
a.btn.skip-link {
  position: fixed;
  top: -80px;
  left: calc(var(--rail) + 12px);
  z-index: 60;
}

a.btn.skip-link:focus {
  top: 12px;
}

.main:focus {
  outline: none;
}

/* Line breaks: headings balance, paragraphs avoid a lone last word */
:is(h1, h2, h3) {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Spacing: one right edge per column, and no boxes bigger than what's in them */
.about .prose p {
  max-width: 74ch;
}

/* The radio sits beside the services, so the message box stays the size of a message */
@media (min-width: 1201px) {
  .contact > div:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    column-gap: 24px;
    align-content: start;
  }

  .contact > div:first-child > :not(.radio, .hire) {
    grid-column: 1 / -1;
  }

  }

/* The form ends level with the column beside it: the message box takes up the difference */
.contact .term {
  display: flex;
  flex-direction: column;
}

.term-form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.term-line.is-multi {
  flex: 1;
  grid-template-rows: minmax(0, 1fr);
}

.term-line.is-multi textarea {
  height: 100%;
}

/* Case pages: the shot and the text share a width, and the facts panel closes the gap */
.case-layout {
  grid-template-columns: minmax(0, 860px) minmax(260px, 440px);
  justify-content: space-between;
}

.case-shot {
  max-width: none;
}

.case-intro .muted,
.case-block p {
  max-width: 100%;
}

@media (max-width: 1000px) {
  .case-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   KD-OS (2026-11): the site as a little operating system on blueprint paper.
   Desktop: the rail becomes a menubar along the top. Phones keep the bottom tab bar.
   Windows (.os-win) are panels with a title bar, crop marks and a faint blueprint grid.
   ========================================================================== */

:root {
  --os-grid: color-mix(in srgb, var(--accent) 8%, transparent);
  --os-grid-fine: color-mix(in srgb, var(--accent) 3.5%, transparent);
}

/* The rail sits on the same blueprint paper as the windows */
.rail {
  background-color: color-mix(in srgb, var(--bg-2) 88%, transparent);
  background-image:
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Windows */
.os-win {
  position: relative;
  min-width: 0;
}

/* Crop marks on two corners, outside the clipped frame */
.os-win::before,
.os-win::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 0 solid var(--accent);
  pointer-events: none;
}

.os-win::before {
  top: -7px;
  left: -7px;
  border-top-width: 1.5px;
  border-left-width: 1.5px;
}

.os-win::after {
  right: -7px;
  bottom: -7px;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
}

.os-frame {
  --cut: 14px;
  --cut-c: var(--line-2);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--cut-c);
  background-color: color-mix(in srgb, var(--bg-2) 94%, transparent);
  background-image:
    linear-gradient(var(--os-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid) 1px, transparent 1px),
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px),
    radial-gradient(120% 90% at 0 0, var(--glow), transparent 60%);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px, 100% 100%;
  background-position: -1px -1px;
  box-shadow: inset 0 0 26px -14px var(--line-glow);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

/* The diagonal edges of the cut corners */
.os-frame::after {
  --edge: linear-gradient(135deg, transparent calc(50% - 1px), var(--cut-c) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  content: "";
  position: absolute;
  inset: -1px;
  background:
    var(--edge) top left / var(--cut) var(--cut) no-repeat,
    var(--edge) bottom right / var(--cut) var(--cut) no-repeat;
  pointer-events: none;
}

.os-win.is-focus .os-frame {
  --cut-c: color-mix(in srgb, var(--accent) 50%, var(--line-2));
}

.os-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.os-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.os-title b {
  color: var(--text);
  font-weight: 500;
}

.os-title span {
  margin-left: 8px;
  color: var(--dim);
}

.os-ctl {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  color: var(--dim);
}

.os-ctl span {
  margin-right: 10px;
}

.os-ctl i {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid var(--line-2);
  font-size: 9px;
  font-style: normal;
  line-height: 1;
}

/* Hero: hello.txt and the viewport side by side */
.os-hero {
  position: relative;
  padding-block: clamp(32px, 3.4vw, 56px) clamp(28px, 2.6vw, 44px);
}

.os-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(20px, 2vw, 32px);
}

.os-hero .hero-copy {
  grid-row: auto;
  padding: clamp(28px, 2.8vw, 48px) clamp(24px, 2.6vw, 44px);
  pointer-events: auto;
}

.os-hero .lede {
  max-width: 54ch;
  margin-top: 0;
}

.os-hero .viewport {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: clamp(260px, 22vw, 380px);
  margin: 0;
  background: radial-gradient(closest-side, var(--glow), transparent) center / 100% 100% no-repeat;
}

.os-hero .viewport::after {
  display: none;
}

.os-hero .hud-tl {
  top: 12px;
  left: 16px;
}

.os-hero .hud-tr {
  top: 12px;
  right: 16px;
}

.os-readout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.os-readout div {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
}

.os-readout div:last-child {
  border-right: 0;
}

.os-readout dd {
  margin: 0;
}

.os-readout dt {
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .os-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .os-hero .viewport {
    order: 0;
    height: auto;
    min-height: 280px;
  }

  .os-readout {
    font-size: 12px;
  }

  .os-readout div {
    padding: 10px 12px;
  }
}

/* Skills strip: a taskbar in the content column, not a full-width band */
.skillbar {
  margin-inline: var(--inset);
  padding-inline: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
}

.skill-open {
  margin-left: 0;
  padding: 0 20px;
}

/* Sections that live in a window drop the full-width rule between sections */
.section.os-section {
  border-top: 0;
}

.os-body .section-top {
  align-items: end;
}

/* Experience: plain rows inside the window, no track or monogram nodes */
.os-journey {
  --meta-w: clamp(250px, 21vw, 320px);
  gap: 16px;
  padding: 0;
}

.os-journey::before,
.os-journey::after,
.os-journey .stop::before,
.os-journey .stop-node {
  display: none;
}

.os-journey .stop-card {
  grid-template-columns: var(--meta-w) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  box-shadow: none;
  clip-path: none;
}

.os-journey .stop-card::after {
  display: none;
}

.os-journey .stop-meta {
  margin: 0;
  padding: 22px;
  background: none;
}

.os-journey .xp-wins {
  gap: 0;
}

.os-journey .xp-wins li {
  padding: 22px 20px;
  border-top: 0;
  border-right: 1px dashed var(--line);
  background: none;
}

.os-journey .xp-wins li:last-child {
  border-right: 0;
}

.os-journey .xp-wins li:hover {
  background: var(--glow);
  transform: none;
}

.os-journey .xp-builds {
  padding-top: 0;
}

.os-journey .work-reel {
  grid-template-columns: var(--meta-w) minmax(0, 1fr);
  border: 0;
}

.os-journey .xp-also {
  max-width: none;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .os-journey .xp-wins li:nth-child(2n) {
    border-right: 0;
  }

  .os-journey .xp-wins li:nth-child(-n + 2) {
    border-bottom: 1px dashed var(--line);
  }
}

@media (max-width: 900px) {
  .os-journey .stop-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .os-journey .stop-meta {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .os-journey .work-reel {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Renders: eight tiles of the same shape, four to a row */
.os-renders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.os-fig {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}

.os-fig .tile-link {
  display: block;
  height: 100%;
}

.os-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.os-fig:hover {
  border-color: var(--accent);
}

.os-fig:hover img {
  transform: scale(1.03);
}

.os-fig figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 12px 9px;
  /* Held dark behind the text line itself, so pale product shots keep the caption readable */
  background: linear-gradient(0deg, rgb(7 9 13 / 0.9), rgb(7 9 13 / 0.78) 55%, transparent);
  color: #f2f6fd;
  font-size: 12px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.os-fig figcaption span:last-child {
  flex: none;
  text-transform: uppercase;
}

.os-fig figcaption i {
  color: #6fd3ff;
  font-style: normal;
}

@media (max-width: 1000px) {
  .os-renders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {

  .os-fig figcaption span:last-child {
    display: none;
  }
}

/* Projects: flat file rows inside the window instead of separate panels */
.os-features .feature {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  box-shadow: none;
  clip-path: none;
}

.os-features .feature::after {
  display: none;
}

.os-features .feature:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.os-features.is-compact .feature-shot {
  flex: 0 0 40%;
  align-self: stretch;
  aspect-ratio: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
}

.os-features .feature-shot.is-code {
  display: grid;
  place-items: center;
}

@media (max-width: 1100px) {
  .os-features {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .os-features.is-compact .feature {
    flex-direction: column;
  }

  .os-features.is-compact .feature-shot {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    aspect-ratio: auto;
  }
}

/* Contact: the info window and the terminal window side by side, the same height */
.os-contact {
  align-items: stretch;
  gap: clamp(20px, 2vw, 32px);
}

.os-term {
  display: flex;
}

.os-term .term {
  flex: 1;
  background-color: color-mix(in srgb, var(--bg-2) 94%, transparent);
  background-image:
    linear-gradient(var(--os-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid) 1px, transparent 1px),
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
}

.os-term .term-bar {
  padding: 0 14px 0 18px;
  min-height: 32px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .os-contact {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Footer: the drawing's title block */
.foot.os-foot {
  display: block;
  padding: clamp(28px, 3vw, 48px) var(--inset) clamp(28px, 3vw, 44px);
  border-top: 0;
  font-size: 14px;
}

.os-tb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto) auto;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
}

.os-tb > * {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
}

.os-tb > :last-child {
  border-right: 0;
}

.os-tb-k {
  margin-bottom: 4px;
  color: var(--dim);
  font-size: max(11px, 0.7rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.os-tb .os-tb-top {
  display: flex;
  align-items: center;
  color: var(--accent-ink);
}

@media (max-width: 900px) {
  .os-tb {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .os-tb > * {
    border-bottom: 1px solid var(--line);
  }

  .os-tb-links {
    grid-column: 1 / -1;
  }
}

/* Inside a window there's no dot field to hide, so reading text needs no backdrop */
.os-frame :is(.prose, .muted, .hire, .case-block) {
  background: none;
  box-shadow: none;
}

/* Windows bring their own frame, so sections need less room around them */
.section.os-section {
  padding-block: clamp(20px, 2.2vw, 36px);
}

.os-fig figcaption span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Project thumbnails: every screenshot sits whole in the same preview pane, nothing cropped */
.os-features.is-compact .feature-shot {
  display: grid;
  place-items: center;
  padding: 14px;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 16px 16px;
}

.os-features .feature-shot img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line);
}

.os-features .feature-shot svg.thumb {
  width: 100%;
  height: auto;
}

/* Sub-pages: the pager above, then one window with the heading and the list */
.os-section .page-nav {
  margin-bottom: clamp(22px, 2.2vw, 34px);
}

.os-page .os-body > :is(.features, .tiles, .work-list) {
  margin-top: clamp(26px, 2.6vw, 40px);
}

.os-page .os-body > .chips {
  margin-top: 22px;
}

.os-page .work-list .work-group:first-child {
  border-top: 0;
}

/* Skills popup: a KD-OS window */
.skills.os-dialog {
  position: fixed;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-2));
  background-color: var(--bg-2);
  background-image:
    linear-gradient(var(--os-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid) 1px, transparent 1px),
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.5), inset 0 0 30px -14px var(--line-glow);
}

.skills.os-dialog .os-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-right: 6px;
  background-color: var(--bg-2);
}

.skills.os-dialog .icon-btn {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  font-size: 14px;
  --cut: 5px;
}

.skills.os-dialog .label {
  margin-bottom: 0;
}

/* Selected work: reads as something you open. A real button, a tab on the reel, and the whole block lights up on hover */
.work-reel-btn {
  gap: 10px;
  align-self: flex-start;
  margin-top: auto;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
}

.work-reel-btn span {
  transition: transform 0.25s;
}

.work-reel:is(:hover, :focus-visible) .work-reel-btn {
  --cut-c: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.work-reel:is(:hover, :focus-visible) .work-reel-btn span {
  transform: translateX(4px);
}

.work-reel-track img {
  filter: brightness(0.82) saturate(0.9);
  transition: filter 0.3s;
}

.work-reel:is(:hover, :focus-visible) .work-reel-track img {
  filter: none;
}

.os-journey .work-reel:is(:hover, :focus-visible) {
  background: var(--glow);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 22px -8px var(--line-glow);
}

/* Project previews keep a fixed shape while the screenshot loads, so nothing jumps */
.os-features .feature-shot img {
  aspect-ratio: 16 / 10;
}

/* Footer and image viewer: the same blueprint paper as the windows */
.os-tb,
.viewer,
.viewer-stage {
  background-color: var(--bg-2);
  background-image:
    linear-gradient(var(--os-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid) 1px, transparent 1px),
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
}

.viewer-stage {
  background-color: var(--bg);
}

.viewer {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2));
}

/* Sub-pages: the pager is a KD-OS toolbar, with the path you're on in the middle */
.page-nav.os-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-2);
  background-color: var(--bg-2);
  background-image:
    linear-gradient(var(--os-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--os-grid-fine) 1px, transparent 1px);
  background-size: 16px 16px;
}

.os-toolbar > a {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  transition: color 0.2s, border-color 0.2s;
}

.os-toolbar > a:hover {
  border-color: var(--accent);
}

.os-toolbar > .page-home {
  justify-content: center;
  padding: 0 11px;
}

.os-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--dim);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.04em;
}

.os-path::before {
  content: ">";
  color: var(--accent-ink);
}

.os-path a {
  color: var(--muted);
  text-decoration: none;
}

.os-path a:hover {
  color: var(--accent-ink);
}

.os-path b {
  color: var(--text);
  font-weight: 500;
}

.os-path b:last-child {
  color: var(--accent-ink);
}

@media (max-width: 700px) {
  .page-nav.os-toolbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .os-toolbar > a span {
    display: none;
  }

  .os-toolbar > a {
    padding: 0 11px;
  }
}

/* The home link inside the path is plain text, not a button */
.os-path a {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  clip-path: none;
}

.os-path a::after {
  display: none;
}

/* Small render tiles: the title gets the whole caption; the viewer still shows the kind */
.os-renders .os-fig figcaption span:last-child {
  display: none;
}

.os-path {
  align-self: stretch;
  min-height: 38px;
}

/* ---------- Buttons: one system everywhere ----------
   Two kinds only. Primary: cyan fill, gets a little lighter on hover (never a different blue).
   Outline: line border, turns accent on hover. Same height, padding, type and corner cut for both.
   No glow from the parent: it only reached some buttons, so none get it. */
.btn,
.features.is-compact .btn,
.work-reel-btn {
  --cut: 10px;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.btn:not(.btn-primary):hover {
  --cut-c: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary,
.btn-primary:hover {
  --cut-c: var(--fill);
}

.btn-primary:hover {
  border-color: var(--fill-hover);
  background: var(--fill-hover);
  color: var(--on-fill-hover);
}

.actions,
.form-end,
.mail-row {
  filter: none;
}

/* Email me is a button like the rest, not a big underlined link */
.btn.mail {
  margin-top: 0;
  border: 1px solid var(--line-2);
  font-weight: 400;
  text-decoration: none;
  text-transform: uppercase;
}

/* Every button looks and behaves like the primary one: cyan fill, dark text, a lighter cyan on hover */
.btn,
.btn:not(.btn-primary),
.work-reel .work-reel-btn {
  --cut-c: var(--fill);
  border-color: var(--fill);
  background: var(--fill);
  color: var(--on-accent);
}

.btn:hover,
.btn:not(.btn-primary):hover,
.work-reel:is(:hover, :focus-visible) .work-reel-btn {
  --cut-c: var(--fill-hover);
  border-color: var(--fill-hover);
  background: var(--fill-hover);
  color: var(--on-fill-hover);
}

/* Project cards: the ways in are terminal commands, like the contact terminal */
.feature .actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.cmd::before {
  content: ">";
  color: var(--accent-ink);
}

/* A block cursor shows up after the command you point at */
.cmd::after {
  content: "";
  width: 0.55em;
  height: 1.05em;
  background: var(--accent);
  opacity: 0;
}

.cmd:is(:hover, :focus-visible) {
  color: var(--accent-ink);
}

.cmd:is(:hover, :focus-visible)::after {
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

.cmd span {
  color: var(--dim);
}

/* ==========================================================================
   Compact pass (2026-11-14): one spacing scale (8 / 12 / 16 / 24 / 32) and a clear type order:
   hero headline > section headings > card titles > body > labels.
   ========================================================================== */

/* Between and inside windows */
.section.os-section {
  padding-block: clamp(14px, 1.4vw, 22px);
}

.os-hero {
  padding-block: clamp(22px, 2.2vw, 32px) clamp(14px, 1.4vw, 22px);
}

.os-body {
  padding: clamp(22px, 2.2vw, 32px);
}

.os-bar {
  height: 30px;
}

/* Section heads: label, then heading, then content, always the same gaps */
.os-body .label {
  margin-bottom: 10px;
}

.os-body h2 {
  font-size: clamp(1.6rem, 1.9vw, 2.3rem);
  line-height: 1.05;
}

.os-body .section-top {
  margin-bottom: 20px;
}

/* About: text on the left, a properties table on the right */
.os-body > h2 {
  margin-bottom: 20px;
}

.os-body .made-with {
  margin-top: 12px;
}

/* The hero headline is the biggest text on the page */
.os-hero .console {
  font-size: clamp(1.9rem, 2.5vw, 3.3rem);
}

.os-hero .hero-copy {
  padding: clamp(24px, 2.4vw, 36px) clamp(22px, 2.4vw, 36px);
}

.os-hero .actions {
  margin-top: 24px;
}

.os-hero .viewport {
  min-height: clamp(230px, 19vw, 340px);
}

.os-readout div {
  padding: 10px 16px;
}

/* Experience: tighter rows; the long explanations step down a size */
.os-journey {
  gap: 12px;
}

.os-journey .stop-meta {
  padding: 18px 20px;
}

.os-journey .stop h3 {
  margin-top: 12px;
}

.os-journey .stop-why {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.os-journey .xp-wins li {
  gap: 4px;
  padding: 18px;
}

.os-journey .xp-stat {
  margin-bottom: 4px;
}

.os-journey .xp-what {
  font-size: 14px;
  line-height: 1.45;
}

.os-journey .xp-how {
  font-size: 13px;
  line-height: 1.55;
}

.os-journey .work-reel-info {
  gap: 8px;
  padding: 18px 20px;
}

.os-journey .work-reel-track {
  padding: 12px 0;
}

.os-journey .work-reel-track img {
  height: clamp(96px, 8.4vw, 132px);
}

.os-journey .xp-also {
  padding: 10px 20px;
}

/* Project cards */
.os-features {
  gap: 12px;
}

.os-features.is-compact .feature-body {
  gap: 8px;
  padding: 20px 22px;
}

.os-features.is-compact .feature-shot {
  padding: 12px;
}

/* About */
.os-body .about {
  gap: clamp(22px, 3vw, 48px);
}

.os-body .prose p + p {
  margin-top: 12px;
}

/* Contact */
.os-contact .os-body .muted {
  margin-top: 12px;
}

.os-contact .hire {
  margin-top: 20px;
}

.os-contact .mail-row {
  margin-top: 20px;
}

.os-term .term-form {
  padding-block: 18px;
}

/* Footer */
.foot.os-foot {
  padding-block: clamp(18px, 1.8vw, 28px);
}

.os-tb > * {
  padding: 10px 16px;
}

/* Phones: the four stats sit two to a row instead of one long column */
@media (max-width: 600px) {
  .os-journey .xp-wins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .os-journey .xp-wins li {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px dashed var(--line);
  }

  .os-journey .xp-wins li:nth-child(odd) {
    border-right: 1px dashed var(--line);
  }

  .os-journey .xp-wins li:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

/* ==========================================================================
   Phones: keep what someone needs in a couple of swipes (who, proof, contact).
   Supporting detail is hidden here only; desktop shows everything.
   ========================================================================== */
@media (max-width: 700px) {
  /* Hero: a smaller viewport, no stats readout */
  .os-hero .viewport {
    min-height: 190px;
  }

  .os-hero .os-readout,
  .os-hero .hud-tr {
    display: none;
  }

  .os-hero-grid {
    gap: 14px;
  }

  /* Experience: role, numbers and their headline; the long explanations stay on desktop */
  .os-journey .stop-why,
  .os-journey .xp-how,
  .os-journey .xp-also,
  .os-journey .work-reel-brands {
    display: none;
  }

  .os-journey .stop-meta {
    padding: 14px 16px;
  }

  .os-journey .stop h3 {
    margin-top: 8px;
  }

  .os-journey .xp-wins li {
    padding: 12px 14px;
  }

  .os-journey .work-reel-track img {
    height: 80px;
  }

  /* Renders: four, the rest are one tap away */
  .os-renders .os-fig:nth-child(n + 5) {
    display: none;
  }

  /* Builds: title, one line of what it does, and the commands */
  .os-features.is-compact .feature .feature-shot,
  .os-features.is-compact .feature .feature-stack {
    display: none;
  }

  .os-features.is-compact .feature-body {
    gap: 6px;
    padding: 16px;
  }

  .os-features .feature .actions {
    margin-top: 6px;
  }

  /* About: the first paragraph and the facts */
  .os-body .prose p:not(:first-child):not(.about-cta) {
    display: none;
  }

  .about-cta > span {
    display: none;
  }

  /* Contact: all of it, with a shorter message box */
  .term-line.is-multi textarea {
    min-height: 90px;
  }

  .os-body {
    padding: 20px 18px;
  }

  .section.os-section {
    padding-block: 10px;
  }
}

@media (max-width: 700px) {
  #art .made-with,
.term-note {
    display: none;
  }

  .os-features .feature-body .muted {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .os-term .term-form {
    gap: 4px;
    padding-block: 12px;
  }

  .term-line {
    padding-block: 8px;
  }
}

/* ==========================================================================
   Scaling pass (phones 360-430px): nothing overlaps, truncates or overflows.
   ========================================================================== */

/* Path box: the crumbs keep their own width instead of shrinking into each other */
.os-path > * {
  flex: none;
}

.os-path {
  font-size: 12px;
}

@media (max-width: 700px) {
  /* Title bars: the item count goes first, the file name and sheet always fit */
  .os-ctl span {
    display: none;
  }

  .os-bar {
    padding-left: 14px;
  }

  /* The headline stays on one line down to 360px */
  .os-hero .console {
    font-size: clamp(1.4rem, 6.6vw, 1.9rem);
  }

  /* Buttons share the row evenly instead of leaving a ragged edge */
  :is(.os-body, .os-hero) .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 12px;
    letter-spacing: 0.08em;
  }

  /* The closing call on sub-pages, at phone scale */
  .closer h2 {
    font-size: 1.6rem;
  }

  .closer .actions {
    width: 100%;
  }

  .closer .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Footer: links on one line, then the title block two by two */
  .foot-links {
    gap: 6px 16px;
  }

  .os-tb > * {
    padding: 10px 14px;
  }
}

@media (max-width: 400px) {
  .os-title span {
    display: none;
  }
}

@media (max-width: 400px) {

  .os-path b:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
    min-width: 0;
  }
}

/* About: facts shown as a task manager */
.taskmgr {
  container-type: inline-size;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  font-family: var(--mono);
}

.taskmgr table {
  width: 100%;
  border-collapse: collapse;
}

.taskmgr th,
.taskmgr td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.taskmgr thead th {
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.taskmgr tbody tr + tr :is(th, td) {
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.taskmgr tbody td:nth-child(2) {
  color: var(--dim);
}

.tm-load {
  width: 1%;
}

.tm-load,
.taskmgr thead th:last-child {
  text-align: right;
}

.tm-spark {
  width: 72px;
  height: 16px;
  margin-right: 10px;
  vertical-align: middle;
  overflow: visible;
}

.tm-spark polyline {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tm-spark polygon {
  fill: color-mix(in srgb, var(--accent-ink) 14%, transparent);
  stroke: none;
}

.tm-live {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--accent-ink);
  animation: tm-ping 2s ease-out infinite;
}

@keyframes tm-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-ink) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px transparent; }
}

.tm-pct {
  display: inline-block;
  min-width: 4ch;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* Narrow box: drop the status column and shorten the bars */
@container (max-width: 460px) {
  .taskmgr th,
  .taskmgr td {
    padding: 10px 12px;
  }

  .taskmgr thead th:nth-child(2),
  .taskmgr tbody td:nth-child(2) {
    display: none;
  }

  .tm-spark {
    width: 48px;
  }
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero: how I work, as a git log (newest on top) */
.os-log {
  display: grid;
  gap: 6px;
  margin: 22px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  font-family: var(--mono);
  font-size: 14px;
  list-style: none;
}

.os-log li {
  text-wrap: pretty;
  padding-left: 2ch;
  text-indent: -2ch;
  color: var(--muted);
}

.os-log li::before {
  content: "* ";
  color: var(--accent-ink);
}

.os-log li:first-child {
  color: var(--text);
}

.log-hash {
  color: var(--dim);
}

.os-log b {
  color: var(--accent-ink);
  font-weight: 500;
}

/* Commits land one at a time, oldest first */
@media (prefers-reduced-motion: no-preference) {
  .os-log li {
    animation: log-in 0.4s ease both;
  }

  .os-log li:nth-child(4) { animation-delay: 0.3s; }
  .os-log li:nth-child(3) { animation-delay: 0.55s; }
  .os-log li:nth-child(2) { animation-delay: 0.8s; }
  .os-log li:nth-child(1) { animation-delay: 1.05s; }
}

@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@media (max-width: 600px) {
  .os-log {
    padding: 12px;
    font-size: 12px;
  }
}

/* Phones: the long "Next stop" button wraps, so it needs real room above and below its two lines */
@media (max-width: 600px) {
  .stop-next {
    padding-block: 11px;
    line-height: 1.45;
  }
}

/* ---------- Unslop pass, 2026-11-15 ----------
   Type: no italic, sentence-case labels (section tags, telemetry and buttons stay uppercase).
   Buttons: one filled cyan action per window; the rest are outlines that fill on hover.
   Spacing: the about text starts right under its heading. */
.stop-why,
.os-journey .stop-why {
  font-style: normal;
}

.xp-stat span,
.made-with > span:first-child,
.work-reel-label,
.taskmgr thead th {
  letter-spacing: 0.02em;
  text-transform: none;
}

.os-body .prose {
  margin-top: 0;
}

.stop.is-now .stop-node {
  animation: none;
}

.btn:not(.btn-primary),
.work-reel .work-reel-btn {
  --cut-c: color-mix(in srgb, var(--fill) 55%, transparent);
  border-color: color-mix(in srgb, var(--fill) 55%, transparent);
  background: transparent;
  color: var(--accent-ink);
}

.btn:not(.btn-primary):hover,
.work-reel:is(:hover, :focus-visible) .work-reel-btn {
  --cut-c: var(--fill);
  border-color: var(--fill);
  background: var(--fill);
  color: var(--on-accent);
}

/* The image viewer has one way out to ArtStation, so it stays filled */
.viewer-info .btn {
  --cut-c: var(--fill);
  border-color: var(--fill);
  background: var(--fill);
  color: var(--on-accent);
}

/* ---------- Unslop pass, phones ----------
   The tab bar gets words, nothing is cut off with "…", "View all" always sits under its heading,
   and "Next stop" comes after the jobs as the next entry in the log. */
.nav-label,
.stop-next.is-after {
  display: none;
}

@media (max-width: 900px) {
  .rail .nav-link {
    flex-direction: column;
    gap: 4px;
  }

  .nav-label {
    display: block;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .nav-link:is(.is-active, :hover) .nav-label {
    color: var(--accent-ink);
  }
}

@media (max-width: 700px) {
  .os-features .feature-body .muted {
    display: block;
    -webkit-line-clamp: unset;
  }

  .os-features .pitch-rest {
    display: none;
  }

  .os-fig figcaption span:first-child {
    white-space: normal;
  }

  .os-body .section-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .xp-stat span {
    line-height: 1.35;
  }

  .section-top .stop-next {
    display: none;
  }

  .stop-next.is-after {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 12px;
  }
}

@media (max-width: 380px) {
  .cmdk-btn {
    flex-basis: 48px;
  }
}
