:root {
  --text: #111418;
  --muted: #5b6470;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --accent: #1f5eff;
  --radius: 10px;
  --max: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav nav a:hover { color: var(--text); }

/* Buttons */
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; background: var(--text); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 15px; border: 1px solid var(--text); transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); opacity: 1; }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* Hero */
.hero { padding: 96px 24px 72px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: .02em; margin: 0 0 16px; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 20px; max-width: 820px; }
.lead { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 0 32px; }
.lead strong { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 32px; }
.stats li { color: var(--muted); font-size: 14px; }
.stats span { display: block; color: var(--text); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 28px; letter-spacing: -.02em; margin: 0 0 40px; }
.section-title-sm { margin-top: 64px; font-size: 22px; }

/* Projects */
.project { padding: 0 0 72px; margin-bottom: 72px; border-bottom: 1px solid var(--line); }
.project:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.project-head { margin-bottom: 24px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.project h3 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 12px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.media-main video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16/9; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.gallery-3 { grid-template-columns: repeat(3, 1fr); }
.gallery img, .compare img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; background: var(--bg-alt); border: 1px solid var(--line); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.compare figure { margin: 0; }
.compare img { object-fit: contain; background: #fff; }
.compare figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.wwr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.wwr h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 8px; }
.wwr p { margin: 0; color: #2c333b; font-size: 15px; }

/* 3D viewer */
.viewer { position: relative; width: 100%; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(#fff, #f3f5f8); overflow: hidden; }
.viewer canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer .hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.viewer .fallback { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Experience */
.xp { padding: 28px 0; border-top: 1px solid var(--line); }
.xp:first-of-type { border-top: 0; padding-top: 0; }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.xp h3 { font-size: 18px; margin: 0; }
.xp-head span { color: var(--muted); font-size: 14px; }
.xp ul { margin: 12px 0 0; padding-left: 20px; color: #2c333b; }
.xp li { margin-bottom: 6px; }

/* Skills & Edu */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 48px; }
.skills h4 { margin: 0 0 6px; font-size: 15px; }
.skills p { margin: 0; color: var(--muted); }
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.edu h3 { font-size: 17px; margin: 0 0 4px; }
.edu p { margin: 0; color: var(--muted); }

.contact { text-align: left; }
.footer { padding: 32px 24px; color: var(--muted); font-size: 14px; }

/* Lightbox */
dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
dialog#lightbox::backdrop { background: rgba(10,12,15,.85); }
dialog#lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; }
dialog#lightbox button { position: fixed; top: 16px; right: 20px; font-size: 32px; color: #fff; background: none; border: 0; cursor: pointer; }

/* Mobile */
@media (max-width: 760px) {
  .nav nav a:not(.btn) { display: none; }
  .hero { padding: 56px 24px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-3 { grid-template-columns: repeat(3, 1fr); }
  .wwr, .skills, .edu { grid-template-columns: 1fr; gap: 20px; }
  .viewer { aspect-ratio: 4/3; }
  .section { padding: 56px 0; }
}
