@import url("./design-system.css?v=20260930-zero-tracking");

:root {
  --surface: #1d1e20;
  --surface-elevated: rgba(19, 22, 28, 0.56);
  --surface-elevated-2: rgba(255, 255, 255, 0.06);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-soft: rgba(255, 255, 255, 0.48);
  --accent: #3fa8ff;
  --hero-overlay-top: rgba(23, 25, 29, 0);
  --hero-overlay-mid: rgba(23, 25, 29, 0.02);
  --hero-overlay-deep: rgba(16, 19, 26, 0.07);
  --hero-overlay-bottom: rgba(16, 19, 26, 0.24);
  --hero-glow-strong: rgba(125, 96, 255, 0.24);
  --hero-glow-soft: rgba(55, 198, 255, 0.12);
  --canvas-scrim: transparent;
  --scene-canvas-blur: 0px;
  --border-soft: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.34);
  --shadow-floating: 0 24px 60px rgba(0, 0, 0, 0.3);
  --social-chip-bg: var(--navigation-control-surface);
  --social-chip-fg: var(--navigation-control-foreground);
  --social-chip-icon-filter: none;
  --section-pad-bottom: clamp(72px, 7vw, 96px);
  --section-pad-bottom-tight: clamp(48px, 5vw, 60px);
  --section-pad-bottom-loose: clamp(96px, 10vw, 140px);
  --section-message-min-h: clamp(300px, 34vw, 490px);
  --section-message-top-pad: clamp(140px, 18vw, 250px);
  --section-heading-before: 260px;
  --section-heading-after: 60px;
  --projects-intro-top-pad: var(--section-heading-before);
  --center-heading-to-block-gap: var(--section-heading-after);
  --projects-showcase-top-space: 60px;
  --projects-grid-gap: var(--space-sm);
  --card-padding: var(--card-content-padding);
  --footer-pad-bottom: clamp(48px, 5vw, 64px);
  --text-block-max: 52rem;
  --bridge-text-max: 40rem;
  --hero-shell-width: min(calc(100% - 120px), 1320px);
  --hero-inner-width: min(100%, 1320px);
  --hero-section-height: 820px;
  --hero-section-top-pad: 120px;
  --hero-title-width: 776px;
  --hero-actions-gap: 52px;
  --hero-social-top-offset: 92px;
}

:root[data-theme="light"] {
  --surface: #e9e9e9;
  --surface-elevated: rgba(239, 245, 252, 0.7);
  --surface-elevated-2: rgba(18, 24, 35, 0.05);
  --text-main: #111317;
  --text-muted: rgba(17, 19, 23, 0.76);
  --text-soft: rgba(17, 19, 23, 0.54);
  --accent: #1272d5;
  --hero-overlay-top: rgba(248, 251, 255, 0.04);
  --hero-overlay-mid: rgba(248, 251, 255, 0.08);
  --hero-overlay-deep: rgba(229, 237, 247, 0.28);
  --hero-overlay-bottom: rgba(221, 232, 244, 0.58);
  --hero-glow-strong: rgba(18, 114, 213, 0.22);
  --hero-glow-soft: rgba(18, 114, 213, 0.1);
  --canvas-scrim: transparent;
  --border-soft: rgba(17, 19, 23, 0.1);
  --border-strong: rgba(17, 19, 23, 0.18);
  --shadow-floating: 0 18px 44px rgba(34, 44, 63, 0.12);
  --social-chip-bg: rgba(255, 255, 255, 0.58);
  --social-chip-fg: #111317;
  --social-chip-icon-filter: brightness(0) saturate(100%);
}

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

html {
  min-height: 100%;
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--surface);
  color: var(--text-main);
  font-family: "PP Neue Montreal";
}

input,
textarea,
select,
button,
option,
label {
  font-family: var(--font-sans);
}

input::placeholder,
textarea::placeholder {
  font-family: var(--font-sans);
}

a,
button {
  color: inherit;
}

button {
  font: inherit;
}

.background-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
  pointer-events: none;
  z-index: 0;
}

.background-stage::before,
.background-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.background-stage::before {
  background:
    linear-gradient(
      180deg,
      var(--hero-overlay-top) 0%,
      var(--hero-overlay-mid) 26%,
      var(--hero-overlay-deep) 68%,
      var(--hero-overlay-bottom) 100%
    );
  z-index: 0;
}

.background-stage::after {
  inset: auto 50% -22%;
  width: min(92vw, 1480px);
  height: min(66vw, 1040px);
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 60%, rgba(124, 94, 255, 0.18) 0%, rgba(124, 94, 255, 0.08) 22%, rgba(124, 94, 255, 0) 56%),
    radial-gradient(circle at 66% 56%, rgba(53, 196, 255, 0.1) 0%, rgba(53, 196, 255, 0.05) 18%, rgba(53, 196, 255, 0) 48%),
    radial-gradient(circle at 34% 64%, rgba(120, 86, 255, 0.08) 0%, rgba(120, 86, 255, 0.04) 16%, rgba(120, 86, 255, 0) 42%),
    radial-gradient(circle at center, var(--hero-glow-strong) 0%, var(--hero-glow-soft) 34%, rgba(63, 168, 255, 0) 74%);
  filter: blur(16px);
  z-index: 1;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--scene-initial-background, var(--surface));
  z-index: 2;
}

.hero-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--canvas-scrim);
  backdrop-filter: blur(var(--scene-canvas-blur));
  -webkit-backdrop-filter: blur(var(--scene-canvas-blur));
  pointer-events: none;
  z-index: 3;
}

.canvas-container canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
  z-index: 2;
}

.page-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  right: auto;
  z-index: 12;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: var(--layout-wide-width);
  height: 71px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.brand {
  display: flex;
  margin-inline-start: var(--layout-text-inset);
  align-items: center;
  width: auto;
  min-width: 0;
  height: 100%;
  text-decoration: none;
}

.brand__name {
  display: inline-flex;
  align-items: center;
  font-size: var(--type-caption-size);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--ui-fg, var(--text-main));
}

.topbar__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: auto;
  height: 100%;
}

.story-shell {
  position: relative;
  z-index: 2;
}

.story-panel {
  position: relative;
  min-height: 132vh;
  padding-top: 112px;
}

.story-panel--hero {
  display: flex;
  align-items: center;
  min-height: var(--hero-section-height);
  height: var(--hero-section-height);
  padding: 0;
  box-sizing: border-box;
}

.skills-marquee {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 60px;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}

/* Lift the ticker clear of the desktop dock without shifting later sections. */
@media (min-width: 920px) {
  .skills-marquee {
    top: -40px;
  }
}

.skills-marquee__viewport {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 1) 7%,
    rgba(0, 0, 0, 1) 93%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 1) 7%,
    rgba(0, 0, 0, 1) 93%,
    transparent 100%
  );
}

.skills-marquee__belt {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: skills-marquee 42s linear infinite;
  transform: translate3d(0, 0, 0);
}

.skills-marquee__viewport::before,
.skills-marquee__viewport::after {
  display: none;
}

.skills-marquee__viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(29, 30, 32, 0) 100%);
}

.skills-marquee__viewport::after {
  right: 0;
  background: linear-gradient(270deg, var(--surface) 0%, rgba(29, 30, 32, 0) 100%);
}

.skills-marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 60px;
  min-width: max-content;
  padding: 18px 0;
}

.skills-marquee__track + .skills-marquee__track {
  margin-left: 60px;
}

.skills-marquee__item {
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  white-space: nowrap;
}

.skills-marquee__dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.25px solid color-mix(in srgb, var(--text-main) 86%, transparent);
  opacity: 0.84;
}

.section-heading {
  width: var(--layout-wide-width);
  min-height: auto;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  box-sizing: border-box;
}

.section-heading__line {
  display: block;
}

.story-panel--cluster {
  min-height: auto;
  padding-top: 0;
  box-sizing: border-box;
}

.story-panel--nebula {
  min-height: 150vh;
}

.story-panel__inner {
  display: flex;
  align-items: flex-end;
  width: var(--layout-main-width);
  min-height: inherit;
  padding: 0 0 var(--section-pad-bottom);
  margin: 0 auto;
}

.story-panel__inner--hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 240px;
  width: var(--layout-wide-width);
  min-height: 500px;
  margin: 0 auto;
  padding: 0;
  transform: none;
}

/* Keep the hero copy readable on compact desktops without changing the mobile stack. */
@media (min-width: 920px) and (max-width: 1199px) {
  .story-panel__inner--hero {
    gap: 139px;
  }
}

.story-panel__inner--left {
  justify-content: flex-start;
}

.story-panel__inner--right {
  justify-content: flex-end;
}

.story-panel__inner--cluster {
  display: block;
  width: var(--layout-wide-width);
  max-width: 100%;
  min-height: auto;
  padding: 0;
  margin: 0 auto;
}

.story-message-container {
  width: 100%;
  min-height: auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  box-sizing: border-box;
}

.stage2-board {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(320px, 7fr) minmax(0, 10fr);
  gap: 0;
  align-items: stretch;
}

.stage2-board__lead {
  min-height: 588px;
  padding: clamp(104px, 11vw, 157px) var(--section-card-pad) clamp(108px, 11vw, 158px);
  border: 0;
  --board-surface:
    linear-gradient(180deg, rgba(82, 88, 103, 0.34) 0%, rgba(30, 36, 52, 0.18) 40%, rgba(13, 17, 27, 0.36) 100%),
    rgb(0 0 0 / 44%);
  --board-blur: 8px;
  --board-shadow: 0 20px 56px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 33px;
}

.stage2-board__lead-title {
  margin: 0;
  color: #fff;
  width: min(100%, 440px);
  font-size: var(--type-heading-2-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-heading-2-line);
  letter-spacing: var(--type-heading-2-tracking);
  text-wrap: balance;
  white-space: pre-line;
}

.stage2-board__lead-text {
  margin: 0;
  max-width: 26ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  letter-spacing: 0;
  white-space: pre-line;
  text-wrap: pretty;
}

.stage2-board__grid {
  min-height: 588px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px var(--section-card-gap);
  align-content: center;
  padding: clamp(44px, 5.6vw, 54px) clamp(36px, 4.6vw, 48px) clamp(44px, 5.6vw, 54px);
  border: 0;
  --board-surface:
    linear-gradient(180deg, rgba(98, 104, 124, 0.28) 0%, rgba(36, 42, 61, 0.16) 42%, rgba(14, 18, 30, 0.3) 100%),
    rgba(16, 20, 34, 0.38);
  --board-blur: 7px;
  --board-shadow: 0 20px 56px rgba(0, 0, 0, 0.3);
}

.stage2-board__lead,
.stage2-board__grid {
  position: relative;
  isolation: isolate;
}

.stage2-board__lead::before,
.stage2-board__grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--board-surface);
  box-shadow: var(--board-shadow);
  backdrop-filter: blur(var(--board-blur));
  -webkit-backdrop-filter: blur(var(--board-blur));
}

.stage2-board__lead::before { left: calc(-1 * var(--board-expand-left, 0px)); }
.stage2-board__grid::before { right: calc(-1 * var(--board-expand-right, 0px)); }

@media (max-width: 919px) {
  .stage2-board__lead::before { right: calc(-1 * var(--board-expand-right, 0px)); }
  .stage2-board__grid::before { left: calc(-1 * var(--board-expand-left, 0px)); }
}

.stage2-board__item {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  gap: 14px;
  align-content: start;
}

.stage2-board__item-title {
  margin: 0;
  min-height: 0;
  color: #fff;
  font-size: var(--type-heading-3-size);
  font-weight: var(--font-weight-medium);
  line-height: 1.15;
  letter-spacing: var(--type-heading-3-tracking);
  white-space: pre-line;
}

.stage2-board__item-text {
  margin: 0;
  width: min(100%, 34ch);
  color: rgba(255, 255, 255, 0.64);
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-line);
  letter-spacing: 0;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: none;
}

@media (min-width: 920px) {
  .stage2-board__item-text {
    width: min(100%, calc(34ch - 32px));
  }
}

.hero-copy {
  display: flex;
  padding-inline-start: var(--layout-text-inset);
  box-sizing: border-box;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  gap: 32px;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  transform: none;
  animation: hero-fade 700ms ease-out both;
}

.hero-copy__title {
  margin: 0;
  width: min(100%, 776px);
  font-size: var(--type-display-xl-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-display-xl-line);
  letter-spacing: var(--type-display-xl-tracking);
}

.hero-copy__text {
  margin: 0;
  width: min(100%, 776px);
  font-size: var(--type-lead-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--type-lead-line);
  letter-spacing: 0;
}

.hero-copy__text span {
  color: var(--accent);
}

.hero-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
  gap: 14px;
  min-height: 0;
  padding-top: 0;
  width: auto;
  margin-top: 0;
  transform: none;
  animation: hero-fade 700ms ease-out 100ms both;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: max-content;
  min-width: 0;
  height: var(--ui-height-compact);
  padding: 4px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ui-bg, var(--social-chip-bg));
  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  box-shadow: none;
  color: var(--ui-fg, var(--social-chip-fg));
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-regular, 400);
  line-height: var(--type-label-line);
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease);
}

.profile-chip__label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.profile-chip__icon {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background: currentColor;
  -webkit-mask: url("./assets/home/social-arrow.svg") center / contain no-repeat;
  mask: url("./assets/home/social-arrow.svg") center / contain no-repeat;
}

.scene-card {
  width: min(100%, 448px);
  padding: 28px 30px 30px;
  border: 1px solid var(--border-soft);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-floating);
}

.scene-card--dense {
  width: min(100%, 468px);
}

.scene-card--wide {
  width: min(100%, 520px);
}

.scene-card__eyebrow {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--text-soft);
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-label-line);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
}

.scene-card__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: 0;
}

.scene-card__text {
  margin: 18px 0 0;
  max-width: 32ch;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.45;
}

/* Light mode panel surfaces: keep the same effects, but use a much lighter neutral base. */
:root[data-theme="light"] .stage2-board__lead {
  --board-surface:
    linear-gradient(180deg, rgba(248, 251, 255, 0.24) 0%, rgba(242, 247, 255, 0.16) 42%, rgba(235, 242, 255, 0.1) 100%),
    rgba(255, 255, 255, 0.07);
  --board-shadow:
    0 20px 56px rgba(19, 29, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

:root[data-theme="light"] .stage2-board__grid {
  --board-surface:
    radial-gradient(64% 80% at 52% 44%, rgba(245, 249, 255, 0.2) 0%, rgba(238, 244, 255, 0.14) 54%, rgba(232, 240, 255, 0.08) 100%),
    linear-gradient(180deg, rgba(245, 249, 255, 0.18) 0%, rgba(237, 244, 255, 0.12) 42%, rgba(230, 239, 255, 0.08) 100%),
    rgba(255, 255, 255, 0.06);
  --board-shadow:
    0 20px 56px rgba(19, 29, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* Light mode typography: keep all text dark, independent of backdrop tuning. */
:root[data-theme="light"] .stage2-board__lead-title,
:root[data-theme="light"] .stage2-board__item-title {
  color: #111317;
}

:root[data-theme="light"] .stage2-board__lead-text,
:root[data-theme="light"] .stage2-board__item-text {
  color: rgba(17, 19, 23, 0.76);
}

/* Projects navigation cards stay dark in both themes, so keep card typography white in light mode. */

.scene-debug-launch {
  position: static;
  z-index: 18;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #1d1e20;
  box-sizing: border-box;
  cursor: pointer;
  transition: box-shadow var(--ui-duration) var(--ui-ease);
}

.scene-debug-launch__surface {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(29, 30, 32, 0.07);
  transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease);
}

.scene-debug-launch svg {
  width: 14px;
  height: 14px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-debug-launch[aria-pressed="true"] .scene-debug-launch__surface {
  background: #1d1e20;
  color: #ffffff;
}

.scene-debug-panel {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.scene-debug-panel__dialog {
  position: absolute;
  top: 62px;
  right: clamp(20px, 4vw, 60px);
  width: min(318px, calc(100vw - 28px));
  max-height: calc(100svh - 78px);
  overflow: auto;
  padding: 17px 18px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text-main);
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  pointer-events: auto;
  animation: scene-controls-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.scene-debug-panel__header,
.scene-debug-panel__header-actions,
.scene-debug-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scene-debug-panel__title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: 0;
}

.scene-debug-panel__close,
.scene-debug-panel__reset {
  appearance: none;
  border: 0;
  background: var(--ui-bg, transparent);
  color: var(--ui-fg, var(--text-main));
  cursor: pointer;
}

.scene-debug-panel__reset {
  padding: 5px 3px;
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
  color: var(--ui-fg, var(--text-soft));
  transition: color var(--ui-duration) var(--ui-ease);
}

.scene-debug-panel__close {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-elevated-2);
  transition: background-color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}

.scene-debug-panel__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.scene-debug-panel__grid {
  display: grid;
  margin-top: 13px;
  border-top: 1px solid var(--border-soft);
}

.scene-debug-field {
  display: grid;
  gap: 9px;
  padding: 13px 0 12px;
  border-bottom: 1px solid var(--border-soft);
}

.scene-debug-field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.scene-debug-field__label {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-label-line);
  letter-spacing: 0;
}

.scene-debug-field__range {
  --scene-progress: 50%;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    var(--accent) 0 var(--scene-progress),
    var(--border-strong) var(--scene-progress) 100%
  ) center / 100% 2px no-repeat;
  cursor: pointer;
}

.scene-debug-field__range::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

.scene-debug-field__range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.scene-debug-field__value {
  min-width: 34px;
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.scene-debug-panel__footer {
  display: grid;
  min-height: 34px;
  padding-top: 13px;
  gap: 9px;
}

.scene-debug-panel__color-label {
  font-size: var(--type-label-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-label-line);
}

.scene-debug-colors,
.scene-debug-color {
  display: flex;
  align-items: center;
}

.scene-debug-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.scene-debug-color {
  justify-content: space-between;
  gap: 6px;
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line);
  color: var(--text-soft);
}

.scene-debug-color--wide {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.scene-debug-color input {
  appearance: none;
  display: block;
  width: 28px;
  height: 28px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.scene-debug-color input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.scene-debug-color input::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

@keyframes scene-controls-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-fade {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skills-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(calc(-50% - 11px), 0, 0);
  }
}

@media (max-width: 919px) {
  :root {
    --layout-gutter: 24px;
    --layout-gutter-wide: 24px;
    --layout-main-max: 100%;
    --layout-wide-max: 100%;
    --section-pad-bottom: clamp(72px, 10vw, 96px);
    --section-pad-bottom-tight: clamp(40px, 8vw, 60px);
    --section-pad-bottom-loose: clamp(60px, 12vw, 88px);
    --section-message-top-pad: clamp(80px, 18vw, 140px);
    --section-heading-before: clamp(140px, 28vw, 260px);
    --section-heading-after: 60px;
    --projects-intro-top-pad: var(--section-heading-before);
    --center-heading-to-block-gap: var(--section-heading-after);
    --projects-showcase-top-space: 60px;
    --card-padding: var(--card-content-padding);
    --section-card-gap: 20px;
    --section-card-pad: var(--card-content-padding);
  }

  .page-frame {
    min-width: 0;
  }

  .topbar {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    height: auto;
    justify-content: space-between;
    align-items: center;
    padding: 24px var(--layout-gutter) 0;
  }

  .brand {
    height: auto;
    align-self: center;
  }

  .topbar__actions {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    height: auto;
    pointer-events: auto;
  }

  .topbar__actions > * {
    flex: 0 0 auto;
  }

  .theme-switch {
    position: static;
  }

  .menu-toggle {
    position: relative;
  }

  .story-panel {
    min-height: auto;
    padding-top: 92px;
  }

  .story-panel--hero {
    min-height: auto;
    height: auto;
    padding: 0;
  }

  .skills-marquee {
    margin-top: -24px;
    margin-bottom: 0;
  }

  .skills-marquee__belt {
    animation-duration: 30s;
  }

  .skills-marquee__track {
    gap: 36px;
    padding: 14px 0;
  }

  .skills-marquee__track + .skills-marquee__track {
    margin-left: 36px;
  }

  .skills-marquee__item {
    font-size: 12px;
  }

  .story-panel__inner,
  .story-panel__inner--hero {
    display: block;
    min-height: auto;
    padding: 92px 0 var(--section-pad-bottom);
    transform: none;
  }

  .story-panel__inner--cluster {
    padding: 0;
    gap: 0;
  }

  .story-message-container {
    min-height: auto;
  }

  .stage2-board {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: clamp(56px, 8vw, 96px);
  }

  .stage2-board__lead {
    min-height: auto;
    padding: 80px var(--section-card-pad);
    gap: var(--space-lg);
  }

  .stage2-board__lead-title {
    line-height: 1;
  }

  .stage2-board__lead-text {
    font-size: 16px;
    max-width: 36ch;
  }

  .stage2-board__grid {
    min-height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 60px;
    padding: 60px var(--section-card-pad);
  }

  .stage2-board__item-title {
    font-size: var(--type-heading-3-size);
  }

  .hero-copy {
    width: auto;
  }

  .hero-copy__title {
    margin-bottom: var(--space-lg);
    font-size: var(--type-display-xl-size);
    line-height: var(--type-display-xl-line);
  }

  .hero-links {
    width: 100%;
    padding-inline-start: var(--layout-text-inset);
    box-sizing: border-box;
    margin-top: var(--space-xl);
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--space-sm);
  }

  .story-panel--cluster {
    padding-top: 0;
  }

  .scene-card,
  .scene-card--dense,
  .scene-card--wide {
    width: 100%;
  }

  .scene-debug-launch {
    position: fixed;
    right: 14px;
    bottom: 84px;
  }

  .scene-debug-panel__dialog {
    top: 64px;
    right: 14px;
    left: auto;
    width: min(318px, calc(100vw - 28px));
  }
}

@media (min-width: 721px) and (max-width: 919px) {
  .story-panel--hero,
  .story-panel__inner--hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: var(--space-xl);
    min-height: 100svh;
  }

  .hero-copy {
    flex: 0 0 auto;
    gap: 16px;
  }

  .hero-copy__title {
    margin-bottom: 0;
  }

  .hero-links {
    margin-top: 0;
  }

  .stage2-board__lead {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 60px;
    padding-block: 60px;
  }

  .stage2-board__lead-text {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  :root {
    --layout-gutter: 16px;
    --layout-gutter-wide: 16px;
    --section-heading-before: clamp(104px, 30vw, 180px);
    --section-heading-after: 48px;
    --projects-grid-gap: 10px;
    --card-padding: var(--card-content-padding);
    --section-card-gap: 16px;
    --section-card-pad: var(--card-content-padding);
  }

  .background-stage::after {
    bottom: -14%;
    width: 96vw;
    height: 80vw;
  }

  .hero-links {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .scene-debug-launch {
    bottom: 14px;
  }

  .scene-debug-panel__dialog {
    top: 68px;
    right: 12px;
    width: min(318px, calc(100vw - 24px));
  }
}

@media (max-width: 560px) {
  .hero-copy {
    gap: 8px;
  }

  .stage2-board__grid {
    grid-template-columns: 1fr;
  }

  .stage2-board__item-title {
    min-height: 0;
  }
}

/* One viewport composition: hero + ticker + reserved fixed-UI lane. */
:root { --hero-bottom-lane: 164px; }
.story-panel--hero {
  height: auto;
  min-height: calc(100svh - var(--hero-bottom-lane));
}
.story-panel__inner--hero {
  min-height: calc(100svh - var(--hero-bottom-lane));
  box-sizing: border-box;
  padding-block: 96px 24px;
}
.skills-marquee {
  top: auto;
  height: var(--hero-bottom-lane);
  margin: 0;
}
@media (max-width: 919px) {
  .story-panel__inner--hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 48px;
  }
  .hero-copy { flex: 0 0 auto; }
  .hero-copy__title { margin-bottom: 0; }
  .hero-links {
    margin-top: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 14px;
  }
}
@media (max-width: 759px) {
  :root { --hero-bottom-lane: 100px; }
}
@media (min-width: 760px) and (max-width: 1024px) {
  :root { --hero-bottom-lane: 192px; }
}
@media (max-height: 740px) {
  .story-panel__inner--hero { padding-block: 80px 16px; gap: 40px; }
  .hero-copy { gap: 12px; }
  .hero-copy__title { font-size: clamp(44px, 9svh, 100px); }
}
@media (max-width: 759px) {
  .hero-copy {
    padding-inline-end: var(--layout-text-inset);
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .skills-marquee__belt {
    animation: none !important;
  }
}
