/* --------------------------------------------------------------------------
   KELVIN GAO / PORTFOLIO DRAWING SYSTEM
   Flat blueprint treatment: solid surfaces, ruled grids, technical annotation.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --bg: #06101c;
  --surface: #091725;
  --surface-2: #0c1c2c;
  --surface-3: #102337;
  --text: #edf6ff;
  --text-soft: #c9d9e8;
  --muted: #9eb2c6;
  --faint: #8098af;
  --blue: #4da3ff;
  --blue-deep: #1677be;
  --blue-fill: rgba(77, 163, 255, 0.12);
  --nav-progress-fill: rgba(77, 163, 255, 0.36);
  --line: rgba(77, 163, 255, 0.25);
  --line-soft: rgba(123, 180, 231, 0.13);
  --line-strong: rgba(77, 163, 255, 0.56);
  --grid-minor: rgba(77, 163, 255, 0.055);
  --grid-major: rgba(77, 163, 255, 0.11);
  --header-bg: #06101c;
  --preview-bg: #071522;
  --preview-line: rgba(107, 183, 255, 0.55);
  --preview-fill: rgba(77, 163, 255, 0.14);
  --preview-quiet: rgba(222, 241, 255, 0.18);
  --container: 1440px;
  --sidebar-width: 136px;
  --mono: "Nunito", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --title-font: "Bitcount Prop Single", "Nunito", ui-sans-serif, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4f8;
  --surface: #f8fbfd;
  --surface-2: #e8f1f7;
  --surface-3: #deebf3;
  --text: #0a243b;
  --text-soft: #2d4961;
  --muted: #50697e;
  --faint: #587085;
  --blue: #0c619f;
  --blue-deep: #084d7e;
  --blue-fill: rgba(12, 97, 159, 0.09);
  --nav-progress-fill: rgba(12, 97, 159, 0.22);
  --line: rgba(12, 97, 159, 0.24);
  --line-soft: rgba(31, 91, 135, 0.13);
  --line-strong: rgba(12, 97, 159, 0.54);
  --grid-minor: rgba(12, 97, 159, 0.055);
  --grid-major: rgba(12, 97, 159, 0.105);
  --header-bg: #eef4f8;
  --preview-bg: #e7f0f6;
  --preview-line: rgba(11, 91, 150, 0.55);
  --preview-fill: rgba(12, 97, 159, 0.11);
  --preview-quiet: rgba(14, 58, 89, 0.16);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 140ms linear, color 140ms linear;
}

h1,
h2,
h3 {
  font-family: var(--title-font);
  font-weight: 400;
}

::selection {
  background: var(--blue);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.6;
}

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border: 1px solid var(--blue);
  background: var(--bg);
  color: var(--text);
  font: 700 12px/1.2 var(--mono);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* Exact source artwork, recolored non-destructively and cropped to its bounds. */

.logo-render {
  position: relative;
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 704 / 812;
  overflow: hidden;
}

.logo-render img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.logo-render--brand {
  width: 26px;
}

/* Header */

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  width: fit-content;
  min-height: 44px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--faint);
  font: 600 8px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav {
  position: absolute;
  top: 15px;
  left: 50%;
  display: flex;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  transform: translateX(-50%);
}

.main-nav a {
  --page-wheel-progress: 0%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding-inline: 14px;
  border-right: 1px solid var(--line);
  background-image: linear-gradient(
    var(--nav-progress-fill),
    var(--nav-progress-fill)
  );
  background-repeat: no-repeat;
  background-position: left center;
  background-size: var(--page-wheel-progress) 100%;
  color: var(--muted);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-size 70ms linear, color 70ms linear;
}

.main-nav a[data-wheel-direction="previous"] {
  background-position: right center;
}

.main-nav a:last-child {
  border-right: 0;
}

.main-nav a:hover,
.main-nav a.is-active {
  background-color: var(--blue-fill);
  color: var(--blue);
}

.main-nav a.is-wheel-target {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-height: 44px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--blue-fill);
}

.theme-toggle__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 58px;
  height: 30px;
  padding-inline: 8px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--muted);
}

.theme-icon {
  z-index: 1;
  width: 12px;
  height: 12px;
}

.theme-icon--moon {
  color: #fff;
}

html[data-theme="light"] .theme-icon--moon {
  color: var(--muted);
}

html[data-theme="light"] .theme-icon--sun {
  color: #fff;
}

.theme-toggle__knob {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--blue);
  transition: transform 140ms linear;
}

html[data-theme="light"] .theme-toggle__knob {
  transform: translateX(28px);
}

.theme-toggle__label {
  min-width: 31px;
  color: var(--text-soft);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, 0.94fr);
  align-items: center;
  gap: clamp(44px, 7vw, 100px);
  min-height: 100svh;
  padding-top: 132px;
  padding-bottom: 94px;
}

.hero::before {
  position: absolute;
  top: 74px;
  bottom: 0;
  left: -24px;
  width: 1px;
  background: var(--line);
  content: "";
}

.hero::after {
  position: absolute;
  top: 98px;
  left: -29px;
  width: 11px;
  height: 11px;
  border: 1px solid var(--blue);
  background: var(--bg);
  content: "";
}

.hero-copy {
  position: relative;
}

.eyebrow,
.section-kicker {
  color: var(--blue);
  font: 700 10px/1.3 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 0;
  border: 0;
  background: transparent;
}

.eyebrow::before {
  width: 34px;
  height: 1px;
  background: var(--blue);
  content: "";
}

.eyebrow-dot {
  display: none;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.35rem, 6.2vw, 5.65rem);
  font-weight: 400;
  letter-spacing: -0.064em;
  line-height: 0.98;
}

.gradient-text {
  color: var(--blue);
}

.hero-intro {
  max-width: 570px;
  margin: 32px 0 0;
  padding-left: 20px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: 750 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button--primary {
  background: var(--blue-deep);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue);
  color: #06101c;
}

html[data-theme="light"] .button--primary:hover {
  color: #fff;
}

.text-link,
.hero-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-left: 0;
  color: var(--text-soft);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-link:hover,
.hero-social-link:hover {
  background: var(--blue-fill);
  color: var(--blue);
}

.hero-social-links {
  display: inline-flex;
  align-items: stretch;
}

.hero-social-link {
  border-left: 0;
  gap: 8px;
  padding-inline: 14px;
}

.hero-social-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: currentColor;
}

.hero-social-link[href^="mailto:"] svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.5;
}

.hero-blueprint {
  position: relative;
  width: min(100%, 520px);
  min-height: 592px;
  margin: 0;
  justify-self: end;
  border: 1px solid var(--line-strong);
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}

.hero-blueprint::before,
.hero-blueprint::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--blue);
  content: "";
}

.hero-blueprint::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.hero-blueprint::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.blueprint-caption {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 45px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 650 9px/1.2 var(--mono);
  letter-spacing: 0.1em;
}

.blueprint-caption span {
  display: flex;
  align-items: center;
  padding-inline: 13px;
  border-right: 1px solid var(--line);
}

.blueprint-caption span:last-child {
  border-right: 0;
}

.logo-plate,
.model-plate {
  position: relative;
  display: grid;
  height: 470px;
  place-items: center;
}

.logo-plate::before,
.logo-plate::after,
.model-plate::before,
.model-plate::after {
  position: absolute;
  background: var(--line-soft);
  content: "";
}

.logo-plate::before,
.model-plate::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.logo-plate::after,
.model-plate::after {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.logo-render--hero {
  z-index: 1;
  width: min(46%, 220px);
}

.model-plate {
  overflow: hidden;
  cursor: default;
}

.model-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: pan-y;
}

.model-canvas.is-dragging {
  cursor: grabbing;
}

[data-model-viewer].is-model-ready .model-canvas {
  opacity: 1;
}

.model-placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.12em;
}

.logo-render--model {
  width: 86px;
  opacity: 0.5;
}

[data-model-viewer].is-model-ready .model-placeholder {
  visibility: hidden;
}

.model-loader {
  position: absolute;
  z-index: 6;
  right: 170px;
  bottom: 58px;
  left: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.model-loader[hidden],
.model-error[hidden] {
  display: none;
}

.model-loader__copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.model-loader__track,
.model-progress__track {
  display: block;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.model-loader__track {
  margin-top: 9px;
}

.model-loader__track i,
.model-progress__track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
}

.model-error {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(76%, 300px);
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font: 600 8px/1.6 var(--mono);
  letter-spacing: 0.05em;
  transform: translate(-50%, -50%);
}

.model-error strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 9px;
}

.model-error a {
  width: max-content;
  margin-top: 11px;
  color: var(--blue);
  font-weight: 750;
}

.model-description,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.model-controls {
  position: absolute;
  z-index: 7;
  bottom: 12px;
  left: 14px;
  display: flex;
  background: var(--surface);
}

.model-controls button {
  display: grid;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  font: 700 7px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.model-controls button:last-child {
  min-width: 60px;
  border-right: 1px solid var(--line);
}

.model-controls button:hover,
.model-controls button[aria-pressed="true"] {
  background: var(--blue-fill);
  color: var(--blue);
}

.model-controls button:focus-visible {
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  background: var(--blue-fill);
  color: var(--blue);
}

.model-controls button:disabled {
  cursor: wait;
  opacity: 0.42;
}

.model-progress {
  position: absolute;
  z-index: 5;
  top: 55px;
  right: 15px;
  display: grid;
  grid-template-columns: auto 72px 26px;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.07em;
}

.model-progress output {
  color: var(--blue);
  text-align: right;
}

.dimension {
  position: absolute;
  z-index: 2;
  color: var(--faint);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.dimension--horizontal {
  top: 26px;
  left: 22%;
  width: 56%;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
  text-align: center;
}

.dimension--horizontal::before,
.dimension--horizontal::after {
  position: absolute;
  bottom: -5px;
  width: 1px;
  height: 10px;
  background: var(--line-strong);
  content: "";
}

.dimension--horizontal::before {
  left: 0;
}

.dimension--horizontal::after {
  right: 0;
}

.dimension--vertical {
  top: 25%;
  bottom: 22%;
  left: 24px;
  display: grid;
  width: 19px;
  place-items: center;
  border-left: 1px solid var(--line-strong);
  writing-mode: vertical-rl;
}

.dimension--vertical::before,
.dimension--vertical::after {
  position: absolute;
  left: -5px;
  width: 10px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.dimension--vertical::before {
  top: 0;
}

.dimension--vertical::after {
  bottom: 0;
}

.crosshair {
  position: absolute;
  width: 13px;
  height: 13px;
}

.crosshair::before,
.crosshair::after {
  position: absolute;
  background: var(--blue);
  content: "";
}

.crosshair::before {
  top: 6px;
  left: 0;
  width: 13px;
  height: 1px;
}

.crosshair::after {
  top: 0;
  left: 6px;
  width: 1px;
  height: 13px;
}

.crosshair--one {
  top: 76px;
  right: 25px;
}

.crosshair--two {
  bottom: 25px;
  left: 66px;
}

.project-counter {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 44px;
  display: grid;
  width: 132px;
  min-height: 104px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.project-counter__label,
.project-counter__foot {
  color: var(--faint);
  font: 650 8px/1.2 var(--mono);
  letter-spacing: 0.11em;
}

.project-counter strong {
  align-self: center;
  color: var(--blue);
  font-size: 48px;
  font-weight: 620;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.project-counter__foot {
  align-self: end;
}

.blueprint-coordinates {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 42px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 650 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.blueprint-coordinates span {
  display: flex;
  align-items: center;
  padding-inline: 12px;
  border-right: 1px solid var(--line);
}

.blueprint-coordinates span:nth-child(2) {
  justify-content: center;
}

.blueprint-coordinates span:last-child {
  justify-content: flex-end;
  border-right: 0;
}

.scroll-cue {
  position: absolute;
  top: calc(100svh - 38px);
  bottom: auto;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-cue__line {
  display: block;
  width: 54px;
  height: 1px;
  background: var(--blue);
}

/* Sections */

.page-main {
  min-height: calc(100svh - 116px);
  padding-top: 74px;
}

.page-main > .section:first-child {
  border-top: 0;
}

.section {
  position: relative;
  padding-top: 118px;
  padding-bottom: 118px;
  border-top: 1px solid var(--line);
}

.section::before {
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 1px solid var(--blue);
  background: var(--bg);
  content: "";
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  align-items: end;
  gap: 64px;
  margin-bottom: 48px;
}

.section-kicker {
  margin: 0 0 16px;
}

.section-heading h2,
.section-heading h1,
.about-intro h2,
.about-intro h1,
.contact-card h2,
.contact-card h1 {
  margin: 0;
  font-size: clamp(2.45rem, 4.8vw, 4.3rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.section-description {
  margin: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* Project index */

.project-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.project-tabs {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.project-tabs::before {
  display: flex;
  align-items: center;
  height: 38px;
  padding-inline: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.12em;
  content: "INDEX / SELECT DRAWING";
}

.project-tab {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 108px;
  padding: 16px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-tab::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--blue);
  content: "";
  opacity: 0;
}

.project-tab:hover,
.project-tab.is-active {
  background: var(--blue-fill);
}

.project-tab.is-active::before {
  opacity: 1;
}

.project-tab__number {
  align-self: start;
  padding-top: 2px;
  color: var(--faint);
  font: 650 9px/1 var(--mono);
}

.project-tab__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-tab__copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 730;
}

.project-tab__copy span {
  color: var(--muted);
  font: 600 9px/1.3 var(--mono);
  text-transform: uppercase;
}

.project-tab__arrow {
  color: var(--blue);
  font-size: 14px;
  opacity: 0;
}

.project-tab:hover .project-tab__arrow,
.project-tab.is-active .project-tab__arrow {
  opacity: 1;
}

.project-panels {
  min-width: 0;
}

.project-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(350px, 1.14fr);
  min-height: 100%;
}

.project-panel[hidden] {
  display: none;
}

.project-panel__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-transform: uppercase;
}

.project-status i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--blue);
  background: var(--blue-fill);
}

.project-panel__content > div:nth-child(2) {
  margin-block: auto;
}

.project-type {
  margin: 50px 0 15px;
  color: var(--blue);
  font: 700 9px/1.3 var(--mono);
  letter-spacing: 0.12em;
}

.project-panel h3 {
  max-width: 440px;
  margin: 0;
  font-size: clamp(2rem, 3.3vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.03;
}

.project-summary {
  max-width: 460px;
  margin: 23px 0 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 30px;
}

.project-tags span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font: 700 9px/1.3 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-link span {
  color: var(--blue);
  font-size: 15px;
}

/* Schematic project drawings */

.project-preview {
  --project-accent: var(--blue);
  position: relative;
  display: grid;
  min-height: 620px;
  place-items: center;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background-color: var(--preview-bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}

.project-preview::before {
  position: absolute;
  z-index: 8;
  top: 13px;
  left: 14px;
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.11em;
  content: "SCHEMATIC / NOT TO SCALE";
}

.project-preview::after {
  position: absolute;
  z-index: 8;
  top: 11px;
  right: 13px;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--blue);
  border-right: 1px solid var(--blue);
  content: "";
}

.preview-orb {
  display: none;
}

.preview-index {
  position: absolute;
  z-index: 0;
  right: 15px;
  bottom: 10px;
  color: var(--line);
  font: 500 74px/0.8 var(--mono);
  letter-spacing: -0.08em;
}

/* Project 01 / contained model-to-photo sequence */

.project-preview--assembly {
  padding: 48px 24px;
}

.project-model-window {
  position: relative;
  z-index: 2;
  width: min(96%, 560px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--surface);
}

.project-model-window__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 36px;
  padding-inline: 10px;
  border-bottom: 1px solid var(--preview-line);
  color: var(--faint);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.project-model-window__bar > span:nth-child(2) {
  color: var(--text-soft);
  text-align: center;
}

.project-model-window__bar > span:last-child {
  justify-self: end;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots i {
  width: 5px;
  height: 5px;
  border: 1px solid var(--preview-line);
}

.project-model-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: ns-resize;
  background-color: var(--preview-bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 72px 72px, 72px 72px, 18px 18px, 18px 18px;
  outline: 0;
  touch-action: pan-y;
}

.project-model-viewport::before,
.project-model-viewport::after {
  position: absolute;
  z-index: 0;
  background: var(--line-soft);
  content: "";
  pointer-events: none;
}

.project-model-viewport::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.project-model-viewport::after {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.project-model-viewport:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

.project-model-viewport .model-canvas {
  cursor: ns-resize;
  pointer-events: none;
}

.project-model-viewport .model-placeholder {
  z-index: 2;
}

.project-model-viewport .model-loader {
  right: 14px;
  bottom: 14px;
  left: 14px;
}

.project-model-viewport .model-error {
  width: min(82%, 290px);
}

.sequence-hover-note {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 5px;
  width: min(248px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid var(--blue);
  background: var(--blue-deep);
  color: #fff;
  opacity: 1;
  pointer-events: none;
  transition: opacity 100ms linear, visibility 100ms linear;
}

.sequence-hover-note strong {
  font: 780 10px/1 var(--mono);
  letter-spacing: 0.09em;
}

.sequence-hover-note small {
  color: inherit;
  font: 650 7px/1.2 var(--mono);
  letter-spacing: 0.07em;
  opacity: 0.8;
}

.project-model-viewport:hover .sequence-hover-note,
.project-model-viewport:focus-visible .sequence-hover-note {
  background: var(--blue);
  color: #06101c;
}

.project-model-viewport:hover:not(:focus-visible) {
  outline: 1px solid var(--blue);
  outline-offset: -2px;
}

html[data-theme="light"] .project-model-viewport:hover .sequence-hover-note,
html[data-theme="light"] .project-model-viewport:focus-visible .sequence-hover-note {
  color: #fff;
}

[data-model-viewer].has-sequence-progress .sequence-hover-note {
  visibility: hidden;
  opacity: 0;
}

.sequence-photo-deck,
.sequence-photo {
  position: absolute;
  inset: 0;
}

.sequence-photo-deck {
  z-index: 3;
  pointer-events: none;
}

.sequence-photo {
  display: grid;
  grid-template-rows: 1fr 34px;
  padding: 14px;
  background: var(--preview-bg);
  opacity: 0;
  will-change: opacity;
}

.sequence-photo__art {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background-color: var(--surface-2);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 18px 18px;
}

.sequence-photo__art::before,
.sequence-photo__art::after,
.sequence-photo__art i {
  position: absolute;
  display: block;
  border: 1px solid var(--preview-line);
  content: "";
}

.sequence-photo__caption {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.sequence-photo__caption span:first-child {
  color: var(--blue);
}

.sequence-photo--one .sequence-photo__art::before {
  top: 18%;
  left: 12%;
  width: 42%;
  height: 64%;
}

.sequence-photo--one .sequence-photo__art::after {
  top: 28%;
  right: 12%;
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.sequence-photo--one .sequence-photo__art i:nth-child(1) {
  right: 12%;
  bottom: 18%;
  width: 29%;
  height: 8%;
  background: var(--preview-fill);
}

.sequence-photo--one .sequence-photo__art i:nth-child(2) {
  top: 31%;
  left: 18%;
  width: 24%;
  height: 28%;
  border-color: var(--blue);
}

.sequence-photo--one .sequence-photo__art i:nth-child(3) {
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--blue);
}

.sequence-photo--two .sequence-photo__art::before,
.sequence-photo--two .sequence-photo__art::after,
.sequence-photo--two .sequence-photo__art i:nth-child(1) {
  top: 18%;
  bottom: 18%;
  width: 20%;
  background: var(--preview-fill);
}

.sequence-photo--two .sequence-photo__art::before { left: 12%; }
.sequence-photo--two .sequence-photo__art i:nth-child(1) { left: 40%; }
.sequence-photo--two .sequence-photo__art::after { right: 12%; }

.sequence-photo--two .sequence-photo__art i:nth-child(2) {
  right: 8%;
  bottom: 9%;
  left: 8%;
  height: 1px;
  border: 0;
  background: var(--blue);
}

.sequence-photo--two .sequence-photo__art i:nth-child(3) {
  top: 10%;
  left: 10%;
  width: 28%;
  height: 7%;
}

.sequence-photo--three .sequence-photo__art::before,
.sequence-photo--three .sequence-photo__art::after,
.sequence-photo--three .sequence-photo__art i:nth-child(1) {
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sequence-photo--three .sequence-photo__art::before {
  width: 68%;
  aspect-ratio: 1;
}

.sequence-photo--three .sequence-photo__art::after {
  width: 46%;
  aspect-ratio: 1;
}

.sequence-photo--three .sequence-photo__art i:nth-child(1) {
  width: 22%;
  aspect-ratio: 1;
  border-color: var(--blue);
  background: var(--preview-fill);
}

.sequence-photo--three .sequence-photo__art i:nth-child(2),
.sequence-photo--three .sequence-photo__art i:nth-child(3) {
  top: 50%;
  width: 22%;
  height: 1px;
  border: 0;
  background: var(--preview-line);
}

.sequence-photo--three .sequence-photo__art i:nth-child(2) { left: 4%; }
.sequence-photo--three .sequence-photo__art i:nth-child(3) { right: 4%; }

.sequence-photo--four .sequence-photo__art::before {
  top: 16%;
  right: 12%;
  bottom: 16%;
  left: 12%;
  background: var(--preview-fill);
  clip-path: polygon(0 78%, 23% 52%, 43% 67%, 66% 28%, 100% 8%, 100% 100%, 0 100%);
}

.sequence-photo--four .sequence-photo__art::after {
  top: 16%;
  right: 12%;
  bottom: 16%;
  left: 12%;
}

.sequence-photo--four .sequence-photo__art i:nth-child(1) {
  top: 24%;
  right: 20%;
  width: 13%;
  aspect-ratio: 1;
  border-color: var(--blue);
  border-radius: 50%;
}

.sequence-photo--four .sequence-photo__art i:nth-child(2) {
  bottom: 23%;
  left: 18%;
  width: 34%;
  height: 7%;
  background: var(--surface);
}

.sequence-photo--four .sequence-photo__art i:nth-child(3) {
  top: 9%;
  left: 9%;
  width: 8px;
  height: 8px;
  background: var(--blue);
}

.project-model-window__footer {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 68px;
  padding: 11px;
  border-top: 1px solid var(--preview-line);
  background: var(--surface);
}

.sequence-meter {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr 26px;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.07em;
}

.sequence-meter__track {
  display: block;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.sequence-meter__track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
}

.sequence-meter output {
  color: var(--blue);
  text-align: right;
}

.sequence-help {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.sequence-help span:first-child {
  color: var(--blue);
}

.sequence-controls {
  display: none;
  justify-content: stretch;
}

.sequence-controls button {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  font: 700 8px/1 var(--mono);
  cursor: pointer;
}

.sequence-controls button:last-child {
  border-right: 1px solid var(--line);
}

.sequence-controls button:hover,
.sequence-controls button:focus-visible {
  outline: 0;
  background: var(--blue-fill);
  color: var(--blue);
}

.sequence-controls button:focus-visible {
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

.sequence-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}

.sequence-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.browser-frame {
  width: 84%;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--preview-bg);
}

.browser-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 38px;
  padding-inline: 11px;
  border-bottom: 1px solid var(--preview-line);
  color: var(--faint);
  font: 600 7px/1 var(--mono);
}

.browser-dots {
  display: flex;
  gap: 5px;
}

.browser-dots i {
  width: 5px;
  height: 5px;
  border: 1px solid var(--preview-line);
}

.dashboard-ui {
  display: grid;
  grid-template-columns: 47px 1fr;
  min-height: 326px;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-right: 1px solid var(--preview-line);
}

.dash-logo,
.dash-nav i {
  width: 14px;
  height: 5px;
  background: var(--preview-quiet);
}

.dash-logo {
  width: 20px;
  height: 20px;
  margin-bottom: 8px;
  border: 1px solid var(--preview-line);
  background: var(--preview-fill);
}

.dash-content {
  padding: 32px 28px;
}

.dash-title {
  width: 38%;
  height: 10px;
  background: var(--preview-line);
}

.dash-subtitle {
  width: 61%;
  height: 5px;
  margin-top: 10px;
  background: var(--preview-quiet);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr;
  gap: 12px;
  margin-top: 40px;
}

.dash-chart,
.dash-stat {
  position: relative;
  min-height: 150px;
  border: 1px solid var(--preview-line);
  background: transparent;
}

.dash-chart::before,
.dash-chart::after {
  position: absolute;
  right: 14px;
  left: 14px;
  height: 1px;
  background: var(--preview-quiet);
  content: "";
}

.dash-chart::before {
  top: 40%;
}

.dash-chart::after {
  top: 70%;
}

.chart-line {
  position: absolute;
  right: 14px;
  bottom: 28px;
  left: 14px;
  height: 72px;
  background: var(--preview-line);
  clip-path: polygon(0 86%, 18% 63%, 34% 75%, 50% 36%, 68% 54%, 84% 14%, 100% 2%, 100% 6%, 84% 20%, 68% 60%, 50% 42%, 34% 81%, 18% 69%, 0 92%);
}

.chart-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1px solid var(--project-accent);
  background: var(--preview-bg);
}

.chart-dot--one { bottom: 58px; left: 35%; }
.chart-dot--two { right: 31%; bottom: 74px; }
.chart-dot--three { right: 12px; bottom: 92px; }

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
}

.dash-stat b {
  color: var(--blue);
  font: 600 24px/1 var(--mono);
}

.dash-stat span {
  width: 80%;
  height: 4px;
  margin-top: 12px;
  background: var(--preview-quiet);
}

.dash-stat span:last-child {
  width: 56%;
  margin-top: 7px;
}

.project-preview--mobile {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 48px;
}

.phone {
  position: relative;
  width: 170px;
  height: 350px;
  padding: 38px 15px 15px;
  border: 1px solid var(--preview-line);
  border-radius: 12px;
  background: var(--preview-bg);
}

.phone--back {
  justify-self: end;
  margin-right: -16px;
  opacity: 0.55;
}

.phone--front {
  z-index: 1;
  justify-self: start;
  margin-left: -16px;
}

.phone-speaker {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 42px;
  height: 4px;
  background: var(--preview-line);
  transform: translateX(-50%);
}

.phone-greeting {
  width: 55%;
  height: 6px;
  margin-bottom: 17px;
  background: var(--preview-line);
}

.phone-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 148px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--preview-fill);
}

.phone-card__orb {
  position: absolute;
  top: -22px;
  right: -17px;
  width: 86px;
  height: 86px;
  border: 12px double var(--preview-line);
  border-radius: 50%;
}

.phone-card b {
  color: var(--blue);
  font: 600 28px/1 var(--mono);
}

.phone-card small {
  margin-top: 6px;
  color: var(--faint);
  font: 600 6px/1 var(--mono);
  letter-spacing: 0.13em;
}

.phone-card--small {
  height: 112px;
  margin-top: 10px;
  background: transparent;
}

.phone-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.phone-row i {
  height: 50px;
  border: 1px solid var(--preview-line);
}

.phone-lines {
  margin-top: 23px;
}

.phone-lines i {
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 10px;
  background: var(--preview-quiet);
}

.phone-lines i:nth-child(2) { width: 70%; }
.phone-lines i:nth-child(3) { width: 86%; }

.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(68%, 340px);
  aspect-ratio: 0.72;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--preview-bg);
  color: var(--text);
}

.poster::before {
  position: absolute;
  inset: 11px;
  border: 1px solid var(--preview-quiet);
  content: "";
}

.poster-label,
.poster-foot {
  z-index: 1;
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.15em;
}

.poster strong {
  z-index: 1;
  align-self: flex-start;
  font-size: clamp(2.5rem, 5vw, 4.55rem);
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.poster-rings {
  position: absolute;
  top: 48%;
  left: 56%;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
}

.poster-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--preview-line);
  border-radius: 50%;
}

.poster-rings i:nth-child(2) { inset: 40px; }
.poster-rings i:nth-child(3) { inset: 78px; }

.terminal-window {
  width: 82%;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--preview-bg);
}

.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding-inline: 15px;
  border-bottom: 1px solid var(--preview-line);
  color: var(--faint);
  font: 600 8px/1 var(--mono);
}

.terminal-top i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--blue);
}

.terminal-body {
  min-height: 318px;
  padding: 34px 28px;
  color: var(--muted);
  font: 600 11px/1.8 var(--mono);
}

.terminal-body b,
.terminal-body span {
  color: var(--blue);
}

.terminal-progress {
  width: 100%;
  height: 6px;
  margin-block: 29px 19px;
  border: 1px solid var(--preview-line);
}

.terminal-progress i {
  display: block;
  width: 76%;
  height: 100%;
  background: var(--blue);
}

.terminal-body .terminal-ready {
  color: var(--text);
}

/* Mini-game library */

.game-noscript {
  display: none;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
  font: 650 10px/1.6 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-library {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 720px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.game-library__index {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.game-library__label {
  display: flex;
  align-items: center;
  height: 38px;
  margin: 0;
  padding-inline: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.12em;
}

.game-entry {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 108px;
  padding: 16px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.game-entry::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
  content: "";
  opacity: 0;
}

.game-entry:hover,
.game-entry.is-active {
  background: var(--blue-fill);
}

.game-entry.is-active::before {
  opacity: 1;
}

.game-entry__number {
  align-self: start;
  padding-top: 2px;
  color: var(--blue);
  font: 700 9px/1 var(--mono);
}

.game-entry__copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.game-entry__copy strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-entry__copy small,
.game-entry > i {
  color: var(--faint);
  font: 650 8px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-entry > i {
  color: var(--blue);
  font-style: normal;
}

.game-entry.is-locked {
  opacity: 0.58;
}

.game-console {
  display: grid;
  min-width: 0;
  padding: clamp(28px, 4.5vw, 56px);
  place-items: center;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}

.game-console[hidden] {
  display: none;
}

.game-window {
  width: min(100%, 460px);
  border: 1px solid var(--preview-line);
  background: var(--preview-bg);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-window__bar {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto 58px 48px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--preview-line);
  color: var(--faint);
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.game-window__bar > * {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding-inline: 12px;
  border-right: 1px solid var(--line);
}

.game-window__bar > :last-child {
  border-right: 0;
}

.game-window__bar h2,
.game-window__bar h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font: inherit;
  font-family: var(--title-font);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-window__bar .window-dots {
  gap: 5px;
}

.game-fullscreen-toggle,
.game-sound-toggle {
  align-self: stretch;
  justify-content: center;
  min-height: 44px;
  padding-inline: 4px;
  border: 0;
  background: var(--surface-2);
  color: var(--blue);
  font: 750 7px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
}

.game-fullscreen-toggle {
  min-width: 48px;
}

.game-sound-toggle {
  min-width: 58px;
}

.game-sound-toggle[aria-pressed="false"] {
  color: var(--faint);
}

.game-sound-toggle:disabled {
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.62;
}

.game-fullscreen-toggle:hover,
.game-fullscreen-toggle:focus-visible,
.game-sound-toggle:not(:disabled):hover,
.game-sound-toggle:not(:disabled):focus-visible {
  background: var(--blue);
  color: #06101c;
}

html[data-theme="light"] .game-fullscreen-toggle:hover,
html[data-theme="light"] .game-fullscreen-toggle:focus-visible,
html[data-theme="light"] .game-sound-toggle:not(:disabled):hover,
html[data-theme="light"] .game-sound-toggle:not(:disabled):focus-visible {
  color: #fff;
}

html.has-game-fullscreen,
html.has-game-fullscreen body {
  overflow: hidden;
  overscroll-behavior: none;
}

.game-console.is-game-fullscreen-active {
  display: grid;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  box-sizing: border-box;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  overflow: hidden;
  background: var(--preview-bg);
  place-items: stretch;
}

.game-console.is-game-fullscreen-fallback {
  position: fixed;
  z-index: 3000;
  inset: 0;
  height: 100vh;
  height: 100dvh;
}

.game-console:fullscreen::backdrop {
  background: var(--preview-bg);
}

.game-console.is-game-fullscreen-active .game-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100% !important;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  background: var(--preview-bg);
}

.game-console.is-game-fullscreen-active .tetris-window {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.game-console.is-game-fullscreen-active .game-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  touch-action: none;
}

.game-stage {
  position: relative;
  overflow: hidden;
  background: var(--preview-bg);
  cursor: pointer;
  touch-action: manipulation;
}

.flappy-stage {
  aspect-ratio: 3 / 4;
}

.snake-stage {
  aspect-ratio: 1;
}

.invaders-stage {
  aspect-ratio: 8 / 9;
}

.tetris-window {
  width: min(100%, 560px);
}

.tetris-stage {
  aspect-ratio: 5 / 6;
  touch-action: none;
}

.garden-window {
  width: min(100%, 760px);
}

.garden-stage {
  isolation: isolate;
  aspect-ratio: 4 / 5;
  touch-action: manipulation;
}

.game-console.is-game-fullscreen-active .garden-stage {
  touch-action: manipulation;
}

.garden-stage canvas {
  touch-action: none;
}

.garden-toolbar {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  min-height: 66px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--preview-line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--preview-bg) 72%, transparent);
  touch-action: manipulation;
}

.garden-unit-strip {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--blue) transparent;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.garden-unit-card {
  position: relative;
  display: grid;
  min-width: 82px;
  min-height: 54px;
  flex: 1 0 82px;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.garden-unit-card > span {
  display: grid;
  width: 21px;
  height: 21px;
  grid-row: 1 / 3;
  place-items: center;
  border: 1px solid var(--blue);
  color: var(--blue);
  font: 750 7px/1 var(--mono);
}

.garden-unit-card strong,
.garden-unit-card small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garden-unit-card strong {
  align-self: end;
  color: var(--text-soft);
  font: 750 7px/1 var(--mono);
  letter-spacing: 0.05em;
}

.garden-unit-card small {
  align-self: start;
  color: var(--faint);
  font: 650 6px/1.2 var(--mono);
  letter-spacing: 0.04em;
}

.garden-unit-card [data-garden-cooldown] {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--blue);
  transform: scaleX(var(--garden-cooldown, 0));
  transform-origin: left center;
}

.garden-unit-card:hover,
.garden-unit-card:focus-visible,
.garden-unit-card[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-fill);
}

.garden-unit-card[aria-pressed="true"] > span {
  background: var(--blue);
  color: var(--preview-bg);
}

.garden-unit-card[aria-disabled="true"] {
  cursor: not-allowed;
}

.garden-unit-card[data-garden-locked] {
  border-style: dashed;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 7px,
    var(--grid-minor) 7px 8px
  );
  cursor: help;
}

.garden-unit-card[data-garden-locked] strong,
.garden-unit-card[data-garden-locked] small {
  color: var(--faint);
}

.garden-unit-card[data-garden-locked] > span {
  border-color: var(--faint);
  color: var(--faint);
}

.garden-unit-card[data-garden-new]:not([data-garden-locked]) {
  box-shadow: inset 0 -3px 0 var(--blue);
}

.garden-unit-card--remove {
  flex: 0 0 82px;
  border-color: var(--line-strong);
}

.garden-unit-card--remove > span {
  border-style: dashed;
}

.garden-footer .garden-readouts b {
  color: var(--blue);
}

.tetris-mobile-previews {
  display: none;
}

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

.game-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-overlay,
.flappy-overlay {
  position: absolute;
  display: grid;
  z-index: 2;
  inset: 0;
  place-content: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
  pointer-events: none;
}

.game-overlay[hidden],
.flappy-overlay[hidden] {
  display: none;
}

.game-overlay strong,
.game-overlay span,
.flappy-overlay strong,
.flappy-overlay span {
  border: 1px solid var(--preview-line);
  background: var(--surface);
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.game-overlay strong,
.flappy-overlay strong {
  min-width: min(280px, calc(100% - 40px));
  padding: 13px 16px;
  color: var(--text);
  font-size: 12px;
}

.game-overlay span,
.flappy-overlay span {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 8px;
}

.garden-stage .game-overlay {
  padding: 84px 14px 18px;
  background: color-mix(in srgb, var(--preview-bg) 68%, transparent);
}

.garden-stage .game-overlay > * {
  width: min(390px, calc(100% - 24px));
  box-sizing: border-box;
}

.garden-stage .game-overlay[data-overlay-mode="briefing"] strong {
  border-color: var(--blue);
  color: var(--blue);
}

.garden-stage .game-overlay .garden-overlay-detail {
  max-width: min(390px, calc(100% - 24px));
  padding: 10px 12px;
  color: var(--text-soft);
  line-height: 1.45;
  white-space: normal;
}

.game-window__footer {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  min-height: 54px;
  border-top: 1px solid var(--preview-line);
  color: var(--faint);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.07em;
}

.game-state,
.game-scores,
.game-window__footer button {
  min-height: 54px;
  border-right: 1px solid var(--line);
}

.game-state {
  display: flex;
  align-items: center;
  padding-inline: 12px;
}

.game-scores {
  display: flex;
  align-items: stretch;
}

.game-scores output {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-inline: 11px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.game-scores output:last-child {
  border-right: 0;
}

.game-scores b {
  color: var(--blue);
}

.game-window__footer button {
  min-width: 82px;
  padding-inline: 12px;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: var(--blue-deep);
  color: #fff;
  font: 750 9px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.game-window__footer button:hover,
.game-window__footer button:focus-visible {
  background: var(--blue);
  color: #06101c;
}

html[data-theme="light"] .game-window__footer button:hover,
html[data-theme="light"] .game-window__footer button:focus-visible {
  color: #fff;
}

.tetris-footer {
  grid-template-columns: minmax(100px, 1fr) auto 68px 82px;
}

.tetris-footer [data-tetris-hold] {
  min-width: 68px;
  border-right: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--blue);
}

.tetris-footer [data-tetris-hold]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Desktop game chassis: keep the playfield portrait and move its readouts
   into a compact rail. Phone layouts retain the horizontal footer below. */

@media (min-width: 951px) and (min-height: 600px) {
  .game-console.is-game-fullscreen-active {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .game-console:fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    transform: none !important;
  }

  .game-console {
    container-type: size;
  }

  .game-console.is-game-fullscreen-active {
    place-items: center;
  }

  .game-console .game-window,
  .game-console.is-game-fullscreen-active .game-window {
    --game-rail-width: 180px;
    display: grid;
    width: min(100%, 720px);
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    grid-template-areas:
      "stage bar"
      "stage controls";
    grid-template-columns: minmax(0, 1fr) var(--game-rail-width);
    grid-template-rows: 44px minmax(0, 1fr);
    overflow: hidden;
  }

  .game-console.is-game-fullscreen-active .game-window,
  .game-console.is-game-fullscreen-active .tetris-window {
    grid-template-rows: 44px minmax(0, 1fr);
  }

  #game-panel-flappy .game-window {
    width: min(100%, 720px) !important;
    width: min(100%, calc(75cqh + var(--game-rail-width))) !important;
  }

  #game-panel-snake .game-window {
    width: min(100%, 860px) !important;
    width: min(100%, calc(100cqh + var(--game-rail-width))) !important;
  }

  #game-panel-invaders .game-window {
    width: min(100%, 800px) !important;
    width: min(100%, calc(88.889cqh + var(--game-rail-width))) !important;
  }

  #game-panel-tetris .game-window {
    --game-rail-width: 190px;
    width: min(100%, 790px) !important;
    width: min(100%, calc(83.333cqh + var(--game-rail-width))) !important;
  }

  #game-panel-garden .game-window {
    --game-rail-width: 190px;
    width: min(100%, 1160px) !important;
    width: min(100%, calc(145cqh + var(--game-rail-width))) !important;
  }

  .game-console .game-window__bar {
    grid-area: bar;
    grid-template-columns: minmax(0, 1fr) 58px 48px;
    border-bottom: 1px solid var(--preview-line);
    border-left: 1px solid var(--preview-line);
  }

  .game-console .game-window__bar .window-dots,
  .game-console .game-window__bar .game-build-label {
    display: none;
  }

  .game-console .game-stage {
    grid-area: stage;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: auto;
  }

  .game-console .game-window__footer {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-area: controls;
    grid-template-columns: 1fr;
    grid-template-rows:
      minmax(44px, 0.65fr)
      minmax(80px, 1.35fr)
      54px;
    border-top: 0;
    border-left: 1px solid var(--preview-line);
  }

  .game-console .game-state,
  .game-console .game-scores,
  .game-console .game-window__footer button {
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-console .game-state {
    justify-content: center;
    padding: 10px;
    text-align: center;
  }

  .game-console .game-scores {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .game-console .game-scores output {
    justify-content: center;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-console .game-scores output:last-child {
    border-bottom: 0;
  }

  .game-console .garden-readouts {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .game-console .game-window__footer > button {
    border-bottom: 0;
  }

  .game-console .tetris-footer {
    grid-template-columns: 1fr;
    grid-template-rows:
      minmax(44px, 0.55fr)
      minmax(72px, 1.15fr)
      50px
      54px;
  }

  .game-console .tetris-footer > button {
    border-bottom: 1px solid var(--line);
  }

  .game-console .tetris-footer > button:last-child {
    border-bottom: 0;
  }

  .game-console .tetris-footer [data-tetris-hold] {
    border-right: 0;
  }
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 86px;
  align-items: start;
}

.about-intro h2,
.about-intro h1 {
  max-width: 690px;
}

.about-copy {
  padding: 34px 0 0 20px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
}

.about-copy p {
  margin: 0;
}

.about-copy p + p {
  margin-top: 20px;
}

.about-copy .about-lead {
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.7;
}

.about-photo {
  width: min(100%, 280px);
  margin: clamp(18px, 2.5vh, 28px) 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.about-photo .blueprint-caption {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 30px;
  font-size: 7px;
}

.about-photo .blueprint-caption span {
  min-width: 0;
  padding-inline: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.about-photo__viewport {
  position: relative;
  display: grid;
  height: clamp(118px, 15svh, 150px);
  overflow: hidden;
  place-items: center;
  background: var(--surface);
}

.about-photo__viewport::before,
.about-photo__viewport::after {
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-color: var(--blue);
  content: "";
  pointer-events: none;
}

.about-photo__viewport::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.about-photo__viewport::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.about-photo__placeholder {
  color: var(--blue);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 18px 18px;
}

.about-photo__glyph {
  width: min(48%, 112px);
}

.about-photo__datum {
  opacity: 0.35;
  stroke-dasharray: 3 5;
}

.about-photo__label {
  position: absolute;
  right: 9px;
  bottom: 7px;
  color: var(--faint);
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.1em;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 76px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.capability-card {
  position: relative;
  min-height: 250px;
  padding: 27px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.capability-card:hover {
  background: var(--blue-fill);
}

.capability-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--blue);
}

.capability-icon svg {
  width: 19px;
  height: 19px;
}

.capability-number {
  position: absolute;
  top: 29px;
  right: 28px;
  color: var(--faint);
  font: 650 9px/1 var(--mono);
}

.capability-card h3 {
  margin: 51px 0 8px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.capability-card p {
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

/* Contact drawing */

.contact {
  padding-top: 84px;
  padding-bottom: 84px;
}

.contact-card {
  position: relative;
  min-height: 500px;
  padding: clamp(40px, 7vw, 78px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.contact-card::before,
.contact-card::after {
  position: absolute;
  width: 25px;
  height: 25px;
  border-color: var(--blue);
  content: "";
}

.contact-card::before {
  top: 13px;
  right: 13px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.contact-card::after {
  right: 13px;
  bottom: 13px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.contact-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  pointer-events: none;
}

.contact-card > *:not(.contact-grid, .logo-render--contact) {
  position: relative;
  z-index: 2;
}

.contact-card h2,
.contact-card h1 {
  max-width: 760px;
  font-size: clamp(3rem, 6.2vw, 5.45rem);
}

.contact-card h2 span,
.contact-card h1 span {
  color: var(--blue);
}

.contact-card > p:not(.section-kicker) {
  max-width: 480px;
  margin: 27px 0 34px;
  color: var(--muted);
}

.button--light {
  background: var(--blue-deep);
  color: #fff;
}

.button--light:hover {
  background: var(--blue);
  color: #06101c;
}

html[data-theme="light"] .button--light:hover {
  color: #fff;
}

.logo-render--contact {
  position: absolute;
  top: 50%;
  right: 7%;
  width: min(22vw, 220px);
  opacity: 0.14;
  transform: translateY(-50%);
}

/* Footer */

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 116px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 600 9px/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand--footer {
  color: var(--text);
}

.site-footer > p:nth-child(2) {
  justify-self: center;
}

.site-footer > p:last-child {
  justify-self: end;
}

/* Static by design: JavaScript adds these classes, but the drawing does not
   stage or float into view. */

.js .reveal,
.js .reveal--delay,
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Responsive */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
    gap: 48px;
  }

  .hero-blueprint {
    min-height: 592px;
  }

  .logo-plate {
    height: 438px;
  }

  .project-workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .project-panel {
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  }

  .project-panel__content {
    padding-inline: 27px;
  }

  .project-preview--mobile {
    padding-inline: 22px;
  }
}

@media (max-width: 950px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 148px;
  }

  .hero-copy {
    position: static;
    top: auto;
    max-width: 760px;
  }

  .hero-blueprint {
    width: min(100%, 660px);
    top: auto;
    justify-self: start;
  }

  .scroll-cue {
    display: none;
  }

  .project-workspace {
    grid-template-columns: 1fr;
  }

  .project-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
  }

  .project-tabs::before {
    display: none;
  }

  .project-tab {
    min-height: 90px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .project-tab::before {
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 3px;
  }

  .project-panel {
    grid-template-columns: minmax(290px, 0.82fr) minmax(360px, 1.18fr);
  }

  .game-library {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .game-library__index {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
  }

  .game-library__label {
    display: none;
  }

  .game-entry {
    min-height: 90px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .game-entry::before {
    inset: auto 0 0;
    width: auto;
    height: 3px;
  }

  .game-console {
    min-height: 690px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .about-copy {
    max-width: 680px;
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 124px;
  }

  .container {
    width: min(calc(100% - 32px), var(--container));
  }

  .site-header {
    height: 116px;
  }

  .page-main {
    padding-top: 116px;
  }

  .header-inner {
    height: 65px;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    top: 65px;
    right: 16px;
    left: 16px;
    height: 50px;
    transform: none;
  }

  .main-nav a {
    flex: 1;
    min-width: 0;
  }

  .hero {
    min-height: auto;
    padding-top: 164px;
    padding-bottom: 92px;
  }

  .hero-blueprint {
    top: auto;
    height: auto;
    min-height: 592px;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3rem, 13vw, 5rem);
  }

  .section {
    padding-top: 84px;
    padding-bottom: 84px;
  }

  .game-console {
    min-height: 0;
    padding: 28px;
  }

  .about-photo {
    width: min(100%, 260px);
    margin-top: 20px;
  }

  .about-photo__viewport {
    height: 132px;
    aspect-ratio: auto;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 36px;
  }

  .section-description {
    max-width: 560px;
  }

  .project-panel {
    grid-template-columns: 1fr;
  }

  .project-panel__content {
    min-height: 480px;
    padding: 27px 24px;
  }

  .project-preview {
    min-height: 430px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .project-preview--assembly {
    padding: 42px 16px;
  }

  .project-model-window {
    width: min(calc(100% - 32px), 480px);
  }

  .capability-grid {
    grid-template-columns: 1fr;
    margin-top: 56px;
  }

  .capability-card {
    min-height: 215px;
  }

  .capability-card h3 {
    margin-top: 36px;
  }

  .contact {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .contact-card {
    min-height: 500px;
  }

  .logo-render--contact {
    right: -5%;
    width: 190px;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer > p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 520px) {
  .main-nav a {
    padding-inline: 4px;
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .brand-copy small {
    display: none;
  }

  .theme-toggle__label {
    display: none;
  }

  .theme-toggle {
    padding-right: 5px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button--primary,
  .text-link,
  .hero-social-links {
    width: 100%;
  }

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

  .hero-social-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-social-link {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .hero-social-link + .hero-social-link {
    border-left: 0;
  }

  .game-console {
    padding: 16px 12px;
  }

  .game-window__bar {
    grid-template-columns: 62px minmax(0, 1fr) 58px 48px;
  }

  .game-window__bar .game-build-label {
    display: none;
  }

  .game-window__bar h3 {
    border-right: 0;
  }

  .game-window__footer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-state {
    grid-column: 1 / -1;
    min-height: 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-scores,
  .game-window__footer button {
    min-height: 48px;
  }

  .game-scores output {
    flex: 1;
  }

  .game-overlay strong,
  .flappy-overlay strong {
    min-width: min(240px, calc(100% - 32px));
    font-size: 10px;
  }

  .garden-toolbar {
    top: 6px;
    right: 6px;
    left: 6px;
    min-height: 62px;
    padding: 4px;
  }

  .garden-unit-card {
    min-width: 74px;
    min-height: 52px;
    flex-basis: 74px;
    padding-inline: 5px;
  }

  .garden-unit-card--remove {
    flex-basis: 74px;
  }

  .garden-readouts {
    font-size: 6px;
    letter-spacing: 0.02em;
  }

  .garden-readouts output {
    min-width: 0;
    padding-inline: 4px;
  }

  .tetris-mobile-previews {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 72px;
    border-top: 1px solid var(--preview-line);
    background: var(--surface-2);
    color: var(--faint);
    font: 700 7px/1 var(--mono);
    letter-spacing: 0.08em;
  }

  .tetris-mini-preview,
  .tetris-mobile-previews > output {
    display: grid;
    min-width: 0;
    min-height: 72px;
    place-items: center;
    padding: 5px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: inherit;
    font: inherit;
  }

  .tetris-mini-preview--hold {
    appearance: none;
    border-radius: 0;
    cursor: pointer;
    touch-action: manipulation;
  }

  .tetris-mini-preview--hold:disabled {
    cursor: not-allowed;
  }

  .tetris-mini-preview--hold:not(:disabled):active {
    background: var(--blue-fill);
  }

  .tetris-mini-preview--hold:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -3px;
  }

  .tetris-mobile-previews > :last-child {
    border-right: 0;
  }

  .tetris-mini-preview canvas {
    width: 48px;
    max-width: 100%;
    height: 48px;
    pointer-events: none;
  }

  .tetris-mobile-previews b {
    color: var(--blue);
    font-size: 11px;
  }

  .tetris-footer {
    grid-template-columns: minmax(0, 1fr) 58px 72px;
  }

  .tetris-footer .game-state {
    grid-column: 1 / -1;
  }

  .tetris-footer .game-scores {
    min-width: 0;
  }

  .tetris-footer .game-scores output,
  .tetris-footer button {
    min-width: 0;
    padding-inline: 6px;
  }

  .hero-blueprint {
    height: auto;
    min-height: 500px;
  }

  .blueprint-caption {
    grid-template-columns: auto 1fr;
  }

  .blueprint-caption span:last-child {
    display: none;
  }

  .logo-plate {
    height: 348px;
  }

  .logo-render--hero {
    width: min(48%, 160px);
  }

  .dimension--vertical {
    left: 15px;
  }

  .project-counter {
    right: 10px;
    bottom: 49px;
    width: 108px;
    min-height: 96px;
  }

  .project-counter strong {
    font-size: 40px;
  }

  .model-loader {
    right: 126px;
    bottom: 56px;
    left: 10px;
  }

  .model-progress {
    right: 10px;
    grid-template-columns: 58px 26px;
  }

  .model-progress > span:first-child {
    display: none;
  }

  .model-controls {
    left: 10px;
  }

  .model-controls button {
    min-width: 26px;
    height: 40px;
    padding-inline: 6px;
  }

  .model-controls button:last-child {
    min-width: 54px;
  }

  .blueprint-coordinates span:nth-child(2) {
    display: none;
  }

  .blueprint-coordinates {
    grid-template-columns: 1fr 1fr;
  }

  .project-tab {
    min-width: 155px;
  }

  .project-panel__content {
    min-height: 510px;
  }

  .project-preview {
    min-height: 360px;
  }

  .project-preview--assembly {
    padding: 32px 14px;
  }

  .project-model-window {
    width: 100%;
  }

  .project-model-window__bar {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  .project-model-window__bar > span:nth-child(2) {
    text-align: right;
  }

  .project-model-window__bar > span:last-child {
    display: none;
  }

  .sequence-photo {
    grid-template-rows: 1fr 29px;
    padding: 10px;
  }

  .sequence-photo__caption {
    font-size: 6px;
  }

  .sequence-meter {
    grid-template-columns: 82px 1fr 24px;
    gap: 7px;
    font-size: 6px;
  }

  .sequence-hover-note {
    top: 9px;
    right: 9px;
    width: min(228px, calc(100% - 18px));
    padding: 8px 9px;
  }

  .sequence-hover-note strong {
    font-size: 8px;
  }

  .sequence-hover-note small {
    font-size: 6px;
  }

  .browser-frame,
  .terminal-window {
    width: 91%;
  }

  .dashboard-ui {
    min-height: 250px;
  }

  .dash-content {
    padding: 24px 19px;
  }

  .dash-grid {
    margin-top: 29px;
  }

  .dash-chart,
  .dash-stat {
    min-height: 122px;
  }

  .project-preview--mobile {
    min-height: 410px;
    padding-inline: 4px;
  }

  .phone {
    width: 142px;
    height: 292px;
  }

  .phone-card {
    height: 116px;
  }

  .poster {
    width: min(72%, 270px);
  }

  .poster-rings {
    width: 205px;
    height: 205px;
  }

  .poster-rings i:nth-child(2) { inset: 35px; }
  .poster-rings i:nth-child(3) { inset: 67px; }

  .terminal-body {
    min-height: 260px;
    padding: 25px 21px;
  }

  .contact-card {
    min-height: 530px;
    padding: 37px 23px;
  }

  .contact-card h2,
  .contact-card h1 {
    font-size: clamp(2.7rem, 14vw, 4.1rem);
  }

  .button--light {
    width: 100%;
    font-size: 9px;
  }

  .logo-render--contact {
    right: -16%;
    width: 170px;
  }

  .site-footer {
    font-size: 8px;
  }
}

/* Desktop viewport deck
   Each document occupies one browser viewport. Wheel navigation between
   documents is handled in script.js; narrow layouts retain natural scrolling. */

@media (min-width: 951px) and (min-height: 600px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    display: grid;
    height: 100dvh;
    grid-template-rows: minmax(0, 1fr) 56px;
  }

  body > main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .site-footer {
    height: 56px;
    min-height: 0;
  }

  .site-footer > p {
    margin-block: 0;
  }

  .page-main {
    height: 100%;
    min-height: 0;
    padding-top: 74px;
  }

  .page-main > .section {
    height: 100%;
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .section-heading {
    gap: 36px;
    margin-bottom: 12px;
  }

  .section-kicker {
    margin-bottom: 8px;
  }

  .section-heading h1,
  .section-heading h2,
  .about-intro h1,
  .about-intro h2 {
    font-size: clamp(2rem, 3vw, 2.75rem);
  }

  .section-description {
    font-size: 12px;
    line-height: 1.45;
  }

  .games .section-heading h1,
  .games .section-heading h2 {
    font-size: clamp(1.8rem, 2.7vw, 2.25rem);
  }

  /* Home */

  .hero {
    height: 100%;
    min-height: 0;
    padding-top: 86px;
    padding-bottom: 14px;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 4.5vw, 4.2rem);
  }

  .hero-intro {
    margin-top: 18px;
    line-height: 1.55;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-blueprint {
    height: min(560px, calc(100dvh - 160px));
    min-height: 0;
  }

  .logo-plate {
    height: calc(100% - 87px);
  }

  .scroll-cue {
    top: auto;
    bottom: 8px;
  }

  /* Projects */

  .projects,
  .games {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .project-workspace {
    height: 100%;
    min-height: 0;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .project-tabs::before {
    height: 32px;
  }

  .project-tab {
    flex: 1;
    min-height: 0;
    padding: 10px 12px;
  }

  .project-panels {
    min-height: 0;
  }

  .project-panel {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(235px, 0.72fr) minmax(430px, 1.28fr);
  }

  .project-panel__content {
    min-height: 0;
    padding: 18px;
  }

  .project-type {
    margin: 20px 0 8px;
  }

  .project-panel h3 {
    font-size: clamp(1.65rem, 2.5vw, 2.45rem);
  }

  .project-summary {
    margin: 10px 0 14px;
    line-height: 1.5;
  }

  .project-tags {
    margin-bottom: 12px;
  }

  .project-link {
    padding-top: 11px;
  }

  .project-preview {
    height: 100%;
    min-height: 0;
  }

  .project-preview--assembly {
    padding: 10px 14px;
  }

  .project-preview--mobile {
    padding: 18px;
  }

  .project-model-window {
    width: min(94%, 560px, calc(133.333dvh - 506.667px));
  }

  .poster {
    width: auto;
    height: min(88%, 460px);
  }

  /* Games */

  .game-library {
    height: 100%;
    min-height: 0;
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .game-library__index {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .game-library__label {
    height: 32px;
    flex: 0 0 32px;
  }

  .game-entry {
    min-height: 0;
    flex: 1;
    padding: 10px 12px;
  }

  .game-console {
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  /* About */

  .about {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px 28px;
  }

  .about-grid {
    grid-column: 1 / -1;
    gap: 48px;
  }

  .about-copy {
    padding-top: 0;
  }

  .about-copy .about-lead {
    font-size: 14px;
    line-height: 1.5;
  }

  .about-copy p {
    font-size: 12px;
    line-height: 1.5;
  }

  .about-copy p + p {
    margin-top: 9px;
  }

  .about-photo {
    grid-column: 1;
    align-self: center;
    margin: 0;
  }

  .about-photo__viewport {
    height: 150px;
  }

  .capability-grid {
    grid-column: 2;
    align-self: center;
    margin-top: 0;
  }

  .capability-card {
    min-height: 190px;
    padding: 18px;
  }

  .capability-number {
    top: 20px;
    right: 19px;
  }

  .capability-card h3 {
    margin-top: 28px;
    font-size: 17px;
  }

  .capability-card p {
    font-size: 11px;
    line-height: 1.55;
  }

  /* Contact */

  .contact {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .contact-card {
    height: 100%;
    min-height: 0;
    padding: clamp(28px, 5vh, 48px);
  }

  .contact-card h1,
  .contact-card h2 {
    font-size: clamp(2.8rem, 5.4vw, 4.6rem);
  }

  .contact-card > p:not(.section-kicker) {
    margin: 18px 0 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .hero-copy {
    position: static;
  }

  .hero-blueprint {
    position: relative;
    top: auto;
  }

  .sequence-help {
    display: none;
  }

  .sequence-hover-note {
    display: none;
  }

  .sequence-controls {
    display: flex;
  }
}

@media (hover: none), (pointer: coarse), (any-pointer: coarse) {
  .sequence-help {
    display: none;
  }

  .sequence-controls {
    display: flex;
  }

  .sequence-controls button {
    min-height: 44px;
  }

  .sequence-hover-note {
    display: none;
  }
}

/* Desktop navigation rail
   The page controls move out of the content header so the viewport can use
   its full height. Narrow layouts retain the compact horizontal header. */

@media (min-width: 1100px) and (min-height: 600px) {
  html {
    scroll-padding-top: 0;
  }

  body {
    padding-left: var(--sidebar-width);
  }

  .container {
    width: min(calc(100% - 32px), var(--container));
  }

  .site-header {
    right: auto;
    bottom: 0;
    width: var(--sidebar-width);
    height: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .header-inner.container {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 14px 12px;
  }

  .site-header .brand {
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    min-height: 48px;
  }

  .site-header .brand-copy strong {
    font-size: 12px;
  }

  .site-header .brand-copy small {
    font-size: 7px;
    letter-spacing: 0.08em;
  }

  .main-nav {
    top: 88px;
    right: 0;
    left: 0;
    height: auto;
    flex-direction: column;
    border-right: 0;
    border-left: 0;
    transform: none;
  }

  .main-nav a {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .theme-toggle {
    position: absolute;
    right: 12px;
    bottom: 16px;
    left: 12px;
    width: auto;
    grid-column: auto;
    justify-content: flex-start;
    justify-self: auto;
  }

  .page-main {
    padding-top: 0;
  }

  .hero {
    padding-top: 18px;
  }

  .hero::before {
    top: 0;
  }

  .hero::after {
    top: 24px;
  }

  .project-model-window {
    width: min(96%, 680px, calc(133.333dvh - 400px));
  }
}
