/* ===== Theme Tokens (tasteful gray dark) ===== */
:root {
  --header-h: 56px;

  /* Light */
  --bg: #f7f8fa;
  --text: #1f2328;
  --muted: #66707a;
  --elev: #ffffff;
  --surface: #f0f2f5;

  --brand: #3b82f6;
  --brand-ink: #0b63e6;

  --header: #252a33;
  --header-text: #ffffff;
  --focus: #a0c7ff;
  --shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* Tasteful gray dark */
html[data-theme="dark"] {
  --bg: #1b1e23;
  --text: #e6e8eb;
  --muted: #a7b0ba;
  --elev: #23272e;
  --surface: #1f2328;

  --brand: #7fb3ff;
  --brand-ink: #98c5ff;

  --header: #20242a;
  --header-text: #e6e8eb;
  --focus: #3a79d8;
  --shadow: 0 12px 36px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ===== Header / Navbar ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header);
  color: var(--header-text);
  box-shadow: var(--shadow);
}

.navbar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo { font-weight: 700; letter-spacing: .3px; color: var(--header-text); }

/* Desktop menu */
.nav-links {
  list-style: none;
  display: none;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}
.nav-links a, .nav-links .dropdown-toggle {
  color: var(--header-text);
  background: transparent;
  border: 0;
  font: inherit;
  text-decoration: none;
  padding: .45rem .6rem;
  border-radius: .4rem;
  transition: background-color 180ms ease;
  cursor: pointer;
}
.nav-links a:hover, .nav-links a:focus-visible,
.nav-links .dropdown-toggle:hover, .nav-links .dropdown-toggle:focus-visible {
  background: rgba(255,255,255,0.09);
}

/* Theme toggle at far right */
.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--header-text);
  font-size: 1rem;
  cursor: pointer;
  padding: .35rem .55rem;
  border-radius: .5rem;
}
.theme-toggle:focus-visible, .hamburger:focus-visible, .dropdown-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Hamburger */
.hamburger {
  background: transparent;
  border: 0;
  padding: .35rem;
  cursor: pointer;
  margin-left: .25rem;
  order: 3;
}
.hamburger .bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--header-text);
  border-radius: 2px;
  transition: transform 250ms ease, opacity 200ms ease;
}
.hamburger .bar + .bar { margin-top: 4px; }
.hamburger.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desktop breakpoint */
@media (min-width: 769px) {
  .nav-links { display: flex; }
  .hamburger { display: none; }
}

/* ===== Dropdown menu ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--header);
  border-radius: .5rem;
  padding: .4rem 0;
  margin: 0;
  list-style: none;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: transform 180ms ease, opacity 160ms ease;
  z-index: 10;
}
.dropdown-menu li a {
  display: block;
  padding: .5rem .9rem;
  color: var(--header-text);
  text-decoration: none;
  border-radius: .35rem;
}
.dropdown-menu li a:hover { background: rgba(255,255,255,0.08); }

/* Open state (JS adds .open) */
.dropdown.open > .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Also open on hover/focus for desktop accessibility */
@media (min-width: 769px) {
  .dropdown:hover > .dropdown-menu,
  .dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .dropdown:hover > .dropdown-toggle,
  .dropdown:focus-within > .dropdown-toggle {
    background: rgba(255,255,255,0.09);
  }
}

/* ===== Mobile Full-Width Panel ===== */
.nav-panel {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: var(--header);
  color: var(--header-text);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 200ms ease;
  display: flex; flex-direction: column;
}
.nav-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }

.panel-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.panel-title { font-weight: 600; }
.panel-theme { border-color: rgba(255,255,255,0.25); }

.panel-links {
  list-style: none; padding: .5rem 1rem 1rem; margin: 0;
  display: grid; gap: .25rem;
}
.panel-links a, .panel-links .dropdown-toggle {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--header-text);
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  border: 0; font: inherit; cursor: pointer;
  padding: .9rem .75rem; border-radius: .5rem;
}
.panel-links a:active { background: rgba(255,255,255,0.1); }

/* Mobile dropdown reveal */
.panel-links .dropdown .dropdown-menu {
  position: static;
  background: transparent;
  box-shadow: none;
  padding: .25rem 0 .5rem;
  opacity: 1; transform: none; pointer-events: auto;
  display: none;
}
.panel-links .dropdown.open .dropdown-menu { display: block; }
.panel-links .dropdown .dropdown-menu a { background: rgba(255,255,255,0.04); margin-top: .25rem; }

/* Prevent background scroll when panel open */
.no-scroll { overflow: hidden; }

/* ===== Hero & Sections (same as v2) ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.hero {
  padding: 5rem 0 2.5rem;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(0,0,0,0) 100%);
  text-align: center;
}
.hero h1 { margin: 0 0 .5rem; font-size: clamp(1.9rem, 2.2vw + 1.2rem, 3rem); }
.hero p { margin: 0 auto 1.25rem; max-width: 60ch; color: var(--muted); }
.cta-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.section { padding: 3rem 0; }
.section.alt { background: var(--surface); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.features-grid article {
  background: var(--elev);
  padding: 1rem;
  border-radius: .75rem;
  box-shadow: var(--shadow);
}

.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.media-block img {
  display: flex;         /* removes bottom gap from inline images */
  max-width: 100%;        /* never wider than its container */
  height: auto;           /* maintain aspect ratio */
  border-radius: 0.9rem;  /* match your old style */
  box-shadow: var(--shadow);
}
.checklist { padding-left: 1.1rem; }
.checklist li { margin: .35rem 0; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.card { background: var(--elev); border-radius: .8rem; padding: 1rem; box-shadow: var(--shadow); }
.card .btn.tiny { margin-top: .5rem; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.plan { background: var(--elev); border-radius: .9rem; padding: 1.25rem; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.04); }
html[data-theme="dark"] .plan { border-color: rgba(255,255,255,0.06); }
.plan.featured { outline: 2px solid var(--brand); }
.plan .price { font-size: 2rem; margin: .25rem 0 1rem; }
.plan .price span { font-size: 1rem; color: var(--muted); }

details { background: var(--elev); padding: .9rem 1rem; border-radius: .6rem; box-shadow: var(--shadow); }
details + details { margin-top: .75rem; }
summary { cursor: pointer; font-weight: 600; }

/* Buttons */
.btn { display: inline-block; text-decoration: none; padding: .6rem .9rem; border-radius: .6rem; border: 1px solid transparent; }
.btn.primary { background: var(--brand); color: white; }
.btn.ghost { background: transparent; color: var(--text); border-color: rgba(0,0,0,0.15); }
html[data-theme="dark"] .btn.ghost { border-color: rgba(255,255,255,0.25); color: var(--header-text); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Footer */
.site-footer { padding: 2rem 0; color: var(--muted); text-align: center; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 1) Center items in the desktop list */
.nav-links { align-items: center; }          /* flex container */

/* 2) Make links and the dropdown button render the same */
.nav-links a,
.nav-links .dropdown-toggle {
  display: inline-flex;                      /* so we can center content */
  align-items: center;
  gap: .3rem;                                /* space before the caret */
  line-height: 1;                            /* kill baseline wobble */
  padding: .45rem .6rem;                     /* keep your existing padding */
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--header-text);
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
}

/* 3) Add the caret via CSS instead of the text node */
.nav-links .dropdown-toggle::after {
  content: "▾";
  font-size: .85em;
  translate: 0 1px;                          /* tiny optical nudge */
}

/* TOC link styling (kills default blue/purple) */
.cv-toc .toc-list a:link,
.cv-toc .toc-list a:visited {
  color: inherit;            /* or use var(--text) / var(--header-text) */
  text-decoration: none;
  opacity: .85;
}

.cv-toc .toc-list a:hover,
.cv-toc .toc-list a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-toc .toc-list a.active {
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
