/* CapX Planning — ThresholdStack | styles */
:root {
  --ink: #0d1b2a;
  --ink-2: #1b263b;
  --slate: #415a77;
  --slate-2: #5b7290;
  --mist: #e0e6ee;
  --paper: #f6f8fb;
  --white: #ffffff;
  --line: #d8e0ea;
  --accent: #2f6df6;
  --accent-dark: #1d4ed8;
  --gold: #c79a3a;
  --green: #1c8a5a;
  --green-bg: #e6f5ee;
  --red: #c0392b;
  --red-bg: #fbeae7;
  --amber: #b7791f;
  --amber-bg: #fbf3e0;
  --shadow: 0 1px 3px rgba(13,27,42,.08), 0 8px 24px rgba(13,27,42,.06);
  --shadow-lg: 0 12px 40px rgba(13,27,42,.14);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- Gate ---------- */
#gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 70% -10%, #21314b 0%, var(--ink) 55%);
}
.gate-card {
  background: var(--white); width: min(420px, 92vw);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 38px 34px; text-align: center;
}
.gate-card .brand-mark { justify-content: center; margin-bottom: 22px; }
.gate-card h1 { font-size: 19px; margin: 0 0 6px; }
.gate-card p { color: var(--slate); font-size: 13.5px; margin: 0 0 22px; }
.gate-card input {
  width: 100%; padding: 13px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s;
}
.gate-card input:focus { border-color: var(--accent); }
.gate-card button {
  width: 100%; margin-top: 12px; padding: 13px; font-size: 15px; font-weight: 650;
  color: #fff; background: var(--accent); border: 0; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.gate-card button:hover { background: var(--accent-dark); }
.gate-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.gate-foot { margin-top: 20px; font-size: 11.5px; color: var(--slate-2); }

/* ---------- Brand ---------- */
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: var(--line); display: inline-block; }
.brand-sub { font-size: 10.5px; color: var(--slate-2); line-height: 1.3; letter-spacing: .01em; }
.gate-logo { height: 38px; width: auto; display: block; margin: 0 auto 6px; }
.gate-tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.brand-mark { display: flex; align-items: center; gap: 12px; }
.brand-mark .glyph {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), #6f9bff);
  position: relative;
}
.brand-mark .glyph::before, .brand-mark .glyph::after {
  content: ""; position: absolute; background: #fff; border-radius: 1px;
}
.brand-mark .glyph::before { left: 8px; right: 8px; height: 3px; top: 9px; opacity: .95; }
.brand-mark .glyph::after { left: 8px; right: 8px; height: 3px; bottom: 9px; opacity: .6; }
.brand-mark .wordmark { font-weight: 750; letter-spacing: .04em; font-size: 14px; }
.brand-mark .wordmark span { color: var(--accent); }
.brand-mark .tag { font-size: 10.5px; color: var(--slate-2); letter-spacing: .02em; }

/* ---------- App shell ---------- */
#app { max-width: 1180px; margin: 0 auto; padding: 0 22px 80px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(246,248,251,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 14px 22px; margin: 0 -22px 0;
}
.topbar .right { display: flex; align-items: center; gap: 14px; }
.prop-select {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink);
  padding: 9px 34px 9px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23415a77' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 11px center;
  appearance: none; cursor: pointer; max-width: 320px;
}
.btn-link { font-size: 12.5px; color: var(--slate); cursor: pointer; background: none; border: 0; }

/* ---------- Hero ---------- */
.hero { padding: 30px 0 8px; }
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: 30px; margin: 6px 0 4px; letter-spacing: -.01em; }
.hero .sub { color: var(--slate); font-size: 15px; }
.hero .addr { color: var(--slate-2); font-size: 13px; margin-top: 2px; }
.illus-banner {
  margin-top: 14px; padding: 9px 13px; border-radius: var(--radius-sm);
  background: var(--amber-bg); color: var(--amber); font-size: 12.5px; font-weight: 600;
  border: 1px solid #f0dcae;
}

/* ---------- Cards / sections ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; margin: 0; }
.section-head .note { font-size: 12.5px; color: var(--slate-2); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px 22px; }

/* sourced grid */
.sourced-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.sourced-cell { background: var(--white); padding: 13px 15px; }
.sourced-cell .k { font-size: 11.5px; color: var(--slate-2); display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.sourced-cell .v { font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.badge-otr { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: var(--green); background: var(--green-bg); border: 1px solid #bfe6d2; border-radius: 4px; padding: 1px 4px; }

/* headline returns */
.returns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.return-card { padding: 18px 18px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); position: relative; }
.return-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,109,246,.12), var(--shadow); }
.return-card .label { font-size: 12.5px; font-weight: 650; color: var(--slate); }
.return-card .big { font-size: 27px; font-weight: 760; font-variant-numeric: tabular-nums; margin: 8px 0 2px; letter-spacing: -.01em; }
.return-card .big.neg { color: var(--red); }
.return-card .big.pos { color: var(--green); }
.return-card .meta { font-size: 12px; color: var(--slate-2); font-variant-numeric: tabular-nums; }
.return-card .pill { position: absolute; top: 14px; right: 14px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: var(--accent); background: #e8f0ff; border-radius: 5px; padding: 2px 6px; }
.delta-strip { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ink); color: #dfe7f3; display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.delta-strip b { color: #fff; font-variant-numeric: tabular-nums; font-size: 16px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.control { display: flex; flex-direction: column; gap: 6px; }
.control > label { font-size: 11.5px; font-weight: 650; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--white); }
.seg button { border: 0; background: var(--white); padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--slate); cursor: pointer; font-family: var(--sans); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.control input[type=range] { width: 180px; accent-color: var(--accent); }
.control .rv { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; }
.control input[type=date] { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: var(--sans); font-size: 13px; }

/* tables */
table.model { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.model th, table.model td { padding: 9px 14px; text-align: right; font-variant-numeric: tabular-nums; }
table.model th:first-child, table.model td:first-child { text-align: left; }
table.model thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--slate-2); border-bottom: 1.5px solid var(--line); }
table.model tbody tr + tr td { border-top: 1px solid #eef2f7; }
table.model tr.subtotal td { font-weight: 700; border-top: 1.5px solid var(--line) !important; }
table.model tr.grand td { font-weight: 800; background: var(--paper); border-top: 2px solid var(--ink) !important; font-size: 14.5px; }
table.model td.indent { padding-left: 26px; color: var(--ink-2); }
table.model td.neg { color: var(--red); }
.col-active { background: rgba(47,109,246,.05); }
table.model th.col-active { color: var(--accent); }

/* incentives */
.inc-group-head td { font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); background: var(--paper); padding-top: 14px !important; }
.inc-name { font-weight: 600; }
.inc-name small { display: block; color: var(--slate-2); font-weight: 400; font-size: 11.5px; margin-top: 2px; max-width: 420px; }
.status { font-size: 10.5px; font-weight: 750; letter-spacing: .02em; border-radius: 5px; padding: 3px 7px; display: inline-block; }
table.model.inc { table-layout: fixed; }
table.model.inc td { vertical-align: top; word-wrap: break-word; overflow-wrap: anywhere; }
table.model.inc .inc-name small { max-width: none; }
.status.live { color: var(--green); background: var(--green-bg); }
.status.dead { color: var(--red); background: var(--red-bg); }
.status.low { color: var(--amber); background: var(--amber-bg); }
.status.cond { color: var(--slate); background: var(--mist); }
tr.is-dead .inc-name, tr.is-dead td.val { text-decoration: line-through; color: var(--slate-2); text-decoration-thickness: 1.5px; }
td.val { font-variant-numeric: tabular-nums; font-weight: 650; }
td.val.fin { color: var(--slate); font-weight: 600; }
.inc-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-top: 16px; }
.tot { padding: 15px 17px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); }
.tot .k { font-size: 11.5px; color: var(--slate-2); }
.tot .v { font-size: 21px; font-weight: 760; font-variant-numeric: tabular-nums; margin-top: 3px; }
.tot.hl { background: var(--ink); border-color: var(--ink); }
.tot.hl .k { color: #aebccf; }
.tot.hl .v { color: #fff; }

/* pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 24px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.price-card.reco { border: 2px solid var(--accent); box-shadow: var(--shadow-lg); }
.price-card .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .04em; padding: 4px 14px; border-radius: 20px; white-space: nowrap; }
.price-card .tier { font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.price-card .amt { font-size: 34px; font-weight: 780; margin: 8px 0 0; letter-spacing: -.02em; white-space: nowrap; }
.price-card .amt-unit { font-size: 13px; font-weight: 600; color: var(--slate-2); margin: 0 0 6px; }
.price-card .desc { font-size: 13px; color: var(--slate); min-height: 38px; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 0; font-size: 13px; }
.price-card li { padding: 6px 0 6px 24px; position: relative; color: var(--ink-2); }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.price-card.reco .amt { color: var(--accent-dark); }
.price-note { margin-top: 14px; font-size: 12.5px; color: var(--slate); }

/* preview / locked */
.preview-wrap { position: relative; }
.preview-blur { filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.preview-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.preview-cta { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px 32px; text-align: center; max-width: 380px; }
.preview-cta .lock { font-size: 26px; }
.preview-cta h3 { margin: 8px 0 6px; font-size: 18px; }
.preview-cta p { color: var(--slate); font-size: 13.5px; margin: 0 0 16px; }
.preview-cta a { display: inline-block; background: var(--accent); color: #fff; font-weight: 650; font-size: 14px; padding: 11px 22px; border-radius: var(--radius-sm); }

/* footer */
.foot { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--slate-2); font-size: 12px; }
.foot .disc { margin-top: 8px; }

@media (max-width: 760px) {
  .returns, .pricing { grid-template-columns: 1fr; }
  table.model { font-size: 12.5px; }
  table.model th, table.model td { padding: 8px 8px; }
  .hero h1 { font-size: 24px; }
}
