:root {
  --bg: #050607;
  --bg-soft: #0a0d0e;
  --text: #d7ffe5;
  --muted: #789184;
  --green: #63ff9b;
  --green-dim: #1f8f4e;
  --cyan: #5de4ff;
  --border: rgba(99, 255, 155, 0.18);
  --glow: rgba(99, 255, 155, 0.25);
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code",
    "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(20, 80, 50, 0.14),
      transparent 40%
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow-x: hidden;
}

/* ------------------------------
   CRT EFFECT
   ------------------------------ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.35;
  mix-blend-mode: overlay;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background:
    radial-gradient(
      ellipse at center,
      transparent 55%,
      rgba(0, 0, 0, 0.55) 100%
    );
  box-shadow:
    inset 0 0 120px rgba(0, 0, 0, 0.8);
}

/* ------------------------------
   ANIMATED BACKGROUND
   ------------------------------ */

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(
      rgba(99, 255, 155, 0.045) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(99, 255, 155, 0.045) 1px,
      transparent 1px
    );
  background-size: 50px 50px;
  transform:
    perspective(500px)
    rotateX(60deg)
    translateY(-10%);
  animation: gridMove 18s linear infinite;
}

@keyframes gridMove {
  from {
    transform:
      perspective(500px)
      rotateX(60deg)
      translateY(-10%);
  }

  to {
    transform:
      perspective(500px)
      rotateX(60deg)
      translateY(10%);
  }
}

.glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(40, 255, 120, 0.07);
  filter: blur(100px);
  animation: drift 12s ease-in-out infinite alternate;
}

.glow.one {
  top: 5%;
  left: 15%;
}

.glow.two {
  right: 5%;
  bottom: 5%;
  animation-delay: -5s;
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(100px, -60px);
  }
}

/* ------------------------------
   LAYOUT
   ------------------------------ */

main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

header {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero {
  width: 100%;
}

.terminal-line {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.prompt {
  color: var(--green);
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1em;
  background: var(--green);
  vertical-align: -2px;
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
  box-shadow: 0 0 10px var(--green);
}

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

h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  font-weight: 700;
  color: var(--text);
  text-shadow:
    0 0 10px rgba(99, 255, 155, 0.35),
    0 0 35px rgba(99, 255, 155, 0.15);
}

h1 span {
  color: var(--green);
}

.subtitle {
  margin-top: 30px;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.subtitle strong {
  color: var(--text);
  font-weight: 400;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 35px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  background: rgba(10, 20, 15, 0.65);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

.scroll {
  position: absolute;
  bottom: 35px;
  left: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: scrollPulse 2s ease-in-out infinite;
  cursor: pointer;
}

@keyframes scrollPulse {
  50% {
    opacity: 0.35;
    transform: translateY(5px);
  }
}

/* ------------------------------
   SECTIONS
   ------------------------------ */

section {
  padding: 120px 0;
  position: relative;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 45px;
}

.section-number {
  color: var(--green);
  font-size: 0.75rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  letter-spacing: -0.05em;
}

.section-description {
  color: var(--muted);
  max-width: 650px;
  line-height: 1.7;
  margin-bottom: 45px;
}

/* ------------------------------
   PROJECTS
   ------------------------------ */

#projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

#projects li {
  list-style: none;
}

#projects a {
  position: relative;
  display: block;
  padding: 25px;
  border: 1px solid var(--border);
  background:
    linear-gradient(
      135deg,
      rgba(99, 255, 155, 0.035),
      rgba(0, 0, 0, 0.25)
    );
  color: var(--text);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
  overflow: hidden;
}

#projects a::before {
  content: ">";
  position: absolute;
  right: 20px;
  top: 20px;
  color: var(--green);
  opacity: 0.25;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

#projects a:hover {
  transform: translateY(-5px);
  border-color: var(--green-dim);
  background:
    linear-gradient(
      135deg,
      rgba(99, 255, 155, 0.09),
      rgba(0, 0, 0, 0.35)
    );
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(99, 255, 155, 0.06);
}

#projects a:hover::before {
  opacity: 1;
  transform: translateX(5px);
}

/* ------------------------------
   ABOUT / TERMINAL
   ------------------------------ */

.terminal {
  border: 1px solid var(--border);
  background: #030504;
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(99, 255, 155, 0.04);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-dim);
}

.terminal-body {
  padding: 30px;
  line-height: 1.8;
  color: var(--muted);
  overflow-x: auto;
}

.terminal-body .key {
  color: var(--cyan);
}

.terminal-body .value {
  color: var(--text);
}

/* ------------------------------
   FOOTER
   ------------------------------ */

footer {
  padding: 60px 0 80px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.7rem;
}

footer a {
  color: var(--green);
  text-decoration: none;
}

/* ------------------------------
   GLITCH
   ------------------------------ */

.glitch {
  position: relative;
}

.glitch:hover {
  animation: glitch 220ms steps(2) infinite;
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }

  25% {
    transform: translate(-2px, 1px);
  }

  50% {
    transform: translate(2px, -1px);
  }

  75% {
    transform: translate(-1px, -1px);
  }

  100% {
    transform: translate(0);
  }
}

/* ------------------------------
   MOBILE
   ------------------------------ */

@media (max-width: 600px) {
  main {
    width: min(100% - 28px, 1100px);
  }

  header {
    min-height: 100svh;
  }

  section {
    padding: 80px 0;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 8rem);
    letter-spacing: -0.075em;
    max-width: 100%;
  }

  .terminal-body {
    padding: 20px;
    font-size: 0.8rem;
  }

  footer {
    flex-direction: column;
  }
}

/* ------------------------------
   REDUCED MOTION
   ------------------------------ */

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

/* ------------------------------
   PROJECT LINKS
   ------------------------------ */

#projects li.project-with-page,
#projects li.project-without-page {
  display: block;
}

#projects li.project-with-page > .project-link,
#projects li.project-without-page > .project-link {
  display: block;
  width: 100%;
}

#projects .project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0 1rem;
  padding: 0;
  line-height: 1;

  transform: none !important;
  transition: none !important;
}

#projects .project-meta-link {
  display: inline-block;

  width: auto;
  height: auto;

  margin: 0;
  padding: 0;

  background: none;
  border: 0;
  box-shadow: none;

  font-size: 0.6rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-decoration: none;

  opacity: 0.55;

  transform: none !important;
  transition:
    opacity 0.2s ease,
    text-shadow 0.2s ease !important;
}

#projects .project-meta-project {
  color: #f0d060;
}

#projects .project-meta-web {
  color: #8bd5ff;
}

#projects .project-meta-link:hover {
  opacity: 1;
  transform: none !important;
  text-shadow: 0 0 8px currentColor;
}
