/* JFastFramework documentation site -- liquid ruby.
 *
 * One stylesheet, no build step, no framework. Dark is the default and light
 * is the reader's explicit choice: the glass and the ruby are drawn for a
 * near-black studio, and a page that followed a light OS by default would
 * open on the weaker of the two.
 *
 * Every token is defined on :root and re-pointed once, under
 * [data-theme="light"]. No colour has its only definition anywhere else.
 */

:root {
  /* Ground and glass. */
  --bg: #030305;
  --surface: rgba(14, 15, 20, 0.58);
  --surface-solid: #0c0d12;
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --specular: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(12, 13, 18, 0.68);

  /* Text. --text-faded is for display type only: at 82px it reads, at 16px it
   * would fail contrast, so nothing smaller uses it. */
  --text: #ffffff;
  --text-muted: #9aa0b2;
  --text-faded: rgba(255, 255, 255, 0.36);

  /* Ruby. --accent fills; --link is the brighter one used for text on the dark
   * ground, where #e11d2e alone sits at 4.3:1 and misses AA for body links. */
  --accent: #e11d2e;
  --accent-glow: #ff4d5e;
  --accent-body: #7a0714;
  --accent-deep: #31060a;
  --accent-soft: rgba(225, 29, 46, 0.12);
  --accent-text: #ffffff;
  --link: #ff4d5e;

  /* Code. The terminal keeps a dark ground in both themes. */
  --code-bg: rgba(255, 255, 255, 0.045);
  --terminal-bg: rgba(6, 6, 9, 0.86);
  --terminal-text: #e8e8ee;
  --terminal-dim: #7c8193;
  --terminal-prompt: #ff6b78;

  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.08);
  --glow: rgba(225, 29, 46, 0.28);
  --scrollbar: rgba(255, 255, 255, 0.16);

  --radius: 18px;
  --radius-sm: 10px;
  --measure: 74ch;
  --sidebar: 250px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Plus Jakarta Sans and JetBrains Mono, each with a full fallback stack: the
   * site has to stay readable when Google Fonts is blocked, which on a
   * corporate network it often is. */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8f9fd;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-solid: #ffffff;
  --surface-2: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --specular: rgba(255, 255, 255, 0.95);
  --shadow: 0 24px 50px -12px rgba(28, 35, 60, 0.1), 0 2px 6px rgba(0, 0, 0, 0.03);
  --nav-bg: rgba(255, 255, 255, 0.82);

  --text: #0b0d14;
  --text-muted: #5e6578;
  --text-faded: rgba(11, 13, 20, 0.35);

  --accent: #c8102e;
  --accent-glow: #e11d2e;
  --accent-body: #7a0714;
  --accent-deep: #31060a;
  --accent-soft: rgba(200, 16, 46, 0.08);
  --accent-text: #ffffff;
  --link: #b80f28;

  --code-bg: rgba(0, 0, 0, 0.035);
  --terminal-bg: #0b0b10;
  --terminal-text: #e8e8ee;
  --terminal-dim: #7c8193;
  --terminal-prompt: #ff6b78;

  --warn: #b45309;
  --warn-bg: #fffbeb;
  --glow: rgba(225, 29, 46, 0.14);
  --scrollbar: rgba(0, 0, 0, 0.2);

  color-scheme: light;
}

/* ---------- base ---------- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 9999px; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s ease;
}

/* A still ruby light behind every page. The landing adds the moving glass on
 * top; the documentation keeps only this, because text over motion is text
 * nobody finishes. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, var(--glow), transparent 70%),
    radial-gradient(700px 480px at -10% 110%, color-mix(in srgb, var(--accent-body) 22%, transparent), transparent 70%);
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip { position: absolute; left: -999px; }
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--surface-solid);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* The glass itself. One recipe, used by every panel on the site. */
.glass,
.topbar,
.sidebar,
.card,
.link-card,
.argument-grid article,
.audience-grid article,
.compare-col,
.stats,
.pager a,
.toc,
.notice,
.cta-panel,
.mark-lockup {
  background: var(--surface);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 1.5px var(--specular);
}

/* ---------- the island navbar ---------- */

.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 32px);
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 9px 12px 9px 20px;
  border-radius: 9999px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border-color: var(--border-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.2s var(--ease);
}
.brand:hover { transform: scale(1.03); }
.brand .mark { height: 24px; width: auto; display: block; }

/* jfast in ruby, framework in the text colour: one word that still says which
 * half is the name. */
.wordmark { font-weight: 500; letter-spacing: -0.02em; }
.wordmark b { font-weight: 800; color: var(--accent-glow); }
:root[data-theme="light"] .wordmark b { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 6px; }

.ghost {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.ghost:hover { color: var(--text); background: var(--surface-2); }
.ghost.lang {
  font-family: var(--mono);
  font-size: 0.74rem;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.version-picker select {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), color 0.2s;
}
.theme-toggle:hover { transform: scale(1.06); color: var(--accent-glow); }
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }

/* One button, two icons: the active theme shows the one you would switch to.
 * Dark is the default, so the sun shows until light is chosen. */
.theme-toggle .sun { display: block; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }

/* ---------- the documentation shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 14px 10px;
  border-radius: var(--radius);
}

.sidebar h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 8px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-glow);
}
:root[data-theme="light"] .sidebar h4 { color: var(--accent); }
.sidebar h4::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sidebar h4:first-child { margin-top: 4px; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}
.sidebar a .icon { width: 15px; height: 15px; opacity: 0.6; transition: color 0.15s, opacity 0.15s; }
.sidebar a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a:hover .icon { color: var(--accent-glow); opacity: 1; }
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar a.active .icon { color: var(--accent-glow); opacity: 1; }
.sidebar a:focus-visible { outline-offset: -2px; }

.content { min-width: 0; max-width: var(--measure); }
.shell.wide .content { max-width: none; }

/* ---------- typography ---------- */

.doc-head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.doc-head h1 { margin: 0; }
.doc-head p { color: var(--text-muted); margin: 12px 0 0; max-width: 64ch; }

h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 2.4em 0 0.7em;
  padding-top: 0.4em;
}
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin: 1.8em 0 0.5em; }
h2 + h3, h1 + h2 { margin-top: 1.2em; }

p, li { color: var(--text); }
.content > p:first-of-type { font-size: 1.05rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }
strong { font-weight: 700; }

blockquote {
  margin: 1.5em 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}

/* ---------- code ---------- */

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.14em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }

/* Enough colour to read, not a rainbow: keywords in ruby, the rest muted. */
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kc { color: var(--accent-glow); font-weight: 600; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd { color: #7ee2c8; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--text-muted); font-style: italic; }
.highlight .nf, .highlight .nc, .highlight .nd { color: #ffc37a; }
.highlight .mi, .highlight .mf { color: #c4b5fd; }
:root[data-theme="light"] .highlight .k,
:root[data-theme="light"] .highlight .kn,
:root[data-theme="light"] .highlight .kd,
:root[data-theme="light"] .highlight .kc { color: var(--accent); }
:root[data-theme="light"] .highlight .s,
:root[data-theme="light"] .highlight .s1,
:root[data-theme="light"] .highlight .s2,
:root[data-theme="light"] .highlight .sb,
:root[data-theme="light"] .highlight .sd { color: #0f766e; }
:root[data-theme="light"] .highlight .nf,
:root[data-theme="light"] .highlight .nc,
:root[data-theme="light"] .highlight .nd { color: #b45309; }
:root[data-theme="light"] .highlight .mi,
:root[data-theme="light"] .highlight .mf { color: #6d28d9; }

.snippet { position: relative; }
.snippet .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 11px;
  font: inherit;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.snippet:hover .copy,
.snippet .copy:focus-visible { opacity: 1; }
.snippet .copy:hover { color: var(--link); border-color: var(--accent); }
.snippet.terminal-wrap .copy { background: #111118; border-color: #2a2a33; color: var(--terminal-dim); }

/* ---------- tables ---------- */

.table-wrap {
  margin: 1.5em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ---------- on this page, prev/next, notices ---------- */

.toc { margin: 0 0 30px; padding: 14px 18px; border-radius: 14px; }
.toc-title {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-glow);
  margin: 0 0 6px;
}
:root[data-theme="light"] .toc-title { color: var(--accent); }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.toc li { margin: 0; break-inside: avoid; }
.toc a { display: block; padding: 3px 0; font-size: 0.88rem; color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--link); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin: 48px 0 0; }
.pager a {
  flex: 1 1 0;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.pager a:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); }
.pager .next { text-align: right; }
.pager small {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: 14px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.page-footer a { color: var(--text-muted); }
.page-footer a:hover { color: var(--link); }

.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.74rem;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.badge.alpha { color: var(--link); border-color: var(--accent); }

/* ---------- the documentation home ---------- */

.doc-section h2 { margin-top: 1.6em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  display: block;
  padding: 18px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 0.98rem; }
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- icons ---------- */

.sprite { display: none; }
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-glow);
}
:root[data-theme="light"] .card-icon { color: var(--accent); }
.card-icon .icon { width: 19px; height: 19px; }

/* ===========================================================================
   The landing.
   =========================================================================== */

/* The moving glass, the studio vignette and the light that follows the
 * pointer. All three are decoration: fixed, behind everything, and never in
 * the way of a click. */
.liquid-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.liquid-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 70% 40%, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
}
:root[data-theme="light"] .liquid-vignette { display: none; }

.liquid-glow {
  position: fixed;
  left: 70%;
  top: 40%;
  width: 680px;
  height: 680px;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: blur(130px);
  opacity: 0.28;
  background: radial-gradient(circle, rgba(225, 29, 46, 0.26) 0%, rgba(49, 6, 10, 0.2) 40%, transparent 70%);
}

/* Without WebGL -- or with three.js blocked -- a still ruby body stands in
 * for the ribbon, so the page keeps its colour rather than going flat. */
.no-webgl .liquid-glow {
  left: 78%;
  top: 34%;
  width: 760px;
  height: 760px;
  opacity: 0.75;
  filter: blur(90px);
  background: radial-gradient(circle at 40% 35%, rgba(255, 77, 94, 0.5) 0%, rgba(225, 29, 46, 0.35) 30%, rgba(122, 7, 20, 0.3) 55%, transparent 72%);
}

.landing .topbar,
.landing-main,
.landing-footer { position: relative; z-index: 2; }

.landing-main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px 40px; }

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

.hero { padding: 72px 0 24px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 7px 15px;
  border-radius: 9999px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.pulse { position: relative; display: inline-flex; width: 8px; height: 8px; }
.pulse::before,
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-glow); }
.pulse::before { animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; opacity: 0.8; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

.display {
  margin: 0 0 26px;
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.048em;
}
.display span { display: block; }
.display .faded { font-weight: 800; letter-spacing: -0.042em; color: var(--text-faded); }

.lede { max-width: 58ch; margin: 0 0 32px; font-size: 1.12rem; line-height: 1.65; color: var(--text-muted); }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* Three kinds of button, from the reference: a lit white pill for the one
 * thing to do, glass for the second, ruby for the moment of commitment. */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.25s, border-color 0.25s;
}
.button:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--text) 8%, transparent); }
.button .arrow { transition: transform 0.2s ease; }
.button:hover .arrow { transform: translateX(4px); }

.button.primary {
  padding: 13px 28px;
  border: 0;
  background: #ffffff;
  color: #050608;
  box-shadow:
    0 14px 34px -8px rgba(255, 255, 255, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -2px 3px rgba(0, 0, 0, 0.1);
}
.button.primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 42px -6px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(0, 0, 0, 0.2), inset 0 2px 2px #fff;
}
.button.primary:active { transform: translateY(1px) scale(0.98); }
:root[data-theme="light"] .button.primary {
  background: #090b10;
  color: #ffffff;
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.button.ruby {
  overflow: hidden;
  isolation: isolate;
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #ff4d5e 0%, #e11d2e 38%, #a3101f 100%);
  box-shadow: 0 12px 30px -6px rgba(225, 29, 46, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.button.ruby::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e11d2e, #ff4d5e, #a3101f, #e11d2e);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: ruby-shift 3.5s linear infinite;
}
.button.ruby:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -5px rgba(225, 29, 46, 0.6); }
.button.ruby:hover::before { opacity: 1; }
@keyframes ruby-shift { to { background-position: 300% 50%; } }

.cta-link { color: var(--text-muted); font-size: 0.92rem; font-weight: 600; text-decoration: none; }
.cta-link:hover { color: var(--link); }

/* ---- the logo, on the right of the hero ----
 *
 * The whole lockup -- mark and wordmark, as in the navbar -- on one pane of
 * glass. The mark alone, blown up in a square, read as an app icon rather
 * than as the name of the thing. The pane is thin enough that the ribbon
 * shows through it. */

.hero-mark { display: flex; justify-content: center; align-items: center; padding-top: 96px; }

.mark-lockup {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 34px 44px;
  border-radius: 32px;
  background: rgba(14, 15, 20, 0.34);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border-color: rgba(255, 255, 255, 0.12);
}
.mark-lockup::before {
  content: "";
  position: absolute;
  inset: 10% 30% 10% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 29, 46, 0.3), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}
.mark-lockup img {
  position: relative;
  width: auto;
  height: 58px;
  filter: drop-shadow(0 12px 28px rgba(225, 29, 46, 0.4));
}
.mark-lockup .wordmark {
  position: relative;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
  color: var(--text);
}
:root[data-theme="light"] .mark-lockup { background: rgba(255, 255, 255, 0.55); border-color: rgba(0, 0, 0, 0.06); }

/* The one terminal on the page's first screen: what the command does. The
 * width is on the wrapper, which the copy button is positioned against. */
.start-terminal { max-width: 760px; margin: 56px 0 0; }
.start-terminal pre { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .mark-lockup { animation: float-a 7s ease-in-out infinite; }
  .display span,
  .hero .lede,
  .hero .cta { animation: rise 0.7s var(--ease) both; }
  .display span:nth-child(2) { animation-delay: 60ms; }
  .display span:nth-child(3) { animation-delay: 120ms; }
  .hero .lede { animation-delay: 180ms; }
  .hero .cta { animation-delay: 260ms; }
  .hero-mark { animation: rise 0.9s var(--ease) 200ms both; }
}
@keyframes float-a { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(0.6deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---- the numbers ---- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  max-width: 760px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.metric b {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.metric b em { font-style: normal; color: var(--accent-glow); }
:root[data-theme="light"] .metric b em { color: var(--accent); }
.metric span { display: block; margin-top: 8px; font-family: var(--mono); font-size: 0.74rem; color: var(--text-muted); }

/* ---- terminal ---- */

.terminal {
  position: relative;
  background: var(--terminal-bg);
  color: var(--terminal-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 44px !important;
  font-size: 0.82rem;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.06);
}
.terminal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px 14px 0 0;
}
.terminal::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 15px 0 0 #ffbd2e, 30px 0 0 #27c93f;
}
.terminal .c { color: var(--terminal-prompt); user-select: none; }
.terminal .dim { color: var(--terminal-dim); }
.terminal .ok { color: #4ade80; }
.terminal .bad { color: #ff6b78; }
.terminal.check { margin: 26px 0 8px; white-space: pre-wrap; line-height: 1.65; }

/* ---- stack strip ---- */

.stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}
.stack .stack-label {
  margin: 0 8px 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stack .chip {
  padding: 6px 13px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
.stack .chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

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

.argument { margin-top: 110px; }

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-glow);
}
:root[data-theme="light"] .section-kicker { color: var(--accent); }
.section-kicker .icon { width: 14px; height: 14px; }

.argument > h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 22ch;
}
.argument > .lede { margin-bottom: 0; }

/* Bento: a 12-column grid, cards claim spans. */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; margin-top: 34px; }
.bento > * { grid-column: span 4; }
.bento > .span-7 { grid-column: span 7; }
.bento > .span-5 { grid-column: span 5; }
.bento > .span-6 { grid-column: span 6; }
.bento > .span-3 { grid-column: span 3; }
.bento > .span-12 { grid-column: span 12; }

.argument-grid article,
.audience-grid article,
.link-card,
.compare-col {
  position: relative;
  padding: 28px;
  border-radius: 26px;
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.argument-grid article:hover,
.audience-grid article:hover,
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.bento-num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.argument-grid h3,
.audience-grid h3,
.link-card h3,
.compare-col h3 { margin: 0 0 8px; font-size: 1.22rem; font-weight: 750; letter-spacing: -0.02em; }
.argument-grid p,
.audience-grid p,
.link-card p { margin: 0; color: var(--text-muted); font-size: 0.93rem; line-height: 1.6; }

/* The honest half of each claim, marked: a trade-off set in the same grey as
 * the pitch is a trade-off nobody reads. */
.argument-grid .cost {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.86rem;
}
.cost-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-glow);
}
:root[data-theme="light"] .cost-label { color: var(--accent); }

.compare-col p:last-child { margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.65; }
.compare-col.after {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background:
    radial-gradient(420px 200px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.compare-col.after p:last-child { color: var(--text); }
.compare-label {
  display: inline-block;
  margin: 0 0 14px;
  padding: 3px 11px;
  border-radius: 9999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.compare-col.after .compare-label { color: var(--link); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }

.audience-grid .step {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-glow);
}
:root[data-theme="light"] .audience-grid .step { color: var(--accent); }

.link-card { display: block; text-decoration: none; color: inherit; }
.link-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--link);
}
.link-card:hover .go .arrow { transform: translateX(4px); }
.link-card .go .arrow { transition: transform 0.2s ease; }

.dim-note { margin: 16px 0 0; font-size: 0.9rem; color: var(--text-muted); max-width: 70ch; }

/* The closing panel. */
.cta-panel {
  position: relative;
  overflow: hidden;
  margin-top: 120px;
  padding: 64px 32px;
  border-radius: 32px;
  text-align: center;
}
.cta-panel::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.cta-panel h2 {
  position: relative;
  max-width: 20ch;
  margin: 0 auto 14px;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.cta-panel p { position: relative; max-width: 52ch; margin: 0 auto 28px; color: var(--text-muted); }
.cta-panel .cta { position: relative; justify-content: center; }

.landing-footer {
  max-width: 1200px;
  margin: 72px auto 0;
  padding: 28px 28px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.landing-footer p { margin: 0; }
.landing-footer nav { display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--mono); font-size: 0.76rem; }
.landing-footer a { color: var(--text-muted); text-decoration: none; }
.landing-footer a:hover { color: var(--link); }

/* 3D tilt, driven by a few lines of script. Without it the cards simply stay
 * flat. */
[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* ---------- reveal on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal { opacity: 0; transform: translateY(18px); }
  .js-reveal .reveal.shown {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
}

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

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  /* Stacked, the mark would push the call to action off the first screen. */
  .hero-mark { display: none; }
  .bento > *,
  .bento > .span-7,
  .bento > .span-5,
  .bento > .span-6 { grid-column: span 12; }
  .bento > .span-3 { grid-column: span 6; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; }
  .sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sidebar a { font-size: 13px; padding: 5px 10px; }
  /* The sidebar wraps into rows here, so a group heading claims the whole line
   * or it reads as one more link. */
  .sidebar h4 { flex: 0 0 100%; margin: 10px 0 2px; }
  .sidebar h4:first-child { margin-top: 0; }
}

@media (max-width: 720px) {
  .topbar { border-radius: 22px; padding: 8px 10px 8px 14px; }
  .topbar .ext,
  .version-picker { display: none; }
  .landing-main { padding: 0 16px 32px; }
  .hero { padding-top: 44px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > .span-3 { grid-column: span 12; }
  .argument { margin-top: 80px; }
  .cta-panel { padding: 44px 20px; margin-top: 80px; }
  .landing-footer { padding: 24px 16px 40px; }
}

@media (max-width: 420px) {
  .wordmark { display: none; }
  .ghost { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
