:root {
  --accent: #d97706;
  --accent-light: #fef9ee;
  --accent-border: #fde68a;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-body: #374151;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --border: #e5e7eb;
  --nav-bg: #111827;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 920px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ===== NAV ===== */
nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: relative;
}
.nav-brand {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: stretch;
}
.nav-links li {
  display: flex;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.12); }

/* ===== PROJECTS DROPDOWN ===== */
.has-dropdown {
  position: relative;
}
.has-dropdown > a::after {
  content: ' ▾';
  font-size: 0.75em;
  opacity: 0.6;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  z-index: 200;
  width: 620px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.drop-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.drop-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  transform: translateY(-2px);
}
.drop-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.drop-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}
.drop-card-thumb--steel {
  background: linear-gradient(135deg, #111827 0%, #1e3a5f 60%, #1a4a7a 100%);
}
.drop-card-body {
  padding: 0.5rem 0.625rem 0.625rem;
  text-align: center;
}
.drop-card-tag {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.drop-card-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

/* ===== HERO ===== */
.hero {
  background: var(--nav-bg);
  padding: 3.5rem 1.5rem;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-inner--centered {
  display: block;
  max-width: 640px;
  text-align: center;
}
.hero-inner--centered .hero-bio {
  margin-left: auto;
  margin-right: auto;
}
.hero-inner--centered .hero-links {
  justify-content: center;
}
.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.hero-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  color: #fff;
}
.hero-title {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.25rem;
}
.hero-bio {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.68);
  margin-bottom: 1.75rem;
  max-width: 480px;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: var(--nav-bg);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.hero-links a:hover { opacity: 0.8; }
.hero-links a svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ===== MAIN ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.page-section { margin-bottom: 1.5rem; }

/* ===== PROJECT CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 4px 16px rgba(0,0,0,0.08);
}
.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-alt);
}
.card-body { padding: 1rem 1.125rem 1.25rem; }
.card-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.375rem;
}
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.card-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.375rem; line-height: 1.55; }

/* ===== EXPERIENCE ===== */
.exp-list {
  display: flex;
  flex-direction: column;
}
.exp-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child {
  border-bottom: none;
}
.exp-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.exp-company {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.exp-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 2rem;
}

/* ===== SKILLS ===== */
.skills-line {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 2;
  letter-spacing: 0.01em;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* ===== HERO ENTRANCE ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-name  { animation: fadeUp 0.5s ease both 0.05s; }
.hero-title { animation: fadeUp 0.5s ease both 0.15s; }
.hero-bio   { animation: fadeUp 0.5s ease both 0.25s; }
.hero-links { animation: fadeUp 0.5s ease both 0.35s; }

/* ===== CONTACT CTA ===== */
.contact-section {
  background: var(--nav-bg);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
}
.contact-heading {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.contact-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  max-width: 480px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
}
.contact-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.contact-btn:hover { opacity: 0.85; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  padding: 0.375rem 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; }

/* ===== ABOUT PAGE ===== */
.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: center;
}
.about-photo {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.about-text {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-body);
  margin-bottom: 1rem;
}
.about-text:last-child { margin-bottom: 0; }

/* ===== CASE STUDY ===== */
.case-hero {
  background: var(--nav-bg);
  padding: 4rem 1.5rem 3.5rem;
}
.case-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.case-hero-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.case-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: #fff;
}
.case-hero p {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  line-height: 1.65;
}

.case-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.case-section { margin-bottom: 3.5rem; }
.case-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.375rem;
}
.case-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.case-h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--text);
}
.case-p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 0.875rem;
}
.case-p:last-child { margin-bottom: 0; }
.case-img {
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.09);
  width: 100%;
}
.case-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.case-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.case-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}
.two-col:last-child { margin-bottom: 0; }

.full-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.09);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  .hero-photo { margin: 0 auto; width: 130px; height: 130px; }
  .hero-links { justify-content: center; }
  .hero-bio { margin-left: auto; margin-right: auto; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { max-width: 260px; margin: 0 auto; }

  .two-col { grid-template-columns: 1fr; gap: 1.5rem; }

  .nav-links a { font-size: 0.8125rem; padding: 0.375rem 0.5rem; }
  .nav-brand { font-size: 0.875rem; }
}

/* ===== SNAKE GAME ===== */
.snake-trigger {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  line-height: 1;
  vertical-align: middle;
}
.snake-trigger:hover {
  opacity: 1;
}
.snake-overlay-name {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  letter-spacing: -0.01em;
  pointer-events: none;
}

.snake-overlay {
  position: fixed;
  inset: 0;
  background: var(--nav-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.snake-overlay.active {
  opacity: 1;
  visibility: visible;
}
.snake-score {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.snake-canvas {
  display: block;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  touch-action: none;
}
.snake-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s ease;
}
.snake-close:hover { color: rgba(255,255,255,0.8); }
