/* LayoutKit docs — site skin. Layout is handled by layoutkit.css (<lk-*> tags);
   this file is only color, type, borders, and component surfaces. No framework. */

:root {
  --bg: #0a0a0b;
  --fg: #e4e4e7;
  --muted: #71717a;
  --border: #1e1e22;
  --surface: #111113;
  --surface-2: #16161a;
  --accent: #22d3ee;
  --purple: #a78bfa;
  --green: #86efac;
  --yellow: #fbbf24;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(34, 211, 238, 0.2); color: #f4f4f5; }

/* Skip link — hidden until keyboard-focused (accessibility / hypermedia hygiene) */
.skip {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--bg);
  padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px;
  transition: top 0.15s;
}
.skip:focus { top: 8px; }
:target { scroll-margin-top: 64px; }

/* Long tokens in code samples wrap instead of forcing horizontal scroll. */
pre, code { overflow-wrap: anywhere; }

/* ---- Layout helpers (the few non-lk bits) ---- */
.container { width: 100%; max-width: 880px; margin-inline: auto; padding-inline: 24px; }
.sans { font-family: var(--sans); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.purple { color: var(--purple); }
.green { color: var(--green); }
.center-text { text-align: center; }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  padding: 12px 16px;
}
@media (min-width: 640px) { .nav { padding: 12px 24px; } }
.brand { font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: var(--bg); font-weight: 800; font-size: 14px;
}
.brand-name { display: none; }
@media (min-width: 640px) { .brand-name { display: inline; } }
.badge {
  border-radius: 4px; background: var(--border); color: var(--muted);
  padding: 2px 6px; font-size: 10px; font-weight: 600;
}
.navlinks { overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlink {
  flex-shrink: 0; border-radius: 6px; padding: 6px 10px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap; transition: color 0.15s, background 0.15s;
}
@media (min-width: 640px) { .navlink { padding: 6px 14px; } }
.navlink:hover { color: var(--fg); }
.navlink[aria-current="page"] { background: var(--border); color: var(--accent); }

/* ---- Type ---- */
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; font-weight: 800; }
.hero-title {
  font-size: 34px; line-height: 1.08;
  background: linear-gradient(135deg, #f4f4f5, #a1a1aa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (min-width: 640px) { .hero-title { font-size: 56px; line-height: 1.05; } }
.h2 { font-size: 24px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 17px; color: var(--muted); max-width: 65ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; padding: 10px 22px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--border); color: var(--fg); cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s; background: transparent;
}
.btn:hover { border-color: #3f3f46; }
.btn-primary {
  border: none; color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--purple));
}
.btn-primary:hover { opacity: 0.9; }

/* ---- Surfaces / cards ---- */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 24px; }
.pill {
  display: inline-block; border-radius: 999px; padding: 4px 12px;
  font-size: 11px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.pill-green { border-color: color-mix(in srgb, var(--green) 30%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green); }
.pill-purple { border-color: color-mix(in srgb, var(--purple) 30%, transparent); background: color-mix(in srgb, var(--purple) 10%, transparent); color: var(--purple); }

/* ---- Small external helpers (brand glue LayoutKit doesn't cover; kept external so the site stays CSP-clean under style-src 'self') ---- */
.hero { padding-block: 56px 40px; }
.section { margin-bottom: 64px; }
.anchor { scroll-margin-top: 80px; }
.card-purple { border-color: color-mix(in srgb, var(--purple) 30%, transparent); background: color-mix(in srgb, var(--purple) 5%, transparent); }
.card-green { border-color: color-mix(in srgb, var(--green) 30%, transparent); background: color-mix(in srgb, var(--green) 5%, transparent); }

/* ---- Code ---- */
.code {
  border: 1px solid var(--border); border-radius: 10px; background: #08080a;
  padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.7;
}
.code pre { margin: 0; white-space: pre-wrap; }
.code-inline { background: #27272a; border-radius: 4px; padding: 1px 6px; font-size: 0.9em; }
.tok-tag { color: var(--accent); }
.tok-attr { color: var(--purple); }
.tok-str { color: var(--green); }
.tok-com { color: var(--muted); }

/* ---- Tables ---- */
.table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); }
td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td code { color: var(--accent); }

/* ---- Playground ---- */
.split { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 860px) { .split { flex-direction: row; } .split > * { flex: 1; min-width: 0; } }
.editor { border: 1px solid var(--border); border-radius: 10px; background: #08080a; overflow: hidden; }
.panel-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); }
/* Editor + preview share one fixed stage height so neither column can balloon */
textarea.pg { display: block; width: 100%; height: 300px; resize: vertical; background: #08080a; color: var(--accent); font-family: var(--mono); font-size: 13px; line-height: 1.7; border: 0; padding: 16px; outline: none; }
.preview-frame { height: 300px; padding: 16px; overflow: auto; }
/* Inside the preview, "full-height" fills the stage, not the real viewport */
#pg-preview { height: 100%; }
#pg-preview [full-height] { min-height: 100% !important; }
.pg-css { margin: 0; padding: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }

/* Preset buttons — active state must be visible in dark mode */
.preset { flex-shrink: 0; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; }
.preset:hover { color: var(--fg); border-color: #3f3f46; }
.preset[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }

/* ---- Demo frames (docs/tutorial examples) ---- */
.demo { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; background: var(--surface-2); }
.chip { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 6px; padding: 8px 12px; font-size: 12px; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 32px 0; }
