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

:root {
  --bg: #0d0d0d;
  --bg-alt: #111;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #4ade80;
  --accent-dim: #22c55e33;
  --radius: 10px;
  --nav-h: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Nav ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}

.nav-links a:hover { color: var(--text); }

/* ── Hero ────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 0 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #0f2a1a 0%, var(--bg) 70%);
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.hero-sub {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--muted);
}

/* ── Sections ────────────────────────────────────── */
.section { padding: 6rem 2rem; }
.section-alt { background: var(--bg-alt); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -.02em;
}

p { color: var(--muted); max-width: 640px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Project Grid ────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}

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

/* ── iframe Preview ──────────────────────────────── */
.project-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #000;
}

.project-preview iframe {
  width: 200%;
  height: 200%;
  transform: scale(.5);
  transform-origin: top left;
  border: none;
  pointer-events: none;
  display: block;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.8) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity .2s;
}

.project-card:hover .preview-overlay { opacity: 1; }

.play-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: .3rem .7rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

/* ── Project Info ────────────────────────────────── */
.project-info {
  padding: 1.25rem;
}

.project-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--text);
}

.project-info p {
  font-size: .875rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: .45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.btn:hover {
  background: var(--accent);
  color: #000;
  text-decoration: none;
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .8rem;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ── Snake page iframe ───────────────────────────── */
.game-frame-wrap {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  display: flex;
  flex-direction: column;
}

.game-frame-wrap iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
}
