:root {
  --bg: #07111f;
  --surface: #0d1a2c;
  --surface-soft: #13233a;
  --text: #eef6ff;
  --muted: #9eb1c9;
  --line: rgba(148, 163, 184, 0.22);
  --blue: #3ba5ff;
  --green: #2dd4bf;
  --green-dark: #16a394;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 165, 255, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.11), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(7, 17, 31, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #04101d;
  font-size: 0.84rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

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

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 3px auto;
  background: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Shared layout */
.section {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 6rem 0;
  scroll-margin-top: 5.5rem;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.eyebrow,
.project-kicker {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

h1 {
  max-width: 760px;
  margin-top: 0.7rem;
  font-size: clamp(3rem, 8vw, 6.6rem);
  letter-spacing: 0;
}

h2 {
  max-width: 760px;
  margin-top: 0.6rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.btn-primary {
  background: var(--green);
  color: #04101d;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #5eead4;
}

.btn-secondary {
  background: rgba(59, 165, 255, 0.12);
  border-color: rgba(59, 165, 255, 0.38);
  color: #d8edff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.btn-small {
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 4rem);
  padding-top: 7rem;
}

.hero-title {
  margin-top: 1rem;
  color: var(--text);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 700;
}

.hero-copy {
  max-width: 680px;
  margin-top: 1rem;
  font-size: 1.1rem;
}

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

.profile-card,
.project-card,
.resume-panel,
.contact-grid a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 35, 58, 0.92), rgba(13, 26, 44, 0.92));
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 1rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.12);
}

.terminal-window {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  background: #07101d;
}

.terminal-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.terminal-bar span {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  background: var(--blue);
}

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

.terminal-bar span:nth-child(3) {
  background: #f59e0b;
}

.terminal-window pre {
  overflow-x: auto;
  padding: 1.2rem;
  color: #d8edff;
  font-size: clamp(0.78rem, 2vw, 0.92rem);
}

/* About and stack */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.about-grid.single {
  max-width: 860px;
  grid-template-columns: 1fr;
}

.about-text {
  padding: 1.5rem;
  border-left: 3px solid var(--blue);
  background: rgba(255, 255, 255, 0.035);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-list span,
.project-stack span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: #d8edff;
  font-size: 0.92rem;
  font-weight: 700;
}

.tech-list span {
  padding: 0.7rem 0.9rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  border-color: rgba(45, 212, 191, 0.58);
  transform: translateY(-4px);
}

.project-card h3 {
  margin: 0.35rem 0 0.75rem;
}

.project-stack,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-stack span {
  padding: 0.38rem 0.55rem;
  color: var(--green);
  font-size: 0.8rem;
}

/* Resume and contact */
.resume-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(59, 165, 255, 0.16), rgba(45, 212, 191, 0.09)),
    var(--surface);
}

.resume-panel p {
  max-width: 640px;
  margin-top: 0.7rem;
}

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

.contact-grid a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem;
  color: var(--text);
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-grid a:hover,
.contact-grid a:focus-visible {
  border-color: rgba(59, 165, 255, 0.56);
  transform: translateY(-3px);
}

.contact-grid span {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer {
  padding: 2rem 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  font-size: 0.92rem;
}

/* Scroll animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

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

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

/* Responsive */
@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    display: none;
    width: min(18rem, calc(100vw - 2rem));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 26, 44, 0.98);
    box-shadow: var(--shadow);
  }

  .nav.active {
    display: flex;
  }

  .nav a {
    padding: 0.85rem;
  }

  .hero,
  .about-grid,
  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

  .resume-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    display: none;
  }

  .section {
    width: min(100% - 1.2rem, var(--max-width));
    padding: 4.5rem 0;
  }

  .hero-actions,
  .project-actions {
    flex-direction: column;
  }

  .btn,
  .project-actions .btn {
    width: 100%;
  }

  .project-card {
    min-height: auto;
  }
}
