/* ShaderMate site: tokens, base, chrome (nav, footer, search), shared components.
   Page styles live in landing.css, docs.css and gallery.css. */

@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* surfaces */
  --ink: #05050a;
  --panel: #0b0a14;
  --raised: #12101f;
  --raised-2: #1a1729;
  --glass: rgba(12, 10, 26, .58);
  --glass-strong: rgba(12, 10, 26, .82);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  /* text */
  --text: #cfcbe6;
  --strong: #f4f2ff;
  --dim: #9a95b8;
  --faint: #67628a;

  /* accents (the shaders bring the rest of the colour) */
  --lime: #c6ff3d;
  --cyan: #22d3ee;
  --violet: #7c5cff;
  --pink: #ff4fd8;
  --amber: #ffd166;
  --aqua: var(--cyan);
  --link: #a99bff;
  --focus: var(--lime);
  --grad: linear-gradient(100deg, var(--lime), var(--cyan) 55%, var(--pink));

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1240px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* names the example pages and ShaderMate's own UI themes already use */
  --bg: var(--ink); --surface: var(--panel); --surface2: var(--raised-2);
  --border: var(--line); --border-strong: var(--line-2);
  --text-strong: var(--strong); --text-dim: var(--dim); --label: var(--faint);
  --accent: var(--violet); --accent-hover: #6a49f0;
  --hover: rgba(255, 255, 255, .06); --active: rgba(255, 255, 255, .1);
  --ui-font: var(--font-ui); --mono-font: var(--font-mono);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); background: var(--ink); }
body {
  margin: 0; min-height: 100vh;
  background: var(--ink); color: var(--text);
  font: 400 16px/1.6 var(--font-ui);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code, kbd, pre, samp { font-family: var(--font-mono); }
::selection { background: rgba(198, 255, 61, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: 99px; background: var(--lime); color: var(--ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

kbd {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: rgba(255, 255, 255, .05); color: var(--dim); font: 500 11px/1 var(--font-mono);
}

/* gradient text, used for the second line of display headings */
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--strong); font: 500 14.5px/1 var(--font-ui); letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { border-color: rgba(255, 255, 255, .3); background: rgba(30, 26, 52, .7); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--lime); border-color: transparent; color: var(--ink); font-weight: 600; }
.btn-primary:hover { background: #d4ff6b; border-color: transparent; box-shadow: 0 0 32px -6px rgba(198, 255, 61, .6); }
.btn-secondary, .btn-quiet { }
.btn-ghost { background: none; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--text); }
.btn-ghost:hover { background: var(--hover); color: var(--strong); }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-accent { background: var(--violet); border-color: transparent; color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }

/* glass pill (labels, chips, small links) */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  color: var(--strong); font: 500 12.5px/1 var(--font-mono); text-decoration: none; white-space: nowrap;
  transition: background-color .2s, border-color .2s;
}
a.pill:hover, button.pill:hover { background: rgba(30, 26, 52, .78); border-color: rgba(255, 255, 255, .28); }
.pill .mark { width: 15px; height: 15px; border-radius: 5px; box-shadow: 0 0 10px rgba(124, 92, 255, .5); }
.pill-static { color: var(--dim); pointer-events: none; }
.pill-lime { background: var(--lime); border-color: transparent; color: var(--ink); font-weight: 600; }
.pill-lime:hover { background: #d4ff6b !important; }

/* the "01 · Section" kicker */
.kicker { display: flex; align-items: center; gap: 12px; color: var(--lime); font: 500 12px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; }
.kicker::before { content: ""; width: 30px; height: 1px; background: currentColor; }

/* ── Announcement bar ──────────────────────────────────────────── */
.announce {
  position: relative; z-index: 61;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 36px; padding: 8px 16px;
  background: rgba(198, 255, 61, .06); border-bottom: 1px solid rgba(198, 255, 61, .14);
  color: var(--dim); font: 400 13px/1.35 var(--font-ui); text-align: center; text-decoration: none;
  transition: color .15s, background-color .15s;
}
.announce strong { color: var(--lime); font-weight: 600; }
.announce:hover { color: var(--text); background: rgba(198, 255, 61, .09); }
.announce-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ── Nav ───────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s, -webkit-backdrop-filter .25s, backdrop-filter .25s;
}
.nav-overlay { position: fixed; left: 0; right: 0; }
.nav.is-solid, .nav:not(.nav-overlay) {
  background: rgba(5, 5, 10, .72);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 10px; height: var(--nav-h); width: min(1400px, 100% - 40px); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: 14px; color: var(--strong); font: 700 19px/1 var(--font-display); letter-spacing: -.03em; text-decoration: none; }
.brand .mark { flex: none; }
.brand-ver { padding: 4px 7px; border-radius: 99px; background: var(--lime); color: var(--ink); font: 600 11px/1 var(--font-mono); letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: rgba(12, 10, 26, .42); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav-links a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 99px; color: var(--dim); font-size: 14px; font-weight: 500; text-decoration: none; transition: color .15s, background-color .15s; }
.nav-links a:hover { color: var(--strong); background: var(--hover); }
.nav-links a[aria-current] { color: var(--ink); background: var(--strong); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px; width: 190px; height: 38px; padding: 0 8px 0 14px;
  border: 1px solid var(--line-2); border-radius: 99px; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--dim); font-size: 13.5px; cursor: pointer; text-align: left;
  transition: border-color .15s, background-color .15s, color .15s;
}
.search-btn:hover { border-color: rgba(255, 255, 255, .28); color: var(--text); }
.search-btn .search-label { flex: 1; white-space: nowrap; }
.search-btn kbd { white-space: nowrap; }
.npm-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--dim); font: 600 12.5px/1 var(--font-mono); text-decoration: none; transition: color .15s, border-color .15s; }
.npm-btn:hover { color: var(--strong); border-color: rgba(255, 255, 255, .28); }
.npm-btn i { width: 9px; height: 9px; border-radius: 2px; background: #cb3837; }
/* brand mark (same as the favicon) */
.mark { display: inline-block; flex: none; width: 24px; height: 24px; border-radius: 7px; background: conic-gradient(from 200deg, var(--violet), var(--cyan), var(--lime), var(--pink), var(--violet)); box-shadow: 0 0 20px rgba(124, 92, 255, .55); animation: mark-hue 6s linear infinite; }
@keyframes mark-hue { to { filter: hue-rotate(360deg); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--dim); cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--strong); border-color: rgba(255, 255, 255, .28); }
.nav-gh { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 99px; background: var(--strong); color: var(--ink); font: 600 13.5px/1 var(--font-ui); text-decoration: none; transition: background-color .15s, box-shadow .15s; }
.nav-gh:hover { background: #fff; box-shadow: 0 0 24px -6px rgba(255, 255, 255, .5); }
.nav-gh svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.ver { display: inline-flex; align-items: center; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--glass); color: var(--dim); font: 500 12px/1 var(--font-mono); text-decoration: none; transition: color .15s, border-color .15s; }
.ver:hover { color: var(--strong); border-color: rgba(255, 255, 255, .28); }

.mobile-menu { display: none; flex-direction: column; padding: 8px 20px 24px; background: rgba(5, 5, 10, .96); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.mobile-menu a { padding: 16px 4px; border-bottom: 1px solid var(--line); color: var(--strong); font: 600 24px/1.2 var(--font-display); letter-spacing: -.03em; text-decoration: none; }
.mobile-menu a:last-child { border-bottom: 0; }

@media (max-width: 1080px) { .ver, .search-label, .search-btn kbd { display: none; } .search-btn { width: 38px; padding: 0; justify-content: center; } }
@media (max-width: 900px) {
  .nav-links, .nav-gh span { display: none; }
  .nav-gh { width: 38px; padding: 0; justify-content: center; }
  .menu-btn { display: inline-flex; }
  .mobile-menu:not([hidden]) { display: flex; }
}
@media (max-width: 480px) { .npm-btn { display: none; } .brand { margin-right: 4px; } }

/* ── Search palette ────────────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(3, 3, 8, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.palette-box { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 20px; background: var(--glass-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--dim); }
.palette-input input { flex: 1; height: 58px; border: 0; outline: 0; background: none; color: var(--strong); font-size: 17px; }
.palette-input input::placeholder { color: var(--faint); }
.palette-list { overflow: auto; padding: 8px; }
.palette-group { padding: 10px 10px 4px; color: var(--lime); font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.palette-item { display: block; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; }
.palette-item .t { display: flex; align-items: baseline; gap: 8px; color: var(--strong); font-weight: 600; font-size: 14.5px; }
.palette-item .p { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.palette-item .x { display: block; margin-top: 2px; color: var(--dim); font-size: 13px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item[aria-selected="true"] { background: rgba(198, 255, 61, .1); box-shadow: inset 0 0 0 1px rgba(198, 255, 61, .25); }
.palette-item mark { background: none; color: var(--lime); }
.palette-empty { padding: 28px 16px; color: var(--dim); text-align: center; font-size: 14px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Footer ────────────────────────────────────────────────────── */
.footer { position: relative; overflow: hidden; border-top: 1px solid var(--line); background: var(--ink); }
.footer::before { content: ""; position: absolute; left: 50%; top: -260px; width: 900px; height: 420px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(124, 92, 255, .22), transparent); pointer-events: none; }
.footer-cta { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; width: min(var(--maxw), 100% - 48px); margin-inline: auto; padding: 64px 0 52px; border-bottom: 1px solid var(--line); }
.footer-cta h2 { color: var(--strong); font: 700 clamp(30px, 4vw, 52px)/.95 var(--font-display); letter-spacing: -.045em; }
.footer-cta .row { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-inner { position: relative; display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; width: min(var(--maxw), 100% - 48px); margin-inline: auto; padding: 52px 0 40px; }
.footer-brand .brand { margin: 0 0 14px; }
.footer-brand p { max-width: 30ch; color: var(--dim); font-size: 14.5px; }
.footer-brand .footer-note { margin-top: 10px; color: var(--faint); font-size: 13px; }
.footer-col h2 { margin-bottom: 14px; color: var(--lime); font: 500 11px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.footer-col li { margin: 9px 0; }
.footer-col a { color: var(--dim); font-size: 14.5px; text-decoration: none; transition: color .15s; }
.footer-col a:hover { color: var(--strong); }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; width: min(var(--maxw), 100% - 48px); margin-inline: auto; padding: 20px 0 36px; border-top: 1px solid var(--line); color: var(--faint); font: 400 12.5px/1.5 var(--font-mono); }
.footer-bottom a { color: var(--dim); text-decoration: none; }
.footer-bottom a:hover { color: var(--strong); }
@media (max-width: 900px) { .footer-inner { grid-template-columns: repeat(2, 1fr); } .footer-brand { grid-column: 1 / -1; } }

/* ── Example pages: breadcrumb pills, hint, toolbar, form controls ─ */
.pill-bar { position: fixed; left: 16px; right: 16px; top: 16px; z-index: 20; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.pill-bar .pill { pointer-events: auto; }
.pill-spacer { flex: 1; }
@media (max-width: 640px) { .pill-static { display: none; } }

.hint {
  position: fixed; left: 16px; bottom: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px); padding: 10px 15px; pointer-events: none;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--dim); font: 400 12.5px/1.3 var(--font-mono);
}
.hint b, .hint strong { color: var(--lime); font-weight: 500; }
.hint kbd { pointer-events: none; }
.hint a, .hint button { pointer-events: auto; }

.toolbar { display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.toolbar .title { margin-right: auto; display: inline-flex; align-items: center; gap: 10px; color: var(--strong); font: 600 14px/1 var(--font-ui); text-decoration: none; }
.toolbar .meta { min-width: 64px; color: var(--faint); font: 500 12px/1 var(--font-mono); text-align: right; }
.select {
  height: 34px; padding: 0 30px 0 14px; border: 1px solid var(--line-2); border-radius: 99px; appearance: none; cursor: pointer;
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a95b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--strong); font-size: 13px;
}
.select:hover { background-color: var(--raised-2); }
textarea:focus-visible { outline: none; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 99px; background: rgba(198, 255, 61, .12); color: var(--lime); font: 500 11.5px/1 var(--font-mono); }

/* glass panel for example controls */
.glass { border: 1px solid var(--line-2); border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }

/* code chip, as on the home page */
.chip-code { display: inline-block; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #ebe8ff; font: 400 13px/1.65 var(--font-mono); white-space: pre; text-align: left; overflow-x: auto; max-width: 100%; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ── Syntax colours (docs code blocks, code chips and editors) ─── */
.hljs-comment, .hljs-quote { color: #6c6790; }
.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-name, .hljs-tag { color: #ff7ae0; }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title, .hljs-title.class_ { color: #6fe3f2; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #c6ff3d; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #ffc978; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #22d3ee; }
.hljs-attr, .hljs-attribute, .hljs-property { color: #b4a6ff; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #ff9ec4; }
.hljs-meta .hljs-string { color: #c6ff3d; }
.hljs-deletion { color: #ff9a9a; }
