/* =====================
   THEME (Light default, Dark optional)
   ===================== */
html[data-theme='light']{
  color-scheme: light;
  --page-bg: #f6f8fb;
  --text: #0f172a;
  --muted: #475569;
  --link: #2563eb;
  --link-hover: #0ea5e9;

  --header-bg: #ffffff;
  --header-text: #0f172a;
  --border-color: rgba(15,23,42,0.08);

  --section-bg: #ffffff;
  --section-alt: #f8fafc;

  --nav-bg: #ffffff;

  --chip-bg: #f1f5f9;
  --shadow: 0 6px 24px rgba(2, 6, 23, 0.08);
}

html[data-theme='dark']{
  color-scheme: dark;
  --page-bg: #0b1220;
  --text: #dbeafe;
  --muted: #94a3b8;
  --link: #80eaff;
  --link-hover: #a5f3fc;

  --header-bg: #0f172a;
  --header-text: #ffffff;
  --border-color: rgba(255,255,255,0.08);

  --section-bg: #0e1528;
  --section-alt: #0b1220;

  --nav-bg: #0f172a;

  --chip-bg: #172036;
  --shadow: 0 6px 24px rgba(2, 6, 23, 0.35);
}

/* Base */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--page-bg);
  color: var(--text);
  line-height:1.6;
}
.container{ max-width:1140px; margin:0 auto; padding:0 20px; }

a{ color: var(--link); }
a:hover{ color: var(--link-hover); }

.visually-hidden{ position:absolute !important; clip:rect(1px,1px,1px,1px); clip-path: inset(50%); width:1px; height:1px; overflow:hidden; white-space:nowrap; }

.skip-link{position:absolute;left:-999px;top:-999px}
.skip-link:focus{left:16px;top:16px;background:#fff;color:#111;padding:8px 12px;border-radius:8px;z-index:2000}

/* Header */
.site-header{
  position:sticky; top:0; z-index:1000;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom:1px solid var(--border-color);
  box-shadow: var(--shadow);
}
.header-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:72px;
}
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color: var(--header-text); }
.brand__logo{ width:200px !important; display:block; background:#fff; border-radius:10px; padding:6px 10px; box-shadow:0 2px 8px rgba(0,0,0,.10); }

.header-controls{ display:flex; align-items:center; gap:10px; }

/* Nav */
.nav{ display:block; }
.nav__list{ display:flex; align-items:center; gap:28px; list-style:none; margin:0; padding:0; }
.nav__list a{ color: var(--header-text); text-decoration:none; font-weight:600; padding:10px 0; display:inline-block; }
.nav__list a:hover{ color: var(--link-hover); }

/* Theme toggle */
.theme-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:8px;
  background: var(--chip-bg);
  border:1px solid var(--border-color);
  color: var(--header-text);
  cursor:pointer;
}
.theme-toggle .icon{ width:22px; height:22px; display:none; }
html[data-theme='light'] .icon-moon{ display:block; }
html[data-theme='dark']  .icon-sun{  display:block; }

/* Hamburger */
.hamburger{
  display:none; width:44px; height:44px; align-items:center; justify-content:center;
  background:transparent; border:none; cursor:pointer; position:relative;
}
.hamburger span{ position:absolute; left:50%; transform:translateX(-50%); width:24px; height:2px; background: var(--header-text); transition:.25s }
.hamburger span:nth-child(1){ top:16px }
.hamburger span:nth-child(2){ top:21px }
.hamburger span:nth-child(3){ top:26px }
.hamburger.is-active span:nth-child(1){ transform:translateX(-50%) rotate(45deg); top:21px }
.hamburger.is-active span:nth-child(2){ opacity:0 }
.hamburger.is-active span:nth-child(3){ transform:translateX(-50%) rotate(-45deg); top:21px }

/* Hero */
.hero{ position:relative; overflow:hidden; color:#fff; }
.hero__bg{
  position:absolute; inset:-20% -10% 0 -10%;
  background:
    radial-gradient(80% 60% at 20% 20%, rgba(34,211,238,0.20) 0, rgba(34,211,238,0) 60%),
    radial-gradient(80% 60% at 80% 30%, rgba(79,70,229,0.18) 0, rgba(79,70,229,0) 60%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  opacity:.95;
  will-change: transform;
  z-index:0;
}
.hero__chart{
  position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:none;
  filter: drop-shadow(0 6px 18px rgba(34,211,238,.25));
}
.chart-line{ stroke-dasharray:1800; stroke-dashoffset:1800; animation: draw 2.2s ease-out forwards; }
@keyframes draw{ to { stroke-dashoffset:0; } }
.hero__content{ position:relative; z-index:2; padding-block: clamp(64px, 16vh, 160px); text-align:center; }
.hero__content h1{ font-size: clamp(1.5rem, 2.4vw + 1rem, 2.4rem); max-width: 900px; margin: 0 auto; line-height:1.3; font-weight:800; text-shadow:0 8px 28px rgba(0,0,0,.4) }

/* Sections */
.section{
  padding-block: 64px;
  background: var(--section-bg);
  border-top:1px solid var(--border-color);
  scroll-margin-top: calc(72px + 12px); /* ensures anchor targets never hide under header */
  color: var(--text);
}
.section:nth-of-type(even){ background: var(--section-alt); }
.section h2{ color: var(--text); font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem); margin:0 0 12px; }
.flow > * + *{ margin-top:12px }
.section ul{ padding-left:1.25rem }
.section li{ margin:6px 0 }

/* Footer (standard UI) */
.site-footer{ background: var(--section-alt); color: var(--text); border-top:1px solid var(--border-color); padding: 15px; }
.footer-grid{ display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap:24px; padding:28px 0; }
.footer-brand{ display:flex; flex-direction:column; gap:10px; }
.footer-tagline{ color: var(--muted); margin:0; }
.footer-links{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.footer-links a{ color: var(--text); text-decoration:none; }
.footer-links a:hover{ color: var(--link-hover); }
.footer-copy{ display:flex; align-items:flex-end; justify-content:flex-end; }
.smallprint{ color: var(--muted); margin:0; font-size:.9rem; }

/* Responsive nav & footer */
@media (max-width:980px){
  .nav{
    position:fixed; left:0; right:0; top:72px;
    background: var(--nav-bg);
    overflow:hidden; max-height:0; transition:max-height .28s ease;
    border-bottom:1px solid var(--border-color);
    z-index: 999;
  }
  .nav.open{ max-height: 260px; }
  .nav__list{ flex-direction:column; gap:12px; padding:14px 0; }
  .hamburger{ display:inline-flex; }

  .footer-grid{ grid-template-columns: 1fr; }
  .footer-copy{ justify-content:flex-start; }
}
