:root {
  color-scheme: dark;
  --bg: #040604;
  --surface: rgba(6, 11, 5, 0.84);
  --surface-soft: rgba(7, 12, 6, 0.66);
  --line: rgba(54, 196, 0, 0.18);
  --line-strong: rgba(54, 196, 0, 0.46);
  --text: #c8f8b4;
  --muted: #88b979;
  --accent: #36c400;
  --accent-soft: #2d9f00;
  --cursor-glow: rgba(54, 196, 0, 0.1);
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  --panel-glow: inset 0 0 0 1px rgba(54, 196, 0, 0.06), 0 0 14px rgba(54, 196, 0, 0.06);
  --page-bg:
    radial-gradient(circle at 50% -6%, rgba(54, 196, 0, 0.09), transparent 24%),
    radial-gradient(circle at 20% 22%, rgba(54, 196, 0, 0.04), transparent 16%),
    linear-gradient(180deg, #030503 0%, #040604 52%, #050705 100%);
}

body[data-theme="light"] {
  color-scheme: light;
  --surface: rgba(244, 248, 255, 0.88);
  --surface-soft: rgba(248, 251, 255, 0.8);
  --line: rgba(0, 110, 255, 0.18);
  --line-strong: rgba(0, 110, 255, 0.44);
  --text: #0d2f73;
  --muted: #4b6daa;
  --accent: #006eff;
  --accent-soft: #3f95ff;
  --cursor-glow: rgba(0, 110, 255, 0.11);
  --shadow: 0 14px 26px rgba(15, 54, 122, 0.08);
  --panel-glow: inset 0 0 0 1px rgba(0, 110, 255, 0.06), 0 0 12px rgba(0, 110, 255, 0.05);
  --page-bg:
    radial-gradient(circle at 50% -10%, rgba(0, 110, 255, 0.11), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 56%, #ffffff 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--text);
  background: var(--page-bg);
  transition: background 220ms ease, color 220ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.28;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
  opacity: 0.14;
}

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

button {
  font: inherit;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 400;
}

.screen-noise,
.screen-grid,
.screen-glitches,
.cursor-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.screen-noise {
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(54, 196, 0, 0.1) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 64%, rgba(54, 196, 0, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 42% 80%, rgba(54, 196, 0, 0.08) 0 1px, transparent 1px);
  background-size: 140px 140px, 180px 180px, 120px 120px;
  animation: screenNoisePulse 8.4s ease-in-out infinite;
}

.screen-grid {
  background:
    linear-gradient(rgba(54, 196, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 196, 0, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 44%, transparent 92%);
  opacity: 0.18;
  animation: gridEnergy 9.2s linear infinite;
}

.screen-glitches {
  overflow: hidden;
  opacity: 0.48;
}

.screen-glitches::before,
.screen-glitches::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.screen-glitches::before {
  background:
    linear-gradient(180deg, transparent 0 32%, color-mix(in srgb, var(--accent) 10%, transparent) 32% 33%, transparent 33% 100%),
    repeating-linear-gradient(90deg, transparent 0 28px, color-mix(in srgb, var(--accent) 6%, transparent) 28px 31px, transparent 31px 76px);
  animation: scanBreak 8.8s linear infinite;
}

.screen-glitches::after {
  background:
    radial-gradient(circle at 18% 26%, color-mix(in srgb, var(--accent) 16%, transparent) 0 1px, transparent 1px),
    radial-gradient(circle at 74% 40%, color-mix(in srgb, var(--accent) 14%, transparent) 0 1px, transparent 1px),
    radial-gradient(circle at 58% 74%, color-mix(in srgb, var(--accent) 14%, transparent) 0 1px, transparent 1px);
  background-size: 88px 88px, 120px 120px, 96px 96px;
  animation: fragmentPulse 7.2s steps(2, end) infinite;
}

.pixel-glitch {
  position: absolute;
  border-radius: 2px;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 10%, color-mix(in srgb, var(--accent) 22%, transparent) 10% 14%, transparent 14% 22%, color-mix(in srgb, var(--accent) 16%, transparent) 22% 28%, transparent 28% 100%),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, transparent) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent) 0 2px, transparent 2px 6px);
  background-blend-mode: screen;
  box-shadow:
    0 0 6px color-mix(in srgb, var(--accent) 8%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 4%, transparent);
  mix-blend-mode: screen;
}

.pixel-glitch-a {
  top: 17%;
  left: 10%;
  width: 144px;
  height: 52px;
  animation: pixelGlitchA 6.2s steps(2, end) infinite;
}

.pixel-glitch-b {
  top: 44%;
  right: 12%;
  width: 118px;
  height: 46px;
  animation: pixelGlitchB 6.8s steps(2, end) infinite;
}

.pixel-glitch-c {
  bottom: 14%;
  left: 58%;
  width: 156px;
  height: 50px;
  animation: pixelGlitchC 7.4s steps(2, end) infinite;
}

.cursor-particles {
  width: 100vw;
  height: 100vh;
  opacity: 0.68;
  mix-blend-mode: screen;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.control-header,
.terminal-module,
.menu-toggle,
.nav-menu,
.contact-item,
.skill-cell,
.display-card,
.media-shell {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-header::before,
.terminal-module::before,
.menu-toggle::before,
.nav-menu::before,
.contact-item::before,
.skill-cell::before,
.display-card::before,
.media-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: var(--panel-glow);
}

.control-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.95rem;
  backdrop-filter: blur(10px);
}

.header-brand-group {
  display: flex;
  align-items: center;
  justify-self: start;
}

.brand-mark {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  color: var(--text);
  pointer-events: none;
  z-index: 1;
}

.ui-label,
.module-state,
.status-tag,
.status-chip,
.nav-menu a,
.contact-item strong,
.terminal-footer p,
.status-line strong,
.project-meta p {
  font-family: "Share Tech Mono", "Courier New", monospace;
}

.ui-label,
.module-state,
.status-tag,
.status-chip {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.ui-label {
  color: var(--accent);
}

.menu-wrap {
  position: relative;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  min-width: 2.9rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-soft));
}

.menu-icon {
  display: grid;
  gap: 0.25rem;
}

.menu-icon span {
  display: block;
  width: 1rem;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  width: 180px;
  display: grid;
  gap: 0.15rem;
  padding: 0.4rem;
  border-radius: 0.85rem;
  background: var(--surface-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.nav-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu a {
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.theme-toggle {
  position: relative;
  overflow: hidden;
  justify-self: end;
  margin-left: auto;
  color: color-mix(in srgb, var(--muted) 86%, var(--text) 14%);
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 97%, transparent);
  box-shadow: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-soft));
}

.theme-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  transform-origin: center;
  transition:
    opacity 220ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 220ms ease;
}

.theme-icon::before,
.theme-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
}

.theme-icon-moon {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  opacity: 1;
  transform: scale(1);
}

.theme-icon-moon::before {
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 16%, transparent);
}

.theme-icon-moon::after {
  width: 0.92rem;
  height: 0.92rem;
  inset: auto;
  top: 0.03rem;
  left: 0.34rem;
  border-radius: 50%;
  background: var(--surface-soft);
}

.theme-icon-sun {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0.68) rotate(-35deg);
  box-shadow:
    0 -0.75rem 0 -0.4rem currentColor,
    0 0.75rem 0 -0.4rem currentColor,
    0.75rem 0 0 -0.4rem currentColor,
    -0.75rem 0 0 -0.4rem currentColor;
}

.theme-icon-sun::before {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: currentColor;
}

body[data-theme="light"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.68) rotate(24deg);
  filter: blur(0.5px);
}

body[data-theme="light"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  filter: blur(0);
}

.terminal-surface {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
}

body:not(.intro-ready) .terminal-module {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
}

.boot-module {
  display: grid;
  grid-template-columns: minmax(9rem, 0.56fr) minmax(620px, 980px) minmax(9rem, 0.56fr);
  gap: clamp(0.75rem, 2vw, 1.6rem);
  align-items: center;
  min-height: max(60vh, calc(100vh - 15rem));
  padding-top: clamp(1rem, 2vh, 1.8rem);
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
  margin-bottom: clamp(0.35rem, 1.5vh, 1rem);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.boot-module.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.boot-copy {
  display: grid;
  gap: 0.25rem;
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 14rem;
  transform: translateY(-1.4rem);
}

.boot-copy-left {
  justify-self: end;
  justify-items: end;
  text-align: right;
  transform: translateX(clamp(1.6rem, 4vw, 3.2rem));
}

.boot-copy-right {
  justify-self: start;
  justify-items: start;
  text-align: left;
  transform: translateX(clamp(-1.6rem, -4vw, -3.2rem));
}

.typed-line {
  position: relative;
  display: inline-block;
  min-height: 2.1rem;
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  color: var(--text);
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent);
  white-space: nowrap;
}

.typed-line::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.typed-line::after {
  content: "";
}

.typed-line.is-glitching {
  animation: textGlitch 180ms steps(2, end) both;
}

.typed-line.is-glitching::before {
  opacity: 0.5;
  color: var(--accent);
  text-shadow:
    -1px 0 0 color-mix(in srgb, var(--accent) 68%, transparent),
    1px 0 0 color-mix(in srgb, var(--text) 60%, transparent);
  animation: textGhost 180ms steps(2, end) both;
}

.typed-line.is-complete {
  animation: terminalIdleFlicker 5.8s steps(2, end) infinite;
}

.typed-line.is-complete::after {
  content: "_";
  display: inline-block;
  margin-left: 0.12em;
  color: color-mix(in srgb, var(--accent) 88%, var(--text) 12%);
  text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: terminalCursor 1s steps(1, end) infinite;
}

.portrait-field {
  position: relative;
  min-height: clamp(30rem, 62vh, 46rem);
  display: grid;
  align-items: center;
}

.portrait-field::before {
  content: "";
  position: absolute;
  inset: 8% 11% 7%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%);
  filter: blur(34px);
  pointer-events: none;
}

.portrait-terminal {
  position: relative;
  overflow: visible;
  min-height: clamp(30rem, 62vh, 46rem);
  background: transparent;
  border: 0;
  box-shadow: none;
  transform-style: preserve-3d;
  transition: transform 220ms ease, opacity 260ms ease, filter 260ms ease;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: contrast(1.04) saturate(0.74);
}

.portrait-scan {
  display: none;
}

.boot-assembling {
  animation: portraitBoot 1.15s ease forwards;
}

.module-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1rem;
}

.terminal-module {
  overflow: hidden;
  padding: 1rem;
  border-radius: 0.95rem;
  backdrop-filter: blur(8px);
  transform: translateY(16px) scale(0.985);
  opacity: 0;
  transition: opacity 420ms ease, transform 420ms ease, border-color 180ms ease;
}

.terminal-module::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 28%),
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 14%, transparent) 40%, transparent 82%);
  transform: translateX(-100%);
  opacity: 0;
}

.terminal-module.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: moduleBitsIn 560ms ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

.terminal-module.is-visible::after {
  animation: moduleScan 720ms ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

.terminal-module:hover,
.terminal-module:focus-within {
  border-color: var(--line-strong);
}

.module-head,
.module-head-inline,
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.module-head-inline {
  align-items: flex-end;
}

.about-module h2,
.skills-module h2,
.projects-module h2,
.contact-module h2 {
  font-size: clamp(1.7rem, 2.4vw, 2.3rem);
  line-height: 1.05;
}

.status-stack {
  display: grid;
  gap: 0.55rem;
}

.status-line {
  display: grid;
  gap: 0.08rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.status-line span,
.status-line strong {
  font-size: 0.98rem;
  letter-spacing: 0.03em;
}

.status-line strong {
  color: var(--text);
}

.status-wave {
  height: 64px;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background:
    linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
  background-size: 12px 12px;
  position: relative;
  overflow: hidden;
}

.status-wave::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 16%, transparent) 12%, transparent 24%),
    linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--accent) 30%, transparent) 50%, transparent 60%);
  animation: waveform 4.8s linear infinite;
}

.skills-module {
  min-height: 300px;
}

.skills-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.rail-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 0.45rem;
}

.skills-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.skills-arrow:hover,
.skills-arrow:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-soft));
}

.skills-arrow span {
  font-size: 1rem;
  line-height: 1;
}

.edge-rail {
  position: relative;
}

.skills-carousel,
.project-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-rows: 1fr;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
  touch-action: pan-x;
}

.skills-carousel {
  grid-auto-columns: calc((100% - 4rem) / 5);
  padding: 0.4rem 0 0.2rem;
}

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

.project-rail {
  grid-auto-columns: calc((100% - 2rem) / 3);
  padding: 0.2rem 0 0.2rem;
}

.project-rail::-webkit-scrollbar {
  display: none;
}

.skill-cell,
.display-card {
  min-width: 0;
  border-radius: 0.9rem;
  background: var(--surface-soft);
  scroll-snap-align: start;
}

.skill-cell {
  display: grid;
  gap: 0.25rem;
  min-height: 180px;
  padding: 0.9rem;
  transform: scale(0.95);
  opacity: 0.68;
  transition: transform 220ms ease, opacity 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.skill-cell.is-active {
  transform: scale(1);
  opacity: 1;
  border-color: var(--line-strong);
}

.skill-cell h3 {
  font-size: 1.35rem;
}

.skill-meter {
  position: relative;
  height: 0.45rem;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.skill-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent);
  transform-origin: left center;
  transform: scaleX(0.08);
  opacity: 0.4;
}

.skill-cell.is-active .skill-meter span {
  opacity: 1;
}

.skill-cell.is-meter-animating .skill-meter span {
  animation: skillMeterBuild 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.projects-module {
  min-height: 520px;
}

.project-stack {
  display: grid;
  gap: 1rem;
  margin-top: 0.4rem;
}

.project-panel {
  display: grid;
  gap: 0.55rem;
}

.display-card {
  display: grid;
  grid-template-rows: 220px minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 100%;
  padding: 0.8rem;
  width: 100%;
  transition: transform 180ms ease, border-color 180ms ease;
}

.display-card:hover,
.display-card.is-active,
.display-card:focus-within,
.contact-item:hover,
.contact-item:focus-within {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.project-preview {
  height: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  background:
    linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4, 9, 4, 0.92), rgba(3, 6, 3, 0.98));
  background-size: 16px 16px, 16px 16px, auto;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.72;
  filter: grayscale(0.58) contrast(0.98) saturate(0.72) brightness(0.82);
  transition: filter 260ms ease, opacity 260ms ease, transform 260ms ease;
}

body[data-theme="light"] .project-preview img {
  filter: grayscale(0.52) contrast(0.98) saturate(0.74) brightness(0.94);
}

.display-card:hover .project-preview img,
.display-card.is-active .project-preview img,
.display-card:focus-within .project-preview img {
  opacity: 1;
  filter: none;
  transform: scale(1.02);
}

.media-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.024) 0, rgba(255, 255, 255, 0.024) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: screen;
}

.project-preview.is-missing img {
  display: none;
}

.project-preview.is-missing::after {
  content: "preview pending";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.project-preview-placeholder::after {
  content: "drop in next project";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent) 0 1px, transparent 1px 18px);
}

.project-placeholder-card {
  border-style: dashed;
}

.project-body {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.project-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  min-width: 0;
}

.project-headline-main {
  display: grid;
  gap: 0.18rem;
  align-content: start;
  min-height: 3rem;
  min-width: 0;
}

.project-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-shrink: 0;
  padding-top: 0.08rem;
}

.project-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 0.62rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.project-action svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.project-action:hover,
.project-action:focus-visible {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-soft));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 16%, transparent);
}

.project-body h3 {
  font-size: 1.25rem;
  line-height: 1.08;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-meta p,
.status-chip {
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.status-chip {
  color: var(--accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.contact-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border-radius: 0.85rem;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-item strong {
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.contact-item-muted strong {
  color: var(--muted);
}

.contact-item[href]:hover strong,
.contact-item[href]:focus-visible strong {
  color: var(--text);
}

.contact-item[href]:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.terminal-footer {
  padding: 1rem 0 0.2rem;
}

.terminal-footer p {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

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

@keyframes waveform {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes skillMeterBuild {
  0% {
    transform: scaleX(0.08);
    opacity: 0.32;
  }

  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes portraitBoot {
  0% {
    opacity: 0;
    filter: blur(16px) brightness(0.24);
    transform: scale(0.94);
  }

  45% {
    opacity: 0.55;
    filter: blur(5px) brightness(0.6);
  }

  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: scale(1);
  }
}

@keyframes moduleBitsIn {
  0% {
    opacity: 0;
    filter: blur(10px);
    clip-path: inset(0 0 100% 0);
  }

  55% {
    opacity: 0.74;
  }

  100% {
    opacity: 1;
    filter: blur(0);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes moduleScan {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }

  30% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes textGlitch {
  0% {
    transform: translateX(0);
    opacity: 1;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent);
  }

  30% {
    transform: translateX(-1px);
    text-shadow:
      -2px 0 0 color-mix(in srgb, var(--accent) 44%, transparent),
      2px 0 0 color-mix(in srgb, var(--text) 30%, transparent);
  }

  65% {
    transform: translateX(1px);
    opacity: 0.92;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes textGhost {
  0% {
    transform: translate(0, 0);
    clip-path: inset(0 0 100% 0);
  }

  40% {
    transform: translate(2px, -1px);
    clip-path: inset(12% 0 38% 0);
  }

  100% {
    transform: translate(-1px, 1px);
    clip-path: inset(62% 0 0 0);
    opacity: 0;
  }
}

@keyframes terminalCursor {
  0%,
  46% {
    opacity: 1;
  }

  47%,
  100% {
    opacity: 0;
  }
}

@keyframes terminalIdleFlicker {
  0%,
  95%,
  100% {
    opacity: 1;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent);
  }

  96% {
    opacity: 0.94;
    text-shadow:
      -1px 0 0 color-mix(in srgb, var(--accent) 24%, transparent),
      1px 0 0 color-mix(in srgb, var(--text) 14%, transparent);
  }

  97% {
    opacity: 1;
    text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 20%, transparent);
  }
}

@keyframes pixelGlitchA {
  0%,
  8%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.96);
  }

  8.3% {
    opacity: 0.22;
    transform: translate3d(4px, -2px, 0) scale(1);
  }

  8.8% {
    opacity: 0.05;
    transform: translate3d(-3px, 1px, 0) scale(1.04);
  }
}

@keyframes pixelGlitchB {
  0%,
  15%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.98);
  }

  15.3% {
    opacity: 0.19;
    transform: translate3d(-4px, 2px, 0) scale(1.02);
  }

  15.8% {
    opacity: 0.06;
    transform: translate3d(3px, -1px, 0) scale(0.96);
  }
}

@keyframes pixelGlitchC {
  0%,
  18%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.97);
  }

  18.3% {
    opacity: 0.17;
    transform: translate3d(5px, -1px, 0) scale(1.03);
  }

  18.8% {
    opacity: 0.05;
    transform: translate3d(-2px, 2px, 0) scale(1);
  }
}

@keyframes screenNoisePulse {
  0%,
  100% {
    opacity: 0.05;
    transform: translate3d(0, 0, 0);
  }

  50% {
    opacity: 0.085;
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes gridEnergy {
  0% {
    opacity: 0.18;
    background-position: 0 0, 0 0;
  }

  50% {
    opacity: 0.24;
    background-position: 0 14px, 14px 0;
  }

  100% {
    opacity: 0.18;
    background-position: 0 0, 0 0;
  }
}

@keyframes scanBreak {
  0%,
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }

  10%,
  14% {
    opacity: 0.18;
    transform: translateY(0);
  }

  15% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes fragmentPulse {
  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }

  12% {
    opacity: 0.28;
    transform: translate3d(3px, -2px, 0);
  }

  14% {
    opacity: 0.08;
    transform: translate3d(-2px, 1px, 0);
  }
}

@media (max-width: 1180px) {
  .boot-module,
  .module-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .boot-module {
    min-height: auto;
    gap: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 3.5rem;
    margin-bottom: 1.5rem;
  }

  .boot-copy-left,
  .boot-copy-right {
    justify-items: center;
    text-align: center;
    justify-self: center;
    transform: none;
  }

  .boot-copy {
    transform: translateY(-0.4rem);
    max-width: none;
  }

  .skills-controls {
    justify-self: end;
  }

  .portrait-field,
  .portrait-terminal {
    min-height: 660px;
  }

  .skills-carousel {
    grid-auto-columns: calc((100% - 4rem) / 5);
  }
}

@media (max-width: 900px) {
  .control-header {
    grid-template-columns: auto 1fr auto;
  }

  .typed-line {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
  }

  .portrait-field,
  .portrait-terminal {
    min-height: 600px;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 1rem, 100%);
  }

  .control-header {
    grid-template-columns: 1fr auto;
  }

  .brand-mark {
    font-size: 1.2rem;
  }

  .theme-toggle {
    justify-self: end;
  }

  .boot-module {
    padding-top: 0.35rem;
    padding-bottom: 2.4rem;
    margin-bottom: 1rem;
  }

  .boot-copy {
    transform: none;
  }

  .typed-line {
    font-size: clamp(1rem, 6vw, 1.4rem);
  }

  .skills-controls {
    width: 100%;
    justify-content: center;
  }

  .portrait-field,
  .portrait-terminal {
    min-height: 500px;
  }

  .pixel-glitch {
    transform: scale(0.82);
    opacity: 0;
  }

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

}

@media (hover: none), (pointer: coarse) {
  .skills-carousel,
  .project-rail {
    scroll-snap-type: x mandatory;
  }

  .cursor-particles {
    display: none;
  }
}
