/* ─── NAV ─── */
body > nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

body > nav.scrolled {
  background: rgba(5, 5, 8, 0.97);
}

.nav-logo {
  font-family: 'IBM Plex Mono', 'SF Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-bright);
  padding: 4px 10px;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.nav-logo:hover {
  border-color: rgba(167, 139, 250, 0.45);
  color: var(--accent-bright);
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links li {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links li:not(:last-child)::after {
  content: '/';
  color: var(--text-tertiary);
  font-size: 11px;
  padding: 0 12px;
  font-family: 'IBM Plex Mono', monospace;
}

.nav-links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 14px;
  height: 1px;
  background: var(--accent);
  opacity: 0.65;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-contact {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-bright);
  text-decoration: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: color 0.2s;
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 5px 14px;
  border-radius: 2px;
}

.nav-contact:hover {
  color: var(--accent-bright);
  border-color: rgba(167, 139, 250, 0.6);
  background: var(--accent-dim);
}


/* ─── HAMBURGER ─── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 201;
  transition: border-color 0.2s, background 0.2s;
}

.hamburger:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: var(--accent-dim);
}

/* Two-line icon — top bar shifts to slash, bottom bar stays */
.hamburger-icon {
  position: relative;
  width: 14px;
  height: 9px;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 14px;
  height: 1px;
  background: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-icon::before { top: 0; }
.hamburger-icon::after  { top: 8px; }

/* Close state: both bars form an X */
.hamburger.open .hamburger-icon::before {
  top: 4px;
  transform: rotate(45deg);
}
.hamburger.open .hamburger-icon::after {
  top: 4px;
  transform: rotate(-45deg);
}

/* ─── MOBILE DRAWER ─── */
/* Scrim overlay */
.mobile-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.mobile-drawer-scrim.open {
  opacity: 1;
  pointer-events: all;
}

/* Panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 200;
  width: min(300px, 85vw);
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.012) 2px,
    rgba(255,255,255,0.012) 4px
  );
  border-left: 1px solid var(--border-bright);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.open {
  pointer-events: all;
  transform: translateX(0);
}

/* Drawer header strip */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 58px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-grow: 0;
}

.drawer-header-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  padding: 0;
}

.drawer-close:hover {
  border-color: rgba(167, 139, 250, 0.5);
  color: var(--accent-bright);
  background: var(--accent-dim);
}

.drawer-close svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* Nav entries */
.drawer-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px 0;
  overflow-y: auto;
}

.drawer-nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.drawer-nav a:first-child {
  border-top: 1px solid var(--border);
}

/* Staggered slide-in when drawer opens */
.mobile-drawer .drawer-nav a {
  opacity: 0;
  transform: translateX(16px);
  transition: background 0.2s, opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.open .drawer-nav a:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.08s; }
.mobile-drawer.open .drawer-nav a:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.13s; }
.mobile-drawer.open .drawer-nav a:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.18s; }
.mobile-drawer.open .drawer-nav a:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.23s; }

.mobile-drawer .drawer-footer {
  opacity: 0;
  transition: opacity 0.3s ease 0.28s;
}

.mobile-drawer.open .drawer-footer {
  opacity: 1;
}

.drawer-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-nav a:hover {
  background: rgba(167, 139, 250, 0.05);
}

.drawer-nav a:hover::before {
  transform: scaleY(1);
}

.drawer-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 1px;
  flex-shrink: 0;
  opacity: 0.7;
}

.drawer-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.drawer-nav a:hover .drawer-label {
  color: var(--text);
}

/* Footer CTA */
.drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-grow: 0;
}

.drawer-cta {
  display: block;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-bright);
  text-decoration: none;
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 12px 24px;
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s;
}

.drawer-cta:hover {
  background: var(--accent-dim);
  border-color: rgba(167, 139, 250, 0.65);
}

