/* ============================================================
   base.css — Design tokens · Reset · Container · Navbar · Footer
   ============================================================ */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --bg:            #f3f5f9;
  --surface:       #ffffff;
  --surface-2:     #eef0f6;
  --surface-3:     #e2e6f0;
  --border:        #d4d9e8;
  --text:          #0f1623;
  --text-muted:    #5a6278;
  --text-light:    #9399ad;

  --primary:       #4f46e5;
  --primary-dark:  #3730c4;
  --primary-light: #ebe9fd;
  --primary-glow:  rgba(79,70,229,.15);
  --accent:        #06b6d4;
  --success:       #16a34a;
  --success-light: #dcfce7;
  --warning:       #d97706;

  --nav-h:    64px;
  --nav-bg:   #ffffff;

  --sh-xs: 0 1px 3px rgba(0,0,0,.06);
  --sh-s:  0 2px 8px  rgba(0,0,0,.08);
  --sh-m:  0 6px 24px rgba(0,0,0,.10);
  --sh-l:  0 14px 48px rgba(0,0,0,.14);

  /* unified radius names used by all CSS files */
  --r-xs: 4px;
  --r-s:  8px;
  --r-m:  14px;
  --r-l:  22px;
  --r-xl: 32px;

  /* aliases so content.css (--radius-*) still works */
  --radius-xs: var(--r-xs);
  --radius-s:  var(--r-s);
  --radius-m:  var(--r-m);
  --radius-l:  var(--r-l);
  --radius-xl: var(--r-xl);
  /* old names used by content.css */
  --radius-sm: var(--r-s);
  --radius-md: var(--r-m);
  --shadow-s:  var(--sh-s);
  --shadow-m:  var(--sh-m);
  --transition: 0.18s ease;

  --font: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
  --mono: 'Fira Code','Cascadia Code','Consolas',monospace;

  --max-w:      860px;
  --max-w-wide: 1100px;

  --ease: cubic-bezier(.4,0,.2,1);
  --t:    0.18s;
}

[data-theme="dark"] {
  --bg:            #0b0e17;
  --surface:       #141828;
  --surface-2:     #1b2035;
  --surface-3:     #222844;
  --border:        #272f4a;
  --text:          #e2e6f3;
  --text-muted:    #7d88a6;
  --text-light:    #4e5878;

  --primary:       #7c75f5;
  --primary-dark:  #9891f8;
  --primary-light: #1c1b4a;
  --primary-glow:  rgba(124,117,245,.2);
  --success-light: #052e16;

  --nav-bg: #141828;

  --sh-xs: 0 1px 3px rgba(0,0,0,.28);
  --sh-s:  0 2px 8px  rgba(0,0,0,.38);
  --sh-m:  0 6px 24px rgba(0,0,0,.48);
  --sh-l:  0 14px 48px rgba(0,0,0,.62);

  --shadow-s: var(--sh-s);
  --shadow-m: var(--sh-m);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ── Container ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR  —  rebuilt completely
   Layout:  [brand-left]  [nav-centre]  [actions-right]
   Bottom edge: 3 px gradient strip = overall progress
   ══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}

/* ── overall-progress strip ──────────────────────────────── */
.nav-progress-strip {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.6s var(--ease);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

.header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 28px;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

/* ── Brand ───────────────────────────────────────────────── */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-s);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.nav-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nav-brand-tag {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Centre nav links ────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 4px;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 16px;
  border-radius: var(--r-xl);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  white-space: nowrap;
}

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

.nav-links a.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

/* ── Right actions ───────────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* Progress chip — shows "X / N done" */
.nav-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 6px;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  cursor: default;
  user-select: none;
}

/* small arc SVG inside chip */
.nav-chip-arc {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-chip-arc svg { display: block; }

.nav-chip-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.44rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.nav-chip-label {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-chip-label b {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
}

.nav-chip-label span {
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background var(--t) var(--ease), transform 0.15s var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner { grid-template-columns: 1fr auto; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--nav-h) + 1px);
    left: 0; right: 0;
    background: var(--nav-bg);
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    flex-direction: column;
    padding: 10px 16px;
    gap: 2px;
    box-shadow: var(--sh-m);
    z-index: 199;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    width: 100%;
    border-radius: var(--r-s);
    text-align: left;
  }

  .nav-hamburger { display: flex; }
  .nav-chip      { display: none; }
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  margin-top: 48px;
}

.site-footer p,
.footer-inner p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
