/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:          #0D0D0F;
  --bg-card:     #111115;
  --bg-hover:    #16161C;
  --border:      #1E1E28;
  --border-mid:  #2A2A38;
  --text-muted:  #50505F;
  --text-sub:    #8B8FA8;
  --text-body:   #B8BBCC;
  --text-main:   #E4E6F0;
  --accent:      #4F9EFF;
  --accent-dim:  rgba(79,158,255,.1);
  --font-mono:   'JetBrains Mono', monospace;
  --font-sans:   'Inter', system-ui, sans-serif;
  --radius:      6px;
  --t:           200ms ease;
  --max:         860px;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.page-body  { padding-top: 52px; }

/* ─── NAV ────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px;
  display: flex; align-items: center;
  background: rgba(13,13,15,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease;
}
#nav.scrolled { border-color: var(--border); }
#nav .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-logo {
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-sub);
  display: flex; align-items: center; gap: 4px;
}
.nav-logo .name-part { color: var(--text-main); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 5px 10px; border-radius: var(--radius);
  font-size: .78rem; color: var(--text-muted);
  transition: color var(--t), background var(--t);
  font-family: var(--font-mono);
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); background: var(--bg-hover); }
.nav-links a.active { color: var(--accent); }
#cmd-trigger {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius);
  border: 1px solid var(--border-mid);
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-muted);
  transition: all var(--t);
}
#cmd-trigger:hover { color: var(--text-sub); background: var(--bg-hover); }
#hamburger { display: none; flex-direction: column; gap: 4px; padding: 8px; }
#hamburger span { display: block; width: 20px; height: 1.5px; background: var(--text-sub); transition: all var(--t); }

/* ─── MOBILE MENU ────────────────────────────────────────── */
#mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(13,13,15,.97); padding: 72px 24px 32px;
  flex-direction: column; gap: 4px;
}
#mobile-menu.open { display: flex; }
#mobile-menu a {
  padding: 14px 16px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: .9rem; color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}
#mobile-menu a:hover, #mobile-menu a.active { color: var(--accent); }

/* ─── COMMAND PALETTE ────────────────────────────────────── */
#cmd-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px);
  align-items: flex-start; justify-content: center; padding-top: 14vh;
}
#cmd-overlay.open { display: flex; }
#cmd-box {
  width: min(560px, 92vw);
  background: #13131A;
  border: 1px solid var(--border-mid);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(79,158,255,.06);
  animation: cmdIn 150ms ease;
}
@keyframes cmdIn { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:none; } }
#cmd-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
#cmd-prompt { color: var(--accent); font-family: var(--font-mono); font-size: .85rem; user-select: none; }
#cmd-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-main); font-family: var(--font-mono); font-size: .88rem;
}
#cmd-input::placeholder { color: var(--text-muted); }
#cmd-list { max-height: 300px; overflow-y: auto; padding: 6px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--t); font-size: .865rem;
}
.cmd-item:hover, .cmd-item.active { background: var(--accent-dim); }
.cmd-item .ci-icon { color: var(--text-muted); font-family: var(--font-mono); font-size: .72rem; min-width: 22px; }
.cmd-item .ci-label { color: var(--text-main); flex: 1; }
.cmd-item .ci-desc { color: var(--text-muted); font-size: .75rem; font-family: var(--font-mono); }
#cmd-footer {
  border-top: 1px solid var(--border); padding: 7px 14px;
  display: flex; gap: 14px;
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted);
}
#cmd-footer span { display: flex; align-items: center; gap: 4px; }
.kbd { background: var(--border-mid); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: .66rem; }

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-label {
  font-family: var(--font-mono); font-size: .7rem; color: var(--text-muted);
  letter-spacing: .12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.page-label::before { content: ''; display: block; width: 20px; height: 1px; background: var(--border-mid); }
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; color: var(--text-main);
  letter-spacing: -.03em; line-height: 1.1;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  margin-top: auto; padding: 24px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: .7rem; color: var(--text-muted);
  flex-wrap: wrap; gap: 8px;
}
.footer-cmd { color: var(--accent); cursor: pointer; }

/* ─── REVEAL ─────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ─── SHARED COMPONENTS ──────────────────────────────────── */
.tag {
  font-family: var(--font-mono); font-size: .65rem;
  padding: 3px 8px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--t);
}
.tag:hover { border-color: var(--border-mid); color: var(--text-sub); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links, #cmd-trigger { display: none; }
  #hamburger { display: flex; }
  .page-header { padding: 40px 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
