:root {
  --bg: #060a0e;
  --surface: #0d1117;
  --surface-soft: rgba(13, 17, 23, 0.78);
  --border: #1a2332;
  --accent: #00ff88;
  --accent-2: #00cfff;
  --text: #e6f0ff;
  --muted: #7b90ae;
  --muted-strong: #a9bdd9;
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  --mono: "Space Mono", monospace;
  --display: "Syne", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(0, 207, 255, 0.08), transparent 32%),
    radial-gradient(circle at bottom left, rgba(0, 255, 136, 0.06), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--display);
}

a {
  color: inherit;
}

svg {
  display: block;
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  background: rgba(6, 10, 14, 0.88);
  border-bottom: 1px solid rgba(26, 35, 50, 0.85);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: 2px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.wrapper {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 1.25rem 6rem;
}

.section {
  padding: 5rem 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 7rem;
}

.hero-tag,
.hero-name,
.hero-role,
.hero-desc,
.hero-actions {
  opacity: 0;
  animation: fade-up 0.8s forwards;
}

.hero-tag {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  animation-delay: 0.15s;
}

.hero-tag::before {
  content: "";
  width: 30px;
  height: 1px;
  flex-shrink: 0;
  background: var(--accent);
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
  max-width: 1080px;
}

.hero-copy {
  max-width: 680px;
}

.hero-name {
  margin-bottom: 1.25rem;
  font-size: clamp(3rem, 11vw, 6.2rem);
  line-height: 1.02;
  letter-spacing: -1px;
  font-weight: 800;
  padding-bottom: 0.04em;
  animation-delay: 0.3s;
}

.hero-name span {
  display: block;
  width: fit-content;
  padding-right: 0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  min-height: 1.5em;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(0.82rem, 3vw, 1rem);
  animation-delay: 0.45s;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: middle;
  background: var(--accent);
  animation: blink 1s infinite;
}

.hero-desc {
  max-width: 620px;
  color: var(--muted-strong);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.9;
  animation-delay: 0.6s;
}

.hero-desc strong,
.about-text strong {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
  animation-delay: 0.75s;
}

.hero-media {
  width: min(100%, 360px);
  justify-self: center;
  opacity: 0;
  animation: fade-up 0.85s 0.95s forwards;
}

.hero-photo-frame {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(0, 255, 136, 0.22);
  border-radius: 28px 12px 28px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(7, 12, 18, 0.92);
  box-shadow: var(--shadow);
}

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

.hero-photo-frame::before {
  inset: 10px;
  border: 1px solid rgba(0, 207, 255, 0.14);
  border-radius: 22px 8px 22px 8px;
}

.hero-photo-frame::after {
  inset: auto 16px 16px auto;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.18), transparent 70%);
}

.hero-photo-stack {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 22px 8px 22px 8px;
  background:
    linear-gradient(180deg, rgba(8, 15, 22, 0.08), rgba(8, 15, 22, 0.65)),
    #091119;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-photo-main {
  filter: contrast(1.04) saturate(0.95);
  animation: photo-settle 1.65s ease-out both;
}

.hero-photo-glitch {
  opacity: 0;
  mix-blend-mode: screen;
}

.hero-photo-glitch-red {
  filter: sepia(0.1) saturate(1.2) hue-rotate(-25deg);
  animation: hero-glitch-red 1.55s steps(2, end) 1;
}

.hero-photo-glitch-cyan {
  filter: saturate(1.2) hue-rotate(140deg);
  animation: hero-glitch-cyan 1.55s steps(2, end) 1;
}

.hero-photo-scan {
  position: absolute;
  inset: -8% 0;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(255, 255, 255, 0.04) 42%,
      rgba(0, 255, 136, 0.16) 50%,
      rgba(255, 255, 255, 0.04) 58%,
      transparent 100%
    );
  opacity: 0;
  mix-blend-mode: screen;
  animation: hero-scan 1.45s ease-out 1;
}

.hero-photo-noise {
  position: absolute;
  inset: 12px;
  border-radius: 22px 8px 22px 8px;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 2px,
    transparent 2px,
    transparent 5px
  );
  opacity: 0.22;
  pointer-events: none;
}

.hero-photo-caption {
  margin-top: 0.85rem;
  color: var(--accent);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--border);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.section-label {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.section-line {
  width: 40px;
  height: 2px;
  margin-bottom: 0.85rem;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-title {
  margin-bottom: 2.3rem;
  font-size: clamp(1.9rem, 6vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -1px;
  font-weight: 800;
}

.about-text {
  max-width: 760px;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.9;
}

.stats-grid,
.tech-grid,
.projects-grid,
.social-links {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  margin-top: 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.tech-card,
.project-card,
.social-link {
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1rem;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.stat-number {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.tech-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.45rem 1.25rem;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.tech-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.tech-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.tech-icon svg {
  width: 100%;
  height: 100%;
}

.tech-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tech-name {
  margin-bottom: 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}

.tech-desc {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
}

.tech-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(0, 255, 136, 0.28);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

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

.project-card {
  display: block;
  height: 100%;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project-num {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 2px;
}

.project-title {
  margin-bottom: 0.6rem;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
}

.project-desc {
  margin-bottom: 1rem;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.75;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.tag {
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(0, 255, 136, 0.18);
  background: rgba(0, 255, 136, 0.06);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.project-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.contact-inner {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  text-align: center;
}

.contact-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.contact-title {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.1;
  font-weight: 800;
}

.contact-sub {
  margin-bottom: 2.2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.social-links {
  grid-template-columns: 1fr;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 1rem 1.4rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.social-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid rgba(26, 35, 50, 0.85);
  text-align: center;
}

.site-footer p,
.footer-status {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 1px;
}

.site-footer p {
  color: var(--muted);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.reveal-card {
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.js-enabled .reveal-card {
  opacity: 0;
  transform: translateY(24px);
}

.js-enabled .reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.45);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
  }
}

@keyframes photo-settle {
  0% {
    transform: scale(1.08);
    filter: contrast(1.2) saturate(1.25) blur(1px);
  }

  35% {
    transform: scale(1.02);
    filter: contrast(1.16) saturate(1.08);
  }

  100% {
    transform: scale(1);
    filter: contrast(1.04) saturate(0.95);
  }
}

@keyframes hero-glitch-red {
  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 0 0);
  }

  8% {
    opacity: 0.5;
    transform: translate3d(-14px, 3px, 0);
    clip-path: inset(4% 0 58% 0);
  }

  16% {
    opacity: 0;
  }

  24% {
    opacity: 0.42;
    transform: translate3d(10px, -4px, 0);
    clip-path: inset(38% 0 26% 0);
  }

  34% {
    opacity: 0;
  }

  46% {
    opacity: 0.35;
    transform: translate3d(-8px, 6px, 0);
    clip-path: inset(68% 0 8% 0);
  }

  60% {
    opacity: 0;
  }
}

@keyframes hero-glitch-cyan {
  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 0 0);
  }

  10% {
    opacity: 0;
  }

  18% {
    opacity: 0.42;
    transform: translate3d(12px, 2px, 0);
    clip-path: inset(18% 0 46% 0);
  }

  28% {
    opacity: 0;
  }

  36% {
    opacity: 0.5;
    transform: translate3d(-10px, -5px, 0);
    clip-path: inset(50% 0 16% 0);
  }

  48% {
    opacity: 0;
  }

  58% {
    opacity: 0.3;
    transform: translate3d(6px, 3px, 0);
    clip-path: inset(6% 0 72% 0);
  }

  70% {
    opacity: 0;
  }
}

@keyframes hero-scan {
  0% {
    opacity: 0;
    transform: translateY(-32%);
  }

  20% {
    opacity: 0.6;
  }

  72% {
    opacity: 0.25;
  }

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

@media (min-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 360px);
    gap: 3.2rem;
  }

  .hero-media {
    justify-self: end;
  }

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

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

@media (max-width: 620px) {
  .nav-links {
    display: none;
  }

  .wrapper {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .section {
    padding: 4rem 0;
  }

  .hero {
    min-height: auto;
    padding-top: 6rem;
  }

  .hero-media {
    width: min(100%, 320px);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  #matrix-canvas {
    display: none;
  }
}
