/* Lotus website – shared styles for every page.
   Theme colors (--logo, --key, …) are set from data/themes.tsv by js/lotus.js. */

:root {
  --logo: rgb(248, 184, 208); --key: rgb(181, 211, 113); --accent: rgb(166, 196, 122); --key2: rgb(236, 236, 140);
  --salute: rgb(245, 211, 155); --border: rgb(150, 160, 160); --dim: rgb(120, 128, 128); --music: rgb(30, 215, 96);

  --bg: #05070a;
  --bg-2: #0b0f12;
  --text: #eef2ee;
  --muted: #8a938f;
  --glass: rgba(14, 18, 20, 0.55);
  --glass-strong: rgba(14, 18, 20, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink-key: var(--key);
  --ink-accent: var(--accent);
  --ink-logo: var(--logo);
  --danger: #ff6b6b;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --wrap: min(1120px, calc(100% - 32px));
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f3;
    --bg-2: #ffffff;
    --text: #14181a;
    --muted: #5c6663;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.92);
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.16);
    --ink-key: color-mix(in oklab, var(--key) 55%, #000);
    --ink-accent: color-mix(in oklab, var(--accent) 50%, #000);
    --ink-logo: color-mix(in oklab, var(--logo) 50%, #000);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
::selection { background: var(--logo); color: #111; }
img, svg { display: block; }
code, kbd, pre { font-family: var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
:focus-visible { outline: 2px solid var(--ink-accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: var(--wrap); margin-inline: auto; }
main { position: relative; z-index: 2; }

/* ── Navigation ────────────────────────────────────────────────── */
lotus-nav { display: block; height: 0; }
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; fill: color-mix(in srgb, var(--logo) 22%, transparent); stroke: var(--ink-logo); stroke-width: 1.4; stroke-linejoin: round; }
.nav-links { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); font-size: 14px; color: var(--muted); }
.nav-links > a:hover, .more-btn:hover { color: var(--text); }
.nav-links a[aria-current="page"], .more.active > .more-btn { color: var(--text); }
.nav-links a[aria-current="page"]::after { content: ""; display: block; height: 2px; margin-top: 2px; border-radius: 2px; background: var(--ink-accent); }
.more { position: relative; }
.more-btn { display: flex; align-items: center; gap: 5px; color: var(--muted); padding: 0; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 170px;
  display: grid; padding: 6px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: .25s var(--ease);
}
.more.open .more-menu { opacity: 1; pointer-events: auto; transform: none; }
.more-menu a { padding: 8px 12px; border-radius: 9px; color: var(--text); }
.more-menu a:hover, .more-menu a[aria-current="page"] { background: var(--line); }
.more-menu a[aria-current="page"]::after { display: none; }
.pill { color: var(--bg) !important; background: var(--text); padding: 7px 16px; border-radius: 99px; font-weight: 600; transition: transform .3s var(--ease); }
.pill:hover { transform: translateY(-1px); }
.gh { color: var(--muted); }
.gh:hover { color: var(--text); }
.menu-toggle { display: none; width: 34px; height: 34px; border-radius: 10px; position: relative; }
.menu-toggle span { position: absolute; left: 9px; right: 9px; height: 1.6px; background: var(--text); transition: .3s var(--ease); }
.menu-toggle span:first-child { top: 13px; } .menu-toggle span:last-child { top: 20px; }
.nav.open .menu-toggle span:first-child { top: 16.5px; transform: rotate(45deg); }
.nav.open .menu-toggle span:last-child { top: 16.5px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 62px 12px auto; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--bg-2) 96%, transparent); border: 1px solid var(--line);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: .3s var(--ease);
  }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links > a, .more-btn { padding: 10px 12px; color: var(--text); }
  .nav-links a[aria-current="page"]::after { display: none; }
  .nav-links a[aria-current="page"] { background: var(--line); border-radius: 10px; }
  .more-btn { display: none; }
  .more-menu { position: static; opacity: 1; pointer-events: inherit; transform: none; background: none; border: 0; box-shadow: none; padding: 0; backdrop-filter: none; }
  .nav:not(.open) .nav-links, .nav:not(.open) .nav-links * { pointer-events: none; }
  .more-menu a { padding: 10px 12px; }
  .pill { text-align: center; margin-top: 6px; }
  .gh { padding: 10px 12px; }
}

/* ── Page header ───────────────────────────────────────────────── */
.page-head { padding: 150px 0 50px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.page-head h1 { margin: 0; font: italic 400 clamp(54px, 9vw, 112px)/.95 var(--serif); letter-spacing: -.03em; }
.page-head h1 span { color: var(--ink-logo); }
.lead { max-width: 640px; margin: 18px 0 0; font-size: clamp(17px, 2vw, 20px); color: var(--muted); }
h2.section { margin: 70px 0 18px; font: italic 400 clamp(36px, 5vw, 54px)/1 var(--serif); letter-spacing: -.02em; }
h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }

/* ── Building blocks ───────────────────────────────────────────── */
.card {
  position: relative; border-radius: 20px; padding: 22px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  transition: border-color .3s, transform .4s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip {
  padding: 7px 14px; border-radius: 99px; font-size: 14px; color: var(--muted);
  border: 1px solid var(--line); background: var(--glass); transition: .25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line); margin: 0 4px 4px 0; }

.search {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; margin: 0 0 18px;
  padding: 0 14px; height: 48px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--ink-accent); }
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; height: 100%; border: 0; outline: 0; background: none; font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; border: 1px solid var(--line-strong); background: var(--glass); transition: .25s var(--ease);
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }

.copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 9px;
  border-radius: 10px; background: var(--line); color: var(--text); font-size: 13px; transition: background .25s, transform .25s var(--ease);
}
.copy:hover { background: var(--logo); color: #111; }
.copy.done { background: var(--key); color: #111; }

code { font-size: .92em; padding: 2px 6px; border-radius: 6px; background: var(--line); }
kbd { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--glass); }
.codeblock {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 14px;
  background: #0d1113; border: 1px solid rgba(255,255,255,.08); color: #e7ece9; overflow: hidden;
}
.codeblock code { flex: 1; background: none; padding: 0; font-size: 13.5px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.codeblock code::-webkit-scrollbar { display: none; }
.codeblock .dollar { color: var(--key); user-select: none; }
.codeblock .copy { background: rgba(255,255,255,.08); color: #e7ece9; }

/* Terminal frame – always dark, in light mode too */
.term {
  --fs: 12px;
  border-radius: 14px; overflow: hidden; color: #f2f4f2;
  background: #0e1311; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
.term-bar { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; margin-right: auto; font: 11px var(--sans); color: #8a938f; transform: translateX(-20px); }
.term pre { margin: 0; padding: 14px 16px; font: var(--fs)/1.35 var(--mono); white-space: pre; overflow: auto; }
.t-logo { color: var(--logo); font-weight: 600; } .t-key { color: var(--key); font-weight: 600; } .t-acc { color: var(--accent); }
.t-key2 { color: var(--key2); font-weight: 600; } .t-sal { color: var(--salute); } .t-bor { color: var(--border); }
.t-dim { color: var(--dim); } .t-mus { color: var(--music); font-weight: 600; } .t-b { color: #fff; font-weight: 600; } .t-red { color: var(--danger); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); font-size: 15px; }
.callout::before { content: "i"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 600 12px var(--mono); color: var(--bg); background: var(--ink-accent); }
.callout.warn::before { content: "!"; background: #e0a43a; }
.callout p { margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps > li { counter-increment: step; position: relative; padding: 18px 20px 18px 66px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.steps > li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font: 600 14px var(--mono); color: var(--bg); background: var(--ink-accent);
}
.steps p { margin: 4px 0 0; color: var(--muted); }

table.docs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.docs th, table.docs td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.docs th { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
table.docs td:first-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); }

.burst { position: fixed; z-index: 50; width: 10px; height: 14px; left: 0; top: 0; pointer-events: none; border-radius: 50% 0 50% 50%; background: linear-gradient(135deg, #fff, var(--logo)); }

/* ── Reveal on scroll ──────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); filter: blur(8px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ── Footer ────────────────────────────────────────────────────── */
lotus-footer { display: block; position: relative; z-index: 2; }
.footer {
  display: grid; gap: 22px; grid-template-columns: 1.2fr 2fr; align-items: start;
  width: var(--wrap); margin: 80px auto 0; padding: 40px 0 50px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; flex-wrap: wrap; }
.footer-brand small { flex-basis: 100%; font-weight: 400; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; }
.footer-links a:hover, .footer-meta a:hover { color: var(--text); }
.footer-meta { grid-column: 1 / -1; display: flex; gap: 20px; font-size: 13px; }
@media (max-width: 700px) { .footer { grid-template-columns: 1fr; } .footer-links { justify-content: flex-start; } }

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

/* ── What works where (home page and docs) ─────────────────────── */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); }
.badge-supported { color: var(--ink-accent); border-color: var(--ink-accent); }
.badge-beta { color: var(--text); }
.pf-table-wrap { width: min(1000px, 100%); margin-top: 28px; overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.pf-table th, .pf-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pf-table thead th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pf-table tbody tr:last-child th, .pf-table tbody tr:last-child td { border-bottom: 0; }
.pf-table tbody th { font-weight: 500; min-width: 240px; }
.pf-table small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
.pf-table td { white-space: nowrap; }
.st { display: inline-block; min-width: 54px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-align: center; border: 1px solid var(--line-strong); }
.st-yes { color: var(--ink-accent); border-color: var(--ink-accent); }
.st-partial { color: var(--text); }
.st-soon, .st-no { color: var(--muted); }
.st-no { border-style: dashed; }
.pf-foot { margin-top: 16px; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .pf-table th, .pf-table td { padding: 10px 6px; }
  .pf-table tbody th { min-width: 0; width: 38%; font-size: 13px; }
  .pf-table small { font-size: 11px; }
  .st { min-width: 0; padding: 2px 7px; font-size: 11px; }
}
