:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #121826;
  --muted: #5b6475;
  --line: #e3e6ee;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --hero-a: #0b1a3a;
  --hero-b: #13306e;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #131a2e;
    --text: #e8ecf5;
    --muted: #9aa4ba;
    --line: #232c45;
    --accent: #4f8cff;
    --accent-ink: #06122b;
    --hero-a: #060c1c;
    --hero-b: #0f2350;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #22d3ee);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero {
  background: radial-gradient(1200px 400px at 70% -10%, #2563eb55, transparent), linear-gradient(160deg, var(--hero-a), var(--hero-b));
  color: #eef2ff;
  padding: 72px 0 80px;
}
.hero h1 { font-size: clamp(32px, 6vw, 54px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p { font-size: clamp(17px, 2.2vw, 20px); color: #c7d2fe; max-width: 640px; margin: 0; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: #93c5fd; margin-bottom: 12px; font-weight: 600; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero-art { justify-self: center; }
.hero-art img { width: min(280px, 70vw); filter: drop-shadow(0 20px 40px #0008); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 15px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
}
.hero .btn { background: #fff; color: #0b1a3a; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; opacity: 0.9; }
.btn:hover { filter: brightness(1.08); }

/* Sections */
section { padding: 64px 0; }
section h2 { font-size: clamp(24px, 3.5vw, 32px); margin: 0 0 8px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 32px; max-width: 640px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.card .more { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 15px; }
.card-icon { width: 56px; height: 56px; border-radius: 12px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); width: fit-content; }
.card.placeholder { border-style: dashed; background: transparent; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 720px; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 56px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 15px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; color: var(--muted); font-size: 15px; max-width: 720px; }

table.states { border-collapse: collapse; width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.states td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.states tr:last-child td { border-bottom: 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 8px; }

/* Busy Light ring demo */
.ring {
  --c: #22c55e;
  width: min(240px, 60vw); aspect-ratio: 1; border-radius: 50%; position: relative;
  background: radial-gradient(circle, #0000 52%, #111827 53%, #111827 70%, #0000 71%);
  box-shadow: 0 0 60px 6px color-mix(in srgb, var(--c) 55%, transparent);
  transition: box-shadow .6s ease;
}
.ring i {
  position: absolute; left: 50%; top: 50%; width: 9%; aspect-ratio: 1; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 14px 3px var(--c);
  transform: translate(-50%, -50%) rotate(calc(var(--n) * 30deg)) translateY(-310%);
  transition: background .6s ease, box-shadow .6s ease;
}
.ring-label { text-align: center; margin-top: 18px; color: #c7d2fe; font-weight: 600; min-height: 1.6em; }
@media (prefers-reduced-motion: no-preference) {
  .ring.pulse { animation: pulse 2.2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .45; } }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

@media (max-width: 760px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { order: -1; }
  .nav { gap: 12px; }
  .nav a { font-size: 14px; }
  section { padding: 48px 0; }
}

.nav a, .brand { white-space: nowrap; }
@media (max-width: 480px) {
  .brand-text { display: none; }
}
