/* ============================================================
   css-spec — landing page
   Aesthetic: the page is its own spec sheet. Redline pink,
   blueprint grid, full mono, dotted hairlines everywhere.
   ============================================================ */

:root {
  --accent: #e5377a;
  --accent-soft: rgba(229, 55, 122, 0.1);
  --bg: #fbfbf9;
  --fg: #171717;
  --muted: #6a6a6a;
  --faint: #9b9b96;
  --hairline: rgba(23, 23, 23, 0.16);
  --hairline-soft: rgba(23, 23, 23, 0.08);
  --panel: #ffffff;
  --panel-border: rgba(0, 0, 0, 0.12);
  --row: rgba(0, 0, 0, 0.04);
  --code-bg: #f2f2ee;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --grid-line: rgba(23, 23, 23, 0.045);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Resolved by the css-spec overlay's own font token (--ds-mono falls back
     through this) — the tool renders in its native Geist Mono, independent of
     the page font above. */
  --font-geist-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* demo-card tokens (fun to inspect) */
  --card-radius: 10px;
  --card-pad: 20px;
  --btn-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff5fa2;
    --accent-soft: rgba(255, 95, 162, 0.14);
    --bg: #101012;
    --fg: #ededed;
    --muted: #9a9a9a;
    --faint: #6e6e72;
    --hairline: rgba(237, 237, 237, 0.2);
    --hairline-soft: rgba(237, 237, 237, 0.09);
    --panel: #17171a;
    --panel-border: rgba(255, 255, 255, 0.14);
    --row: rgba(255, 255, 255, 0.06);
    --code-bg: #1c1c20;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
    --grid-line: rgba(237, 237, 237, 0.05);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  transition: color 150ms ease;
}
a:hover { color: var(--accent); }

code, kbd, pre { font-family: var(--mono); }

kbd {
  font-size: 0.85em;
  background: var(--row);
  border: 1px solid var(--panel-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- header ---------------- */

.top {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: baseline; gap: 8px; }

.brand-name { font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }

.ver {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 6px;
}

.top-nav { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--accent); }

.inspect-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 100ms ease;
}
.inspect-toggle:hover { border-color: var(--accent); }
.inspect-toggle:active { transform: scale(0.97); }
.inspect-toggle kbd { font-size: 10px; }
.inspect-toggle .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  transition: background 120ms ease, box-shadow 120ms ease;
}
.inspect-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.inspect-toggle[aria-pressed="true"] .dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
/* Compositor-only pulse: fade the glowing dot rather than re-painting its
   box-shadow every frame. */
@keyframes pulse {
  50% { opacity: 0.55; }
}

/* ---------------- hero ---------------- */

.hero { padding: 72px 0 24px; text-align: center; }

/* Staggered entrance: every hero child rises in, 60ms apart. */
.hero > * { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero > :nth-child(2) { animation-delay: 0.06s; }
.hero > :nth-child(3) { animation-delay: 0.12s; }
.hero > :nth-child(4) { animation-delay: 0.18s; }
.hero > :nth-child(5) { animation-delay: 0.24s; }

.hero-measure {
  position: relative;
  display: inline-block;
  margin: 0 0 30px;
}

.hero-title {
  margin: 0;
  font-size: clamp(52px, 11vw, 92px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.04;
  padding: 10px 18px;
  border: 1px dotted var(--accent);
  background: var(--accent-soft);
}

/* redline measurement annotations around the h1 */
/* Measurement annotations keep the spec-sheet mono, like the tool's own. */
.redline {
  position: absolute;
  pointer-events: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}
.redline i { font-style: normal; background: var(--bg); padding: 0 5px; }

.redline-top {
  left: 0;
  right: 0;
  top: -16px;
  border-top: 1px solid var(--accent);
  display: flex;
  justify-content: center;
}
.redline-top::before,
.redline-top::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 8px;
  background: var(--accent);
}
.redline-top::before { left: 0; }
.redline-top::after { right: 0; }
.redline-top i { transform: translateY(-58%); }

.redline-side {
  top: 0;
  bottom: 0;
  right: -16px;
  border-right: 1px solid var(--accent);
  display: flex;
  align-items: center;
}
.redline-side::before,
.redline-side::after {
  content: "";
  position: absolute;
  right: -4px;
  height: 1px;
  width: 8px;
  background: var(--accent);
}
.redline-side::before { top: 0; }
.redline-side::after { bottom: 0; }
.redline-side i {
  transform: translateX(52%) rotate(90deg);
  transform-origin: center;
  white-space: nowrap;
}

.tagline {
  font-size: clamp(19px, 3.4vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin: 0 0 18px;
}

.sub {
  max-width: 60ch;
  color: var(--muted);
  margin: 0 auto 36px;
}

.install-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 8px 10px 14px;
  font-size: 13px;
}
.install .ps1 { color: var(--accent); user-select: none; }
.install code { user-select: all; }

.copy-btn {
  font: inherit;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  transition:
    color 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    transform 100ms ease;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn:active { transform: scale(0.95); }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

.try-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.try-arrow { color: var(--accent); margin-right: 4px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- sections ---------------- */

section, .devonly { padding: 64px 0 8px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px dotted var(--hairline);
  padding-top: 14px;
  margin-bottom: 30px;
}
.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.section-head h2::before { content: "§ "; color: var(--accent); }
.section-head p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------------- playground ---------------- */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 56px 24px 44px;
  border: 1px dotted var(--hairline);
  background:
    radial-gradient(circle at center, var(--accent-soft), transparent 70%);
}

.stage-caption {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

.spec-card {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow);
}

.spec-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.spec-card-head > div { flex: 1; min-width: 0; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), #ffb347, var(--accent));
  flex-shrink: 0;
}

.spec-card-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.spec-card-sub { margin: 0; font-size: 11px; color: var(--muted); }

.badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
}

.spec-card-body { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.spec-card-body code { color: var(--fg); background: var(--row); border-radius: 3px; padding: 0 4px; }

.spec-card-foot { display: flex; gap: 10px; }

.btn {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--btn-radius);
  padding: 8px 16px;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    transform 100ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  border-color: color-mix(in srgb, var(--accent) 88%, white);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- features ---------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border-top: 1px dotted var(--hairline-soft);
  border-left: 1px dotted var(--hairline-soft);
}

.feature {
  padding: 22px 22px 26px;
  border-right: 1px dotted var(--hairline-soft);
  border-bottom: 1px dotted var(--hairline-soft);
  transition: background 160ms ease;
}
.feature:hover { background: var(--accent-soft); }

.feature-no {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.feature h3 {
  margin: 8px 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature p { margin: 0; font-size: 12.5px; color: var(--muted); }
.feature code { font-size: 11.5px; background: var(--row); border-radius: 3px; padding: 0 4px; color: var(--fg); }

/* ---------------- quick start ---------------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 11px;
  color: var(--accent);
  border: 1px dotted var(--accent);
  border-radius: 4px;
  padding: 2px 5px;
}

.step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

pre {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.c-cmd { color: var(--accent); font-weight: 500; }
.c-kw { color: var(--accent); }
.c-str { color: #2f8a5b; }
@media (prefers-color-scheme: dark) { .c-str { color: #7bd0a0; } }
.c-fn { font-weight: 600; }
.c-comment { color: var(--faint); }
.c-key {
  background: var(--row);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 0 5px;
}

.manual { margin-top: 34px; }
.manual summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  user-select: none;
}
.manual summary:hover { color: var(--accent); }
.manual pre { margin-top: 14px; }
/* <details> can't animate open natively — rising the revealed content in
   reads as an open animation without any JS. */
.manual[open] > *:not(summary) {
  animation: rise 250ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}
.manual-note { font-size: 12px; color: var(--muted); max-width: 62ch; }
.manual-note code { background: var(--row); border-radius: 3px; padding: 0 4px; }

/* ---------------- dev-only callout ---------------- */

.devonly {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  margin-top: 40px;
  padding: 34px 30px;
  border: 1px dotted var(--accent);
  background: var(--accent-soft);
}

.devonly-mark {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  flex-shrink: 0;
}

.devonly h2 { margin: 0 0 8px; font-size: 16px; letter-spacing: -0.01em; }
.devonly p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 62ch; }
.devonly code { background: var(--row); border-radius: 3px; padding: 0 4px; color: var(--fg); font-size: 11.5px; }

/* ---------------- footer ---------------- */

.foot {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.foot-links { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------------- responsive ---------------- */

@media (max-width: 560px) {
  .top { padding: 16px; gap: 10px; }
  .top-nav { gap: 12px; }
  .inspect-toggle kbd { display: none; }
  .hero { padding-top: 48px; }
  .redline-side { display: none; }
  .devonly { flex-direction: column; gap: 14px; }
  .br-sm { display: none; }
}

/* The overlay is hover-driven — pointless on touch-only devices. */
@media (hover: none) and (pointer: coarse) {
  .inspect-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none; }
  .inspect-toggle[aria-pressed="true"] .dot { animation: none; }
  .manual[open] > *:not(summary) { animation: none; }
  a, .copy-btn, .inspect-toggle, .btn, .feature { transition: none; }
}
