:root {
  --accent: #33c481;
  --accent-900: #177248;
  --accent-600: #28a86c;
  --accent-300: #7adcab;
  --accent-soft: rgba(51, 196, 129, 0.12);

  --bg: #f2f7f4;
  --bg-elev: #ffffff;
  --bg-soft: #e7efea;
  --border: #dde6e1;
  --border-strong: #ccd8d2;
  --fg: #0f1411;
  --fg-muted: #5b6660;
  --fg-soft: #8a938e;
  --code-bg: #eaf2ed;
  --shadow: 0 1px 2px rgba(15, 20, 17, 0.04), 0 8px 24px rgba(15, 20, 17, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0d1310;
  --bg-elev: #131a16;
  --bg-soft: #18201c;
  --border: #232c27;
  --border-strong: #2f3a34;
  --fg: #eef2ef;
  --fg-muted: #a8b3ad;
  --fg-soft: #79847e;
  --code-bg: #161f1a;
  --accent-soft: rgba(51, 196, 129, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: 0.9em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.85rem 1.25rem; max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; letter-spacing: -0.01em; font-size: 1.05rem;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 4px 12px rgba(51,196,129,0.35);
}
.brand:hover { color: inherit; }

.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a {
  padding: 0.5rem 0.85rem; border-radius: 8px;
  font-size: 0.95rem; font-weight: 500; color: var(--fg-muted);
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { color: var(--accent); background: var(--bg-soft); }
.nav a.is-active { color: var(--fg); background: var(--accent-soft); }

.header-actions { display: flex; gap: 0.4rem; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-muted); cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--fg); background: var(--bg-soft); border-color: var(--border-strong); }
.lang-toggle {
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--fg-muted); cursor: pointer;
  padding: 0 0.7rem; height: 36px; font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.lang-toggle:hover { color: var(--fg); background: var(--bg-soft); }

.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 5rem; padding: 2rem 0; border-top: 1px solid var(--border);
  color: var(--fg-soft); font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ===== Hero / Home ===== */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(800px 400px at 80% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(600px 300px at 10% 110%, var(--accent-soft), transparent 60%);
}
.hero .container { max-width: 820px; }
.eyebrow {
  display: inline-block; padding: 0.3rem 0.7rem;
  background: var(--accent-soft); color: var(--accent-600);
  border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 1rem;
}
html[data-theme="dark"] .eyebrow { color: var(--accent-300); }
.lead { font-size: 1.15rem; color: var(--fg-muted); max-width: 60ch; }
.hero-cta { display: flex; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.1rem; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, filter 0.2s;
}


.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-900); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

.grid-cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 3rem;
}
.card {
  display: block; padding: 1.4rem; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); color: inherit; }
.card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-600);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
  margin-bottom: 0.9rem;
}
html[data-theme="dark"] .card-icon { color: var(--accent-300); }
.card p { color: var(--fg-muted); margin: 0; font-size: 0.95rem; }

/* ===== Page header ===== */
.page { padding: 2.5rem 0 4rem; }
.page-header { margin-bottom: 2rem; }
.page-header .lead { margin: 0; }

.back-link {
  display: inline-flex; gap: 0.4rem; color: var(--fg-muted);
  font-size: 0.9rem; margin-bottom: 1.5rem;
}

/* ===== Toolbar / Filters ===== */
.toolbar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.toolbar input[type="search"] {
  flex: 1; min-width: 240px;
  padding: 0.7rem 1rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--fg); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.toolbar input[type="search"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.result-count { color: var(--fg-soft); font-size: 0.9rem; }

.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem;
}
.chip {
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--fg-muted); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.is-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ===== Function list ===== */
.fn-table-head {
  display: grid;
  grid-template-columns: 180px 1.2fr 2fr 110px;
  gap: 1rem; padding: 0.6rem 1rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-soft); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.fn-list { list-style: none; padding: 0; margin: 0; }
.fn-row {
  display: grid;
  grid-template-columns: 180px 1.2fr 2fr 110px;
  gap: 1rem; padding: 1rem; align-items: start;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, opacity 0.25s, transform 0.25s;
}
.fn-row:hover { background: var(--bg-soft); }
.fn-row .fn-name {
  font-family: var(--mono); font-weight: 600; color: var(--accent-600);
  font-size: 0.95rem;
}
html[data-theme="dark"] .fn-row .fn-name { color: var(--accent-300); }
.fn-row .fn-args { font-family: var(--mono); font-size: 0.82rem; color: var(--fg-muted); }
.fn-row .fn-desc { color: var(--fg); font-size: 0.92rem; }
.fn-row .fn-version {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 6px;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--fg-muted); white-space: nowrap;
}
.fn-row .category-tag {
  display: inline-block; margin-top: 0.35rem;
  font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-600); font-weight: 500;
}
html[data-theme="dark"] .fn-row .category-tag { color: var(--accent-300); }
@media (max-width: 760px) {
  .fn-table-head { display: none; }
  .fn-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .fn-row .fn-version { justify-self: start; }
}

/* Filter-out animation */
.fn-row.is-leaving { opacity: 0; transform: translateY(-4px); }
.fn-row.is-entering { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Function detail ===== */
.fn-detail h1 {
  font-family: var(--mono); color: var(--accent-600);
  font-size: 2rem; margin-bottom: 0.4rem;
}
html[data-theme="dark"] .fn-detail h1 { color: var(--accent-300); }
.fn-detail .meta-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.fn-detail .meta-row span {
  font-size: 0.8rem; padding: 0.25rem 0.6rem;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 6px; color: var(--fg-muted);
}
.fn-detail .signature {
  font-family: var(--mono); padding: 1rem 1.2rem;
  background: var(--code-bg); border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 2rem; overflow-x: auto;
}
.fn-detail section { margin-top: 2.5rem; }
.fn-detail .args-table { width: 100%; border-collapse: collapse; }
.fn-detail .args-table th, .fn-detail .args-table td {
  text-align: left; padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border); vertical-align: top; font-size: 0.92rem;
}
.fn-detail .args-table th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-soft); font-weight: 600;
}
.fn-detail .args-table .arg-name { font-family: var(--mono); color: var(--accent-600); font-weight: 600; }
html[data-theme="dark"] .fn-detail .args-table .arg-name { color: var(--accent-300); }
.fn-detail .arg-required {
  font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-600); margin-left: 0.4rem;
}
html[data-theme="dark"] .fn-detail .arg-required { color: var(--accent-300); }
.fn-detail .example {
  margin-top: 1.5rem; padding: 1.2rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elev);
}
.fn-detail .example h4 { margin-top: 0; font-size: 1rem; }
.fn-detail .example .formula {
  font-family: var(--mono); padding: 0.8rem 1rem;
  background: var(--code-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border); position: relative; padding-right: 3rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}

/* ===== Copy button ===== */
.copy-btn {
  position: absolute; top: 0.4rem; right: 0.4rem;
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--fg-muted); display: grid; place-items: center;
  cursor: pointer; transition: all 0.15s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.is-copied { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 16px; height: 16px; }

/* ===== Formulas (techniques) grid ===== */
.formula-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.formula-card {
  display: block; padding: 1.4rem; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: all 0.2s;
}
.formula-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: var(--shadow); color: inherit;
}
.formula-card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-600); margin-bottom: 0.5rem;
}
html[data-theme="dark"] .formula-card .tag { color: var(--accent-300); }
.formula-card h3 { margin: 0 0 0.5rem; }
.formula-card p { color: var(--fg-muted); font-size: 0.92rem; margin: 0; }
.formula-card.is-entering { animation: fadeUp 0.35s ease both; }

/* ===== Formula detail / article ===== */
.formula-detail { max-width: 760px; }
.formula-detail h1 { margin-bottom: 0.4rem; }
.formula-detail .article-meta { color: var(--fg-soft); font-size: 0.9rem; margin-bottom: 2rem; }
.formula-detail h2 { margin-top: 2.5rem; }
.formula-detail h3 { margin-top: 2rem; }
.formula-detail pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; overflow-x: auto;
  position: relative;
}
.formula-detail code:not(pre code) {
  background: var(--code-bg); padding: 0.15rem 0.4rem;
  border-radius: 4px; font-size: 0.88em;
}
.formula-detail ul, .formula-detail ol { padding-left: 1.4rem; }
.formula-detail li { margin-bottom: 0.4rem; }
.formula-detail blockquote {
  margin: 1.5rem 0; padding: 0.8rem 1.2rem;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 6px; color: var(--fg);
}

/* ===== Tabs (resources) ===== */
.tabs {
  display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border);
  margin-bottom: 2rem; overflow-x: auto;
}
.tab {
  padding: 0.8rem 1.2rem; background: transparent; border: 0;
  font: inherit; color: var(--fg-muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.2s;
  white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--fg); border-bottom-color: var(--accent); }

.tab-panel { display: none; animation: fadeUp 0.3s ease both; }
.tab-panel.is-active { display: block; }
.panel-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.panel-bar h2 { margin: 0; }

/* ===== LAMBDA list ===== */
.lambda-head {
  display: grid; grid-template-columns: 200px 1.3fr 2fr; gap: 1rem;
  padding: 0.6rem 1rem; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-soft); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.lambda-list { list-style: none; margin: 0; padding: 0; }
.lambda-item { border-bottom: 1px solid var(--border); padding: 1.2rem 0; }
.lambda-row {
  display: grid; grid-template-columns: 200px 1.3fr 2fr; gap: 1rem;
  padding: 0.4rem 1rem; align-items: start;
}
.lambda-row .l-name {
  font-family: var(--mono); font-weight: 600; color: var(--accent-600);
}
html[data-theme="dark"] .lambda-row .l-name { color: var(--accent-300); }
.lambda-row .l-args { font-family: var(--mono); color: var(--fg-muted); font-size: 0.85rem; }
.lambda-row .l-desc { color: var(--fg); font-size: 0.93rem; }
.lambda-formula {
  margin: 1rem 1rem 0; padding: 1rem 3rem 1rem 1.2rem;
  background: var(--code-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border); position: relative;
  font-family: var(--mono); font-size: 0.85rem;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
@media (max-width: 760px) {
  .lambda-head { display: none; }
  .lambda-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ===== VBA list ===== */
.vba-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.vba-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem;
}
.vba-item h3 { margin: 0 0 0.4rem; }
.vba-item .desc { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 0.8rem; }
.vba-item pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 3rem 1rem 1.2rem;
  margin: 0; overflow-x: auto; position: relative;
  font-size: 0.85rem;
}

/* ===== Resource grid (addins/templates) ===== */
.resource-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.resource-card {
  padding: 1.6rem; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.7rem; height: 100%;
}
.resource-card h3 { margin: 0; }
.resource-card .desc { color: var(--fg-muted); font-size: 0.95rem; flex: 1; }
.resource-card .btn { align-self: flex-start; }
.resource-thumb {
  aspect-ratio: 16/10; border-radius: var(--radius-sm);
  background: var(--bg-soft) center/cover no-repeat;
  border: 1px solid var(--border);
  margin-bottom: 0.3rem;
  display: grid; place-items: center;
  color: var(--fg-muted); font-size: 0.85rem;
}
.resource-thumb.is-empty::after {
  content: "Preview"; opacity: .6; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem;
}

/* ===== Community ===== */
.live-banner {
  display: flex; gap: 1rem; align-items: center;
  padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent);
  margin-bottom: 2.5rem;
}
.live-banner[hidden] { display: none; }

.live-banner .dot {
  width: 10px; height: 10px; border-radius: 50%; background: #e34;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238,68,53,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(238,68,53,0); }
}
.live-banner .banner-text { flex: 1; }
.live-banner h4 { margin: 0 0 0.15rem; font-size: 1rem; }
.live-banner p { margin: 0; color: var(--fg-muted); font-size: 0.9rem; }

.community-section { margin-top: 3rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.link { color: var(--accent-600); font-weight: 600; font-size: 0.9rem; }
html[data-theme="dark"] .link { color: var(--accent-300); }

.videos-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.video-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: block; transition: transform 0.2s, border-color 0.2s;
}
.video-card:hover { transform: translateY(-3px); border-color: var(--accent); color: inherit; }
.video-thumb {
  aspect-ratio: 16/9; background: var(--bg-soft);
  background-size: cover; background-position: center;
  position: relative; display: grid; place-items: center;
}
.video-thumb::after {
  content: "▶"; position: absolute; inset: auto; color: #fff;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,0.6); display: grid; place-items: center;
  font-size: 1.1rem; padding-left: 3px;
}
.video-card .video-body { padding: 0.9rem 1rem 1.1rem; }
.video-card h3 { font-size: 0.98rem; margin: 0 0 0.3rem; }
.video-card .date { color: var(--fg-soft); font-size: 0.82rem; }

.blog-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.blog-card {
  padding: 1.4rem; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
  display: block; transition: all 0.2s;
}
.blog-card:hover { transform: translateY(-3px); border-color: var(--accent); color: inherit; }
.blog-card .date { color: var(--fg-soft); font-size: 0.82rem; }
.blog-card h3 { margin: 0.3rem 0 0.4rem; }
.blog-card p { color: var(--fg-muted); font-size: 0.9rem; margin: 0; }

.live-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.live-item {
  display: flex; gap: 1rem; padding: 1rem 1.2rem;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); align-items: center;
}
.live-item .when {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent-600); min-width: 140px;
}
html[data-theme="dark"] .live-item .when { color: var(--accent-300); }
.live-item h4 { margin: 0; font-size: 1rem; }
.live-item .status { margin-left: auto; font-size: 0.78rem; color: var(--fg-soft); }
.live-item.is-live { border-color: var(--accent); }

.empty-state { color: var(--fg-soft); padding: 2rem 0; text-align: center; }

/* =========================================================
   Modern refresh (2026) — overrides
   ========================================================= */
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --bg-elev: #fbfcfb;
  --bg-soft: #f4f6f5;
  --border: #e9ecea;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 12px 32px -12px rgba(16, 24, 20, 0.12);
  --shadow-lg: 0 2px 4px rgba(16, 24, 20, 0.04), 0 24px 60px -20px rgba(16, 24, 20, 0.22);
  --ring: 0 0 0 4px var(--accent-soft);
}
html[data-theme="dark"] {
  --bg: #0a0f0c;
  --bg-elev: #101713;
  --bg-soft: #151d19;
  --border: #1e2823;
  --border-strong: #2b3730;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.7);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 30px 70px -24px rgba(0,0,0,.8);
}

body { letter-spacing: -0.005em; }
h1, h2, h3, h4 { letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }

/* Header */
.site-header {
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}
.brand-mark {
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent-300), var(--accent-600));
  box-shadow: 0 6px 18px -6px rgba(51,196,129,.6);
}
.nav a { border-radius: 9px; }
.nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent-600);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent);
}
html[data-theme="dark"] .nav a.is-active { color: var(--accent-300); }
.icon-btn { border-radius: 999px; }

/* Language switch */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.lang-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: calc((100% - 6px - 2px) / 2);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent);
  transition: transform .28s cubic-bezier(.4,.9,.3,1.3);
}
.lang-switch[data-lang="sr"] .lang-switch-thumb { transform: translateX(calc(100% + 2px)); }
.lang-opt {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 34px; height: 28px;
  border: 0; background: transparent; cursor: pointer; padding: 0;
  border-radius: 999px;
  transition: opacity .2s, filter .2s;
  opacity: .45; filter: grayscale(1);
}
.lang-opt:hover { opacity: .8; filter: grayscale(.3); }
.lang-opt.is-active { opacity: 1; filter: none; }
.lang-opt img {
  width: 20px; height: 14px; display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  object-fit: cover;
}

/* Hero */
.hero {
  position: relative;
  background:
    radial-gradient(900px 460px at 78% -20%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(700px 360px at 5% 120%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 65%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 75%);
  opacity: .5;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow {
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lead { font-size: 1.18rem; }

/* Cards */
.card {
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 60%, transparent), transparent);
  opacity: 0; transition: opacity .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.card:hover::before { opacity: 1; }
.card-icon { border-radius: 12px; }

/* Inputs & chips */
.toolbar input[type="search"] { border-radius: 999px; padding: 0.75rem 1.15rem; background: var(--bg-elev); }
.chip { padding: 0.45rem 0.95rem; }
.chip.is-active {
  background: linear-gradient(145deg, var(--accent), var(--accent-600));
  box-shadow: 0 6px 16px -8px rgba(51,196,129,.9);
}

/* Lists & surfaces */
.fn-list { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev); }
.fn-row:last-child { border-bottom: 0; }
.fn-table-head { border-bottom: 0; padding-bottom: 0.35rem; }
.fn-detail .signature, .fn-detail .example, .copy-btn { border-radius: var(--radius-sm); }
.fn-detail .example { border-radius: var(--radius); box-shadow: var(--shadow); }
.copy-btn { border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.hero .container.hero-grid { max-width: var(--maxw); }

/* ===== Brand logo ===== */
.brand-logo { width: 30px; height: 30px; border-radius: 9px; display: block; object-fit: contain; }

/* ===== Home: hero layout with next live stream ===== */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 2.5rem; align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.next-live {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}
.next-live .nl-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-600);
}
html[data-theme="dark"] .next-live .nl-head { color: var(--accent-300); }
.next-live .nl-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft); animation: nlPulse 2s infinite;
}
@keyframes nlPulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.next-live h3 { margin: 0.7rem 0 0.35rem; font-size: 1.15rem; }
.next-live .nl-time { color: var(--fg-muted); font-size: 0.92rem; margin: 0 0 1rem; }

/* ===== LAMBDA collections ===== */
.collection-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.collection-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
}
.collection-top { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.collection-main { flex: 1 1 320px; min-width: 0; }
.collection-main h3 { margin: 0 0 0.3rem; }
.collection-main .desc { color: var(--fg-muted); margin: 0; }
.collection-toggle {
  margin-top: 0.75rem; display: inline-flex; align-items: center; gap: 0.45rem;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-600); font-weight: 600; font-size: 0.92rem; font-family: inherit;
}
html[data-theme="dark"] .collection-toggle { color: var(--accent-300); }
.collection-toggle svg { transition: transform 0.25s ease; }
.collection-item.is-open .collection-toggle svg { transform: rotate(90deg); }
.collection-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.collection-item.is-open .collection-body { grid-template-rows: 1fr; }
.collection-body > div { overflow: hidden; }
.collection-fns { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.collection-fns li {
  display: grid; grid-template-columns: 160px 180px 1fr; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border-radius: 10px; background: var(--bg-soft); font-size: 0.92rem;
}
.collection-fns .cf-name { font-family: var(--mono); font-weight: 600; }
.collection-fns .cf-args { font-family: var(--mono); color: var(--fg-muted); }
.collection-fns .cf-desc { color: var(--fg-muted); }
@media (max-width: 720px) { .collection-fns li { grid-template-columns: 1fr; gap: 0.2rem; } }
.hero .container.hero-grid { max-width: var(--maxw); }
