/* VVS Finance information hub — single shared stylesheet
   Neutral, content-first, responsive, accessible. No framework. */

:root {
  --bg:            #0f1216;
  --bg-elev:       #161b22;
  --bg-elev-2:     #1c232c;
  --line:          #2a323d;
  --line-soft:     #222932;
  --text:          #e6eaf0;
  --text-soft:     #aab3c0;
  --text-faint:    #7d8794;
  --accent:        #38d6c8;
  --accent-deep:   #1f9d92;
  --accent-ink:    #042b28;
  --link:          #74e3d8;
  --warn:          #ffb454;
  --warn-bg:       #2a2113;
  --danger:        #ff7a7a;
  --danger-bg:     #2a1616;
  --radius:        12px;
  --radius-sm:     8px;
  --measure:       68ch;
  --maxw:          1120px;
  --font-sans:     "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono:     "JetBrains Mono", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:          #f7f9fb;
    --bg-elev:     #ffffff;
    --bg-elev-2:   #eef2f6;
    --line:        #d8dee6;
    --line-soft:   #e6ebf1;
    --text:        #121821;
    --text-soft:   #44505e;
    --text-faint:  #6a7684;
    --accent:      #138a7f;
    --accent-deep: #0c6b62;
    --accent-ink:  #ffffff;
    --link:        #0d7a70;
    --warn:        #8a5a00;
    --warn-bg:     #fff4df;
    --danger:      #b3261e;
    --danger-bg:   #fdeceb;
    --shadow:      0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.08);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Skip link & focus ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

main { display: block; }

.section { padding-block: 28px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand .logo-mark { width: 30px; height: 30px; flex: none; display: block; }
.brand b { color: var(--accent); }
.brand small { color: var(--text-faint); font-weight: 500; font-size: .72rem; letter-spacing: .4px; }

.nav-toggle {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: inline-block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--bg-elev); }
.main-nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    flex-basis: 100%;
    margin-left: 0;
    display: none;
    padding-bottom: 12px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { display: block; padding: 11px 12px; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--text-faint); padding-top: 18px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.22; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.85rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.2vw, 1.85rem); margin: 2.2rem 0 .6rem; padding-top: .4rem; }
h3 { font-size: 1.22rem; margin: 1.7rem 0 .4rem; }
h4 { font-size: 1.02rem; margin: 1.3rem 0 .3rem; color: var(--text-soft); text-transform: none; }

.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--accent-deep); }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.lead { font-size: 1.18rem; color: var(--text-soft); max-width: var(--measure); }

strong { color: var(--text); }
em { color: var(--text-soft); }

code, kbd, samp { font-family: var(--font-mono); font-size: .88em; }
:not(pre) > code {
  background: var(--bg-elev-2);
  border: 1px solid var(--line-soft);
  padding: .1em .4em;
  border-radius: 5px;
  color: var(--text);
}

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.2rem 0; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* ---------- Hero ---------- */
.hero { padding-block: 30px 8px; }
.hero .eyebrow {
  display: inline-block;
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: .6rem;
}
.hero .lead { margin-top: .4rem; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
a.card { text-decoration: none; color: inherit; display: block; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.card h3 { margin: 0 0 .35rem; font-size: 1.08rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.card .kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: .4rem; }

/* ---------- Callouts ---------- */
.callout {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 1.4rem 0;
  background: var(--bg-elev);
  font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 700; display: block; margin-bottom: .25rem; }
.callout.note    { border-left-color: var(--accent); }
.callout.warn    { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.danger  { border-left-color: var(--danger); background: var(--danger-bg); }
.callout.warn .callout-title    { color: var(--warn); }
.callout.danger .callout-title  { color: var(--danger); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.3rem 0; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
caption { text-align: left; color: var(--text-faint); font-size: .85rem; padding: 10px 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { background: var(--bg-elev-2); color: var(--text); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ---------- Definition lists (glossary, FAQ) ---------- */
.faq-item, .term {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--bg-elev);
}
.faq-item h3, .term dt { margin: 0 0 .35rem; font-size: 1.05rem; }
.term dd { margin: 0; color: var(--text-soft); }
.faq-item p:last-child { margin-bottom: 0; }

.term-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 1rem 0 1.6rem; }
.term-index a {
  text-decoration: none;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  width: 2em; height: 2em;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem; color: var(--text-soft);
}
.term-index a:hover { color: var(--accent); border-color: var(--accent-deep); }

/* ---------- Figures / SVG ---------- */
figure { margin: 1.6rem 0; }
figure svg { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--bg-elev); }
figcaption { color: var(--text-faint); font-size: .85rem; margin-top: .55rem; text-align: center; }

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 1.6rem 0; }
.stat { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; }
.stat .v { font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat .k { font-size: .82rem; color: var(--text-faint); margin-top: .3rem; }

/* ---------- Related articles ---------- */
.related { margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.related h2 { margin-top: 0; font-size: 1.25rem; }

/* ---------- Pills / tags ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0; padding: 0; list-style: none; }
.pills li { background: var(--bg-elev-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--text-soft); }

/* ---------- TOC ---------- */
.toc { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 18px; margin: 1.4rem 0; font-size: .92rem; }
.toc strong { display: block; margin-bottom: .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.toc li { margin-bottom: .3rem; break-inside: avoid; }
.toc a { color: var(--text-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 620px) { .toc ul { columns: 1; } }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: .9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 26px; padding-block: 36px 14px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--text); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-brand p { margin: .6rem 0 0; max-width: 34ch; color: var(--text-faint); }
.footer-bottom { border-top: 1px solid var(--line-soft); padding-block: 16px 24px; display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; color: var(--text-faint); font-size: .82rem; }
.footer-bottom .disclaimer { max-width: 70ch; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding-block: 70px; }
.error-page .code { font-size: clamp(4rem, 3rem + 8vw, 7rem); font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -.04em; }
.error-page .prose { margin-inline: auto; }
.error-page .grid { text-align: left; margin-top: 2rem; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-faint { color: var(--text-faint); }
.small { font-size: .86rem; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
