/* Minimal, modern, responsive base — no external libs */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root {
  color-scheme: light dark;
  --bg: #0b1220;
  --panel: #0f172a;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --brand: #0ea5e9;
  --brand-2: #22d3ee;
  --ring: #7dd3fc55;

  /* Fluid type scale */
  --step--1: clamp(0.80rem, 0.24vw + 0.74rem, 0.92rem);
  --step-0:  clamp(1.00rem, 0.44vw + 0.90rem, 1.10rem);
  --step-1:  clamp(1.25rem, 0.80vw + 1.05rem, 1.40rem);
  --step-2:  clamp(1.56rem, 1.20vw + 1.15rem, 1.80rem);
  --step-3:  clamp(1.95rem, 1.80vw + 1.30rem, 2.40rem);

  /* Fluid space scale */
  --space-1: clamp(0.25rem, 0.25vw, 0.5rem);
  --space-2: clamp(0.5rem, 0.5vw, 1rem);
  --space-3: clamp(0.75rem, 0.75vw, 1.25rem);
  --space-4: clamp(1rem, 1.5vw, 2rem);
  --space-5: clamp(1.25rem, 2vw, 2.5rem);
  --space-6: clamp(1.5rem, 2.5vw, 3rem);

  --radius: 1.25rem;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --fg: #0f172a;
    --muted: #334155;
    --ring: #0ea5e933;
  }
}
.wrapper { width: min(1100px, 92vw); margin: 0 auto; padding: var(--space-5) var(--space-2); }

/* Header & nav */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  background: linear-gradient(180deg, rgba(2,6,23,.9), rgba(2,6,23,.6));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(148,163,184,.15);
}
.logo { color: var(--fg); font-weight: 700; text-decoration: none; letter-spacing: .3px; }
.site-nav { display: flex; gap: var(--space-2); margin-left: auto; }
.site-nav a {
  color: var(--muted); text-decoration: none; padding: .5rem .75rem; border-radius: .65rem;
}
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--fg); background: rgba(14,165,233,.15); }

/* Mobile nav toggle */
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--fg); margin: 5px 0; border-radius: 2px; }

@media (max-width: 54rem) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; right: var(--space-2); top: 64px; flex-direction: column; background: var(--panel);
              border: 1px solid rgba(148,163,184,.15); border-radius: var(--radius); padding: .5rem; box-shadow: var(--shadow);
              display: none; }
  .site-nav.open { display: flex; }
}

.page-title { font-size: var(--step-3); margin: 0 0 var(--space-2); }
.lead { color: var(--muted); font-size: var(--step-1); margin-bottom: var(--space-5); }

/* Cards & grids */
.card {
  background: var(--panel);
  border: 1px solid rgba(148,163,184,.12);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 48rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.demo-grid .card { text-align: center; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1rem; border-radius: .9rem; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #001018; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(14,165,233,.6);
}
.btn:hover { filter: brightness(1.05); }
.btn:focus { outline: 2px solid transparent; box-shadow: 0 0 0 4px var(--ring); }

/* Forms */
.form-demo { display: grid; gap: .8rem; max-width: 40rem; }
input, textarea, select {
  width: 100%; padding: .7rem .85rem; border-radius: .7rem;
  border: 1px solid rgba(148,163,184,.3); background: var(--panel); color: var(--fg);
}
input:focus, textarea:focus, select:focus { outline: 2px solid transparent; box-shadow: 0 0 0 4px var(--ring); }

/* Code blocks */
pre { background: #0a0f1d; color: #e2e8f0; padding: var(--space-4); border-radius: var(--radius); overflow: auto; border: 1px solid rgba(148,163,184,.12); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* Media */
.media { overflow: hidden; }
.media img { display: block; width: 100%; height: auto; border-radius: .8rem; }

/* Footer */
.site-footer { color: var(--muted); padding-top: 0; padding-bottom: var(--space-6); }

/* Accessibility */
.skip-link {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; display: inline-block; background: var(--panel); padding: .5rem .75rem; border-radius: .5rem; }
