/* =====================================================================
   CE-QUAL-W2 Website — Design System
   A modern, professional theme for hydrodynamic & water-quality modeling
   ===================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette (water / environmental) */
  --navy-900: #04293a;
  --navy-800: #05445e;
  --deep-700: #0a4d68;
  --teal-600: #11849c;
  --teal-500: #189ab4;
  --aqua-400: #2596be;
  --mint-300: #75e6da;
  --mint-200: #a7efe6;

  --ink: #0b2027;
  --ink-soft: #2c4a52;
  --muted: #5c757d;
  --line: #e2ecef;
  --line-soft: #eef4f6;

  --bg: #f5fafb;
  --bg-alt: #eef6f8;
  --surface: #ffffff;
  --surface-2: #f8fcfd;

  --warn: #e08a1e;
  --good: #2f9e6f;
  --danger: #d9534f;

  /* Gradients */
  --grad-hero: radial-gradient(1200px 600px at 15% -10%, #0a4d68 0%, transparent 55%),
               radial-gradient(900px 500px at 90% 0%, #11849c 0%, transparent 50%),
               linear-gradient(160deg, #04293a 0%, #05445e 55%, #0a4d68 100%);
  --grad-cta: linear-gradient(120deg, var(--teal-500), var(--aqua-400) 55%, var(--mint-300));
  --grad-text: linear-gradient(100deg, #75e6da, #a7efe6 60%, #ffffff);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-head: "Sora", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shape & shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --shadow-sm: 0 1px 2px rgba(8, 47, 62, .06), 0 2px 8px rgba(8, 47, 62, .05);
  --shadow-md: 0 8px 24px rgba(8, 47, 62, .09);
  --shadow-lg: 0 20px 50px rgba(5, 68, 94, .16);
  --shadow-glow: 0 10px 40px rgba(24, 154, 180, .28);

  --container: 1180px;
  --nav-h: 70px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-600); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--aqua-400); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.18; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; color: var(--ink-soft); }
ul, ol { color: var(--ink-soft); }
code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-alt); padding: .12em .4em; border-radius: 6px; color: var(--deep-700); }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
::selection { background: var(--mint-300); color: var(--navy-900); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(54px, 8vw, 100px) 0; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section--alt { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.section--surface { background: var(--surface); }
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-head); font-weight: 600; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--teal-600);
  margin-bottom: .9rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad-cta); border-radius: 2px; }
.section-head { max-width: 720px; margin: 0 auto clamp(34px, 5vw, 56px); text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head p { font-size: 1.08rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--grad-cta);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: .82em 1.5em; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn-primary { background-image: var(--btn-bg); color: var(--navy-900); box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 46px rgba(24, 154, 180, .42); color: var(--navy-900); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--deep-700); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--teal-500); color: var(--teal-600); transform: translateY(-2px); }
.btn-lg { padding: 1em 1.9em; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .76rem; font-weight: 600; font-family: var(--font-head);
  padding: .32em .8em; border-radius: 999px;
  background: var(--bg-alt); color: var(--teal-600); border: 1px solid var(--line);
}
.badge--accent { background: rgba(117, 230, 218, .18); color: var(--teal-600); border-color: rgba(24, 154, 180, .3); }
.badge--new { background: rgba(47, 158, 111, .12); color: var(--good); border-color: rgba(47, 158, 111, .3); }
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .5em .95em; border-radius: 999px; font-size: .9rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), border-color .15s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--teal-500); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-cta); }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: rgba(24, 154, 180, .35); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(24, 154, 180, .14), rgba(117, 230, 218, .22));
  color: var(--teal-600); margin-bottom: 18px; font-size: 1.5rem;
}
.card h3 { margin-bottom: .4em; }
.card p { margin-bottom: 0; font-size: .98rem; }
.card--link::after {
  content: "→"; position: absolute; top: 26px; right: 26px; font-size: 1.2rem;
  color: var(--teal-500); opacity: 0; transform: translateX(-6px); transition: all .25s var(--ease);
}
.card--link:hover::after { opacity: 1; transform: translateX(0); }
.card--feature { padding-top: 34px; }
.card-accent-top { border-top: 3px solid transparent; border-image: var(--grad-cta) 1; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 1000;
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s, background .25s;
}
.nav.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); background: rgba(255, 255, 255, .92); }
.nav__inner { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 38px; height: 38px; flex: 0 0 auto; }
.brand small { display: block; font-size: .62rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__links a {
  font-family: var(--font-head); font-weight: 500; font-size: .94rem; color: var(--ink-soft);
  padding: .55em .9em; border-radius: 10px; transition: background .18s, color .18s;
}
.nav__links a:hover { background: var(--bg-alt); color: var(--deep-700); }
.nav__links a.active { color: var(--teal-600); background: rgba(24, 154, 180, .1); }
.nav__cta { margin-left: 10px; }
.lang-btn {
  margin-left: 8px; padding: .5em .85em; border-radius: 10px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: .85rem;
  color: var(--deep-700); background: var(--bg-alt); border: 1px solid var(--line);
  transition: background .18s, color .18s, border-color .18s; min-width: 48px;
}
.lang-btn:hover { background: var(--surface); border-color: var(--teal-500); color: var(--teal-600); }
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s var(--ease); }
.nav__toggle span + span { margin-top: 5px; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--grad-hero); color: #eaf6f8; padding: calc(var(--nav-h) + 70px) 0 0; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, transparent, #000 30%, transparent 85%);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 2; max-width: 860px; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero h1 .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: rgba(234, 246, 248, .82); font-size: 1.2rem; max-width: 640px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }
.hero__badges .badge { background: rgba(255, 255, 255, .1); color: #d4f6f1; border-color: rgba(255, 255, 255, .18); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 12px 44px; padding: 26px 0 70px; position: relative; z-index: 2; }
.hero__stat .num { font-family: var(--font-head); font-weight: 700; font-size: 2rem; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__stat .lbl { font-size: .86rem; color: rgba(234, 246, 248, .7); }
.hero__waves { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; line-height: 0; }
.hero__waves svg { width: 100%; height: 110px; }

/* hero panel (right visual) */
.hero--split .hero__inner { max-width: 100%; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero__art {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-lg); backdrop-filter: blur(4px);
}

/* ---------- Stat band ---------- */
.statband { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.statband .stat { text-align: center; padding: 28px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.statband .num { font-family: var(--font-head); font-weight: 700; font-size: 2.3rem; background: var(--grad-cta); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.statband .lbl { color: var(--muted); font-size: .92rem; margin-top: 8px; }

/* ---------- Feature list / split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split--reverse .split__media { order: 2; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .tick {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(24,154,180,.16), rgba(117,230,218,.28)); color: var(--teal-600); font-size: .8rem; margin-top: 2px;
}
.feature-list strong { color: var(--ink); }

/* ---------- Diagram panel ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 22px;
}
.panel--dark { background: linear-gradient(160deg, var(--navy-800), var(--deep-700)); border-color: rgba(255,255,255,.1); color: #eaf6f8; }

/* ---------- Constituent / capability grid ---------- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-grid .tag {
  font-size: .88rem; padding: .5em .9em; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-soft); font-weight: 500;
  transition: all .15s var(--ease);
}
.tag-grid .tag:hover { background: var(--surface); border-color: var(--teal-500); color: var(--deep-700); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tag-grid .tag b { color: var(--teal-600); }

/* ---------- Timeline (changelog / history) ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--mint-300), var(--teal-500), transparent); }
.timeline li { position: relative; padding: 0 0 30px; }
.timeline li::before {
  content: ""; position: absolute; left: -28px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--teal-500); box-shadow: 0 0 0 4px rgba(24,154,180,.12);
}
.timeline li.is-latest::before { background: var(--grad-cta); border-color: var(--mint-300); }
.timeline .t-ver { font-family: var(--font-head); font-weight: 700; color: var(--deep-700); font-size: 1.05rem; }
.timeline .t-ver .badge { margin-left: 8px; }
.timeline ul { margin: .5em 0 0; padding-left: 1.1em; }
.timeline ul li { padding: 0 0 4px; }
.timeline ul li::before { display: none; }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: 12px; max-width: 820px; margin: 0 auto; }
.acc-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.acc-item[open] { border-color: rgba(24,154,180,.35); box-shadow: var(--shadow-sm); }
.acc-item summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-family: var(--font-head); font-weight: 600;
  color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after { content: "+"; font-size: 1.4rem; color: var(--teal-500); transition: transform .2s; font-weight: 400; }
.acc-item[open] summary::after { transform: rotate(45deg); }
.acc-body { padding: 0 22px 20px; color: var(--ink-soft); }
.acc-body p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
table.data th, table.data td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.data thead th { background: var(--bg-alt); font-family: var(--font-head); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ---------- Download cards ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.dl-card { display: flex; flex-direction: column; }
.dl-card .dl-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.dl-card .dl-foot { margin-top: auto; padding-top: 18px; }
.dl-card.featured { border-color: var(--teal-500); box-shadow: var(--shadow-glow); }
.dl-card.featured::before { content: "Recommended"; position: absolute; top: 14px; right: -34px; transform: rotate(45deg); background: var(--grad-cta); color: var(--navy-900); font-size: .68rem; font-weight: 700; padding: 4px 40px; font-family: var(--font-head); }

/* ---------- Callout / note ---------- */
.callout {
  display: flex; gap: 16px; padding: 20px 22px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--teal-500);
}
.callout--warn { border-left-color: var(--warn); background: #fff9ef; }
.callout--good { border-left-color: var(--good); background: #f1faf5; }
.callout .ic { font-size: 1.3rem; flex: 0 0 auto; }
.callout p { margin: 0; }
.callout strong { color: var(--ink); }

/* ---------- CTA band ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  background: var(--grad-hero); color: #fff; padding: clamp(40px, 6vw, 72px); text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(234, 246, 248, .85); max-width: 560px; margin-left: auto; margin-right: auto; }
.cta .hero__actions { justify-content: center; margin-bottom: 0; margin-top: 28px; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 80% 120%, rgba(117,230,218,.25), transparent 60%); }

/* ---------- Forms (community / issue board) ---------- */
.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: .8em 1em; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(24,154,180,.14); }
.textarea { min-height: 130px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Board (discussion / issues) ---------- */
.board-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.board-toolbar .search { flex: 1 1 220px; }
.seg { display: inline-flex; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: none; background: none; cursor: pointer; font-family: var(--font-head); font-weight: 500; font-size: .85rem; color: var(--muted); padding: .45em 1em; border-radius: 999px; transition: .15s; }
.seg button.active { background: var(--surface); color: var(--deep-700); box-shadow: var(--shadow-sm); }
.thread { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .18s, transform .18s; }
.thread:hover { border-color: rgba(24,154,180,.35); transform: translateY(-2px); }
.thread .votes { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; }
.thread .votes button { border: 1px solid var(--line); background: var(--surface-2); width: 38px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--teal-600); font-size: 1rem; transition: .15s; }
.thread .votes button:hover { border-color: var(--teal-500); background: var(--bg-alt); }
.thread .votes .count { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
.thread .body { flex: 1; min-width: 0; }
.thread .body h4 { margin: 0 0 6px; font-size: 1.08rem; }
.thread .body p { margin: 0 0 10px; font-size: .95rem; }
.thread .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .82rem; color: var(--muted); align-items: center; }
.thread .meta .tagpill { background: var(--bg-alt); border: 1px solid var(--line); padding: .15em .65em; border-radius: 999px; color: var(--teal-600); font-weight: 600; }
.type-pill { font-size: .72rem; font-weight: 700; font-family: var(--font-head); padding: .22em .7em; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.type-pill.issue { background: rgba(217,83,79,.12); color: var(--danger); }
.type-pill.question { background: rgba(37,150,190,.12); color: var(--aqua-400); }
.type-pill.idea { background: rgba(47,158,111,.12); color: var(--good); }
.type-pill.discussion { background: rgba(11,132,156,.12); color: var(--teal-600); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- Person / contact cards ---------- */
.person { display: flex; gap: 16px; align-items: center; }
.person .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--grad-cta); color: var(--navy-900); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; flex: 0 0 auto; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: #c4dde2; padding: 64px 0 28px; }
.footer a { color: #aecfd6; }
.footer a:hover { color: var(--mint-300); }
.footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__brand .brand { color: #fff; }
.footer__brand p { color: #9fc0c8; font-size: .93rem; max-width: 320px; margin-top: 14px; }
.footer h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer ul a { font-size: .93rem; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: .85rem; color: #80a4ac; }
.footer__bottom a { color: #9fc0c8; }

/* ---------- Page header (interior pages) ---------- */
.pagehead { background: var(--grad-hero); color: #eaf6f8; padding: calc(var(--nav-h) + 56px) 0 64px; position: relative; overflow: hidden; }
.pagehead::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 26px 26px; opacity: .5; }
.pagehead__inner { position: relative; z-index: 2; max-width: 760px; }
.pagehead h1 { color: #fff; }
.pagehead p { color: rgba(234,246,248,.82); font-size: 1.12rem; }
.breadcrumb { display: flex; gap: 8px; font-size: .85rem; color: rgba(234,246,248,.6); margin-bottom: 18px; }
.breadcrumb a { color: rgba(234,246,248,.8); }

/* ---------- Source / citation list ---------- */
.sources { display: grid; gap: 10px; }
.sources a { display: flex; gap: 10px; align-items: baseline; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-soft); box-shadow: var(--shadow-sm); transition: border-color .18s, transform .18s; }
.sources a:hover { border-color: var(--teal-500); transform: translateX(3px); }
.sources .n { font-family: var(--font-mono); font-size: .8rem; color: var(--teal-600); flex: 0 0 auto; }
.sources .ttl { color: var(--ink); font-weight: 500; }
.sources .url { color: var(--muted); font-size: .82rem; word-break: break-all; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.text-grad { background: var(--grad-cta); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flex { display: flex; } .gap-2 { gap: .8rem; } .gap-3 { gap: 1.2rem; } .wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.hide-toast { opacity: 0 !important; transform: translateY(20px) !important; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--navy-900); color: #eaf6f8; padding: 14px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg); z-index: 2000; font-size: .92rem; display: flex; align-items: center; gap: 10px;
  transition: opacity .3s, transform .3s; max-width: 90vw;
}
.toast .ic { color: var(--mint-300); }

/* ---------- Back to top ---------- */
.totop { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .25s var(--ease); z-index: 900; color: var(--teal-600); }
.totop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .hero--split .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .split--reverse .split__media { order: 0; }
  .statband { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(255,255,255,.98); backdrop-filter: blur(14px); padding: 16px 20px 26px; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: transform .3s var(--ease); box-shadow: var(--shadow-md); max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav__links.open { transform: none; }
  .nav__links a { padding: .8em 1em; font-size: 1rem; }
  .nav__cta { margin: 8px 0 0; }
  .nav__toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .hero__stats { gap: 18px 30px; }
  .footer__top { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 54px 0; }
}
