:root {
  color-scheme: dark;
  --bg: #020403;
  --bg-soft: #06100c;
  --panel: rgba(5, 18, 13, 0.78);
  --panel-strong: rgba(7, 26, 20, 0.9);
  --line: rgba(92, 255, 177, 0.25);
  --line-strong: rgba(92, 255, 177, 0.55);
  --green: #5cffb1;
  --green-soft: #a2ffd2;
  --cyan: #65e7ff;
  --amber: #ffd166;
  --red: #ff5c80;
  --text: #eefcf6;
  --muted: #9cb7ac;
  --soft: #d4efe5;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --mono: "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(101, 231, 255, 0.13), transparent 32rem),
    radial-gradient(circle at 80% 8%, rgba(255, 209, 102, 0.08), transparent 28rem),
    linear-gradient(180deg, #020403 0%, #041009 45%, #020403 100%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  letter-spacing: 0;
}

body.intro-active {
  overflow: hidden;
}

body.intro-active .site-header,
body.intro-active main {
  visibility: hidden;
}

body.site-revealing .site-header,
body.site-revealing main {
  animation: siteReveal 1050ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.matrix-muted #matrix-canvas {
  opacity: 0.18;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.78;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: 1rem;
  border: 0;
  background: #010604;
  color: var(--green);
  cursor: crosshair;
  transition:
    opacity 1100ms ease,
    visibility 1100ms ease,
    filter 1100ms ease;
}

.intro-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(92, 255, 177, 0.12), transparent 25rem),
    repeating-linear-gradient(
      180deg,
      rgba(92, 255, 177, 0.055) 0,
      rgba(92, 255, 177, 0.055) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.82;
}

.intro-screen::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 34%, rgba(223, 255, 238, 0.72) 48%, rgba(101, 231, 255, 0.34) 52%, transparent 66%);
  transform: translateX(-85%);
}

.intro-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-screen.intro-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  filter: blur(10px);
}

.intro-screen.intro-exiting {
  opacity: 0;
  filter: blur(8px);
}

.intro-screen.intro-exiting::after {
  animation: unlockSweep 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-screen.intro-exiting .intro-rain {
  opacity: 0.24;
  transition: opacity 800ms ease;
}

.intro-screen.intro-exiting .intro-name {
  opacity: 0;
  transition:
    opacity 800ms ease,
    filter 800ms ease,
    text-shadow 800ms ease;
}

.intro-name {
  --intro-name-spacing: clamp(0.55rem, 1.15vw, 1.15rem);
  position: relative;
  z-index: 1;
  display: block;
  max-width: calc(100vw - 2rem);
  font-family: var(--mono);
  color: var(--text);
  font-size: clamp(1.95rem, 6.2vw, 5.8rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 0 28px rgba(92, 255, 177, 0.38);
  letter-spacing: var(--intro-name-spacing);
  filter: blur(0.35px);
  transition:
    filter 1050ms ease,
    text-shadow 1050ms ease;
}

.intro-screen.intro-revealing .intro-name {
  color: var(--text);
  letter-spacing: var(--intro-name-spacing);
  filter: blur(0);
  text-shadow: 0 0 36px rgba(101, 231, 255, 0.56), 0 0 80px rgba(92, 255, 177, 0.2);
}

@keyframes unlockSweep {
  0% {
    opacity: 0;
    transform: translateX(-85%);
  }

  18% {
    opacity: 0.95;
  }

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

@keyframes siteReveal {
  0% {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(12px);
  }

  58% {
    opacity: 1;
  }

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

.matrix-reveal {
  --reveal-delay: 0ms;
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  filter: blur(10px) saturate(1.25);
  clip-path: inset(36% 0 34% 0);
  will-change: opacity, transform, filter, clip-path;
}

.section-band.matrix-reveal,
.terminal-window.matrix-reveal,
.identity-panel.matrix-reveal,
.command-dock.matrix-reveal,
.project-card.matrix-reveal,
.stack-card.matrix-reveal,
.achievement-card.matrix-reveal,
.timeline li.matrix-reveal,
.contact-actions a.matrix-reveal {
  position: relative;
  overflow: hidden;
}

.matrix-reveal::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(223, 255, 238, 0.72) 48%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      rgba(92, 255, 177, 0.2) 0,
      rgba(92, 255, 177, 0.2) 1px,
      transparent 1px,
      transparent 9px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(101, 231, 255, 0.14) 0,
      rgba(101, 231, 255, 0.14) 1px,
      transparent 1px,
      transparent 7px
    );
  mix-blend-mode: screen;
  transform: translateY(-110%);
}

.matrix-reveal.matrix-revealed {
  animation: matrixMaterialize 850ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay) both;
}

.matrix-reveal.matrix-revealed::after {
  animation: matrixScan 900ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay) both;
}

[data-matrix-reveal="section"] {
  scroll-margin-top: 5.25rem;
}

[data-matrix-reveal="item"] {
  transform: translate3d(0, 18px, 0);
}

@keyframes matrixMaterialize {
  0% {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    filter: blur(12px) saturate(1.35);
    clip-path: inset(44% 0 48% 0);
  }

  28% {
    opacity: 0.7;
    transform: translate3d(0, 10px, 0);
    filter: blur(5px) saturate(1.28);
    clip-path: inset(20% 0 22% 0);
  }

  62% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }

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

@keyframes matrixScan {
  0% {
    opacity: 0;
    transform: translateY(-115%);
  }

  20% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: translateY(115%);
  }
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: -1;
  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 5px
  );
  mix-blend-mode: screen;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  backdrop-filter: blur(16px);
}

.brand,
.nav-links,
.command-dock,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--green-soft);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  background: rgba(92, 255, 177, 0.08);
  box-shadow: 0 0 24px rgba(92, 255, 177, 0.2);
  color: var(--green);
}

.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-links a {
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
}

.nav-links a:hover {
  border-color: var(--line);
  color: var(--green);
  background: rgba(92, 255, 177, 0.06);
}

.section-band {
  position: relative;
  padding: 6rem 0;
}

.hero {
  min-height: calc(100vh - 4.5rem);
  padding-top: 3.5rem;
}

.section-band-contrast {
  background: linear-gradient(180deg, rgba(5, 18, 13, 0.72), rgba(2, 4, 3, 0.38));
  border-block: 1px solid rgba(92, 255, 177, 0.12);
}

.section-inner,
.hero-shell,
.command-dock {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  gap: 1.5rem;
  align-items: stretch;
}

.terminal-window,
.identity-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 0 42px rgba(92, 255, 177, 0.04);
  backdrop-filter: blur(20px);
}

.terminal-window {
  min-height: 36rem;
}

.terminal-bar {
  display: flex;
  gap: 0.55rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.terminal-bar span {
  width: 0.74rem;
  height: 0.74rem;
  border-radius: 50%;
}

.terminal-bar span:nth-child(1) {
  background: var(--red);
}

.terminal-bar span:nth-child(2) {
  background: var(--amber);
}

.terminal-bar span:nth-child(3) {
  background: var(--green);
}

.terminal-content {
  padding: 2rem;
}

.prompt-line,
.boot-line,
.section-kicker,
.handle,
.hero-stack,
.card-meta,
.chip-list,
.timeline time,
.command-button,
.command-link {
  font-family: var(--mono);
}

.prompt-line,
.boot-line {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.prompt-line span,
.boot-line.ok,
.section-kicker {
  color: var(--green);
}

.eyebrow {
  width: fit-content;
  margin: 2.4rem 0 0.7rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(101, 231, 255, 0.34);
  background: rgba(101, 231, 255, 0.08);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.86rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: 4.5rem;
  max-width: 10ch;
  text-shadow: 0 0 28px rgba(92, 255, 177, 0.28);
}

h2 {
  font-size: 2.7rem;
}

h3 {
  font-size: 1.35rem;
}

.handle {
  margin: 0.85rem 0 0;
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-stack {
  margin: 1.1rem 0 0;
  color: var(--amber);
  font-weight: 700;
}

.hero-copy {
  max-width: 54rem;
  margin: 1.2rem 0 0;
  color: var(--soft);
  font-size: 1.05rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

.command-link,
.command-button,
.contact-actions a {
  min-height: 2.8rem;
  border: 1px solid var(--line);
  background: rgba(92, 255, 177, 0.07);
  color: var(--green-soft);
  box-shadow: 0 0 0 rgba(92, 255, 177, 0);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.command-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
}

.command-link span,
.command-button span {
  color: var(--cyan);
}

.command-link:hover,
.command-button:hover,
.contact-actions a:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  background: rgba(92, 255, 177, 0.13);
  box-shadow: 0 0 24px rgba(92, 255, 177, 0.15);
}

.identity-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.3rem;
}

.avatar {
  width: 100%;
  max-width: 18rem;
  aspect-ratio: 1;
  height: auto;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.05);
}

.signal-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.signal-list div {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(92, 255, 177, 0.14);
}

.signal-list dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.signal-list dd {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-weight: 700;
}

.command-dock {
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.command-button {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
}

.command-button-alt {
  border-color: rgba(255, 209, 102, 0.45);
  color: var(--amber);
  background: rgba(255, 209, 102, 0.08);
}

.two-column,
.split-panels,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(0, 1.28fr);
  gap: 2rem;
  align-items: start;
}

.section-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.prose-block {
  color: var(--soft);
  font-size: 1.05rem;
}

.prose-block p {
  margin: 0 0 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.project-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-height: 23rem;
  padding: 1.2rem;
  border: 1px solid rgba(92, 255, 177, 0.18);
  background: linear-gradient(180deg, rgba(7, 26, 20, 0.92), rgba(3, 9, 7, 0.86));
  box-shadow: var(--shadow);
}

.project-card:nth-child(4),
.project-card:nth-child(5) {
  grid-column: span 3;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--cyan);
  font-size: 0.76rem;
}

.project-card p,
.stack-card p,
.achievement-card p,
.contact-copy {
  color: var(--muted);
}

.project-card p {
  margin: 0.9rem 0 1rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: auto 0 1.1rem;
  list-style: none;
  font-size: 0.78rem;
}

.chip-list li {
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(101, 231, 255, 0.22);
  color: var(--soft);
  background: rgba(101, 231, 255, 0.06);
}

.project-card a {
  width: fit-content;
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
}

.project-card a:hover {
  color: var(--amber);
}

.stack-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stack-card,
.achievement-card {
  min-height: 12rem;
  padding: 1.1rem;
  border: 1px solid rgba(92, 255, 177, 0.16);
  background: rgba(4, 14, 11, 0.72);
}

.stack-card h3 {
  color: var(--green);
}

.achievement-card strong {
  display: block;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 1.05rem;
}

.timeline {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(92, 255, 177, 0.16);
}

.timeline time {
  color: var(--cyan);
  font-weight: 700;
}

.timeline span {
  color: var(--soft);
}

.final-band {
  padding-bottom: 7rem;
}

.contact-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.contact-actions a {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  color: var(--green-soft);
}

.mock-socials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.mock-socials a {
  text-align: center;
  border-color: rgba(101, 231, 255, 0.28);
  background: rgba(101, 231, 255, 0.06);
  color: var(--cyan);
}

@media (max-width: 980px) {
  .hero-shell,
  .two-column,
  .split-panels,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .identity-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .project-card,
  .project-card:nth-child(4),
  .project-card:nth-child(5) {
    grid-column: span 3;
  }

  .stack-grid,
  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .section-band {
    padding: 4rem 0;
  }

  .hero {
    padding-top: 2rem;
  }

  .terminal-content {
    padding: 1.15rem;
  }

  .terminal-window {
    min-height: auto;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 2rem;
  }

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

  .avatar {
    max-width: none;
  }

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

  .project-card,
  .project-card:nth-child(4),
  .project-card:nth-child(5) {
    grid-column: auto;
    min-height: 0;
  }

  .stack-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .command-button,
  .command-link {
    width: 100%;
    justify-content: center;
  }

  .intro-name {
    --intro-name-spacing: clamp(0.22rem, 1.25vw, 0.42rem);
    font-size: clamp(1.55rem, 9vw, 3.2rem);
  }

  .mock-socials {
    grid-template-columns: 1fr;
  }
}

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

  #matrix-canvas {
    opacity: 0.16;
  }
}
