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

:root {
  --bg:       #050508;
  --fg:       #e8e4dc;
  --accent:   #c8aa88;
  --dim:      #444;
  --dim2:     #2a2a2a;
  --panel-bg: rgba(8, 8, 8, 0.97);
  --font:     'Space Grotesk', sans-serif;
  --mono:     'Space Mono', monospace;
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ─── CANVAS + GRID ─────────────────────────────────────────────────────── */
#canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
#bottom-fade {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 160px; pointer-events: none; z-index: 2;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}
#grid-overlay {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.016) 1px, transparent 1px);
  background-size: 70px 70px;
}

/* ─── UI LAYER ──────────────────────────────────────────────────────────── */
#ui {
  position: fixed; inset: 0;
  z-index: 10; pointer-events: none;
}
/* Elements needing pointer events */
#menu-btn, #close-btn,
#prev-section, #next-section, .dot,
#content-panel a, #content-panel button { pointer-events: all; }
/* Nav items only clickable when overlay is open */
#nav-overlay.open .nav-item { pointer-events: all; }

/* ─── TOP BAR ───────────────────────────────────────────────────────────── */
#topbar {
  position: absolute; top: 28px; left: 32px;
  display: flex; align-items: center; gap: 12px;
}
#logo { font-size: 13px; font-weight: 700; letter-spacing: 0.18em; }
#tagline { font-size: 10px; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--mono); }

/* ─── HAMBURGER ─────────────────────────────────────────────────────────── */
#menu-btn {
  position: absolute; top: 22px; right: 32px;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; padding: 8px; z-index: 20;
}
#menu-btn span {
  display: block; height: 1px; background: var(--fg);
  transition: width 0.3s var(--ease), transform 0.35s var(--ease), opacity 0.3s ease;
  transform-origin: left center;
}
#menu-btn span:nth-child(1) { width: 28px; }
#menu-btn span:nth-child(2) { width: 20px; }
#menu-btn span:nth-child(3) { width: 24px; }
#menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 28px; }
#menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 28px; }
#menu-btn.hide { opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }

/* ─── HERO ──────────────────────────────────────────────────────────────── */
#hero {
  position: fixed; bottom: 44px; left: 0; right: 0;
  text-align: center;
  transition: none;
  filter: drop-shadow(0 0 24px rgba(0,0,0,0.9));
}
#hero.hidden { opacity: 0 !important; transform: translateY(20px) !important; pointer-events: none; transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
#hero-name { display: flex; flex-direction: column; line-height: 0.9; margin-bottom: 14px; align-items: center; }
.name-line {
  display: block;
  font-size: clamp(24px, 8vw, 88px);
  font-weight: 700; letter-spacing: -0.03em; text-transform: uppercase;
  text-shadow:
    0 0 40px rgba(0,0,0,1),
    0 2px 12px rgba(0,0,0,0.95),
    0 0 80px rgba(var(--glow, 0,115,230), var(--glow-near, 0.70)),
    0 0 120px rgba(var(--glow, 0,115,230), var(--glow-far, 0.40));
}
.name-line.outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(232,228,220,0.75);
  text-shadow:
    0 0 60px rgba(var(--glow, 0,115,230), var(--glow-outline-near, 0.55)),
    0 0 100px rgba(var(--glow, 0,115,230), var(--glow-outline-far, 0.30));
}
#hero-sub {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: var(--mono); margin-bottom: 14px;
  color: rgba(232,228,220,0.9);
  text-shadow:
    0 1px 8px rgba(0,0,0,1),
    0 0 30px rgba(var(--glow, 0,115,230), var(--glow-sub, 0.45));
}
#hero-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 9px; letter-spacing: 0.15em;
  text-transform: uppercase; font-family: var(--mono);
  color: rgba(232,228,220,0.55);
  text-shadow: 0 1px 6px rgba(0,0,0,1);
}
.eyebrow-line { display: block; width: 20px; height: 1px; background: rgba(232,228,220,0.35); }

/* ─── NAV OVERLAY ───────────────────────────────────────────────────────── */
#nav-overlay {
  position: absolute; inset: 0;
  background: rgba(8,8,8,0.93); backdrop-filter: blur(2px);
  display: flex; align-items: center;
  padding-left: clamp(32px, 10vw, 120px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease; z-index: 15;
}
#nav-overlay.open { opacity: 1; pointer-events: all; }
#nav-overlay ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: baseline; gap: 16px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); padding: 5px 0;
  color: rgba(232,228,220,0.15);
  transition: color 0.25s ease;
}
.nav-item:hover { color: var(--fg); }
.nav-item:hover .nav-num { color: var(--accent); }
.nav-num { font-size: 11px; font-family: var(--mono); color: transparent; letter-spacing: 0.1em; transition: color 0.25s ease; min-width: 22px; }
.nav-label { font-size: clamp(34px, 5.5vw, 72px); font-weight: 700; letter-spacing: -0.03em; text-transform: uppercase; line-height: 1; }
#nav-overlay.open .nav-item:nth-child(1) { animation: navSlide 0.5s 0.05s var(--ease) both; }
#nav-overlay.open .nav-item:nth-child(2) { animation: navSlide 0.5s 0.11s var(--ease) both; }
#nav-overlay.open .nav-item:nth-child(3) { animation: navSlide 0.5s 0.17s var(--ease) both; }
#nav-overlay.open .nav-item:nth-child(4) { animation: navSlide 0.5s 0.23s var(--ease) both; }
#nav-overlay.open .nav-item:nth-child(5) { animation: navSlide 0.5s 0.29s var(--ease) both; }
@keyframes navSlide {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── CONTENT PANEL ─────────────────────────────────────────────────────── */
#content-panel {
  position: absolute; top: 0; right: 0;
  width: min(520px, 92vw); height: 100%;
  background: var(--panel-bg);
  border-left: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.65s var(--ease);
  z-index: 12; pointer-events: none;
  /* No overflow here — handled by children */
}
#content-panel.open { transform: translateX(0); pointer-events: all; }

#close-btn {
  position: absolute; top: 24px; right: 28px;
  background: none; border: 1px solid rgba(255,255,255,0.07);
  color: var(--dim); font-size: 13px; cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--mono); z-index: 2; flex-shrink: 0;
}
#close-btn:hover { color: var(--fg); border-color: rgba(255,255,255,0.2); }

/* Scrollable content area */
#content-inner {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 80px 40px 24px;
  /* transition set dynamically by JS for section swipe */
}
#content-inner::-webkit-scrollbar { width: 2px; }
#content-inner::-webkit-scrollbar-track { background: transparent; }
#content-inner::-webkit-scrollbar-thumb { background: var(--dim2); }

/* ─── SECTION NAV (bottom strip) ────────────────────────────────────────── */
#section-nav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 14px 40px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: var(--panel-bg);
}
.sec-arrow {
  background: none; border: none; cursor: pointer;
  color: var(--dim); font-size: 14px; font-family: var(--mono);
  padding: 6px 10px; line-height: 1;
  transition: color 0.2s;
}
.sec-arrow:hover { color: var(--fg); }
.sec-arrow:disabled { color: var(--dim2); cursor: default; }
#section-dots { display: flex; gap: 8px; align-items: center; }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%; border: 1px solid var(--dim);
  background: transparent; cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  padding: 0;
}
.dot.active { background: var(--fg); border-color: var(--fg); transform: scale(1.25); }
.dot:hover:not(.active) { border-color: var(--accent); }

/* ─── CONTENT STYLES ────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px; letter-spacing: 0.22em; color: var(--accent);
  text-transform: uppercase; font-family: var(--mono); margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::before { content: ''; display: block; width: 16px; height: 1px; background: var(--accent); }
.section-title {
  font-size: clamp(26px, 4vw, 42px); font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.025em; color: var(--fg); margin-bottom: 24px; line-height: 1;
}
.content-text { font-size: 13px; line-height: 1.8; color: rgba(232,228,220,0.52); margin-bottom: 14px; }
.stat-highlight { color: var(--fg); font-weight: 600; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin-top: 6px; }
.skill-tag {
  font-size: 11px; font-family: var(--mono); color: rgba(200,170,136,0.8);
  border: 1px solid rgba(200,170,136,0.1); padding: 8px 12px;
  letter-spacing: 0.05em; text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s; cursor: default;
}
.skill-tag:hover { background: rgba(200,170,136,0.05); border-color: rgba(200,170,136,0.22); }

/* Experience */
.exp-item {
  border-left: 1px solid rgba(255,255,255,0.06); padding-left: 20px; margin-bottom: 30px; position: relative;
}
.exp-item::before {
  content: ''; position: absolute; left: -3px; top: 6px;
  width: 5px; height: 5px; border: 1px solid var(--accent);
  background: var(--bg); transform: rotate(45deg);
}
.exp-company { font-size: 16px; font-weight: 600; color: var(--fg); margin-bottom: 3px; }
.exp-role { font-size: 10px; color: var(--accent); font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.exp-period { font-size: 10px; color: var(--dim); font-family: var(--mono); margin-bottom: 12px; }
.exp-bullets { list-style: none; }
.exp-bullets li { font-size: 12px; line-height: 1.65; color: rgba(232,228,220,0.48); padding: 3px 0 3px 16px; position: relative; }
.exp-bullets li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 10px; top: 6px; }

/* Contact */
.contact-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(232,228,220,0.55); text-decoration: none; font-size: 13px;
  transition: color 0.2s; cursor: pointer;
  background: none; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left; font-family: var(--font);
}
.contact-link:hover { color: var(--fg); }
.contact-label { font-size: 9px; color: var(--dim); font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; width: 68px; flex-shrink: 0; }
.contact-link.copied { color: var(--fg); border-bottom-color: rgba(76,175,121,0.25); }
.contact-link.copied .contact-value { color: #4caf79; letter-spacing: 0.04em; }
.contact-value { transition: color 0.2s ease; }
.contact-available { display: flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 10px; color: var(--dim); font-family: var(--mono); letter-spacing: 0.08em; }
.avail-dot { width: 6px; height: 6px; border-radius: 50%; background: #4caf79; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

/* ─── SIDE COUNTER ──────────────────────────────────────────────────────── */
#side-counter {
  position: absolute; right: 32px; bottom: 32px;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  letter-spacing: 0.12em; display: flex; align-items: center; gap: 5px;
}
#counter-current { color: var(--fg); font-size: 11px; }
.counter-sep { opacity: 0.3; }

/* ─── MOBILE ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #hero { bottom: 48px; left: 20px; }
  #topbar { left: 20px; top: 20px; }
  #menu-btn { right: 20px; top: 18px; }
  #side-counter { right: 20px; bottom: 20px; }

  #content-panel { width: 100vw; border-left: none; }
  #content-inner { padding: 72px 24px 20px; }
  #section-nav { padding: 12px 24px; }

  .name-line { font-size: min(15vw, 56px); }
  .nav-label  { font-size: min(11vw, 48px); }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .name-line { font-size: 13vw; }
}
