/* FigurePal — design tokens + base styles */

:root {
  /* Accent (blue default; tweakable) */
  --accent: #2563eb;
  --accent-600: #1d4ed8;
  --accent-50: #eff6ff;
  --accent-100: #dbeafe;
  --accent-fg: #ffffff;

  /* Neutrals */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --border: #e5e7eb;
  --border-strong: #d4d4d8;
  --ink: #0b1220;
  --ink-2: #1f2937;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  /* Type */
  --font-sans: "Manrope", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadow tokens — switched by card-style tweak */
  --card-bg: var(--surface);
  --card-border: 1px solid var(--border);
  --card-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 1px rgba(15,23,42,0.03);
  --card-radius: var(--r-lg);

  /* Density */
  --gap-1: 6px;
  --gap-2: 10px;
  --gap-3: 14px;
  --gap-4: 20px;
  --gap-5: 28px;
  --gap-6: 40px;
  --gap-7: 64px;

  --content-pad-y: 28px;
  --section-gap: 56px;
  --card-pad: 18px;
}

[data-card="flat"] {
  --card-bg: var(--surface);
  --card-border: 1px solid var(--border);
  --card-shadow: none;
}
[data-card="shadow"] {
  --card-bg: var(--surface);
  --card-border: 1px solid transparent;
  --card-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 8px 24px -12px rgba(15,23,42,0.10);
}
[data-card="outline"] {
  --card-bg: var(--surface);
  --card-border: 1.5px solid var(--ink);
  --card-shadow: none;
}

[data-density="compact"] {
  --section-gap: 40px;
  --card-pad: 14px;
  --content-pad-y: 18px;
}
[data-density="comfortable"] {
  --section-gap: 64px;
  --card-pad: 22px;
  --content-pad-y: 36px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, button, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.cs-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.cs-header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 64px;
}
.cs-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 20px;
}
.cs-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  position: relative;
}
.cs-logo-mark::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.cs-nav { display: flex; gap: 22px; align-items: center; font-size: 14.5px; color: var(--ink-2); }
.cs-nav a { padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.cs-nav a:hover { color: var(--accent); }
.cs-nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.cs-header-spacer { flex: 1; }
.cs-header-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 280px;
  color: var(--muted);
  font-size: 13.5px;
}
.cs-header-search:hover { border-color: var(--border-strong); color: var(--ink-2); }
.cs-header-search kbd {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: #fff; color: var(--muted);
}
@media (max-width: 760px) {
  .container { padding: 0 20px; }
  .cs-header-inner { gap: 18px; }
  .cs-logo { font-size: 18px; flex: 0 0 auto; }
  .cs-nav { gap: 14px; font-size: 13.5px; min-width: 0; }
  .cs-header-search {
    width: 42px;
    min-width: 42px;
    justify-content: center;
    padding: 0;
  }
  .cs-header-search span,
  .cs-header-search kbd {
    display: none;
  }
}
@media (max-width: 520px) {
  .container { padding: 0 24px; }
  .cs-header-inner { height: 64px; gap: 16px; }
  .cs-nav a[href="#/about"] { display: none; }
  .cs-header-search { display: none; }
  .cs-header-spacer { display: none; }
}
@media (max-width: 380px) {
  .cs-header .container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .cs-header-inner {
    gap: 10px;
  }
  .cs-logo { font-size: 17px; }
  .cs-logo {
    gap: 8px;
  }
  .cs-logo-mark { width: 28px; height: 28px; }
  .cs-nav { gap: 8px; font-size: 12.5px; }
}

/* Hero */
.cs-hero { padding: 56px 0 36px; text-align: center; }
.cs-hero h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 16px;
  font-weight: 800;
  text-wrap: balance;
}
.cs-hero h1 .accent { color: var(--accent); }
.cs-hero p {
  margin: 0 auto 28px; max-width: 640px;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--muted);
  text-wrap: pretty;
}
.cs-search-shell {
  display: flex; align-items: center; gap: 8px;
  max-width: 640px; margin: 0 auto;
  padding: 8px 8px 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -16px rgba(15,23,42,0.18);
  transition: border-color .15s, box-shadow .15s;
}
.cs-search-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-100), 0 12px 32px -16px rgba(15,23,42,0.2);
}
.cs-search-shell svg { flex: 0 0 auto; color: var(--muted); }
.cs-search-shell input {
  flex: 1; min-width: 0; height: 44px;
  border: 0; outline: 0; background: transparent;
  font-size: 16.5px;
}
.cs-search-shell input::placeholder { color: var(--muted-2); }
.cs-search-go {
  height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: #fff; border: 0; font-weight: 600;
  letter-spacing: -0.01em;
}
.cs-search-go:hover { background: var(--accent); }

.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.cs-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--ink-2);
  transition: all .15s;
}
.cs-chip:hover { border-color: var(--accent); color: var(--accent); }
.cs-chip-label { color: var(--muted); margin-right: 4px; }

/* Section heading */
.cs-section { padding: var(--section-gap) 0 0; }
.cs-section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.cs-section-head h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.02em; margin: 0; font-weight: 700;
}
.cs-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.cs-section-link {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 14px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.cs-section-link:hover { color: var(--accent); }

@media (max-width: 560px) {
  :root {
    --section-gap: 44px;
    --card-pad: 16px;
  }
  .container,
  .container-narrow {
    padding-left: 20px;
    padding-right: 20px;
  }
  .cs-section-head {
    align-items: flex-start;
    gap: 12px;
  }
  .cs-section-head h2 {
    font-size: 25px;
    line-height: 1.12;
  }
  .cs-section-head p {
    font-size: 14px;
    line-height: 1.45;
  }
  .cs-section-link {
    min-height: 38px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  }
}

@media (max-width: 380px) {
  .cs-section-head {
    flex-direction: column;
  }
  .cs-section-link {
    align-self: flex-start;
  }
}

/* Cards */
.cs-card {
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  text-align: left;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
button.cs-card { font: inherit; color: inherit; }
.cs-card:hover {
  border-color: var(--border-strong);
}

/* Category grid */
.cs-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) { .cs-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cs-cat-grid { grid-template-columns: 1fr; } }
.cs-cat-card {
  display: flex; align-items: flex-start; gap: 14px;
  cursor: pointer; text-align: left;
}
.cs-cat-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.cs-cat-icon {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-50);
  color: var(--accent);
  display: grid; place-items: center;
}
[data-card="outline"] .cs-cat-icon { background: var(--accent); color: var(--accent-fg); }
.cs-cat-body h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.01em; }
.cs-cat-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.cs-cat-count { margin-top: 8px; font-size: 12px; color: var(--muted-2); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }

@media (max-width: 540px) {
  .cs-cat-card {
    gap: 14px;
    padding: 18px;
  }
  .cs-cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .cs-cat-body h3 {
    font-size: 18px;
    line-height: 1.2;
  }
  .cs-cat-body p {
    font-size: 14px;
  }
}

/* Calculator card */
.cs-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .cs-calc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .cs-calc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .cs-calc-grid { grid-template-columns: 1fr; } }

.cs-calc-card {
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; min-height: 134px;
}
.cs-calc-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.cs-calc-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 6px;
  background: var(--accent-50); color: var(--accent-600);
}
.cs-calc-card h3 { margin: 0; font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.25; }
.cs-calc-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.cs-calc-card .cs-calc-cta {
  margin-top: auto;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.cs-calc-card:hover .cs-calc-cta { color: var(--accent); }

/* Why bullets */
.cs-why {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .cs-why { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .cs-why { grid-template-columns: 1fr; } }
.cs-why-card { padding: 18px; }
.cs-why-card .cs-why-num {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); font-weight: 600;
}
.cs-why-card h4 { margin: 6px 0 4px; font-size: 15px; letter-spacing: -0.01em; }
.cs-why-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* SEO block */
.cs-seo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
}
@media (max-width: 800px) { .cs-seo { grid-template-columns: 1fr; padding: 24px; gap: 16px; } }
.cs-seo h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.cs-seo .label { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.cs-seo p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.cs-seo p:last-child { margin-bottom: 0; }

/* Footer */
.cs-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.cs-footer-inner {
  padding-top: 48px;
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 800px) { .cs-footer-inner { grid-template-columns: 1fr 1fr; } }
.cs-footer-col h5 {
  margin: 0 0 12px; font-size: 12px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.cs-footer-col a { display: block; padding: 4px 0; font-size: 14px; color: var(--ink-2); }
.cs-footer-col a:hover { color: var(--accent); }
.cs-footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}

@media (max-width: 640px) {
  .cs-footer {
    margin-top: 56px;
  }
  .cs-footer-inner {
    padding-top: 34px;
    padding-bottom: 24px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cs-footer-col:first-child p {
    max-width: none;
  }
  .cs-footer-col h5 {
    margin-bottom: 8px;
  }
  .cs-footer-col a {
    padding: 6px 0;
    font-size: 15px;
  }
  .cs-footer-bottom {
    padding: 18px 0 calc(20px + env(safe-area-inset-bottom));
    display: grid;
    gap: 8px;
    line-height: 1.5;
  }
}

/* Calculator tool form */
.cs-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03), 0 16px 40px -24px rgba(15,23,42,0.18);
}
@media (max-width: 700px) { .cs-tool { padding: 20px; } }

.cs-tool-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
}
@media (max-width: 800px) { .cs-tool-grid { grid-template-columns: 1fr; } }

.cs-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cs-field label,
.cs-field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cs-field .cs-input,
.cs-field select {
  height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 16px; outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.cs-field input.cs-input:focus, .cs-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-100);
}
.cs-input-wrap { position: relative; }
.cs-input-wrap .cs-prefix, .cs-input-wrap .cs-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.cs-input-wrap .cs-prefix { left: 14px; }
.cs-input-wrap .cs-suffix { right: 14px; }
.cs-input-wrap.has-prefix input { padding-left: 28px; }
.cs-input-wrap.has-suffix input { padding-right: 32px; }

.cs-field textarea.cs-textarea {
  height: auto;
  min-height: 110px;
  padding: 12px 14px;
  line-height: 1.55;
  font-family: var(--font-mono);
  font-size: 14px;
  resize: vertical;
}
.cs-field textarea.cs-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-100);
}

/* Sample-data state: shown for fields the user hasn't edited yet. */
.cs-field.is-sample input.cs-input,
.cs-field.is-sample textarea.cs-textarea,
.cs-field.is-sample select {
  color: var(--muted-2);
  background: var(--surface-2);
  border-style: dashed;
}
.cs-field.is-sample input.cs-input:focus,
.cs-field.is-sample textarea.cs-textarea:focus,
.cs-field.is-sample select:focus {
  color: var(--ink);
  background: var(--surface);
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-100);
}
.cs-field.is-sample .cs-prefix,
.cs-field.is-sample .cs-suffix {
  color: var(--muted-2);
}
.cs-field.is-sample .cs-toggle {
  background: var(--surface-2);
}
.cs-field.is-sample .cs-toggle button.is-active {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}
.cs-sample-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* Embed mode — minimal layout for iframe usage. */
html[data-embed] body { background: var(--bg); margin: 0; }
html[data-embed] main { padding-bottom: 0; }
html[data-embed] .container { padding: 0; max-width: none; }
.cs-embed {
  padding: 14px;
  max-width: 100%;
  background: var(--bg);
}
.cs-embed-title {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
}
.cs-embed .cs-tool {
  margin: 0;
  padding: 16px;
}
.cs-embed .cs-tool-grid {
  gap: 18px;
}
.cs-embed-attribution {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.cs-embed-attribution a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
@media (max-width: 700px) {
  .cs-embed .cs-tool-grid { grid-template-columns: 1fr; }
}

.cs-toggle {
  display: inline-flex; padding: 4px;
  background: var(--surface-2); border-radius: 10px;
  border: 1px solid var(--border);
}
.cs-toggle button {
  border: 0; background: transparent;
  padding: 7px 14px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.cs-toggle button.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.cs-actions { display: flex; gap: 10px; margin-top: 6px; }
.cs-btn {
  height: 46px; padding: 0 22px; border-radius: 12px;
  border: 1.5px solid transparent; font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.cs-btn-primary { background: var(--accent); color: var(--accent-fg); }
.cs-btn-primary:hover { background: var(--accent-600); }
.cs-btn-ghost { background: transparent; border-color: var(--border); color: var(--ink-2); }
.cs-btn-ghost:hover { border-color: var(--ink-2); }

.cs-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
}
.cs-result-label {
  font-size: 12px; color: var(--muted);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.cs-result-value {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em; font-weight: 700;
  margin: 6px 0 0; line-height: 1.05;
  color: var(--ink);
  font-feature-settings: "tnum" 1;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cs-result-value .unit { color: var(--muted); font-size: 0.55em; font-weight: 600; margin-left: 6px; letter-spacing: -0.01em; }
.cs-result-sub {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px;
}
.cs-result-sub div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.cs-result-sub div span:first-child { color: var(--muted); }
.cs-result-sub div span:last-child { font-variant-numeric: tabular-nums; }

.cs-result-actions {
  display: flex; gap: 8px; margin-top: 14px;
  padding-top: 12px; border-top: 1px dashed var(--border);
}
.cs-result-action {
  flex: 1; min-height: 32px; padding: 6px 12px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.cs-result-action:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-50);
}
.cs-result-action:active { transform: translateY(1px); }

/* BMI gauge */
.cs-gauge {
  position: relative; height: 14px; border-radius: 999px; margin: 12px 0;
  background: linear-gradient(to right, #60a5fa 0%, #60a5fa 18%, #34d399 18%, #34d399 50%, #fbbf24 50%, #fbbf24 75%, #f87171 75%, #f87171 100%);
}
.cs-gauge-marker {
  position: absolute; top: -6px; width: 4px; height: 26px;
  background: var(--ink); border-radius: 2px;
  transform: translateX(-2px);
  transition: left .25s;
}
.cs-gauge-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* Breadcrumbs */
.cs-crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); padding: 20px 0 4px;
}
.cs-crumbs a:hover { color: var(--accent); }
.cs-crumbs .sep { color: var(--muted-2); }
.cs-crumbs .current { color: var(--ink-2); font-weight: 500; }

/* Calculator page */
.cs-calcpage h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  margin: 8px 0 8px;
  letter-spacing: -0.025em; font-weight: 800;
  text-wrap: balance;
}
.cs-calcpage .lede {
  color: var(--muted); font-size: 17px; max-width: 720px; margin: 0 0 20px;
  text-wrap: pretty;
}
.cs-calcpage-cols {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px;
  margin-top: 36px;
}
@media (max-width: 900px) { .cs-calcpage-cols { grid-template-columns: 1fr; } }
.cs-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
}
.cs-block h3 {
  margin: 0 0 10px; font-size: 17px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.cs-block h3 .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.cs-block p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.cs-block ul, .cs-block ol { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.cs-block li { margin-bottom: 4px; }

.cs-formula {
  font-family: var(--font-mono); font-size: 15px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  color: var(--ink);
  overflow-x: auto;
}

.cs-faq-item { border-top: 1px solid var(--border); padding: 14px 0; }
.cs-faq-item:first-child { border-top: 0; padding-top: 4px; }
.cs-faq-q {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; gap: 12px;
}
.cs-faq-q::-webkit-details-marker { display: none; }
.cs-faq-q::after {
  content: "+"; font-weight: 400; color: var(--muted); font-size: 22px;
  transition: transform .15s;
}
details[open] .cs-faq-q::after { content: "−"; }
.cs-faq-a { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }

.cs-disclaimer {
  font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 10px; padding: 12px 14px; margin-top: 24px; line-height: 1.5;
}

/* Listing page */
.cs-list-controls {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 22px; align-items: center;
}
.cs-list-search {
  flex: 1; min-width: 240px; height: 42px;
  padding: 0 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); font-size: 15px;
}
.cs-list-search:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-100); }
.cs-list-select {
  height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); font-size: 14px;
}
.cs-cat-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.cs-cat-pill {
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
}
.cs-cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cs-cat-pill.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cs-empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--surface);
}

/* Hero variants */
[data-hero="split"] .cs-hero { text-align: left; }
[data-hero="split"] .cs-hero-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center;
}
@media (max-width: 800px) { [data-hero="split"] .cs-hero-grid { grid-template-columns: 1fr; } }
[data-hero="split"] .cs-hero h1 { text-align: left; }
[data-hero="split"] .cs-hero p { margin: 0 0 24px; }
[data-hero="split"] .cs-search-shell { margin: 0; }
[data-hero="split"] .cs-chips { justify-content: flex-start; }

.cs-hero-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03), 0 24px 48px -32px rgba(15,23,42,0.25);
}
.cs-hero-preview-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.cs-hero-preview h4 { margin: 4px 0 12px; font-size: 18px; letter-spacing: -0.01em; }
.cs-hero-preview .cs-result-value { font-size: 36px; }

[data-hero="featured"] .cs-hero-featured {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center;
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px;
}
@media (max-width: 800px) { [data-hero="featured"] .cs-hero-featured { grid-template-columns: 1fr; } }
.cs-featured-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.cs-featured h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.cs-featured p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }

/* Related */
.cs-related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 700px) { .cs-related-grid { grid-template-columns: 1fr; } }
.cs-related-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface);
}
.cs-related-item:hover { border-color: var(--accent); }
.cs-related-item strong { font-size: 14.5px; letter-spacing: -0.01em; }
.cs-related-item span { font-size: 13px; color: var(--muted); }

/* Search overlay */
.cs-search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(2px);
  display: grid; place-items: start center; padding-top: 8vh;
}
.cs-search-modal {
  width: min(640px, 92vw);
  background: var(--surface); border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(15,23,42,0.25);
  overflow: hidden;
}
.cs-search-modal-input {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 18px; border-bottom: 1px solid var(--border);
}
.cs-search-modal-input input {
  flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px;
}
.cs-search-results {
  max-height: 60vh; overflow-y: auto; padding: 8px;
}
.cs-search-result {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.cs-search-result:hover, .cs-search-result.is-active { background: var(--surface-2); }
.cs-search-result strong { font-size: 14.5px; letter-spacing: -0.01em; }
.cs-search-result span { font-size: 12.5px; color: var(--muted); }
.cs-search-result-meta { margin-left: auto; font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* Coming soon */
.cs-coming {
  text-align: center; padding: 60px 24px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--r-xl); color: var(--muted);
}
.cs-coming h3 { color: var(--ink); margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.cs-coming p { max-width: 460px; margin: 0 auto; }

/* Misc */
.text-muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.kbd { font-family: var(--font-mono); padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); font-size: 12px; }

/* ───────── Animations ───────── */
@keyframes cs-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cs-scale-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cs-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes cs-pop {
  0%   { transform: scale(.94); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes cs-marker-slide {
  from { transform: translateX(-2px) scaleY(.5); opacity: 0; }
  to   { transform: translateX(-2px) scaleY(1); opacity: 1; }
}

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

/* Hero entry */
.cs-hero h1 { animation: cs-fade-up .55s cubic-bezier(.2,.7,.2,1) both; }
.cs-hero p  { animation: cs-fade-up .55s cubic-bezier(.2,.7,.2,1) .08s both; }
.cs-search-shell { animation: cs-fade-up .55s cubic-bezier(.2,.7,.2,1) .15s both; }
.cs-chips { animation: cs-fade-up .55s cubic-bezier(.2,.7,.2,1) .22s both; }
.cs-hero-preview, .cs-hero-featured { animation: cs-scale-in .5s cubic-bezier(.2,.7,.2,1) .18s both; }

/* Section reveal: stagger card grids */
.cs-cat-grid > *,
.cs-calc-grid > *,
.cs-why > * {
  animation: cs-fade-up .45s cubic-bezier(.2,.7,.2,1) both;
}
.cs-cat-grid > *:nth-child(1),  .cs-calc-grid > *:nth-child(1),  .cs-why > *:nth-child(1)  { animation-delay: .02s; }
.cs-cat-grid > *:nth-child(2),  .cs-calc-grid > *:nth-child(2),  .cs-why > *:nth-child(2)  { animation-delay: .06s; }
.cs-cat-grid > *:nth-child(3),  .cs-calc-grid > *:nth-child(3),  .cs-why > *:nth-child(3)  { animation-delay: .10s; }
.cs-cat-grid > *:nth-child(4),  .cs-calc-grid > *:nth-child(4),  .cs-why > *:nth-child(4)  { animation-delay: .14s; }
.cs-cat-grid > *:nth-child(5),  .cs-calc-grid > *:nth-child(5),  .cs-why > *:nth-child(5)  { animation-delay: .18s; }
.cs-cat-grid > *:nth-child(6),  .cs-calc-grid > *:nth-child(6)                              { animation-delay: .22s; }
.cs-cat-grid > *:nth-child(7),  .cs-calc-grid > *:nth-child(7)                              { animation-delay: .26s; }
.cs-cat-grid > *:nth-child(8),  .cs-calc-grid > *:nth-child(8)                              { animation-delay: .30s; }
.cs-cat-grid > *:nth-child(n+9), .cs-calc-grid > *:nth-child(n+9)                           { animation-delay: .34s; }

/* Card hover: lift more, with cubic ease */
.cs-card { transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s, border-color .15s; }
.cs-calc-card:hover, .cs-cat-card:hover { transform: translateY(-3px); }
[data-card="shadow"] .cs-calc-card:hover, [data-card="shadow"] .cs-cat-card:hover {
  box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 18px 40px -16px rgba(15,23,42,0.18);
}

/* Calc CTA arrow nudges on hover */
.cs-calc-card .cs-calc-cta svg { transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.cs-calc-card:hover .cs-calc-cta svg { transform: translateX(3px); }
.cs-section-link svg { transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.cs-section-link:hover svg { transform: translateX(3px); }

/* Chips */
.cs-chip { transition: all .15s cubic-bezier(.2,.7,.2,1); }
.cs-chip:hover { transform: translateY(-1px); }
.cs-chip:active { transform: translateY(0) scale(.97); }

/* Buttons */
.cs-btn { transition: background .15s, border-color .15s, transform .12s, box-shadow .15s; }
.cs-btn:active { transform: translateY(1px); }
.cs-btn-primary:hover { box-shadow: 0 6px 16px -8px var(--accent); }

/* Result value pop on change */
.cs-result-value {
  animation: cs-pop .35s cubic-bezier(.2,.7,.2,1);
}

/* BMI gauge marker */
.cs-gauge-marker {
  animation: cs-marker-slide .35s cubic-bezier(.2,.7,.2,1);
  transition: left .35s cubic-bezier(.2,.7,.2,1);
}

/* Header logo: subtle pulse on accent dot */
.cs-logo-mark::after {
  animation: cs-fade-in .4s ease both;
}

/* FAQ open animation */
details[open] .cs-faq-a { animation: cs-fade-up .25s ease both; }

/* Search overlay entry */
.cs-search-overlay { animation: cs-fade-in .15s ease both; }
.cs-search-modal   { animation: cs-scale-in .2s cubic-bezier(.2,.7,.2,1) both; }

/* Form fields focus ring transition */
.cs-field input.cs-input, .cs-field select { transition: border-color .15s, box-shadow .15s; }

/* Skeleton shimmer (used by Coming Soon block) */
.cs-shimmer {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: cs-shimmer 1.8s linear infinite;
  border-radius: 8px;
}
