/* bagfolio web — shared chrome for every page. Tokens mirror the app (src/theme/tokens.ts).
   Landing-only pieces (hero grid, phone mock, ticker) live in landing.css. */
:root {
  --canvas: #eeeff2;
  --surface: #ffffff;
  --subtle: #f3f4f6;
  --lime: #d4ff4a;
  --lime-soft: #f1ffc2;
  --ink: #121417;
  --text: #121417;
  --text-2: #7a7e87;
  --text-3: #aeb2bb;
  --border: #e5e7eb;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(18, 20, 23, 0.04), 0 8px 24px rgba(18, 20, 23, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0c0d0f;
    --surface: #17191c;
    --subtle: #23262b;
    --lime-soft: #2a3312;
    --text: #f5f6f7;
    --text-2: #9aa0a8;
    --text-3: #666c75;
    --border: #2a2e34;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap--wide { max-width: 880px; }

/* atmosphere -------------------------------------------------------------- */
.top-wrap { position: relative; overflow: hidden; }
.glow {
  position: absolute; inset: -220px 0 auto 0; height: 620px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(46% 55% at 22% 40%, rgba(212, 255, 74, 0.30), transparent 70%),
    radial-gradient(38% 48% at 80% 24%, rgba(212, 255, 74, 0.13), transparent 72%);
  filter: blur(12px);
}
@media (prefers-color-scheme: dark) {
  .glow { background:
    radial-gradient(46% 55% at 22% 40%, rgba(212, 255, 74, 0.17), transparent 70%),
    radial-gradient(38% 48% at 80% 24%, rgba(212, 255, 74, 0.08), transparent 72%); }
}
.dots {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--text-3); opacity: 0.16;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.top-wrap > .wrap, .top-wrap > header { position: relative; z-index: 1; }

/* header / footer --------------------------------------------------------- */
header.site { padding: 28px 0 8px; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand svg { width: 30px; height: 30px; display: block; }
.brand span { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
nav.site a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 600; margin-left: 20px; }
nav.site a:hover { color: var(--text); }
nav.site a[aria-current] { color: var(--text); }

footer.site {
  margin-top: 64px; padding: 28px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 14.5px;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
footer.site a { color: var(--text-2); text-decoration: none; margin-right: 18px; }
footer.site a:hover { color: var(--text); }

@media (max-width: 560px) {
  .brand span { font-size: 18px; }
  nav.site a { margin-left: 13px; font-size: 13.5px; }
}

/* type -------------------------------------------------------------------- */
h1 { font-size: clamp(33px, 4.6vw, 50px); line-height: 1.13; font-weight: 800; letter-spacing: -0.03em; margin: 20px 0 12px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 40px 0 10px; scroll-margin-top: 24px; }
h3 { font-size: 17px; font-weight: 700; margin: 24px 0 6px; }
p, li { color: var(--text); }
a { color: var(--text); text-underline-offset: 3px; }
.lede { font-size: 18.5px; color: var(--text-2); margin: 0 0 8px; }
.meta { color: var(--text-3); font-size: 14px; margin: 0 0 8px; }
ul { padding-left: 22px; }
li { margin: 6px 0; }
strong { font-weight: 700; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em;
  background: var(--subtle); padding: 2px 7px; border-radius: 7px;
}

/* the lime marker under a word, as on the landing headline */
.hl { background: linear-gradient(180deg, transparent 62%, var(--lime) 62%); padding: 0 4px; margin: 0 -4px; border-radius: 3px; }

/* blocks ------------------------------------------------------------------ */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  padding: 24px; margin: 20px 0;
}
.note { background: var(--lime-soft); border-radius: 16px; padding: 18px 20px; margin: 22px 0; font-size: 15.5px; }
.note strong { color: var(--text); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 24px 0; }
.grid .card { margin: 0; padding: 20px; }
/* A three-column table cannot fold gracefully into 390px, and letting it push the page sideways is
   worse than letting the table itself scroll. `.table-scroll` keeps the overflow on the wrapper, so
   the document never gains a horizontal scrollbar of its own. */
.table-scroll { overflow-x: auto; margin: 18px 0; -webkit-overflow-scrolling: touch; }
.table-scroll table { margin: 0; }
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15.5px; }
@media (max-width: 640px) {
  .table-scroll table { min-width: 520px; }
}
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: 13.5px; letter-spacing: 0.02em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; background: var(--lime); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px 7px 10px;
  font-size: 13.5px; font-weight: 700; color: var(--text-2);
  box-shadow: var(--shadow); margin: 0;
}
.eyebrow b { color: var(--text); font-weight: 700; }
.dot-lime { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }

/* buttons ----------------------------------------------------------------- */
.cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff; text-decoration: none;
  border-radius: 16px; padding: 15px 24px; font-weight: 700; font-size: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
a.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18, 20, 23, 0.22); }
.cta--lime { background: var(--lime); color: var(--ink); }
a.cta--lime:hover { box-shadow: 0 10px 30px rgba(212, 255, 74, 0.45); }
@media (prefers-color-scheme: dark) { .cta { background: var(--lime); color: var(--ink); } }
.linkish {
  display: inline-flex; align-items: center; gap: 7px; padding: 15px 6px;
  color: var(--text-2); font-weight: 700; font-size: 16px; text-decoration: none;
  transition: color 160ms ease;
}
.linkish:hover { color: var(--text); }
.linkish svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* sections + reveal ------------------------------------------------------- */
.section { padding: 62px 0 0; }
.section__head { max-width: 34em; margin-bottom: 26px; }
.section h2 { margin: 0 0 8px; font-size: clamp(24px, 3.2vw, 32px); }
.section__head p { color: var(--text-2); margin: 0; font-size: 17px; }

/* Hidden only when JS is running (see the inline `js` class in each page) — with JS off or broken
   the page renders complete rather than blank. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* closing band ------------------------------------------------------------ */
.band {
  margin: 70px auto 0; max-width: 760px; border-radius: 28px; padding: 46px 32px; text-align: center;
  background: var(--lime); color: var(--ink); position: relative; overflow: hidden;
}
.band h2 { margin: 10px 0 6px; color: var(--ink); font-size: clamp(24px, 3.4vw, 34px); }
.band p { margin: 0 auto 20px; max-width: 30em; color: rgba(18, 20, 23, 0.72); font-weight: 600; }
.band .cta { background: var(--ink); color: #fff; }
.band .cta:hover { box-shadow: 0 10px 26px rgba(18, 20, 23, 0.28); }
.band__tag { font-size: 13px; color: rgba(18, 20, 23, 0.6); font-weight: 700; margin-top: 14px; }

/* content pages ----------------------------------------------------------- */
.page-head { padding: 34px 0 6px; position: relative; z-index: 1; }
.page-head h1 { margin: 18px 0 10px; }
.page-head .lede { max-width: 32em; }

/* Jump links for the long legal pages. */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 4px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: color 160ms ease, border-color 160ms ease;
}
.toc a:hover { color: var(--text); border-color: var(--lime); }

/* One surface panel for the whole document: cohesive with the landing's cards without chopping
   long legal prose into fragments. */
.prose {
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
  box-shadow: var(--shadow); padding: 12px 40px 40px; margin: 26px auto 0;
  /* The page grid is 880px so the header lines up with the homepage's, but 880 minus padding is
     ~100 characters a line — far past comfortable. The panel keeps the old 760px reading measure
     and simply sits centred inside the wider column. */
  max-width: 760px;
}
.prose > h2:first-of-type { margin-top: 28px; }
.prose h2 {
  display: flex; align-items: center; gap: 12px;
  padding-top: 8px;
}
.prose h2::before {
  content: ''; width: 18px; height: 4px; border-radius: 2px; background: var(--lime); flex: none;
}
.prose > p:last-child, .prose > ul:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .prose { padding: 8px 20px 28px; border-radius: 22px; }
}
/* Twelve chips wrap into eight rows on a phone and push the document off-screen. Below 640px the
   row becomes one horizontal scroller that bleeds to the screen edges — the page itself never
   scrolls sideways because the overflow lives on this element. */
@media (max-width: 640px) {
  .toc {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: -24px; padding-inline: 24px;
    scroll-padding-inline: 24px;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { white-space: nowrap; }
}
