:root {
  --bg: #292929;
  --bg-2: #1f1f1f;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #8f522c;
  --accent-2: #5a3219;
  --topbar-h: 64px;
  --max: 1440px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

img { display: block; max-width: 100%; height: auto; }

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

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(31, 31, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--fg);
  padding: 9px 16px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.menu-btn:hover { background: var(--accent); border-color: var(--accent); }

.menu-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.menu-icon span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.menu-btn[aria-expanded="true"] .menu-icon span:nth-child(1) { transform: translateY(2.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon span:nth-child(2) { transform: translateY(-2.75px) rotate(-45deg); }

/* ── Menu panel ──────────────────────────────────────── */
.menu {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 99;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
  visibility: hidden;
}
.menu.open {
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  visibility: visible;
}
.menu ol {
  list-style: none;
  margin: 0;
  padding: 24px 0;
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.menu li { border-top: 1px solid rgba(255,255,255,0.05); }
.menu li:nth-child(1), .menu li:nth-child(2) { border-top: none; }

.menu a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.menu a:hover { background: rgba(143, 82, 44, 0.18); }
.menu a:hover .num { color: var(--accent); }
.menu .num {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--muted);
  transition: color .2s var(--ease);
}
.menu .title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.menu .cat {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Cover ───────────────────────────────────────────── */
.cover {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--topbar-h) + 24px) 24px 64px;
}
.cover-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 100px);
  max-width: var(--max);
  width: 100%;
}
.avatar {
  width: clamp(220px, 30vw, 420px);
  height: auto;
  flex-shrink: 0;
}
.cover-text h1 {
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin: 0 0 1rem;
}
.cover-text p {
  font-size: clamp(0.9rem, 1.4vw, 1.3rem);
  font-weight: 300;
  letter-spacing: 0.45em;
  margin: 0;
  color: rgba(255,255,255,0.85);
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: var(--muted);
  animation: bounce 2.4s var(--ease) infinite;
}
.scroll-cue:hover { color: var(--accent); }
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ── Projects ────────────────────────────────────────── */
.project {
  scroll-margin-top: var(--topbar-h);
  padding: 48px 24px;
  max-width: var(--max);
  margin-inline: auto;
}
.project img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.video-slot:empty { display: none; }
.video-slot {
  margin-top: 24px;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  border: 1px dashed rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.video-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .brand { font-size: 0.72rem; letter-spacing: 0.14em; }
  .menu-btn { padding: 7px 12px; font-size: 0.7rem; }
  .menu .menu-label { display: none; }

  .menu ol { grid-template-columns: 1fr; padding: 8px 0; }
  .menu li { border-top: 1px solid rgba(255,255,255,0.05); }
  .menu li:nth-child(2) { border-top: 1px solid rgba(255,255,255,0.05); }
  .menu a { padding: 16px 20px; gap: 16px; }
  .menu .cat { display: none; }

  .cover-inner { flex-direction: column; gap: 32px; text-align: center; }
  .cover-text h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .avatar { width: clamp(180px, 50vw, 260px); }

  .project { padding: 24px 12px; }
}
