/* DBMS Unit II — Sauce Labs inspired design system: obsidian glass, one green pulse */
:root {
  --color-obsidian-shell: #132322;
  --color-pure-white: #ffffff;
  --color-mint-frost: #edf7f5;
  --color-deep-abyss: #0e1a19;
  --color-charcoal: #070f0f;
  --color-fog-border: #d0d3d3;
  --color-stone-border: #b2b6b4;
  --color-slate-text: #828786;
  --color-neon-pulse: #3ddc91;
  --color-mint-whisper: #97ddbc;
  --color-signal-yellow: #ffcd48;
  --r-pill: 56px;
  --r-lg: 60px;
  --r-md: 20px;
  --r-sm: 10px;
  --shadow: rgba(0, 0, 0, 0.04) 1px 0 9px 2px;
  --font-body: Aeonik, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: AeonikFono, "Inter Display", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--color-obsidian-shell);
  color: var(--color-pure-white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.08px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--color-neon-pulse); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--color-neon-pulse); outline-offset: 3px; border-radius: 6px; }
.card :focus-visible, .card-white :focus-visible { outline-color: var(--color-obsidian-shell); }
.skip-link {
  position: absolute; left: 16px; top: -60px; background: var(--color-neon-pulse);
  color: var(--color-obsidian-shell); padding: 10px 20px; border-radius: var(--r-pill); z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 500; letter-spacing: -1.2px; }
h2 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 500; letter-spacing: -0.8px; }
h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 400; margin: 36px 0 12px; }
h4 { font-size: 24px; font-weight: 400; margin: 28px 0 8px; }
h5 { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin: 20px 0 6px; }
.card > h3:first-child, .card-white > h3:first-child { margin-top: 0; }
.eyebrow {
  display: block; font-family: var(--font-display); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.45px; color: var(--color-neon-pulse); margin-bottom: 14px; font-weight: 500;
}
.lead { font-size: 20px; max-width: 760px; opacity: 0.92; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin-bottom: 6px; }
code {
  font-family: var(--font-mono); font-size: 0.9em; background: rgba(19, 35, 34, 0.08);
  padding: 2px 7px; border-radius: var(--r-sm); letter-spacing: 0;
}
.band code { background: rgba(255, 255, 255, 0.1); }
.card code, .card-white code { background: rgba(19, 35, 34, 0.08); }
.callout code { background: rgba(255, 255, 255, 0.1); }

/* Announcement banner */
.banner {
  background: var(--color-neon-pulse); color: var(--color-obsidian-shell); text-align: center;
  padding: 10px 56px 10px 20px; position: relative; font-size: 14px;
}
.banner button {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: transparent;
  border: 0; color: var(--color-obsidian-shell); font-size: 22px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
}
.banner[hidden] { display: none; }

/* Nav */
.site-nav {
  position: sticky; top: 0; z-index: 50; background: var(--color-obsidian-shell);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.logo-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--color-neon-pulse); display: inline-block; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { color: #fff; text-decoration: none; padding: 8px 16px; border-radius: var(--r-pill); font-size: 15px; }
.nav-links a:hover { background: rgba(255, 255, 255, 0.08); }
.menu-btn { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--r-pill);
  font: 500 16px/1 var(--font-body); letter-spacing: -0.08px; cursor: pointer; text-decoration: none; border: 1.5px solid transparent;
}
.btn-primary { background: var(--color-neon-pulse); color: var(--color-obsidian-shell); }
.btn-primary:hover { background: var(--color-mint-whisper); }
.btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-dark { background: var(--color-obsidian-shell); color: #fff; }
.btn-dark:hover { background: var(--color-deep-abyss); }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding: 8px 0 24px; }
.toc .toc-title { display: block; margin: 0 0 12px 12px; }
.toc a {
  display: block; color: #fff; text-decoration: none; padding: 9px 14px; border-radius: var(--r-pill); font-size: 14px; margin-bottom: 4px; opacity: 0.78;
}
.toc a:hover { background: rgba(255, 255, 255, 0.08); opacity: 1; }
.toc a.active { background: var(--color-neon-pulse); color: var(--color-obsidian-shell); opacity: 1; font-weight: 500; }
main { min-width: 0; }
section.band { margin-bottom: 80px; }
section.band > .sec-head { margin-bottom: 28px; }
section.band > .sec-head p { max-width: 760px; margin-top: 16px; opacity: 0.9; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 48px; }
.stat { background: var(--color-deep-abyss); border-radius: var(--r-md); padding: 24px; }
.stat b { display: block; font-family: var(--font-display); font-size: 48px; font-weight: 500; color: var(--color-neon-pulse); line-height: 1; }
.stat span { display: block; margin-top: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.45px; opacity: 0.5; }

/* Cards: light cards on dark bands only */
.card {
  background: var(--color-mint-frost); color: var(--color-obsidian-shell); border-radius: var(--r-lg);
  padding: 48px; margin-top: 24px; box-shadow: var(--shadow);
}
.card-white {
  background: var(--color-pure-white); color: var(--color-obsidian-shell); border-radius: var(--r-lg);
  padding: 32px 40px 40px; margin-top: 24px; box-shadow: var(--shadow);
}
.card .eyebrow, .card-white .eyebrow { color: #0b7a47; }
.card a, .card-white a { color: #0b6d3f; }
.card-white figcaption, .caption { font-size: 14px; color: #4f5755; margin-top: 12px; }
figure { margin: 0; }
.diagram { overflow-x: auto; display: flex; justify-content: center; }
.diagram pre.mermaid { margin: 0; background: transparent; width: 100%; display: flex; justify-content: center; font-family: var(--font-body); }
.diagram .mermaid-error { background: var(--color-deep-abyss); color: #fff; border-radius: var(--r-md); padding: 16px; font-size: 13px; }

/* Callouts: nested dark cards inside light cards */
.callout { background: var(--color-deep-abyss); color: #fff; border-radius: var(--r-md); padding: 20px 24px; margin: 22px 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .tag {
  display: inline-block; font-family: var(--font-display); font-size: 9px; text-transform: uppercase; letter-spacing: 0.45px;
  color: var(--color-neon-pulse); margin-bottom: 8px; font-weight: 500;
}
.callout.def { border-left: 4px solid var(--color-neon-pulse); }
.callout details summary { cursor: pointer; color: var(--color-neon-pulse); }
.callout details > *:not(summary) { margin-top: 10px; }

/* Accordions */
details.acc { border: 1.5px solid var(--color-stone-border); border-radius: var(--r-md); margin: 18px 0; background: transparent; }
details.acc > summary {
  list-style: none; cursor: pointer; padding: 16px 56px 16px 22px; font-family: var(--font-display); font-weight: 500; font-size: 18px; position: relative;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-obsidian-shell); color: var(--color-neon-pulse); display: grid; place-items: center; font-size: 20px; line-height: 1;
}
details.acc[open] > summary::after { content: "–"; }
details.acc > .acc-body { padding: 4px 22px 22px; }
details.acc > .acc-body > h5:first-child { margin-top: 8px; }

/* Tabs */
.tablist { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.tablist button {
  background: transparent; color: var(--color-slate-text); border: 1.5px solid transparent; border-radius: var(--r-pill);
  padding: 10px 22px; font: 500 15px/1 var(--font-body); cursor: pointer;
}
.card .tablist button { color: #4f5755; }
.tablist button:hover { border-color: var(--color-stone-border); }
.tablist button[aria-selected="true"] { background: var(--color-neon-pulse); color: var(--color-obsidian-shell); }
[role="tabpanel"][hidden] { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--r-md); border: 1px solid var(--color-fog-border); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 520px; }
th { background: var(--color-obsidian-shell); color: #fff; text-align: left; padding: 12px 16px; font-weight: 500; font-family: var(--font-display); white-space: nowrap; }
td { padding: 11px 16px; border-top: 1px solid var(--color-fog-border); vertical-align: top; }
tr:nth-child(even) td { background: #f6fbfa; }
td.hl { background: var(--color-mint-whisper) !important; font-weight: 500; }
.table-wrap.compact table { min-width: 0; width: auto; }

/* Code */
pre.code {
  position: relative; background: var(--color-deep-abyss); color: #fff; border-radius: var(--r-md); padding: 22px 20px 20px; margin: 18px 0;
  overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; letter-spacing: 0;
}
pre.code code { background: none; padding: 0; font-size: inherit; color: inherit; }
pre.code .lang {
  position: absolute; left: 20px; top: 6px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.45px; color: var(--color-slate-text); font-family: var(--font-display);
}
pre.code .copy-btn {
  position: absolute; right: 12px; top: 10px; background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4);
  border-radius: var(--r-pill); font: 500 12px/1 var(--font-body); padding: 7px 14px; cursor: pointer;
}
pre.code .copy-btn:hover { border-color: var(--color-neon-pulse); color: var(--color-neon-pulse); }
pre.code code { display: block; padding-top: 14px; }
.tk-kw { color: var(--color-neon-pulse); }
.tk-str { color: var(--color-mint-whisper); }
.tk-com { color: var(--color-slate-text); font-style: italic; }
.tk-num { color: var(--color-signal-yellow); }
.tk-fn { color: #ffffff; font-weight: 600; }

/* Two-column helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini { background: var(--color-deep-abyss); color: #fff; border-radius: var(--r-md); padding: 20px 22px; }
.mini h5 { margin-top: 0; color: var(--color-neon-pulse); }
.mini p:last-child { margin-bottom: 0; }
.pill { display: inline-block; background: var(--color-neon-pulse); color: var(--color-obsidian-shell); border-radius: var(--r-pill); padding: 3px 12px; font-size: 13px; font-weight: 500; }
.formula { font-family: var(--font-mono); background: #fff; border: 1.5px solid var(--color-fog-border); border-radius: var(--r-md); padding: 14px 18px; margin: 14px 0; overflow-x: auto; letter-spacing: 0; font-size: 15px; }
.steps { counter-reset: s; list-style: none; padding-left: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 12px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-obsidian-shell); color: var(--color-neon-pulse); display: grid; place-items: center; font-size: 14px; font-weight: 500;
}

/* Calculator */
.calc { display: grid; gap: 14px; }
.calc label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.calc input, .calc textarea {
  font: 400 15px var(--font-mono); padding: 12px 16px; border-radius: var(--r-md); border: 1.5px solid var(--color-stone-border); background: #fff; color: var(--color-obsidian-shell);
}
#cc-out { margin-top: 18px; }

/* Quiz */
.quiz-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.progress { height: 8px; background: var(--color-fog-border); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.progress > div { height: 100%; width: 0; background: var(--color-neon-pulse); transition: width .3s; }
.q-opt {
  display: block; width: 100%; text-align: left; padding: 14px 22px; margin: 10px 0; border: 1.5px solid var(--color-stone-border);
  background: transparent; color: var(--color-obsidian-shell); border-radius: var(--r-md); font: 400 16px/1.4 var(--font-body); cursor: pointer;
}
.q-opt:hover:not([disabled]) { border-color: var(--color-obsidian-shell); }
.q-opt.correct { background: var(--color-mint-whisper); border-color: var(--color-neon-pulse); font-weight: 500; }
.q-opt.wrong { background: var(--color-deep-abyss); color: #fff; border-color: var(--color-deep-abyss); }
.q-opt[disabled] { cursor: default; }
.q-feedback { margin-top: 12px; }
.q-short { width: 100%; font: 400 16px var(--font-body); padding: 14px 18px; border: 1.5px solid var(--color-stone-border); border-radius: var(--r-md); min-height: 96px; background: #fff; color: var(--color-obsidian-shell); }
.score-board { text-align: center; padding: 16px 0; }
.score-board b { font-family: var(--font-display); font-size: 64px; color: #0b7a47; display: block; line-height: 1; }

/* Footer */
.site-footer { background: var(--color-deep-abyss); padding: 48px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; opacity: 0.85; }
.site-footer p { margin: 0; max-width: 560px; }

/* Responsive */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; }
  .toc {
    display: none; position: fixed; inset: 64px 0 0 0; max-height: none; background: var(--color-charcoal); z-index: 45; padding: 24px;
  }
  .toc.open { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .card, .card-white { padding: 24px; border-radius: 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-inner .btn-primary { display: none; }
  .hero { padding: 40px 0 24px; }
  section.band { margin-bottom: 56px; }
  .stat b { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress > div { transition: none; }
}
@media print {
  .site-nav, .toc, .banner, .copy-btn { display: none; }
}
