/* ============================================================
   Medulae — Design System (AI-native gradient, dark-first)
   ============================================================ */

:root {
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --grad: linear-gradient(135deg, var(--violet), var(--cyan));
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: 0.25s ease;
  --maxw: 1160px;
}

/* Dark theme (default) */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090f;
  --bg-soft: #0c1019;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f7;
  --text-muted: #9aa3b5;
  --heading: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --glow: 0 0 80px rgba(124, 58, 237, 0.25);
}

/* Light theme */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fc;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #1e2637;
  --text-muted: #5b6478;
  --heading: #0b1220;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
  --glow: 0 0 80px rgba(124, 58, 237, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* Ambient background glows */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}
body::before { width: 600px; height: 600px; top: -250px; right: -150px; background: rgba(124, 58, 237, 0.18); }
body::after  { width: 500px; height: 500px; bottom: -200px; left: -150px; background: rgba(6, 182, 212, 0.12); }

h1, h2, h3 { color: var(--heading); line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--text-muted); }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--heading); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
}

.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.92rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--heading); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
  font-size: 0.8rem; font-weight: 600;
}
.lang-switch button {
  background: transparent; border: none; color: var(--text-muted);
  padding: 6px 12px; cursor: pointer; font-family: inherit;
}
.lang-switch button.active { background: var(--grad); color: #fff; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: border-color var(--transition);
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; font-family: inherit;
  cursor: pointer; border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35); }
.btn-ghost { background: var(--surface); color: var(--heading); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-sm { padding: 9px 20px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 80px; text-align: center; position: relative; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 26px;
}
.hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.hero h1 { max-width: 820px; margin: 0 auto 20px; }
.hero h1 .grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .subtitle { max-width: 640px; margin: 0 auto 36px; font-size: 1.15rem; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 14px; }
.section-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-bottom: 12px;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  backdrop-filter: blur(10px);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(6,182,212,.18));
  border: 1px solid var(--border);
}
.card .icon svg { width: 24px; height: 24px; stroke: var(--violet); }
[data-theme="light"] .card .icon svg { stroke: #6d28d9; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; }
.card .card-link { display: inline-block; margin-top: 16px; font-weight: 600; font-size: 0.9rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; }

/* Value / stat band */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stat { text-align: center; padding: 28px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); }
.stat .num { font-size: 2.2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; }
.stat .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Process steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-size: 2rem; font-weight: 800; opacity: 0.9;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  display: block; margin-bottom: 10px;
}

/* Page hero for subpages */
.page-hero { padding: 80px 0 56px; border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 80% at 50% -20%, rgba(124,58,237,0.15), transparent); }
.page-hero .breadcrumb { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 18px; }
.page-hero .breadcrumb a:hover { color: var(--heading); }
.page-hero h1 { margin-bottom: 16px; }
.page-hero .lead { max-width: 720px; font-size: 1.12rem; }

/* Offerings list */
.offer { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.offer:last-child { border-bottom: none; }
.offer .check {
  flex: none; width: 26px; height: 26px; border-radius: 8px; margin-top: 3px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(6,182,212,.2));
  border: 1px solid var(--border);
}
.offer .check svg { width: 14px; height: 14px; stroke: var(--violet); }
[data-theme="light"] .offer .check svg { stroke: #6d28d9; }
.offer h3 { margin-bottom: 6px; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 0 24px; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; color: var(--heading);
  list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--text-muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; }

/* CTA band */
.cta-band {
  border-radius: 24px; padding: 64px 40px; text-align: center;
  background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(6,182,212,.18));
  border: 1px solid var(--border-strong);
  box-shadow: var(--glow);
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band p { max-width: 560px; margin: 0 auto 30px; color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: 84px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h4 { color: var(--heading); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer a:hover { color: var(--heading); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-muted); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps, .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps, .stats { grid-template-columns: 1fr; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 10px 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
