/* ───────────────────────────────────────────
   Base & Reset
   ─────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #888888;
  --muted-light: #bbbbbb;
  --border: #f0f0f0;
  --pill-border: #eeeeee;
  --red: #c0392b;
  --orange: #e67e22;
  --purple: #8e44ad;
  --terminal-bg: #1a1a1a;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ───────────────────────────────────────────
   Nav
   ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.nav-resume {
  border: 1.5px dashed var(--fg);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-resume:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ───────────────────────────────────────────
   Hero
   ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 60px;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50vh;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  font-weight: 400;
}

.hero-name {
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 500;
  letter-spacing: -4px;
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: 16px;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto;
  font-weight: 400;
}

/* ───────────────────────────────────────────
   Reaction Game
   ─────────────────────────────────────────── */
.reaction-game {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.reaction-label {
  font-size: 13px;
  color: var(--muted);
}

.reaction-btn {
  border: 1.5px dashed var(--fg);
  border-radius: 999px;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.reaction-btn:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-1px);
}

.reaction-btn.waiting {
  border-color: var(--orange);
  color: var(--orange);
  cursor: default;
}

.reaction-btn.waiting:hover {
  background: transparent;
  color: var(--orange);
  transform: none;
}

.reaction-btn.ready {
  border-color: #27ae60;
  color: #27ae60;
  animation: pulse-green 0.6s ease infinite alternate;
}

.reaction-btn.ready:hover {
  background: #27ae60;
  color: #fff;
}

@keyframes pulse-green {
  from { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.15); }
  to   { box-shadow: 0 0 0 8px rgba(39, 174, 96, 0); }
}

.reaction-result {
  font-size: 14px;
  color: var(--muted);
  min-height: 22px;
  transition: opacity 0.3s;
}

.reaction-result span {
  font-weight: 600;
  color: var(--fg);
}

/* ───────────────────────────────────────────
   Section Label
   ─────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted-light);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 32px;
}

/* ───────────────────────────────────────────
   Projects Column Layout
   ─────────────────────────────────────────── */
.projects {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 48px;
}

.project-list {
  display: flex;
  flex-direction: column;
}

.project-row {
  display: flex;
  gap: 80px;
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

.project-row.flipped {
  flex-direction: row-reverse;
}

.project-meta {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-meta .p-num {
  font-size: 13px;
  color: var(--muted-light);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.project-meta .p-name {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.project-meta .p-type {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.project-badge {
  align-self: flex-start;
  border: 1px solid #f0d080;
  color: #a07000;
  background: #fffbe6;
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 500;
  white-space: nowrap;
}

.project-meta .p-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.project-meta .p-links a {
  font-size: 13px;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--muted-light);
  transition: text-decoration-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.project-meta .p-links a:hover {
  text-decoration-color: var(--fg);
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-content .p-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 620px;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 8px 0;
}

.project-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-stat-num {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--fg);
}

.project-stat-label {
  font-size: 12px;
  color: var(--muted);
}


/* ───────────────────────────────────────────
   Scroll Sections — Antigravity-style
   ─────────────────────────────────────────── */
.scroll-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 48px;
  min-height: 70vh;
}

.scroll-section.flipped .scroll-text {
  order: 2;
}

.scroll-section.flipped .scroll-visual {
  order: 1;
}

.scroll-text .small-label {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted-light);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}

.scroll-text h2 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.scroll-text p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 380px;
}

/* Stat rows */
.stat-rows {
  display: flex;
  flex-direction: column;
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: 1px solid var(--border);
}

.stat-num {
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -2px;
  min-width: 100px;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
}

/* Terminal block */
.terminal {
  background: var(--terminal-bg);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-code {
  padding: 16px 22px 22px;
  overflow-x: auto;
}

.terminal-code code {
  color: #d4d4d4;
  white-space: pre;
}

/* Syntax colors */
.syn-kw   { color: #c586c0; }
.syn-fn   { color: #dcdcaa; }
.syn-str  { color: #ce9178; }
.syn-dec  { color: #569cd6; }
.syn-cm   { color: #6a9955; }
.syn-num  { color: #b5cea8; }
.syn-op   { color: #d4d4d4; }
.syn-var  { color: #9cdcfe; }
.syn-cls  { color: #4ec9b0; }

/* Skill pills */
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  font-size: 13px;
  padding: 8px 18px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  font-weight: 400;
  color: var(--fg);
  transition: all 0.25s ease;
}

.skill-pill:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: translateY(-2px);
}

/* ───────────────────────────────────────────
   Education
   ─────────────────────────────────────────── */
.education {
  text-align: center;
  padding: 60px 24px;
  font-size: 13px;
  color: var(--muted);
}

/* ───────────────────────────────────────────
   Footer
   ─────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 48px 24px 56px;
  font-size: 13px;
  color: #aaaaaa;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer a {
  color: #aaaaaa;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer a:hover {
  color: var(--fg);
}

/* ───────────────────────────────────────────
   Scroll Reveal Animation
   ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children */
.reveal-stagger .reveal {
  transition-delay: calc(var(--i, 0) * 0.08s);
}

/* ───────────────────────────────────────────
   Responsive
   ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    padding: 16px 24px;
  }

  .hero-name {
    letter-spacing: -2px;
  }

  .scroll-section {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 80px 24px;
    min-height: auto;
  }

  .scroll-section.flipped .scroll-text {
    order: 1;
  }

  .scroll-section.flipped .scroll-visual {
    order: 2;
  }

  .project-row, .project-row.flipped {
    flex-direction: column;
    gap: 32px;
    padding: 40px 0;
  }

  .project-meta {
    width: 100%;
  }

  .project-meta .p-links {
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
  }

  .stat-num {
    font-size: 32px;
    min-width: 70px;
  }

  .projects {
    padding: 80px 24px;
  }

  .footer {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 42px;
    letter-spacing: -1.5px;
  }

  .hero-eyebrow {
    font-size: 11px;
  }
}
