/* StockTheta — one stylesheet for the landing page and the app. */

:root {
  --paper: #F2F5F3;
  --surface: #FFFFFF;
  --ink: #0F2A2B;
  --ink-soft: #4A6463;
  --rule: #D3DDD9;
  --teal: #0E7A70;
  --teal-ink: #FFFFFF;
  --teal-wash: #E1F0EC;
  --amber: #B7791F;
  --amber-wash: #F6ECDA;
  --loss: #B42318;
  --loss-wash: #FBE9E7;
  --focus: #1D6FD8;
  --radius-control: 8px;
  --radius-panel: 14px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1819;
    --surface: #13252A;
    --ink: #E4EEEA;
    --ink-soft: #9DB5B0;
    --rule: #26403F;
    --teal: #3FB8A9;
    --teal-ink: #062221;
    --teal-wash: #133934;
    --amber: #E0A84A;
    --amber-wash: #3A2C14;
    --loss: #F0857A;
    --loss-wash: #3D1C19;
    --focus: #7FB4FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  font-feature-settings: "tnum" 1;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.25rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ── buttons & inputs ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .6em 1.15em; border-radius: var(--radius-control);
  border: 1.5px solid var(--teal); background: var(--teal); color: var(--teal-ink);
  font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--teal); }
.btn.danger { background: transparent; color: var(--loss); border-color: var(--loss); }
.btn[disabled] { opacity: .55; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input, select {
  width: 100%; min-height: 44px; padding: .55em .75em; border-radius: var(--radius-control);
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
  font: 400 1rem/1.3 var(--body);
}
input:focus-visible, select:focus-visible { border-color: var(--focus); outline-offset: 0; }
.field { margin-bottom: 1rem; }

/* ── site header ────────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none;
         font: 700 1.3rem/1 var(--display); letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--teal); }
.site-nav a.btn { color: var(--teal-ink); }
.site-nav a.btn:hover { color: var(--teal-ink); }
@media (max-width: 720px) {
  .site-nav .hide-sm { display: none; }
  .site-head .wrap { gap: .75rem; }
  .site-nav { gap: .9rem; flex-wrap: nowrap; }
  .site-nav .btn { min-height: 40px; padding: .45em .8em; font-size: .95rem; white-space: nowrap; }
}

/* ── landing: hero ──────────────────────────────────────────── */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 13ch; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.hero .ctas { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero .fine { margin-top: .9rem; font-size: .875rem; color: var(--ink-soft); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

/* The decay curve: the one memorable element. */
.decay { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); padding: 1.25rem 1.25rem .9rem; }
.decay svg { width: 100%; height: auto; }
.decay figcaption { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--ink-soft); margin-top: .5rem; }
.decay .kept { fill: var(--amber-wash); }
.decay .curve { fill: none; stroke: var(--teal); stroke-width: 3.5; stroke-linecap: round; }
.decay .axis { stroke: var(--rule); stroke-width: 1.5; }
.decay text { fill: var(--ink-soft); font: 500 13px var(--body); }
.decay .kept-label { fill: var(--amber); font-weight: 700; font-size: 15px; }
.decay .value-label { fill: var(--teal); font-weight: 700; font-size: 15px; }
@media (prefers-reduced-motion: no-preference) {
  .decay .curve { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.6s .2s ease-out forwards; }
  .decay .kept { opacity: 0; animation: appear .8s 1.5s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
}

/* ── landing: sections ──────────────────────────────────────── */
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
.band.tint { background: var(--surface); }
.band > .wrap > p { color: var(--ink-soft); font-size: 1.1rem; }

.compare { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2rem; border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; background: var(--surface); }
.compare > div { padding: 1.5rem 1.5rem 1.25rem; }
.compare > div + div { border-left: 1px solid var(--rule); }
.compare dl { margin: 1rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; font-size: .95rem; }
.compare dt { color: var(--ink-soft); }
.compare dd { margin: 0; font-weight: 600; }
.compare.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .compare, .compare.three { grid-template-columns: 1fr; } .compare > div + div { border-left: 0; border-top: 1px solid var(--rule); } }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--teal-wash); color: var(--teal); font: 700 1.05rem/1 var(--display); margin-bottom: .8rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 1.25rem; } }

.rules { margin: 1.5rem 0 0; padding: 0; list-style: none; display: grid; gap: .9rem; max-width: 70ch; }
.rules li { padding-left: 1.6rem; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 2px; background: var(--amber); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 1.25rem; margin-top: 2rem; }
.plan { border: 1.5px solid var(--rule); border-radius: var(--radius-panel); padding: 1.5rem; background: var(--surface); }
.plan.pick { border-color: var(--teal); }
.plan .price { font: 700 2.6rem/1 var(--display); letter-spacing: -.03em; margin: .4rem 0 .2rem; }
.plan .price span { font: 500 1rem var(--body); color: var(--ink-soft); letter-spacing: 0; }
.plan .note { color: var(--amber); font-weight: 600; font-size: .9rem; min-height: 1.4em; }
.plan .btn { width: 100%; margin-top: 1.1rem; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

.faq details { border-bottom: 1px solid var(--rule); padding: 1rem 0; max-width: 75ch; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq details p { margin: .6rem 0 0; color: var(--ink-soft); }

.site-foot { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-size: .85rem; color: var(--ink-soft); }
.site-foot p { max-width: 90ch; }

/* ── app shell ─────────────────────────────────────────────── */
.app-head .wrap { gap: 1rem; }
.tabs { display: flex; gap: .25rem; margin-left: auto; }
.tabs a { padding: .5rem .85rem; border-radius: var(--radius-control); color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--teal-wash); color: var(--teal); }
@media (max-width: 560px) { .tabs a { padding: .5rem .55rem; font-size: .95rem; } }

.notice { margin: 1rem 0; padding: .8rem 1rem; border-radius: var(--radius-control); background: var(--teal-wash); }
.notice.warn { background: var(--amber-wash); }
.notice.err { background: var(--loss-wash); color: var(--loss); }
.notice p { margin: 0; }

main.app { padding: 1.5rem 0 4rem; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.page-title h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.25rem; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); padding: 1.25rem; min-width: 0; }
.panel > p { color: var(--ink-soft); font-size: .95rem; }

.table-scroll { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); border-bottom: 1.5px solid var(--rule); padding: .5rem .6rem .5rem 0; white-space: nowrap; }
td { border-bottom: 1px solid var(--rule); padding: .6rem .6rem .6rem 0; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.sym { font-weight: 700; font-family: var(--display); font-size: 1.02rem; }
tr.new td.sym::after { content: "new"; margin-left: .4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--amber-wash); color: var(--amber); font: 700 .7rem/1.4 var(--body); vertical-align: middle; }
.why { color: var(--ink-soft); font: 400 .82rem/1.45 var(--body); max-width: 34ch; margin-top: .15rem; }
.pos { color: var(--teal); } .neg { color: var(--loss); }

.headline-number { font: 700 clamp(2.4rem, 6vw, 3.4rem)/1 var(--display); letter-spacing: -.03em; color: var(--teal); margin: .25rem 0; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 140px; margin-bottom: 0; }
.row .btn { flex: 0 0 auto; }

.auth { max-width: 420px; margin: clamp(2rem, 8vh, 5rem) auto; }
.auth .panel { padding: 1.75rem; }
.auth h1 { font-size: 2rem; }

.empty { padding: 1.5rem 0 .5rem; color: var(--ink-soft); }
.disclaimer { margin-top: 2.5rem; font-size: .8rem; color: var(--ink-soft); max-width: 90ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── legal pages ── */
.legal { padding: 2.5rem 0 4rem; max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2rem; }
.legal ul { padding-left: 1.2rem; max-width: 68ch; }
.legal li { margin-bottom: .5rem; }
.stats { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: .75rem 0 .5rem; }
.stats strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin: .75rem 0; }
.inline-form .field { margin: 0; min-width: 8rem; }
.inline-form .btn { margin-bottom: 2px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-soft); white-space: nowrap; }
ul.news { list-style: none; padding: 0; margin: .5rem 0 0; }
ul.news li { padding: .55rem 0; border-top: 1px solid var(--rule); }
ul.news li:first-child { border-top: 0; }
.panel h3 { font-size: 1rem; margin: .75rem 0 .4rem; }
