/* ═══════════════════════════════════════════════════════════════════
   REFONTE 2026-04 — SHELL (header + sub-nav + tokens)
   Design source: ameliorations.html (Claude Design)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --shell-ink: #0d1419;
  --shell-ink-2: #141c24;
  --shell-ink-3: #1b2530;
  --shell-ink-4: #243040;
  --shell-line: rgba(255,255,255,.08);
  --shell-line-strong: rgba(255,255,255,.14);

  --shell-gold: #c9a227;
  --shell-gold-soft: #d9b84a;
  --shell-gold-deep: #9a7a1c;
  --shell-emerald: #1e6f5c;
  --shell-emerald-soft: #2a9d8f;

  --shell-text: #ece5d3;
  --shell-text-2: #b6ad98;
  --shell-text-3: #7c7461;

  --shell-font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --shell-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --shell-font-arabic: 'Amiri', serif;
  --shell-font-mono: 'JetBrains Mono', monospace;
}

/* ─── HEADER ──────────────────────────────────────────────────────── */
.site-header-v4 {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 20, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--shell-line);
  font-family: var(--shell-font-sans);
}

.shell-hdr {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

.shell-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--shell-font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--shell-text);
  text-decoration: none;
}

.shell-logo svg { color: var(--shell-gold); flex-shrink: 0; }

.shell-logo-text { display: block; line-height: 1.1; }
.shell-logo-text small {
  display: block;
  font-family: var(--shell-font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--shell-text-3);
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 400;
}

/* ─── SEARCH ──────────────────────────────────────────────────────── */
.shell-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.shell-search-input {
  width: 100%;
  background: var(--shell-ink-3);
  border: 1px solid var(--shell-line);
  color: var(--shell-text);
  font: 500 13px/1 var(--shell-font-sans);
  padding: 10px 44px 10px 38px;
  border-radius: 8px;
  outline: none;
  transition: border-color 180ms;
  cursor: pointer;
}

.shell-search-input::placeholder { color: var(--shell-text-3); }
.shell-search-input:hover,
.shell-search-input:focus { border-color: var(--shell-gold); }

.shell-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--shell-text-3);
  pointer-events: none;
}

.shell-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--shell-font-mono);
  font-size: 10px;
  color: var(--shell-text-3);
  background: var(--shell-ink);
  border: 1px solid var(--shell-line);
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
}

/* ─── HEADER RIGHT BUTTONS ───────────────────────────────────────── */
.shell-hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-btn {
  background: transparent;
  border: 1px solid var(--shell-line);
  color: var(--shell-text-2);
  padding: 8px 12px;
  border-radius: 8px;
  font: 500 12px var(--shell-font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 180ms;
}
.shell-btn:hover { border-color: var(--shell-gold); color: var(--shell-gold); }
.shell-btn svg { flex-shrink: 0; }

/* ─── SUB-NAV (horizontal) ───────────────────────────────────────── */
.shell-subnav {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 0 32px;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(6, 10, 13, 0.6);
  overflow-x: auto;
  scrollbar-width: none;
}
.shell-subnav::-webkit-scrollbar { display: none; }

.shell-subnav a {
  position: relative;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--shell-text-2);
  text-decoration: none;
  transition: color 150ms;
  white-space: nowrap;
  font-family: var(--shell-font-sans);
}
.shell-subnav a:hover { color: var(--shell-text); }
.shell-subnav a.active { color: var(--shell-gold); }
.shell-subnav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--shell-gold);
}
.shell-subnav a.seasonal { color: var(--shell-emerald-soft); }
.shell-subnav a.seasonal::before {
  content: '🌙';
  margin-right: 4px;
}

/* ─── MOBILE HAMBURGER ───────────────────────────────────────────── */
.shell-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--shell-line);
  color: var(--shell-text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.shell-burger:hover { border-color: var(--shell-gold); color: var(--shell-gold); }

/* ─── MOBILE DRAWER ──────────────────────────────────────────────── */
.shell-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86%;
  max-width: 340px;
  background: var(--shell-ink);
  border-left: 1px solid var(--shell-line-strong);
  transform: translateX(100%);
  transition: transform 260ms ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  overflow-y: auto;
}
.shell-drawer.open { transform: translateX(0); }

.shell-drawer-close {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--shell-line);
  color: var(--shell-text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  margin-bottom: 20px;
}

.shell-drawer a,
.shell-drawer button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--shell-text);
  text-decoration: none;
  border-radius: 8px;
  font: 500 14px var(--shell-font-sans);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.shell-drawer a:hover,
.shell-drawer button:hover { background: var(--shell-ink-3); border-color: var(--shell-line); }
.shell-drawer a.active { color: var(--shell-gold); background: var(--shell-ink-2); }

.shell-drawer-sep {
  height: 1px;
  background: var(--shell-line);
  margin: 16px 0;
}

.shell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
}
.shell-overlay.open { opacity: 1; pointer-events: auto; }

/* ─── STREAK BADGE (Quiz) ────────────────────────────────────────── */
.shell-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #1a0a00;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
}
.shell-streak:empty { display: none; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .shell-hdr {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 12px 16px;
  }
  .shell-logo-text small { display: none; }
  .shell-hdr-right .shell-btn:not(.shell-btn--search-mobile) { display: none; }
  .shell-search { display: none; }
  .shell-burger { display: inline-flex; }
  .shell-subnav { display: none; }
  .shell-btn--search-mobile { display: inline-flex; padding: 8px; }
  .shell-btn--search-mobile span { display: none; }
}

@media (min-width: 961px) {
  .shell-btn--search-mobile { display: none; }
}

/* ─── BODY padding reset (if double header) ──────────────────────── */
body.has-shell-v4 .site-header-v3 { display: none !important; }
