/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --on-brand: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --header-bg: rgba(255, 255, 255, 0.85);
  --radius: 16px;
  --max-width: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --bg-alt: #111833;
    --surface: #141c36;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #243052;
    --brand: #818cf8;
    --brand-hover: #a5b4fc;
    --on-brand: #0b1020;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --header-bg: rgba(11, 16, 32, 0.85);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-alt: #111833;
  --surface: #141c36;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #243052;
  --brand: #818cf8;
  --brand-hover: #a5b4fc;
  --on-brand: #0b1020;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(11, 16, 32, 0.85);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--brand);
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 16px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.75em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--brand);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 800;
}

.nav-menu {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.nav-menu a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
}

.theme-toggle,
.nav-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icon-moon { display: inline; }
.icon-sun { display: none; }

:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: inline; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: inline; }
}

@media (max-width: 720px) {
  .nav {
    order: 2;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
  }

  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    padding: 12px 0;
    font-size: 1.05rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 80px;
  background:
    radial-gradient(60% 60% at 15% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    radial-gradient(50% 50% at 90% 20%, color-mix(in srgb, #7c3aed 14%, transparent), transparent 70%);
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  max-width: 16ch;
}

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Sections ---------- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.section-intro {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* ---------- Products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  --accent: var(--brand);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  margin-bottom: 18px;
}

.product-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-card h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.product-tagline {
  color: var(--accent);
  font-weight: 600;
}

:root[data-theme="dark"] .product-tagline,
:root[data-theme="dark"] .product-icon {
  color: color-mix(in srgb, var(--accent) 60%, white);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-tagline,
  :root:not([data-theme="light"]) .product-icon {
    color: color-mix(in srgb, var(--accent) 60%, white);
  }
}

.product-desc {
  color: var(--text-muted);
}

.product-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.product-features li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
}

.product-features li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.product-audience {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-link {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  margin-top: 8px;
}

.product-link:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
}

.product-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.product-legal a {
  color: var(--text-muted);
}

.product-legal a:hover {
  color: var(--text);
}

.noscript-list {
  font-size: 1.1rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-item h3 {
  font-size: 1.2rem;
}

.about-item p {
  color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
}

.contact .section-intro {
  margin-bottom: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.footer-inner p {
  margin: 0;
}

.footer-links,
.footer-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 6px;
}

.footer-links .footer-product {
  color: var(--text);
  font-weight: 700;
}

.copyright {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .product-card { transition: none; }
  .btn:hover, .product-card:hover { transform: none; }
}
