/* ==========================================================================
   Michael Wolfgang — static site styles
   No framework, no build step for CSS. Tokens first, then components.
   ========================================================================== */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #171a26;
  --muted: #5a6175;
  --border: #e3e6ee;
  --border-strong: #cfd4e0;
  --accent: #5b4bdb;
  --accent-strong: #4637bd;
  --accent-soft: #eeecfd;
  --accent-contrast: #ffffff;
  --link: #4637bd;
  --success: #15803d;
  --success-soft: #e8f6ee;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #9a5b00;
  --warning-soft: #fff4de;
  --info-soft: #eaf0ff;
  --hero-from: #17143a;
  --hero-to: #3b2fa3;
  --code-bg: #12142080;
  --code-solid: #14172a;
  --code-text: #e8eaf6;
  --shadow-sm: 0 1px 2px rgba(23, 26, 38, 0.05), 0 1px 3px rgba(23, 26, 38, 0.05);
  --shadow-md: 0 4px 14px rgba(23, 26, 38, 0.08);
  --shadow-lg: 0 12px 32px rgba(40, 30, 110, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1120px;
  --prose: 72ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1018;
    --surface: #161924;
    --surface-2: #1d2130;
    --text: #e9ebf3;
    --muted: #a0a7bc;
    --border: #272c3d;
    --border-strong: #363c52;
    --accent: #8b7dff;
    --accent-strong: #a89dff;
    --accent-soft: #231f4a;
    --accent-contrast: #0e1018;
    --link: #a89dff;
    --success: #4ade80;
    --success-soft: #11291b;
    --danger: #ff8a80;
    --danger-soft: #331715;
    --warning: #f5c26b;
    --warning-soft: #33270e;
    --info-soft: #172240;
    --hero-from: #0b0a1f;
    --hero-to: #2a2170;
    --code-solid: #0a0c14;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1018;
  --surface: #161924;
  --surface-2: #1d2130;
  --text: #e9ebf3;
  --muted: #a0a7bc;
  --border: #272c3d;
  --border-strong: #363c52;
  --accent: #8b7dff;
  --accent-strong: #a89dff;
  --accent-soft: #231f4a;
  --accent-contrast: #0e1018;
  --link: #a89dff;
  --success: #4ade80;
  --success-soft: #11291b;
  --danger: #ff8a80;
  --danger-soft: #331715;
  --warning: #f5c26b;
  --warning-soft: #33270e;
  --info-soft: #172240;
  --hero-from: #0b0a1f;
  --hero-to: #2a2170;
  --code-solid: #0a0c14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 2.9rem); font-weight: 800; }
h2 { font-size: 1.55rem; font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.3em; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
::selection { background: var(--accent); color: var(--accent-contrast); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-contrast);
  padding: 0.6rem 1rem; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 0.65rem; color: var(--text);
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hero-to), var(--accent)); color: #fff;
  font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.nav a, .nav-btn {
  font: inherit; font-size: 0.95rem; font-weight: 550; color: var(--muted);
  background: none; border: 0; padding: 0.5rem 0.75rem; border-radius: 8px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem;
}
.nav a:hover, .nav-btn:hover, .nav-group.open > .nav-btn { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"], .nav-btn.is-current { color: var(--accent); background: var(--accent-soft); }
.nav-btn::after {
  content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); margin-left: 0.2rem; opacity: 0.7;
}
.nav-group { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 0.4rem; display: none; z-index: 120;
}
.nav-group.open > .menu, html:not(.js) .nav-group:focus-within > .menu { display: block; }
.menu a { display: flex; width: 100%; color: var(--text); font-weight: 500; }
.menu a small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.menu-title { display: none; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; margin-left: 0.4rem;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.nav-toggle {
  display: none; margin-left: auto; border: 1px solid var(--border); background: var(--surface);
  width: 42px; height: 42px; border-radius: 10px; cursor: pointer; color: var(--text); place-items: center;
}

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0.15rem; padding: 0.75rem 1.25rem 1.25rem;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav-btn { display: none; }
  .nav-group { position: static; }
  .menu {
    position: static; display: block; box-shadow: none; border: 0; padding: 0; min-width: 0; background: none;
  }
  .menu-title {
    display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--muted); font-weight: 700; padding: 0.9rem 0.75rem 0.2rem;
  }
  .menu a small { display: none; }
  .theme-toggle { margin: 0.6rem 0 0 0.5rem; width: 44px; height: 44px; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 85% -10%, rgba(139, 125, 255, 0.45), transparent 60%),
              linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff; padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); position: relative; overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 3rem; align-items: center; }
.hero .eyebrow { color: #c9c2ff; }
.hero h1 { font-size: clamp(2.3rem, 5vw + 0.8rem, 3.8rem); margin-bottom: 0.4em; }
.hero .lede { font-size: 1.2rem; color: #dcd8ff; max-width: 38em; }
.hero .lede a { color: #fff; font-weight: 650; }
.hero-art {
  justify-self: end; width: min(100%, 360px); aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.2); transform: rotate(2deg);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2.2rem; margin-top: 2.2rem; padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.hero-stats span { font-size: 0.85rem; color: #c9c2ff; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { display: none; }
}

.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2.6rem 0 2.2rem; }
.page-head h1 { margin-bottom: 0.25em; font-size: clamp(1.9rem, 3vw + 1rem, 2.6rem); }
.page-head .lede { margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; font-weight: 750; color: var(--accent); margin: 0 0 0.9rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46em; }

/* ---------- Layout helpers ---------- */
.section { padding: 2.75rem 1.25rem 3.25rem; }
.section.tight { padding-top: 2rem; }
.stack > * + * { margin-top: 1.5rem; }
.grid { display: grid; gap: 1.25rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
.prose { max-width: var(--prose); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: inherit; font-weight: 650; font-size: 0.98rem; padding: 0.7rem 1.2rem; border-radius: 10px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-contrast);
  cursor: pointer; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { background: var(--accent-strong); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-light { background: #fff; color: #2a2170; }
.btn-light:hover { background: #f0eefd; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.12); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.88rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.card-link {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); text-decoration: none; }
.card-link h3 { color: var(--text); margin-bottom: 0.35rem; }
.card-link:hover h3 { color: var(--accent); }
.card-link p { color: var(--muted); font-size: 0.97rem; }
.card-link .more { margin-top: auto; font-weight: 650; font-size: 0.9rem; color: var(--accent); }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1rem;
}
.card h2.card-title { font-size: 1.3rem; padding-left: 0.8rem; border-left: 4px solid var(--accent); margin-bottom: 1rem; }

/* Feature rows (home page) */
.feature {
  display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
}
.feature:nth-child(even) { grid-template-columns: 1fr 300px; }
.feature:nth-child(even) .feature-art { order: 2; }
.feature-art { border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); aspect-ratio: 1; }
.feature-art img { width: 100%; height: 100%; object-fit: cover; }
.feature h2 { margin-bottom: 0.6rem; }
.feature .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.feature .links li { margin: 0; }
.feature .links a { font-weight: 600; }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.7rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b4bdb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8'/%3E%3C/svg%3E") center / 70% no-repeat;
}
@media (max-width: 860px) {
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem; }
  .feature:nth-child(even) .feature-art { order: 0; }
  .feature-art { max-width: 260px; }
}

.feature-art.photo-art { aspect-ratio: 4 / 3; }
.about-intro { display: grid; grid-template-columns: 180px 1fr; gap: 1.6rem; align-items: start; }
.about-intro img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow-md); }
@media (max-width: 620px) { .about-intro { grid-template-columns: 1fr; } .about-intro img { width: 140px; height: 140px; } }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 0.4rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 0.65rem 0.85rem;
}
textarea { font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.field { margin-bottom: 1.1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; font: inherit; font-size: 0.8rem; font-weight: 650;
  padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active, button.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cat-Leadership { background: #e0f2fe; color: #075985; }
.cat-Business { background: #ccfbf1; color: #115e59; }
.cat-Psychology { background: #f3e8ff; color: #6b21a8; }
.cat-Health { background: #d1fae5; color: #065f46; }
.cat-Software { background: #cffafe; color: #155e75; }
.cat-Biography { background: #fef3c7; color: #92400e; }
.cat-History { background: #ffedd5; color: #9a3412; }
.cat-Fiction { background: #ffe4e6; color: #9f1239; }
.cat-Self-Improvement { background: #fae8ff; color: #86198f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [class*="cat-"] { background: #262a3d; color: #d5d9ee; }
}
:root[data-theme="dark"] [class*="cat-"] { background: #262a3d; color: #d5d9ee; }
.chip.cat-active, button.chip[class*="cat-"][aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }

/* ---------- Link lists ---------- */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; padding: 0.85rem 0; border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: 0; padding-top: 0; }
.link-list li:last-child { padding-bottom: 0; }
.link-list a { font-weight: 650; }
.link-list a.ext::after { content: " ↗"; font-size: 0.85em; color: var(--muted); }
.link-list p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- Podcasts ---------- */
.podcast { padding: 0; overflow: hidden; }
.podcast img { width: 100%; height: 190px; object-fit: cover; background: var(--surface-2); transition: transform 0.35s; }
.podcast:hover img { transform: scale(1.05); }
.podcast .img-wrap { overflow: hidden; }
.podcast .body { padding: 1.2rem 1.4rem 1.4rem; }
.podcast h3 { margin-bottom: 0.25rem; }
.podcast p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Q&A ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; background: var(--surface-2); border-radius: 12px; padding: 0.3rem; margin-bottom: 1.5rem; }
.tab {
  font: inherit; font-weight: 650; font-size: 0.95rem; padding: 0.55rem 1.1rem; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.qa { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.8rem; overflow: hidden; }
.qa summary {
  list-style: none; cursor: pointer; display: flex; gap: 0.9rem; align-items: flex-start; padding: 1.1rem 1.3rem;
  font-weight: 650; font-size: 1.05rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; margin-left: auto; flex: none; width: 9px; height: 9px; margin-top: 0.55em;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s;
}
.qa[open] summary::after { transform: rotate(-135deg); margin-top: 0.8em; }
.qa summary:hover { background: var(--surface-2); }
.qa .num {
  flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 750;
}
.qa .answer { padding: 0 1.3rem 1.3rem 4.1rem; color: var(--muted); }
.qa .answer p { margin: 0; border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text); }
.qa .answer.empty p { color: var(--muted); font-style: italic; border-color: var(--border-strong); }
@media (max-width: 620px) { .qa .answer { padding-left: 1.3rem; } }

/* ---------- Books ---------- */
.book { display: grid; grid-template-columns: 120px 1fr; gap: 1.2rem; padding: 1.2rem; }
.book-cover {
  aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); align-self: start;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover.fallback {
  display: grid; place-items: center; padding: 0.6rem; text-align: center; font-weight: 750; font-size: 0.85rem;
  background: linear-gradient(160deg, var(--hero-to), var(--accent)); color: #fff;
}
.book h3 { font-size: 1.12rem; margin-bottom: 0.35rem; }
.book .meta { font-size: 0.88rem; color: var(--muted); margin: 0.5rem 0; }
.book .notes { font-size: 0.93rem; margin: 0 0 0.6rem; }
.book .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rating { color: #b45309; font-weight: 700; }
.chip.status { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 440px) { .book { grid-template-columns: 90px 1fr; } }

/* ---------- Quotes ---------- */
.toolbar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.9rem; align-items: end; margin-bottom: 1rem; }
@media (max-width: 860px) { .toolbar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .toolbar { grid-template-columns: 1fr; } }
.result-count { color: var(--muted); font-size: 0.92rem; margin: 0 0 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.quote { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 0.8rem; }
.quote blockquote { margin: 0 0 0.8rem; font-size: 1.05rem; position: relative; }
.quote-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
.quote-author { font: inherit; font-weight: 700; font-size: 0.92rem; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.quote-author:hover { text-decoration: underline; }
.empty-state { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; }
.progress { margin-bottom: 1.4rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); font-weight: 600; margin-bottom: 0.5rem; }
.progress-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); border-radius: 999px; transition: width 0.25s; }
.question { font-size: clamp(1.3rem, 2vw + 0.8rem, 1.7rem); text-align: center; margin-bottom: 1.5rem; }
.options { display: grid; gap: 0.9rem; }
.option {
  display: flex; gap: 1rem; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.option:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.option .key {
  flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800;
}
.option:hover .key { background: var(--accent); color: var(--accent-contrast); }
.quiz-nav { display: flex; justify-content: center; margin-top: 1.4rem; }
.result-hero {
  text-align: center; border-radius: calc(var(--radius) + 6px); padding: 2.2rem 1.5rem;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; margin-bottom: 1.5rem;
}
.result-hero .type { font-size: clamp(2.8rem, 8vw, 4.5rem); font-weight: 850; letter-spacing: 0.08em; line-height: 1; }
.result-hero h2 { color: #fff; margin: 0.6rem 0 0.4rem; }
.result-hero p { color: #dcd8ff; margin: 0 auto; max-width: 36em; }
.dichotomies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin: 1.5rem 0; }
@media (max-width: 700px) { .dichotomies { grid-template-columns: repeat(2, 1fr); } }
.dich { text-align: center; padding: 1rem 0.6rem; }
.dich .letter { font-size: 2rem; font-weight: 850; color: var(--accent); line-height: 1; }
.dich .name { font-weight: 650; margin: 0.35rem 0 0.2rem; }
.dich .score { color: var(--muted); font-size: 0.85rem; }
.trait-block { padding: 1.1rem 1.3rem; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 0.8rem; }
.trait-block h3 { font-size: 1rem; margin-bottom: 0.3rem; color: var(--accent); }
.trait-block p { margin: 0; }
.prev-card { text-align: center; }
.prev-card .big { font-size: 2.4rem; font-weight: 850; color: var(--accent); letter-spacing: 0.06em; }
.type-guide details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.6rem; }
.type-guide summary { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 650; display: flex; gap: 0.8rem; align-items: baseline; }
.type-guide summary .code4 { font-weight: 850; color: var(--accent); letter-spacing: 0.06em; min-width: 3.4rem; }
.type-guide .inner { padding: 0 1.1rem 1.1rem; }
.type-guide .inner h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0.9rem 0 0.2rem; }
.type-guide .inner p { margin: 0; }
.rank { display: grid; grid-template-columns: 64px 1fr; gap: 1.1rem; align-items: center; margin-bottom: 1rem; }
.rank .badge-circle {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem;
  background: var(--accent-soft);
}
.rank h3 { margin: 0 0 0.25rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.rank h3 .n { font-size: 0.85rem; color: var(--accent); font-weight: 800; }
.rank p { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.95rem; }
.meter { display: flex; align-items: center; gap: 0.8rem; }
.meter-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #c084fc); border-radius: 999px; }
.meter-val { font-size: 0.85rem; font-weight: 700; color: var(--muted); min-width: 3.2rem; text-align: right; }
.rank.first { }
.cols-lists { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .cols-lists { grid-template-columns: 1fr; } }
.tip-list { list-style: none; padding: 0; margin: 0; }
.tip-list li { padding-left: 1.2rem; position: relative; font-size: 0.95rem; margin-bottom: 0.35rem; }
.tip-list li::before { content: "•"; position: absolute; left: 0; color: var(--accent); font-weight: 900; }

/* ---------- Timers / pace ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.stat .v { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.2; word-break: break-all; }
.stat .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 650; }
.pace-big { font-size: 2.6rem; font-weight: 850; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pace-card .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.pace-card .head h2 { margin: 0; font-size: 1.3rem; }
.pace-sub { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.92rem; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.time-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1.2rem; }

/* ---------- Tool output ---------- */
.notice { border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; border: 1px solid; margin: 1rem 0; }
.notice.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.notice.ok { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 45%, transparent); color: var(--success); }
.notice strong { display: block; }
pre.out {
  background: var(--code-solid); color: var(--code-text); padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; line-height: 1.55; margin: 0; white-space: pre-wrap; word-break: break-word;
}
.verdict { display: flex; gap: 1rem; align-items: center; }
.verdict .icon { font-size: 2.4rem; line-height: 1; }
.verdict h3 { margin: 0; }
.verdict p { margin: 0.2rem 0 0; }
.token-parts { word-break: break-all; font-family: var(--mono); font-size: 0.85rem; background: var(--surface-2); padding: 0.8rem 1rem; border-radius: var(--radius-sm); }
.info-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Documentation (generated from original page) ---------- */
.doc-section { margin-bottom: 2.75rem; }
.doc-section > h2 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; }
.doc-sub { margin: 1.6rem 0; }
.doc-sub > h3 { font-size: 1.1rem; }
.doc-section .steps { padding-left: 1.4em; }
.doc-section .steps li { margin-bottom: 0.5rem; }
pre.code {
  background: var(--code-solid); color: var(--code-text); border-radius: var(--radius-sm); padding: 1rem 1.2rem;
  overflow-x: auto; font-size: 0.86rem; line-height: 1.6; margin: 1rem 0; border: 1px solid rgba(255, 255, 255, 0.06);
}
pre.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.doc-section table, .prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.doc-section th { text-align: left; background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.doc-section th, .doc-section td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-section tr:last-child td { border-bottom: 0; }
.doc-section td:first-child { font-family: var(--mono); font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.mini { border-radius: var(--radius-sm); padding: 1rem 1.2rem; border: 1px solid; }
.mini p { margin: 0 0 0.4rem; font-size: 0.95rem; }
.mini p:first-child { font-weight: 750; font-size: 1rem; }
.mini-a { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.mini-b { background: var(--info-soft); border-color: color-mix(in srgb, #3b82f6 30%, transparent); }
.callout { border-left: 4px solid; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.85rem 1.1rem; margin: 0; font-size: 0.95rem; }
.doc-sub > .callout, .doc-section > .callout { margin: 1rem 0; }
.callout-title { font-weight: 750; margin: 0 0 0.25rem; }
.callout > div { color: var(--text); }
.callout-info { background: var(--info-soft); border-color: #3b82f6; }
.callout-tip { background: var(--success-soft); border-color: #22c55e; }
.callout-warning { background: var(--warning-soft); border-color: #f59e0b; }
.callout-danger { background: var(--danger-soft); border-color: #ef4444; }
.badge { display: inline-block; font-family: var(--mono); font-size: 0.78rem; font-weight: 650; padding: 0.15rem 0.55rem; border-radius: 6px; margin: 0 0.25rem 0.25rem 0; }
.badge-indigo { background: var(--accent-soft); color: var(--accent); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badges { margin: 0.5rem 0 1rem; }
.plain-list { list-style: none; padding: 0; }
.pit { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.75rem 0; border-bottom: 1px solid var(--border); margin: 0; }
.pit .x { color: var(--danger); font-weight: 800; flex: none; }
.pit div > span:first-child { font-weight: 700; }
.pit div > span:nth-child(2) { color: var(--muted); margin: 0 0.4rem; }
.ref { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; margin: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.ref > span:first-child { color: var(--accent); }
.ref a { font-weight: 650; }
.ref > span:last-child { color: var(--muted); font-size: 0.85rem; }
.doc-section .grid-2 .callout { margin: 0; }

/* ---------- Game embed ---------- */
.embed { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: #1b1f2a; }
.embed iframe { display: block; width: 100%; height: 760px; border: 0; }

/* ---------- Contact ---------- */
.contact-card { display: flex; gap: 1rem; align-items: center; }
.contact-card .card-icon { margin: 0; flex: none; }
.contact-card h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.contact-card a { font-weight: 600; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 2rem; background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 2rem; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .tag { color: var(--muted); max-width: 26em; margin-top: 0.8rem; }
.footer-bottom { margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 5rem 0; }
.not-found .big { font-size: clamp(4rem, 15vw, 8rem); font-weight: 900; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .theme-toggle, .btn-row { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Running results */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.pr-card { display: block; text-decoration: none; color: inherit; padding: 1rem 1.1rem; }
.pr-card .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 650; }
.pr-card .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.pr-card .m { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }
.dist-block { margin-top: 2rem; scroll-margin-top: 5rem; }
.ultra-head { margin-top: 3rem; }
table.results { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.results th { text-align: left; background: var(--surface-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
table.results th, table.results td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.results tr:last-child td { border-bottom: 0; }
table.results .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.results .nowrap { white-space: nowrap; }
table.results tr.pr td { background: var(--accent-soft); font-weight: 650; }
