/* The kit page: dissolve's Dark Grid Neon (the values of @dissolve/ui's tokens), Instrument Sans and Fragment Mono. */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("/fonts/instrument-sans-5.3.0/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("/fonts/instrument-sans-5.3.0/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("/fonts/instrument-sans-5.3.0/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("/fonts/instrument-sans-5.3.0/instrument-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fragment Mono"; font-weight: 400; font-display: swap; src: url("/fonts/fragment-mono-5.3.0/fragment-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #1b1b1f;
  --surface: #202127;
  --elevated: #2a2a32;
  --border: #2e2e32;
  --border-hover: #414146;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --primary: #646cff;
  --text: rgba(255, 255, 255, 0.95);
  --muted: rgba(235, 235, 245, 0.6);
  --subtle: rgba(235, 235, 245, 0.38);
  --paper: #ffffff;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); }
a { color: var(--accent-light); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; border-radius: 4px; }
img, video { display: block; max-width: 100%; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 8px 12px; }

.top { position: sticky; top: 0; z-index: 10; background: rgba(27, 27, 31, 0.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.top__inner, main, .foot { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.top__links { display: flex; gap: 20px; font-size: 14px; }
.top__links a { color: var(--muted); text-decoration: none; }
.top__links a:hover { color: var(--text); }

.intro { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; padding: 64px 0 40px; }
.intro__mark { width: 96px; height: 96px; }
h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.02em; font-weight: 600; margin: 0; }
.lede { max-width: 60ch; color: var(--muted); font-size: 18px; margin: 16px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-hover); border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.button:hover { border-color: var(--accent-light); color: var(--text); }
.button--primary { background: var(--accent); border-color: var(--accent); }
.button--primary:hover { background: #7c4def; border-color: #7c4def; }

.groups { position: sticky; top: 56px; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.groups a { flex: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; text-decoration: none; }
.groups a:hover { color: var(--text); background: var(--surface); }

.state { color: var(--muted); padding: 48px 0; }
.group { padding: 56px 0 8px; }
.group h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.group > p { color: var(--muted); margin: 8px 0 24px; max-width: 64ch; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: start; }
.preview { display: grid; place-items: center; height: 120px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); padding: 16px; overflow: hidden; }
.preview--light { background: var(--paper); border-color: transparent; }
.preview img, .preview video { max-height: 100%; object-fit: contain; }
.preview--wide { height: auto; aspect-ratio: 16 / 10; padding: 0; }
.preview--wide img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { font-size: 16px; font-weight: 600; margin: 0; }
.row .use { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; overflow: hidden; }
.file a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; color: var(--text); text-decoration: none; }
.file a:hover { background: var(--surface); }
.file .meta { color: var(--subtle); font-family: var(--mono); font-size: 12px; }
.file button { border: 0; border-left: 1px solid var(--border); background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 0 10px; cursor: pointer; min-width: 44px; }
.file button:hover { color: var(--text); background: var(--surface); }

.films { display: grid; gap: 32px; }
.film { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.film video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
.film h3 { font-size: 18px; margin: 0; }
.film .use { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }

.swatches { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.swatch { display: grid; grid-template-columns: 56px 140px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.chip { width: 56px; height: 40px; border-radius: 8px; border: 1px solid var(--border-hover); }
.swatch .name { font-weight: 600; }
.swatch .values { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.swatch .use { color: var(--muted); font-size: 14px; }
.swatch button { border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 13px; min-height: 36px; padding: 0 12px; cursor: pointer; }
.swatch button:hover { color: var(--text); border-color: var(--border-hover); }

.specimen { padding: 20px 0; border-bottom: 1px solid var(--border); }
.specimen:first-of-type { border-top: 1px solid var(--border); }
.specimen .sample { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 8px; overflow-wrap: anywhere; }
.specimen .sample--mono { font-family: var(--mono); font-size: clamp(20px, 3vw, 28px); }
.specimen .use { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

.rules { margin: 0; padding: 0 0 0 20px; color: var(--muted); max-width: 72ch; }
.rules li { margin: 0 0 10px; }

.foot { padding-top: 48px; padding-bottom: 48px; margin-top: 64px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; background: var(--elevated); border: 1px solid var(--border-hover); border-radius: 10px; padding: 10px 14px; font-size: 14px; transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast--on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .top__inner, main, .foot { padding: 0 16px; }
  .intro { grid-template-columns: 1fr; gap: 20px; padding-top: 40px; }
  .intro__mark { width: 64px; height: 64px; }
  .row { grid-template-columns: 1fr; gap: 12px; }
  .film { grid-template-columns: 1fr; }
  .swatch { grid-template-columns: 48px 1fr auto; }
  .swatch .use { grid-column: 2 / -1; }
  .chip { width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
