:root {
  --bg: #0b0a12;
  --bg-elev: #13111d;
  --bg-card: #171425;
  --border: #2a2540;
  --text: #ecebf3;
  --text-dim: #a19db5;
  --accent: #a970ff;
  --accent-2: #5b8cff;
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(169, 112, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(91, 140, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }

a { color: inherit; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(11, 10, 18, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--text-dim); font-size: 0.95rem; transition: color .2s; }
.nav a:hover { color: var(--text); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero { padding: 96px 0 72px; }
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.03em;
}
.subtitle {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  margin: 10px 0 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { max-width: 640px; color: var(--text-dim); font-size: 1.1rem; margin: 0 0 40px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.stat-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { color: var(--text-dim); font-size: 0.88rem; }

/* Sections */
.section-title {
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin: 0 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.work, .skills, .about { padding: 48px 0; }

/* Projects */
.project {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 24px;
  margin-bottom: 28px;
}
.project:nth-of-type(even) .media { order: 2; }
.project.featured {
  grid-template-columns: 1fr;
  border-color: rgba(169, 112, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(169, 112, 255, 0.15), 0 20px 60px -30px rgba(169, 112, 255, 0.5);
}
.project.featured .media img,
.project.featured .media video { max-height: 520px; width: 100%; object-fit: cover; }

.media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  align-self: start;
}
.media img, .media video, .duo-item img, .duo-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform .4s ease;
}
.media img:hover, .duo-item img:hover { transform: scale(1.02); }
.media.duo { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; background: transparent; }
.duo-item { border-radius: var(--radius); overflow: hidden; background: #000; }

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}
.project h3 { font-size: 1.6rem; margin: 0 0 12px; letter-spacing: -0.01em; line-height: 1.2; }
.project-body > p { color: var(--text-dim); margin: 0 0 16px; }

.points { padding-left: 18px; margin: 0 0 18px; }
.points li { margin-bottom: 8px; color: var(--text-dim); }
.points strong { color: var(--text); font-weight: 600; }

.callout {
  border-left: 3px solid var(--accent);
  background: rgba(169, 112, 255, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 0 0 18px;
}
.callout-title { font-weight: 700; margin: 0 0 6px; }
.callout p:not(.callout-title) { color: var(--text-dim); margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

.shipped-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.stats.compact { grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-card);
}

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.skill h4 { margin: 0 0 6px; font-size: 1rem; }
.skill p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

/* About */
.about p { max-width: 720px; color: var(--text-dim); font-size: 1.05rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 28px 20px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 4, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox[hidden] { display: none; }
.lightbox-content img, .lightbox-content video {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-of-type(even) .media { order: 0; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .shipped-grid { grid-template-columns: 1fr; }
  .stats.compact { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .hero { padding: 64px 0 48px; }
  .skill-grid { grid-template-columns: 1fr; }
  .nav ul { gap: 16px; }
  .project { padding: 16px; }
}

/* Game links under media */
.media figcaption { background: var(--bg-card); padding: 12px 16px; }
.game-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.game-link:hover { text-decoration: underline; }
