/* ============================================================
   BaoTabs landing page
   Flat colour only. No gradients anywhere, by design.
   ============================================================ */

:root {
  /* light palette */
  --bg:        #FBF9F5;
  --bg-alt:    #F4F1EA;
  --surface:   #FFFFFF;
  --ink:       #17160F;
  --ink-2:     #46433A;
  --muted:     #6E6A5E;
  --line:      #E4DFD3;
  --line-2:    #D6D0C1;
  --accent:    #A94A25;
  --accent-ink:#FFFFFF;
  --green:     #2E5A4C;
  --dark-bg:   #17160F;
  --dark-ink:  #F5F2EA;
  --dark-muted:#A9A395;
  --dark-line: #302D24;

  --radius:    14px;
  --radius-sm: 9px;
  --wrap:      1120px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg:        #12110D;
  --bg-alt:    #191813;
  --surface:   #1C1B15;
  --ink:       #F4F1E9;
  --ink-2:     #D3CFC3;
  --muted:     #9C978A;
  --line:      #2C2A22;
  --line-2:    #3A372C;
  --accent:    #D97346;
  --accent-ink:#1A1108;
  --green:     #7FB39F;
  --dark-bg:   #0C0B08;
  --dark-ink:  #F4F1E9;
  --dark-muted:#9C978A;
  --dark-line: #26241C;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:        #12110D;
    --bg-alt:    #191813;
    --surface:   #1C1B15;
    --ink:       #F4F1E9;
    --ink-2:     #D3CFC3;
    --muted:     #9C978A;
    --line:      #2C2A22;
    --line-2:    #3A372C;
    --accent:    #D97346;
    --accent-ink:#1A1108;
    --green:     #7FB39F;
    --dark-bg:   #0C0B08;
    --dark-ink:  #F4F1E9;
    --dark-muted:#9C978A;
    --dark-line: #26241C;
  }
}

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

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 650; letter-spacing: -0.01em; }
p  { margin: 0 0 1rem; color: var(--ink-2); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-size: .78rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .9rem;
}
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; }
.fineprint { font-size: .875rem; color: var(--muted); margin-top: 1.1rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }

.nav { margin-left: auto; display: flex; gap: 26px; }
.nav a { color: var(--ink-2); font-size: .94rem; font-weight: 500; }
.nav a:hover { color: var(--ink); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--ink); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .i-sun { display: none; }
  html[data-theme="auto"] .i-moon { display: block; }
}

.menu-btn { display: none; }

.nav-mobile { display: none; }
.nav-mobile[hidden] { display: none !important; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px;
  font-size: .95rem; font-weight: 600; letter-spacing: -.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); color: var(--bg); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--ink-2); }

.btn-sm { padding: 8px 15px; font-size: .875rem; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.75rem; }

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

.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 68px); align-items: center; }
.hero-copy h1 { margin-bottom: .55em; }

.demo-hint { font-size: .82rem; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* ---------- the mock ---------- */

.mock {
  display: grid; grid-template-columns: 208px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 14px 40px -22px rgba(0,0,0,.32);
}

.mock-side {
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 336px;
}
.mock-side-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 12px 8px;
  font-size: .7rem; letter-spacing: .04em;
}
.mock-title { font-weight: 650; color: var(--ink); text-transform: uppercase; font-size: .65rem; letter-spacing: .1em; }
.mock-count { color: var(--muted); font-size: .68rem; }

.mock-list { list-style: none; margin: 0; padding: 0 6px; flex: 1; }

.mock-row {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin-bottom: 2px;
  border-radius: 7px;
  font-size: .76rem; color: var(--ink-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, opacity .18s ease;
}
.mock-row[data-depth="1"] { margin-left: 14px; }
.mock-row[data-depth="2"] { margin-left: 28px; }
.mock-row[data-depth="1"]::before,
.mock-row[data-depth="2"]::before {
  content: ""; position: absolute; left: -8px; top: 0; bottom: 0;
  border-left: 1px solid var(--line-2);
}
.mock-row:hover { background: var(--surface); color: var(--ink); }
.mock-row.is-active { background: var(--accent); color: var(--accent-ink); }
.mock-row.is-active .dot { background: var(--accent-ink); }
.mock-row.is-hidden { display: none; }

.mock-row .lbl { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--muted); }
.dot-a { background: #C0562C; } .dot-b { background: #2E5A4C; } .dot-c { background: #7A6A3F; }
.dot-d { background: #4A5C7A; } .dot-e { background: #8A4260; } .dot-f { background: #3F6B72; }
.dot-g { background: #6B5B8A; }

.tw {
  width: 0; height: 0; flex: none;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: -2px;
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.mock-row.is-collapsed .tw { transform: rotate(0deg); }
.mock-row.is-active .tw { border-left-color: var(--accent-ink); }

.mock-foot {
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  font-size: .74rem; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.plus { font-size: .95rem; line-height: 1; color: var(--accent); }

.mock-browser { display: flex; flex-direction: column; background: var(--surface); }
.mock-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.tl { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tl.r { background: #D96A5E; } .tl.y { background: #D9AE5E; } .tl.g { background: #7FAE6B; }
.mock-url {
  margin-left: 10px; flex: 1;
  background: var(--bg-alt); border-radius: 6px;
  padding: 3px 10px; font-size: .68rem; color: var(--muted);
}
.mock-page { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.ph { height: 9px; border-radius: 4px; background: var(--line); width: 100%; }
.ph-lg { height: 16px; width: 62%; background: var(--line-2); }
.ph-md { width: 78%; }
.ph-sm { width: 44%; }
.ph-block { height: 74px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--line); }

/* ---------- band / pillars ---------- */

.band { border-block: 1px solid var(--line); background: var(--bg-alt); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); padding: clamp(40px, 6vw, 64px) 24px; }
.pillar h3 { margin-bottom: .4em; }
.pillar p { margin: 0; font-size: .96rem; }

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

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 { margin-bottom: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.two-col-tight { align-items: start; }

.ticks { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.ticks li {
  position: relative; padding-left: 26px; margin-bottom: .7rem;
  color: var(--ink-2); font-size: .96rem;
}
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .55em;
  width: 9px; height: 9px; border-radius: 2px; background: var(--accent);
}

/* ---------- tree figure ---------- */

.tree-fig { margin: 0; }
.tree-demo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.t-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: .92rem; color: var(--ink); }
.t-row + .t-row { border-top: 1px solid var(--line); }
.t-1 { padding-left: 26px; }
.t-2 { padding-left: 52px; }
.t-line { width: 14px; height: 1px; background: var(--line-2); flex: none; }
.t-1 .t-cap, .t-2 .t-cap { color: var(--muted); }
.tree-fig figcaption { margin-top: 14px; font-size: .84rem; color: var(--muted); line-height: 1.5; }

/* ---------- feature grid ---------- */

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { margin: 14px 0 .45em; }
.card p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.6; }

.ic { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- privacy (dark band) ---------- */

.section-dark { background: var(--dark-bg); color: var(--dark-ink); }
.section-dark h2, .section-dark h3 { color: var(--dark-ink); }
.section-dark p { color: var(--dark-muted); }
.section-dark .eyebrow { color: var(--accent); }

.privacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--dark-line); border: 1px solid var(--dark-line); border-radius: var(--radius); overflow: hidden; }
.privacy-item { background: var(--dark-bg); padding: 28px 26px; }
.privacy-item h3 { margin-bottom: .4em; }
.privacy-item p { margin: 0; font-size: .93rem; line-height: 1.6; }

/* ---------- download ---------- */

.download { text-align: center; max-width: 640px; }
.download .lead { margin-inline: auto; }
.download .cta-row { justify-content: center; }
.dl-icon { margin: 0 auto 22px; width: 112px; height: 112px; border-radius: 24px; }

/* ---------- faq ---------- */

.faq { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }

.faq summary {
  list-style: none; cursor: pointer;
  padding: 18px 22px; padding-right: 52px;
  font-weight: 600; font-size: 1rem; color: var(--ink);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 10px; height: 10px; margin-top: -6px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { background: var(--bg-alt); }
.faq-body { padding: 0 22px 20px; }
.faq-body p { margin: 0; font-size: .95rem; color: var(--muted); }
code { font-family: var(--mono); font-size: .87em; background: var(--bg-alt); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; background: var(--bg); }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 6px; }
.footer-brand strong { display: block; font-size: .95rem; color: var(--ink); }
.footer-brand span { font-size: .85rem; color: var(--muted); }
.footer-links { display: flex; gap: 22px; margin-left: auto; }
.footer-links a { color: var(--muted); font-size: .88rem; }
.footer-links a:hover { color: var(--ink); text-decoration: none; }
.copyright { width: 100%; margin: 0; font-size: .82rem; color: var(--muted); }

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

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:active { transform: none; }
  .card:hover { transform: none; }
}

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

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }

  .nav-mobile { display: flex; flex-direction: column; padding: 8px 24px 18px; border-top: 1px solid var(--line); background: var(--bg); }
  .nav-mobile a { padding: 11px 0; color: var(--ink-2); font-size: .98rem; border-bottom: 1px solid var(--line); }
  .nav-mobile a:last-child { border-bottom: none; }

  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .hero-demo { order: 2; }
  .pillars { grid-template-columns: 1fr; gap: 28px; }
  .privacy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .mock { grid-template-columns: 172px 1fr; }
  .cta-row .btn { flex: 1 1 auto; }
  .footer-links { margin-left: 0; flex-wrap: wrap; gap: 16px; }
}

/* ---------- legal pages (privacy policy, legal notice) ---------- */

.legal { max-width: 760px; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: .25em; }
.legal .updated { margin: 0 0 2.4rem; color: var(--muted); font-size: .875rem; }
.legal h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  margin: 2.4rem 0 .6em; padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal h3 { font-family: var(--sans); font-size: .98rem; font-weight: 650; margin: 1.5rem 0 .4em; }
.legal p, .legal li, .legal dd { color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
.legal p { margin: 0 0 1rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.15rem; }
.legal li { margin-bottom: .45rem; }
.legal dt { margin-top: 1rem; font-size: .95rem; font-weight: 650; color: var(--ink); }
.legal dd { margin: .15rem 0 0; }
.legal address { font-style: normal; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
.legal .lead { font-size: 1.05rem; color: var(--ink); }

/* The dark band inverts the palette, so the link needs a token that reads on it. */
.privacy-more { margin: 1rem 0 0; color: var(--dark-muted); font-size: .95rem; }
.privacy-more a { color: var(--dark-ink); text-decoration: underline; text-underline-offset: 3px; }
.privacy-more a:hover { color: #fff; }
