:root {
  color-scheme: dark;
  --bg: #030305;
  --ink: #f4efe8;
  --paper: #fff9ea;
  --muted: #a2a0a8;
  --dim: #6f7280;
  --line: rgba(244, 239, 232, 0.22);
  --line-soft: rgba(244, 239, 232, 0.1);
  --violet: #8f6cff;
  --violet-strong: #6b45ff;
  --lime: #9be337;
  --cyan: #55dcff;
  --rose: #ff567a;
  --amber: #e58a3a;
  --panel: rgba(7, 8, 12, 0.74);
  --panel-strong: rgba(10, 11, 16, 0.92);
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

body.is-modal-open {
  overflow: hidden;
}

.opening-sequence {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  overflow: hidden;
  place-items: center;
  background: #030305;
  pointer-events: none;
}

body.js-ready .opening-sequence {
  display: grid;
  animation: opening-safety 0s linear 8s forwards;
}

.opening-sequence[hidden] {
  display: none !important;
}

body.motion-fallback .opening-sequence {
  display: none;
}

body.is-opening .app-status {
  opacity: 0;
}

.opening-panels {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.opening-panels span {
  border-right: 1px solid rgba(244, 239, 232, 0.12);
  background: #050508;
  transform-origin: top center;
}

.opening-panels span:nth-child(2) {
  background: #08080d;
}

.opening-copy {
  position: relative;
  z-index: 1;
  width: min(84vw, 1120px);
  color: var(--paper);
  text-align: left;
}

.opening-kicker {
  display: block;
  margin-bottom: clamp(18px, 3vh, 34px);
  color: rgba(244, 239, 232, 0.55);
  font-family: var(--mono);
  font-size: clamp(10px, 0.9vw, 14px);
  font-weight: 900;
  letter-spacing: 0;
}

.opening-word-mask {
  overflow: hidden;
}

.opening-word-mask strong {
  display: block;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(72px, 14vw, 220px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: 0;
  transform-origin: left bottom;
}

.opening-word-mask:nth-child(3) strong {
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 239, 232, 0.82);
}

.opening-word-mask:nth-child(4) strong {
  color: var(--violet);
}

.opening-meter {
  width: min(100%, 760px);
  height: 2px;
  margin-top: clamp(30px, 6vh, 70px);
  overflow: hidden;
  background: rgba(244, 239, 232, 0.16);
}

.opening-meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--lime);
  transform-origin: left center;
}

.motion-target {
  will-change: transform, opacity, clip-path;
}

.app-status {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.28);
  border-radius: 999px;
  padding: 0 13px;
  background: #090a0f;
  color: rgba(244, 239, 232, 0.78);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  transition: opacity 180ms ease;
}

.app-status::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--violet);
  content: "";
}

.app-status[data-state="ready"]::before {
  background: var(--lime);
}

.app-status[data-state="fallback"]::before {
  background: var(--amber);
}

.app-status[hidden] {
  display: none;
}

.no-script-notice {
  position: fixed;
  inset: 16px 16px auto;
  z-index: 110;
  border: 1px solid rgba(244, 239, 232, 0.32);
  padding: 14px 16px;
  background: #090a0f;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -5;
  content: "";
  background:
    linear-gradient(115deg, rgba(85, 220, 255, 0.1), transparent 28%),
    linear-gradient(255deg, rgba(255, 86, 122, 0.13), transparent 32%),
    linear-gradient(180deg, #020204 0%, #080912 46%, #030305 100%);
}

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

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

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

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

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

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 18px;
  isolation: isolate;
}

.scene-noise,
.scene-grid,
.cursor-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scene-noise {
  z-index: -2;
  opacity: 0.42;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.032) 0,
      rgba(255, 255, 255, 0.032) 1px,
      transparent 1px,
      transparent 6px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: screen;
}

.scene-grid {
  z-index: -4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.82) 58%, transparent 100%);
}

.cursor-light {
  z-index: -3;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(circle, rgba(143, 108, 255, 0.2), transparent 66%);
  transform: translate3d(-50%, -50%, 0);
}

.hud-frame {
  position: relative;
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
  min-height: 760px;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 232, 0.24);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(5, 7, 13, 0.52) 47%, rgba(0, 0, 0, 0.82)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 38%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 32px 120px rgba(0, 0, 0, 0.72);
}

.hud-frame::before,
.hud-frame::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hud-frame::before {
  inset: 72px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 239, 232, 0.42), transparent);
}

.hud-frame::after {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(143, 108, 255, 0.13), transparent 19%, transparent 82%, rgba(85, 220, 255, 0.12)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.42), transparent 30%, transparent 72%, rgba(0, 0, 0, 0.5));
}

.hud-topbar,
.hero-stage,
.scroll-cue,
.boot-rail,
.side-rail {
  position: relative;
  z-index: 2;
}

.hud-topbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(360px, 0.78fr) auto;
  gap: clamp(18px, 2.4vw, 46px);
  align-items: center;
  width: min(94vw, 1840px);
  min-height: 72px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(244, 239, 232, 0.2);
  color: rgba(244, 239, 232, 0.72);
  font-family: var(--mono);
  font-size: clamp(12px, 0.9vw, 15px);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow: visible;
}

.brand-lockup,
.hud-nav,
.system-switches {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 900;
  text-transform: none;
}

.brand-lockup > span:last-child {
  color: rgba(244, 239, 232, 0.72);
  font-family: var(--mono);
  font-size: 0.72em;
}

.brand-mark {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(244, 239, 232, 0.68);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-size: 14px;
}

.hud-nav {
  justify-self: center;
  justify-content: space-between;
  width: min(100%, 560px);
  max-width: 100%;
  min-width: 0;
  gap: clamp(12px, 1.4vw, 26px);
  overflow-x: auto;
  scroll-padding-inline: 12px;
  scrollbar-width: none;
}

.hud-nav::-webkit-scrollbar {
  display: none;
}

.hud-nav a {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 clamp(14px, 1.05vw, 20px);
  color: rgba(244, 239, 232, 0.62);
  font-size: clamp(14px, 1vw, 17px);
}

.hud-nav a:hover,
.hud-nav a:focus-visible {
  color: var(--paper);
}

.hud-nav .is-active {
  border-radius: 999px;
  border-color: rgba(244, 239, 232, 0.34);
  background: #7657ff;
  color: #fff;
}

.system-switches {
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.sound-toggle,
.language-toggle button,
.talk-trigger {
  color: rgba(244, 239, 232, 0.62);
  font-weight: 900;
}

.sound-dot {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: #a692ff;
}

.sound-toggle[aria-pressed="true"] {
  color: #a692ff;
}

.sound-toggle[aria-pressed="false"] {
  color: rgba(244, 239, 232, 0.5);
}

.sound-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.sound-dot::before,
.boot-rail i,
.identity-line span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
}

.sound-toggle[aria-pressed="false"]::before {
  background: var(--dim);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.language-toggle button {
  min-height: 40px;
  padding: 0 2px;
}

.language-toggle button.is-active {
  color: var(--paper);
}

.talk-trigger {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.76);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--paper);
}

.side-rail {
  position: absolute;
  top: 136px;
  bottom: 142px;
  left: 18px;
  margin: 0;
  writing-mode: vertical-rl;
  color: rgba(244, 239, 232, 0.42);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
}

.view-deck {
  position: relative;
  z-index: 2;
  width: min(92vw, 1780px);
  height: calc(100vh - 188px);
  height: calc(100dvh - 188px);
  min-height: calc(100vh - 188px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(143, 108, 255, 0.7) transparent;
  scrollbar-width: thin;
  margin: 0 auto;
}

.view-deck::-webkit-scrollbar {
  width: 6px;
}

.view-deck::-webkit-scrollbar-track {
  background: transparent;
}

.view-deck::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 108, 255, 0.68);
}

.view-panel[hidden] {
  display: none !important;
}

.view-panel {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 188px);
  padding: clamp(30px, 5vh, 68px) 0 104px;
}

.view-panel > :not(.view-motion-title) {
  position: relative;
  z-index: 1;
}

.view-motion-title {
  position: absolute;
  top: clamp(18px, 3.6vh, 46px);
  left: clamp(-12px, -0.8vw, 0px);
  z-index: 0;
  max-width: 100%;
  overflow: hidden;
  color: rgba(244, 239, 232, 0.14);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(74px, 11vw, 170px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.72;
  pointer-events: none;
  text-transform: uppercase;
  transform-origin: left bottom;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgba(244, 239, 232, 0.22);
}

.view-panel:not(.home-view) {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(360px, 1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
  align-content: start;
  max-width: 1180px;
}

.skills-panel {
  grid-template-columns: 1fr !important;
  gap: clamp(18px, 3vh, 34px);
  width: 100%;
  max-width: 1500px !important;
}

.skills-panel .view-copy {
  max-width: 760px;
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(520px, 1.18fr);
  align-items: stretch;
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
  padding: 0;
}

.hero-copy {
  position: relative;
  z-index: 5;
  max-width: 680px;
  align-self: start;
  padding-top: clamp(18px, 3.4vh, 44px);
  padding-left: clamp(20px, 2.8vw, 58px);
}

.identity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--paper);
}

.identity-line strong {
  font-size: clamp(30px, 2.6vw, 48px);
  font-weight: 950;
}

.identity-line b {
  color: #a998ff;
  font-family: var(--mono);
  font-size: clamp(12px, 1.05vw, 18px);
  letter-spacing: 4px;
}

.meta-line {
  margin-bottom: 20px;
  color: #a998ff;
  font-family: var(--mono);
  font-size: clamp(11px, 0.95vw, 16px);
  font-weight: 950;
  line-height: 1.55;
  letter-spacing: 3px;
}

.hero-copy h1 {
  max-width: 680px;
  margin-bottom: 24px;
  color: var(--paper);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(64px, 7vw, 128px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 span {
  display: block;
  color: var(--paper);
  text-shadow:
    4px 0 0 rgba(255, 86, 122, 0.6),
    -4px 0 0 rgba(85, 220, 255, 0.42);
}

.hero-copy h1 em {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px rgba(244, 239, 232, 0.92);
  text-shadow: none;
}

.hero-copy h1 strong {
  display: block;
  color: var(--violet-strong);
  text-shadow:
    4px 4px 0 rgba(255, 86, 122, 0.44),
    0 0 34px rgba(143, 108, 255, 0.65);
}

.service-lockup {
  border-left: 3px solid var(--violet);
  padding-left: 16px;
}

.service-lockup p {
  margin-bottom: 6px;
  color: var(--paper);
  font-size: clamp(20px, 1.65vw, 30px);
  font-weight: 950;
}

.service-lockup span,
.quick-index a,
.section-code,
.contact-console p,
.boot-rail span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-lockup span {
  color: rgba(244, 239, 232, 0.52);
  font-size: clamp(10px, 0.78vw, 13px);
  line-height: 1.6;
}

.quick-index {
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.quick-index a {
  border: 1px solid rgba(244, 239, 232, 0.26);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.36);
  color: rgba(244, 239, 232, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.home-actions button {
  min-height: 42px;
  border: 1px solid rgba(244, 239, 232, 0.32);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(244, 239, 232, 0.76);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-actions .is-primary {
  border-color: transparent;
  background: #7657ff;
  color: #fff;
}

.character-stage {
  position: absolute;
  top: 118px;
  right: clamp(30px, 6vw, 120px);
  bottom: 56px;
  z-index: 3;
  width: min(45vw, 820px);
  pointer-events: none;
}

.character-stage::before {
  position: absolute;
  right: 4%;
  bottom: 0;
  width: 78%;
  height: 86%;
  border: 1px solid rgba(143, 108, 255, 0.24);
  content: "";
  background:
    linear-gradient(180deg, rgba(143, 108, 255, 0.1), transparent 55%),
    linear-gradient(90deg, rgba(85, 220, 255, 0.08), transparent 52%);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  filter: blur(0.2px);
}

.character-aura {
  position: absolute;
  right: 9%;
  bottom: 10%;
  width: 76%;
  height: 72%;
  background:
    radial-gradient(ellipse at 48% 42%, rgba(143, 108, 255, 0.36), transparent 46%),
    radial-gradient(ellipse at 68% 62%, rgba(85, 220, 255, 0.18), transparent 48%);
  filter: blur(20px);
}

.hero-video,
.character-stage img {
  position: absolute;
  right: clamp(24px, 4.4vw, 96px);
  bottom: -5vh;
  z-index: 2;
  width: auto;
  height: min(88vh, 900px);
  max-width: 72vw;
  object-fit: contain;
  filter:
    drop-shadow(0 34px 44px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 30px rgba(143, 108, 255, 0.24));
}

.hero-video {
  width: min(44vw, 720px);
  height: min(72vh, 680px);
  bottom: 46px;
  border: 1px solid rgba(244, 239, 232, 0.14);
  background: #030305;
  object-fit: cover;
  object-position: center;
  opacity: 0.82;
  filter:
    saturate(1.1)
    contrast(1.08)
    brightness(0.82)
    drop-shadow(0 34px 44px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 30px rgba(143, 108, 255, 0.24));
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

.hero-video + img {
  opacity: 0;
}

.cable {
  position: absolute;
  z-index: 1;
  width: 3px;
  height: 78%;
  border: 1px solid rgba(244, 239, 232, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(244, 239, 232, 0.46), transparent);
  box-shadow: 0 0 22px rgba(85, 220, 255, 0.18);
  transform-origin: top center;
}

.cable-one {
  top: -2%;
  left: 18%;
  transform: rotate(-12deg);
}

.cable-two {
  top: -3%;
  right: 8%;
  transform: rotate(14deg);
}

.scroll-cue {
  position: absolute;
  bottom: 86px;
  left: clamp(54px, 5.9vw, 118px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(244, 239, 232, 0.56);
  font-size: clamp(10px, 0.82vw, 13px);
  font-weight: 900;
}

.scroll-cue b {
  color: rgba(244, 239, 232, 0.72);
}

.scroll-cue i {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(143, 108, 255, 0.82);
  border-radius: 50%;
}

.scroll-cue i::before {
  width: 0;
  height: 0;
  border-top: 8px solid #a692ff;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  content: "";
}

.boot-rail {
  position: absolute;
  right: clamp(32px, 4.4vw, 84px);
  bottom: 22px;
  left: clamp(32px, 4.4vw, 84px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(244, 239, 232, 0.42);
  padding-top: 12px;
}

.boot-rail span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(244, 239, 232, 0.62);
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.boot-rail span:nth-child(2) i {
  background: var(--lime);
}

.boot-rail span:nth-child(3) i {
  background: #c6a4ff;
}

.boot-rail span:nth-child(4) i {
  background: var(--amber);
}

.section-code,
.contact-console p {
  display: block;
  margin-bottom: 10px;
  color: #a998ff;
  font-size: 11px;
  font-weight: 950;
}

.view-copy h2,
.project-deck h2 {
  max-width: 760px;
  margin-bottom: 16px;
  color: var(--paper);
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.06;
  letter-spacing: 0;
}

.view-copy p:not(.section-code) {
  max-width: 680px;
  color: rgba(244, 239, 232, 0.68);
  font-size: 16px;
  line-height: 1.72;
}

.module-grid,
.chip-grid,
.run-log,
.project-row,
.contact-console {
  align-self: center;
}

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

.os-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.skills-console {
  position: relative;
  --tree-grow-x: 1;
  --tree-grow-y: 1;
  --tree-glow: 0;
  overflow: visible;
  min-height: max(760px, calc(100vh - 360px));
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.skills-console::before,
.skills-console::after {
  position: absolute;
  inset: -18px 0 -52px;
  content: "";
  pointer-events: none;
}

.skills-console::before {
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--skill-accent, #8f6cff) 18%, transparent), transparent 30%),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(244, 239, 232, 0.1) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(49% - 0.5px), rgba(244, 239, 232, 0.12) calc(49% - 0.5px) calc(49% + 0.5px), transparent calc(49% + 0.5px)),
    radial-gradient(circle at 50% 50%, rgba(7, 8, 12, 0.2), transparent 48%);
  opacity: var(--tree-glow);
  transform: scale(var(--tree-grow-x), var(--tree-grow-y));
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 72%, transparent 90%);
  transition: opacity 220ms ease;
}

.skills-console::after {
  background-image:
    linear-gradient(90deg, rgba(7, 8, 12, 0.78), rgba(7, 8, 12, 0.32), rgba(7, 8, 12, 0.72)),
    var(--skill-preview);
  background-position: center;
  background-size: cover;
  opacity: 0;
  filter: saturate(1.08) contrast(1.05);
  transform: scale(1.04);
  transition:
    opacity 220ms ease,
    transform 420ms ease;
}

.skills-console.is-previewing::after {
  opacity: 0.34;
  transform: scale(1);
}

.skills-console:has(.skill-card:hover)::after,
.skills-console:has(.skill-card:focus-visible)::after {
  opacity: 0.34;
  transform: scale(1);
}

.skills-console:has(.skill-card-top:hover),
.skills-console:has(.skill-card-top:focus-visible) {
  --skill-preview: url("assets/character.png");
  --skill-accent: #8f6cff;
}

.skills-console:has(.skill-card-right:hover),
.skills-console:has(.skill-card-right:focus-visible) {
  --skill-preview: url("assets/character-source.png");
  --skill-accent: #29d3ff;
}

.skills-console:has(.skill-card-left:hover),
.skills-console:has(.skill-card-left:focus-visible) {
  --skill-preview: url("assets/character-source.png");
  --skill-accent: #a8ff3e;
}

.skills-console:has(.skill-card-bottom:hover),
.skills-console:has(.skill-card-bottom:focus-visible) {
  --skill-preview: url("assets/character.png");
  --skill-accent: #ff6f91;
}

.module-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: min(100%, 900px);
}

.module-toolbar button {
  min-height: 34px;
  border: 1px solid rgba(244, 239, 232, 0.2);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(244, 239, 232, 0.62);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.module-toolbar .is-active {
  border-color: rgba(244, 239, 232, 0.34);
  background: #7657ff;
  color: #fff;
}

.module-grid button,
.project-row article,
.skill-card,
.detail-panel,
.contact-channel-grid article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 40%),
    rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(18px);
}

.module-grid button::before,
.project-row article::before,
.skill-card::before,
.detail-panel::before,
.contact-channel-grid article::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--violet), var(--cyan), transparent);
}

.module-grid button {
  display: grid;
  min-height: 132px;
  align-content: end;
  gap: 12px;
  padding: 22px;
  text-align: left;
}

.module-grid span,
.project-row span {
  color: var(--rose);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
}

.module-grid b,
.project-row h3 {
  margin-bottom: 14px;
  color: var(--paper);
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.12;
}

.module-grid small,
.module-grid em {
  color: rgba(244, 239, 232, 0.62);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.chip-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 0.78fr) minmax(180px, 1fr);
  grid-template-rows: minmax(180px, auto) minmax(170px, auto) minmax(180px, auto);
  gap: clamp(16px, 2.1vw, 30px);
  align-items: stretch;
  min-height: 680px;
  padding: clamp(14px, 2.5vw, 32px) 0 clamp(34px, 5vw, 72px);
}

.skill-map-center {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  place-items: center;
  align-self: center;
  min-height: 160px;
  border: 1px solid rgba(244, 239, 232, 0.22);
  border-radius: var(--radius);
  padding: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16), transparent 32%),
    rgba(8, 9, 14, 0.82);
  color: var(--paper);
  text-align: center;
}

.skill-map-center b {
  max-width: 180px;
  font-family: var(--mono);
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 950;
  line-height: 1.2;
}

.skill-map-center span,
.skill-map-center i {
  color: rgba(244, 239, 232, 0.48);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.skill-card {
  display: grid;
  align-content: end;
  min-height: 210px;
  padding: 20px;
  scale: 1;
  transition:
    border-color 180ms ease,
    scale 260ms ease,
    transform 220ms ease,
    filter 220ms ease,
    background-color 180ms ease;
}

.skill-card-top {
  grid-column: 2;
  grid-row: 1;
  transform-origin: center bottom;
}

.skill-card-right {
  grid-column: 3;
  grid-row: 2;
  transform-origin: left center;
}

.skill-card-left {
  grid-column: 1;
  grid-row: 2;
  transform-origin: right center;
}

.skill-card-bottom {
  grid-column: 2;
  grid-row: 3;
  transform-origin: center top;
}

.skill-card::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(7, 8, 12, 0.2), rgba(7, 8, 12, 0.86)),
    var(--skill-preview);
  background-position: center;
  background-size: cover;
  content: "";
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 220ms ease,
    transform 360ms ease;
}

.skill-card:hover,
.skill-card:focus-visible {
  border-color: color-mix(in srgb, var(--skill-accent, #8f6cff) 68%, white);
  background-color: rgba(12, 13, 20, 0.84);
  scale: 1.035;
}

.skill-card.is-scroll-active {
  border-color: color-mix(in srgb, var(--skill-accent, #8f6cff) 74%, white);
  filter: brightness(1.14) saturate(1.08);
  scale: 1.055;
}

.skill-card.is-scroll-active::before {
  background: linear-gradient(90deg, var(--skill-accent, var(--violet)), var(--cyan), transparent);
}

.skill-card:hover::after,
.skill-card:focus-visible::after,
.skill-card.is-scroll-active::after {
  opacity: 0.3;
  transform: scale(1);
}

.skill-card > * {
  position: relative;
  z-index: 1;
}

.skill-index {
  margin-bottom: 24px;
  color: color-mix(in srgb, var(--skill-accent, #8f6cff) 78%, white);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
}

.skill-scroll-cue {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: rgba(244, 239, 232, 0.56);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-scroll-cue::after {
  width: 0;
  height: 0;
  border-top: 7px solid color-mix(in srgb, var(--skill-accent, #8f6cff) 72%, white);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  content: "";
}

.skill-card span,
.contact-channel-grid span {
  color: var(--rose);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.skill-card h3,
.detail-panel h3 {
  margin-bottom: 10px;
  color: var(--paper);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.16;
}

.skill-card p,
.detail-panel p {
  color: rgba(244, 239, 232, 0.66);
  font-size: 14px;
  line-height: 1.64;
}

.skill-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 239, 232, 0.12);
}

.skill-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--skill-accent, var(--violet)), var(--cyan));
}

.data-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.data-pill-row span {
  border: 1px solid rgba(244, 239, 232, 0.18);
  border-radius: 999px;
  padding: 6px 9px;
  color: rgba(244, 239, 232, 0.72);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.run-log {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.run-log li button {
  display: grid;
  width: 100%;
  grid-template-columns: 72px 74px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(7, 8, 12, 0.72);
  text-align: left;
}

.run-log li button.is-active,
.project-row button.is-active {
  border-color: rgba(143, 108, 255, 0.74);
}

.run-log time {
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 950;
}

.run-log span {
  color: #a998ff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.run-log b {
  color: var(--paper);
  font-size: 16px;
}

.run-log p,
.project-row p {
  margin-bottom: 0;
  color: rgba(244, 239, 232, 0.66);
  font-size: 15px;
  line-height: 1.62;
}

.project-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portfolio-stats span {
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 8, 12, 0.68);
  backdrop-filter: blur(18px);
}

.portfolio-stats span {
  display: grid;
  gap: 3px;
  min-height: 72px;
  align-content: center;
  padding: 14px;
}

.portfolio-stats b {
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(20px, 2vw, 32px);
}

.portfolio-stats small {
  color: rgba(244, 239, 232, 0.58);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-deck {
  max-width: 1380px;
  grid-template-columns: minmax(220px, 0.42fr) minmax(620px, 1.35fr);
}

.projects-console {
  gap: 16px;
}

.portfolio-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(240px, 0.74fr);
  gap: clamp(18px, 2.6vw, 34px);
  align-items: stretch;
  overflow: hidden;
  min-height: 380px;
  border: 1px solid rgba(244, 239, 232, 0.18);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px);
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--case-accent, #8f6cff) 24%, transparent), transparent 31%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.025) 46%, rgba(0, 0, 0, 0.18)),
    rgba(9, 10, 15, 0.82);
  backdrop-filter: blur(20px);
}

.portfolio-stage::before {
  position: absolute;
  inset: 0;
  border-top: 1px solid color-mix(in srgb, var(--case-accent, #8f6cff) 52%, transparent);
  content: "";
  pointer-events: none;
}

.portfolio-stage-copy {
  display: grid;
  align-content: end;
  min-width: 0;
}

.portfolio-stage-copy h3 {
  max-width: 720px;
  margin-bottom: 12px;
  color: var(--paper);
  font-size: clamp(34px, 5.6vw, 72px);
  font-weight: 950;
  line-height: 0.96;
}

.portfolio-stage-copy strong {
  display: block;
  margin-bottom: 18px;
  color: color-mix(in srgb, var(--case-accent, #8f6cff) 78%, white);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.55;
  text-transform: uppercase;
}

.portfolio-stage-copy p:not(.section-code) {
  max-width: 620px;
  color: rgba(244, 239, 232, 0.68);
  font-size: 15px;
  line-height: 1.72;
}

.portfolio-stage-media {
  position: relative;
  display: grid;
  min-height: 280px;
  aspect-ratio: 4 / 5;
  align-self: center;
  overflow: hidden;
  place-items: end start;
  border: 1px solid rgba(244, 239, 232, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--case-accent, #8f6cff) 40%, transparent), transparent 54%),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.5), transparent 12%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02)),
    rgba(3, 4, 7, 0.84);
  transform-origin: center;
}

.portfolio-stage-media::before,
.portfolio-stage-media::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.portfolio-stage-media::before {
  inset: 16px;
  border: 1px solid rgba(244, 239, 232, 0.12);
  border-radius: calc(var(--radius) - 2px);
}

.portfolio-stage-media::after {
  right: 18px;
  bottom: 18px;
  width: 42%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--case-accent, #8f6cff) 68%, white);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.74), transparent 18%),
    color-mix(in srgb, var(--case-accent, #8f6cff) 54%, rgba(0, 0, 0, 0.24));
  opacity: 0.82;
}

.portfolio-stage-media span {
  position: relative;
  z-index: 1;
  max-width: 72%;
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(18px, 2.7vw, 34px);
  font-weight: 950;
  line-height: 0.98;
  text-transform: uppercase;
}

.portfolio-stage-media i {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34%;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--case-accent, #8f6cff) 70%, white);
  opacity: 0.72;
}

.portfolio-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.portfolio-progress span {
  border: 1px solid rgba(244, 239, 232, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(244, 239, 232, 0.74);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
}

.portfolio-spotlight {
  display: grid;
  grid-template-columns: minmax(180px, 0.56fr) minmax(0, 1fr);
  gap: 18px;
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(7, 8, 12, 0.68);
  backdrop-filter: blur(18px);
}

.portfolio-spotlight h3 {
  margin-bottom: 10px;
  color: var(--paper);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.portfolio-spotlight p:not(.section-code) {
  color: rgba(244, 239, 232, 0.66);
  line-height: 1.62;
}

.portfolio-spotlight button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.portfolio-cover {
  position: relative;
  display: grid;
  min-height: 118px;
  place-items: end start;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--case-accent, #8f6cff) 42%, transparent), transparent 52%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px),
    rgba(0, 0, 0, 0.38);
}

.portfolio-cover::after {
  position: absolute;
  inset: auto 12px 12px auto;
  width: 54px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--case-accent, #8f6cff) 72%, white);
  border-radius: 50%;
  content: "";
}

.portfolio-cover b {
  position: relative;
  z-index: 1;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-row article {
  min-height: 100%;
}

.project-row button {
  display: grid;
  width: 100%;
  min-height: 260px;
  align-content: start;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: inherit;
  padding: 14px;
  text-align: left;
}

.detail-panel {
  border: 1px solid rgba(244, 239, 232, 0.16);
  padding: 22px;
}

.detail-panel strong {
  display: block;
  margin-bottom: 12px;
  color: rgba(244, 239, 232, 0.78);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.portfolio-process,
.portfolio-assets {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.portfolio-process {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  counter-reset: process;
}

.portfolio-process span,
.portfolio-assets span {
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 239, 232, 0.72);
  font-size: 12px;
}

.portfolio-process span {
  padding: 12px;
}

.portfolio-process span::before {
  display: block;
  margin-bottom: 6px;
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 950;
  counter-increment: process;
  content: "0" counter(process);
}

.portfolio-assets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portfolio-assets span {
  display: grid;
  min-height: 76px;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.detail-panel a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-console {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1fr);
  gap: 18px;
  align-content: center;
  border: 1px solid rgba(244, 239, 232, 0.16);
  border-radius: var(--radius);
  padding: 28px;
  background: rgba(7, 8, 12, 0.72);
}

.contact-console p {
  margin-bottom: 0;
}

.contact-console a {
  color: var(--paper);
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 950;
}

.contact-console button {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.34);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-channel-grid {
  display: grid;
  gap: 12px;
}

.contact-channel-grid article {
  padding: 18px;
}

.contact-channel-grid b {
  display: block;
  margin: 8px 0 14px;
  color: var(--paper);
  font-size: 18px;
}

.contact-channel-grid div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-channel-grid a,
.contact-channel-grid button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.24);
  border-radius: 999px;
  padding: 0 11px;
  color: rgba(244, 239, 232, 0.76);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  cursor: default;
}

.contact-dialog {
  position: relative;
  z-index: 1;
  width: min(94vw, 520px);
  border: 1px solid rgba(244, 239, 232, 0.34);
  border-radius: var(--radius);
  padding: 28px;
  background: rgba(8, 9, 14, 0.96);
  color: var(--ink);
  outline: 0;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(244, 239, 232, 0.28);
  border-radius: 50%;
  color: rgba(244, 239, 232, 0.78);
  font-size: 18px;
}

.contact-dialog h2 {
  max-width: 360px;
  margin-bottom: 12px;
  color: var(--paper);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.contact-dialog p:not(.section-code) {
  margin-bottom: 18px;
  color: rgba(244, 239, 232, 0.68);
  line-height: 1.68;
}

.dialog-email {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--paper);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dialog-actions button,
.dialog-actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid rgba(244, 239, 232, 0.34);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

body.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 760ms ease,
    transform 760ms ease;
}

body.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.motion-ready [data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes opening-safety {
  to {
    visibility: hidden;
  }
}

@media (max-width: 1180px) {
  .hud-frame {
    height: calc(100vh - 36px);
    min-height: 720px;
  }

  .hud-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    align-content: center;
    padding: 10px 0;
  }

  .hud-nav {
    grid-column: 1 / -1;
    justify-self: center;
    justify-content: space-between;
    width: min(78%, 520px);
    max-width: 100%;
  }

  .system-switches {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }

  .hero-stage {
    grid-template-columns: 1fr;
    min-height: 100%;
    padding-bottom: 280px;
  }

  .view-panel:not(.home-view) {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .view-motion-title {
    top: 24px;
    font-size: clamp(56px, 18vw, 118px);
  }

  .character-stage {
    top: auto;
    right: 2vw;
    bottom: 72px;
    width: min(70vw, 640px);
    height: 540px;
  }

  .hero-video,
  .character-stage img {
    right: 8vw;
    height: min(62vh, 620px);
  }

  .hero-video {
    width: min(78vw, 620px);
  }

  .side-rail {
    display: none;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding: 10px;
  }

  .hud-frame {
    min-height: 720px;
  }

  .hud-topbar {
    min-height: auto;
    gap: 6px;
    padding: 8px 0;
  }

  .hud-topbar,
  .view-deck,
  .hero-stage {
    width: min(100% - 20px, 1280px);
  }

  .hud-nav {
    gap: 10px;
  }

  .hud-nav a {
    min-height: 46px;
    padding: 0 18px;
    font-size: 15px;
  }

  .system-switches {
    gap: 8px;
  }

  .talk-trigger {
    min-height: 40px;
  }

  .hero-stage {
    padding: 28px 0 250px;
  }

  .hero-copy {
    padding-top: 10px;
    padding-left: 0;
  }

  .identity-line {
    margin-bottom: 12px;
  }

  .meta-line {
    margin-bottom: 14px;
  }

  .hero-copy h1 {
    margin-bottom: 18px;
  }

  .identity-line b {
    letter-spacing: 4px;
  }

  .meta-line {
    letter-spacing: 2px;
  }

  .hero-copy h1 {
    font-size: clamp(64px, 17vw, 108px);
  }

  .character-stage {
    position: absolute;
    top: auto;
    right: 0;
    bottom: 66px;
    width: 100%;
    height: 320px;
    margin-top: 0;
  }

  .hero-video,
  .character-stage img {
    right: 50%;
    bottom: 0;
    height: 360px;
    max-width: 96vw;
    transform: translateX(50%);
  }

  .hero-video {
    width: min(92vw, 430px);
  }

  .boot-rail {
    right: 24px;
    bottom: 16px;
    left: 24px;
    width: min(100% - 28px, 1280px);
    margin: 0 auto;
  }

  .module-grid,
  .chip-grid,
  .project-row {
    grid-template-columns: 1fr;
  }

  .chip-grid {
    grid-template-rows: auto;
    gap: 18px;
    min-height: 760px;
    padding-bottom: 80px;
  }

  .skill-map-center,
  .skill-card-top,
  .skill-card-right,
  .skill-card-left,
  .skill-card-bottom {
    grid-column: 1;
    grid-row: auto;
  }

  .skill-map-center {
    order: -1;
  }

  .portfolio-stats,
  .portfolio-stage,
  .portfolio-spotlight,
  .portfolio-process,
  .portfolio-assets {
    grid-template-columns: 1fr;
  }

  .portfolio-stage {
    min-height: 0;
  }

  .portfolio-stage-media {
    width: min(100%, 460px);
    min-height: 220px;
    aspect-ratio: 16 / 10;
    justify-self: stretch;
  }

  .contact-console {
    display: grid;
    grid-template-columns: 1fr;
  }

  .run-log li button {
    grid-template-columns: 1fr;
  }

  .detail-panel,
  .skill-card,
  .contact-channel-grid article {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .opening-copy {
    width: min(88vw, 420px);
  }

  .opening-word-mask strong {
    font-size: clamp(62px, 21vw, 104px);
    line-height: 0.78;
  }

  .hud-topbar,
  .view-deck,
  .hero-stage,
  .boot-rail {
    width: min(100% - 20px, 1280px);
  }

  .brand-lockup {
    font-size: 14px;
  }

  .brand-mark {
    width: 34px;
    font-size: 12px;
  }

  .hud-topbar {
    width: min(100% - 20px, 1280px);
  }

  .hud-nav {
    margin-right: 0;
    margin-left: 0;
    padding: 0;
  }

  .system-switches {
    width: 100%;
  }

  .talk-trigger {
    padding: 0 14px;
  }

  .identity-line {
    gap: 10px;
  }

  .identity-line strong {
    font-size: 28px;
  }

  .identity-line b {
    width: 100%;
    font-size: 12px;
  }

  .meta-line {
    font-size: 11px;
    line-height: 1.55;
  }

  .hero-copy h1 {
    font-size: clamp(54px, 18vw, 82px);
  }

  .hero-copy h1 em {
    -webkit-text-stroke-width: 1px;
  }

  .service-lockup {
    padding-left: 14px;
  }

  .service-lockup p {
    font-size: 21px;
  }

  .character-stage {
    height: 430px;
  }

  .hero-video,
  .character-stage img {
    height: 470px;
  }

  .hero-video {
    width: min(94vw, 360px);
  }

  .profile-panel h2,
  .project-deck h2 {
    font-size: 30px;
  }

  .module-grid button,
  .project-row article {
    padding: 18px;
  }

  .portfolio-stage {
    padding: 18px;
  }

  .portfolio-stage-copy h3 {
    font-size: clamp(32px, 12vw, 54px);
  }
}

@media (min-width: 700px) and (max-width: 820px) {
  .hud-frame {
    height: calc(100vh - 20px);
    min-height: 720px;
  }

  .hero-stage {
    min-height: 0;
    padding: 24px 0 100px;
  }

  .hero-copy {
    max-width: 58%;
  }

  .hero-copy h1 {
    font-size: clamp(56px, 9.5vw, 78px);
  }

  .service-lockup p {
    font-size: 20px;
  }

  .service-lockup span {
    font-size: 10px;
  }

  .character-stage {
    position: absolute;
    top: 220px;
    right: 0;
    bottom: 68px;
    width: 50vw;
    height: auto;
    margin-top: 0;
  }

  .hero-video,
  .character-stage img {
    right: 2vw;
    bottom: 72px;
    width: 40vw;
    height: 420px;
    max-width: none;
    transform: none;
  }

  .scroll-cue {
    position: absolute;
    bottom: 92px;
    left: 48px;
    width: auto;
    margin: 0;
  }

  .boot-rail {
    position: absolute;
    right: 32px;
    bottom: 18px;
    left: 32px;
    width: auto;
    margin: 0;
  }
}

.hero-video-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #030305;
  pointer-events: none;
}

.hero-video-layer::before,
.hero-video-layer::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  pointer-events: none;
}

.hero-video-layer::before {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.48) 32%, rgba(0, 0, 0, 0.12) 62%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.36) 0%, transparent 36%, rgba(0, 0, 0, 0.58) 100%);
}

.hero-video-layer::after {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 6px
    ),
    radial-gradient(circle at 74% 36%, rgba(143, 108, 255, 0.18), transparent 34%);
  mix-blend-mode: screen;
  opacity: 0.74;
}

.hero-video-layer .hero-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
  background: #030305;
  object-fit: cover;
  object-position: center center;
  opacity: 0.92;
  clip-path: none;
  transform: none;
  filter: saturate(1.08) contrast(1.08) brightness(0.86);
  pointer-events: none;
}

.system-switches,
.system-switches * {
  position: relative;
  z-index: 20;
}

.character-stage {
  inset: 118px 0 56px;
  width: auto;
  height: auto;
}

.character-stage::before {
  right: 8%;
  bottom: 8%;
  width: min(46vw, 720px);
  height: 70%;
  opacity: 0.32;
}

.character-aura {
  right: 9%;
  bottom: 10%;
  width: min(44vw, 700px);
}

.character-stage img {
  display: none;
}

@media (max-width: 820px) {
  .hero-video-layer .hero-video {
    object-position: center center;
  }

  .character-stage {
    position: absolute;
    inset: 184px 0 0;
    width: auto;
    height: auto;
    margin: 0;
  }

  .character-stage::before,
  .character-aura {
    display: none;
  }

}

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