:root{
  --bg: #0f1115;
  --surface: #141821;
  --text: #e8eaed;
  --muted: #98a2b3;
  --border: #232a36;
  --ring: #7c8cff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --max: 1000px;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f6f7fb; --surface:#fff; --text:#0b1220; --muted:#475467;
    --border:#e6e8f0; --ring:#4f46e5; --shadow:0 10px 30px rgba(15,17,21,.08);
  }
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text); background:var(--bg); line-height:1.6;
}
.container{max-width:var(--max); margin:0 auto; padding:0 1.1rem}

.site-header{
  position:sticky; top:0; z-index:20;
  backdrop-filter:saturate(120%) blur(8px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom:1px solid var(--border);
}
.site-header .container{display:flex; align-items:center; justify-content:space-between; height:64px}
.brand{color:var(--text); text-decoration:none; font-weight:700; letter-spacing:.2px}
.top-nav a{color:var(--muted); text-decoration:none; margin-left:1rem}
.top-nav a:hover,.top-nav a.active{color:var(--text)}

main{background:
  radial-gradient(1200px 600px at 70% -10%, rgba(124,140,255,.12), transparent 60%)
}

.site-footer{
  border-top:1px solid var(--border);
  padding:1rem 0 2rem;
  color:var(--muted);
  font-size:.95rem;
}

/* Utilities shared across pages */
.intro{ padding: clamp(2rem, 5vw, 3rem) 0 1rem; }
.intro h1{ margin:0 0 .4rem; font-size:clamp(1.8rem, 4vw, 2.4rem) }
.intro p{ margin:0; color:var(--muted) }

.btn{
  appearance:none; border:1px solid var(--border); background:transparent;
  color:var(--text); padding:.55rem .8rem; border-radius:10px; cursor:pointer;
  text-decoration:none; display:inline-flex; align-items:center; gap:.45rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .02s ease;
}
.btn:hover{ background: color-mix(in oklab, var(--surface) 80%, transparent) }
.btn:active{ transform: translateY(1px) }
.btn.primary{ border-color: color-mix(in oklab, var(--ring) 60%, var(--border)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ring) 30%, transparent) }
.btn.ghost{ opacity:.9 }

/* Focus styles for a11y */
:where(a,button):focus-visible{
  outline:2px solid color-mix(in oklab, var(--ring) 80%, transparent);
  outline-offset:2px; border-radius:8px;
}

/* ===== Home page primitives (still global) ===== */
.hero{
  padding: clamp(3rem, 8vw, 6rem) 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(124,140,255,.12), transparent 60%);
}
.hero__inner{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 900px){ .hero__inner{ grid-template-columns: 1fr; } }

.hero__text h1{
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 6vw, 3rem);
}
.lead{ color: var(--muted); margin: 0 0 1rem; }
.hero__actions{ display:flex; gap:.6rem; flex-wrap:wrap; }

.hero__image .hero__placeholder{
  height: 220px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--muted);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
}

/* Sections */
.section{ padding: clamp(2rem, 5vw, 3rem) 0; }
.section__title{ margin: 0 0 1rem; font-size: clamp(1.4rem, 3vw, 1.8rem); }

/* Simple responsive grid + tiles */
.grid-3{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px){
  .grid-3{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .grid-3{ grid-template-columns: 1fr; }
}
.tile{
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tile h3{ margin: .2rem 0 .35rem; font-size: 1.05rem; }
.tile p{ margin: 0 0 .8rem; color: var(--muted); }

/* ===== Manual theme override =====
   Default: dark from :root, light via prefers-color-scheme
   Manual overrides win because of higher selector specificity.
*/
html[data-theme="light"] {
  --bg:#f6f7fb; --surface:#fff; --text:#0b1220; --muted:#475467;
  --border:#e6e8f0; --ring:#4f46e5; --shadow:0 10px 30px rgba(15,17,21,.08);
}
html[data-theme="dark"] {
  --bg: #0f1115; --surface:#141821; --text:#e8eaed; --muted:#98a2b3;
  --border:#232a36; --ring:#7c8cff; --shadow:0 10px 30px rgba(0,0,0,.35);
}

/* Toggle button styling (compact, matches your design) */
.theme-toggle{
  margin-left: .75rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  display: inline-flex; align-items: center; gap: .45rem;
  cursor: pointer;
}
.theme-toggle:hover{ background: color-mix(in oklab, var(--surface) 80%, transparent) }
.theme-toggle:focus-visible{ outline:2px solid color-mix(in oklab, var(--ring) 80%, transparent); outline-offset:2px }
.theme-toggle__label{ font-size: .95rem; color: var(--muted) }