/* FOBtoDDP — UI concept v2
   Design language: dark trading desk. Data as the interface. */

:root {
  --bg: #0B0E0C;
  --bg-2: #101411;
  --panel: #131815;
  --panel-2: #171D19;
  --line: #232B25;
  --line-2: #323C34;

  --tx: #E8EEE9;
  --tx-2: #9AA69C;
  --tx-3: #6A756D;

  --acc: #63E0A8;
  --acc-dim: #2E8F66;
  --acc-wash: rgba(99, 224, 168, .09);
  --amber: #E0B36A;
  --clay: #E0896F;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1240px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}

::selection { background: var(--acc); color: #06120C; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: clamp(32px, 3.8vw, 50px); line-height: 1.05; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.4; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tx-3);
  font-weight: 500;
}
.eyebrow.acc { color: var(--acc-dim); }

.small { font-size: 12.5px; color: var(--tx-2); line-height: 1.55; }
.tiny { font-family: var(--mono); font-size: 10.5px; color: var(--tx-3); letter-spacing: .04em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.acc-tx { color: var(--acc); }

.link { border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.link:hover { border-color: var(--acc); color: var(--acc); }

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 14, 12, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.tb-inner { height: 56px; display: flex; align-items: center; gap: 32px; }

.brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.brand .glyph {
  width: 18px; height: 18px; border: 1px solid var(--acc-dim); border-radius: 3px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; color: var(--acc);
}

.nav { display: flex; gap: 24px; }
.nav a { font-size: 13px; color: var(--tx-2); transition: color .16s var(--ease); }
.nav a:hover { color: var(--tx); }
.nav a.on { color: var(--acc); }

.tb-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px;
  border: 1px solid var(--acc); border-radius: 4px;
  background: var(--acc); color: #06120C;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.btn:hover { background: #7FEBB9; border-color: #7FEBB9; }

.btn.ghost { background: transparent; color: var(--tx); border-color: var(--line-2); font-weight: 500; }
.btn.ghost:hover { border-color: var(--tx-2); background: var(--panel); }

.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn .k { font-family: var(--mono); font-size: 11px; opacity: .5; }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-body { padding: 20px; }

/* ---------- inputs ---------- */

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  font-family: var(--sans); font-size: 14px; color: var(--tx);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 9px 12px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc-dim);
  box-shadow: 0 0 0 3px var(--acc-wash);
}
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--tx-3); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239AA69C'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* ---------- command bar ---------- */

.cmd {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 16px 16px 16px 20px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.cmd:focus-within { border-color: var(--acc-dim); box-shadow: 0 0 0 4px var(--acc-wash); }
.cmd .prompt { font-family: var(--mono); font-size: 15px; color: var(--acc); line-height: 1.6; flex: none; padding-top: 1px; }
.cmd textarea {
  flex: 1; min-width: 0;
  border: none; background: transparent; padding: 0;
  font-size: 15px; line-height: 1.6; min-height: 26px; resize: none;
}
.cmd textarea:focus { box-shadow: none; }
.cmd .btn { flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; color: var(--tx-2);
  border: 1px solid var(--line-2); border-radius: 4px;
  padding: 5px 11px; background: var(--panel);
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.chip:hover { border-color: var(--acc-dim); color: var(--acc); }

/* ---------- field table ---------- */

.ftable { display: grid; }
.frow {
  display: grid; grid-template-columns: 8px minmax(0,1fr) auto;
  gap: 12px; align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.frow:last-child { border-bottom: none; }
.frow .k { color: var(--tx-2); }
.frow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.frow .v.txt { font-family: var(--sans); font-size: 13.5px; }

/* ---------- source marks ---------- */

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.you { background: var(--acc); }
.dot.rule { background: var(--amber); }
.dot.model { background: transparent; border: 1px solid var(--tx-3); }

.legend { display: grid; gap: 9px; }
.legend .li { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--tx-2); }
.legend .li b { color: var(--tx); font-weight: 500; }

/* ---------- bars ---------- */

.bars { display: grid; }
.brow {
  display: grid; grid-template-columns: 128px minmax(0,1fr) 76px;
  gap: 14px; align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.brow:last-child { border-bottom: none; }
.brow .nm { font-size: 13px; color: var(--tx-2); }
.brow .nm .sub { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--tx-3); margin-top: 3px; letter-spacing: .03em; }
.brow .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }

.track { display: block; height: 9px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 2px; background: var(--acc); }
.fill.rule { background: var(--amber); }
.fill.model {
  min-width: 8px;
  background-image: repeating-linear-gradient(45deg, var(--acc-dim) 0 2px, transparent 2px 7px);
  background-color: rgba(99,224,168,.06);
}

/* ---------- figure & interval ---------- */

.figure {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 2.1vw, 29px); font-weight: 500;
  letter-spacing: -0.04em; line-height: 1.15; color: var(--acc);
  white-space: nowrap;
}
.figure .cur { font-size: .5em; color: var(--tx-3); letter-spacing: .04em; margin-right: 4px; vertical-align: .16em; }

.boxplot { position: relative; height: 46px; margin: 22px 0 8px; }
.boxplot .axis { position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: var(--line-2); }
.boxplot .whisker { position: absolute; top: 12px; width: 1px; height: 22px; background: var(--tx-3); }
.boxplot .range {
  position: absolute; top: 13px; height: 20px;
  background: var(--acc-wash);
  border: 1px solid var(--acc-dim); border-radius: 2px;
}
.boxplot .med { position: absolute; top: 8px; width: 2px; height: 30px; background: var(--acc); }
.boxplot .tail { position: absolute; top: 23px; height: 1px; background: var(--tx-3); }
.bp-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--tx-3); }

/* ---------- stat strip ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stat { background: var(--bg-2); padding: 24px 26px; }
.stat .n { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -0.035em; color: var(--tx); }
.stat .l { font-size: 12px; color: var(--tx-2); margin-top: 6px; }

/* ---------- ticker ---------- */

.ticker {
  display: flex; gap: 0; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.tk {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 22px; border-right: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--tx-2);
  white-space: nowrap;
}
.tk b { color: var(--tx); font-weight: 500; }
.tk .pc { color: var(--acc); }

/* ---------- layout ---------- */

.hero { padding: 66px 0 0; }
.hero h1 { max-width: 16ch; margin: 18px 0 20px; }
.hero .lede { font-size: 17px; line-height: 1.55; color: var(--tx-2); max-width: 58ch; margin-bottom: 34px; }

.section { padding: 64px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 26px; }

.split { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 56px; align-items: start; }

.work {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.3fr) minmax(290px, .85fr);
  gap: 22px;
  align-items: start;
}

.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 0 44px; }
.footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); font-weight: 500; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer li a { font-size: 12.5px; color: var(--tx-2); }
.footer li a:hover { color: var(--acc); }

.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tx-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 7px;
}
.tag.live { color: var(--acc); border-color: var(--acc-dim); background: var(--acc-wash); }

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

@media (max-width: 1080px) {
  .work { grid-template-columns: 1fr 1fr; }
  .work > :last-child { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  .shell { padding: 0 20px; }
  .nav { display: none; }
  .work { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  .brow { grid-template-columns: 110px minmax(0,1fr) 76px; gap: 12px; }
  .cmd { flex-wrap: wrap; }
  .cmd textarea { flex: 1 1 calc(100% - 30px); }
  .cmd .btn { margin-left: 30px; }
  .ticker { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .cmd-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ============================================================
   Long-form reading — for the 350 content pages
   Dark backgrounds need wider leading and softer ink than UI text.
   ============================================================ */

:root {
  --tx-body: #BAC3BC;
  --prose-w: 66ch;
}

.article {
  display: grid;
  grid-template-columns: minmax(0, var(--prose-w)) 210px;
  gap: 68px;
  align-items: start;
  padding-top: 40px;
}

.prose {
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--tx-body);
  letter-spacing: -0.002em;
}
.prose > * + * { margin-top: 1.05em; }
.prose p { margin: 0; }
.prose > p + p { margin-top: 1.05em; }

.prose h2 {
  font-size: 23px; line-height: 1.3; color: var(--tx); letter-spacing: -0.022em;
  margin-top: 2.2em; padding-top: 1.1em;
  border-top: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 {
  font-size: 16px; line-height: 1.45; color: var(--tx); letter-spacing: -0.01em;
  margin-top: 1.9em;
}
.prose h2 + h3 { margin-top: 0.9em; }

.prose strong { color: var(--tx); font-weight: 600; }
.prose em { font-style: italic; color: var(--tx); }

.prose a { color: var(--acc); border-bottom: 1px solid var(--acc-dim); padding-bottom: 1px; }
.prose a:hover { border-color: var(--acc); }

.prose ul, .prose ol { margin: 1.05em 0 0; padding-left: 1.25em; }
.prose li { margin-top: 0.5em; }
.prose li::marker { color: var(--tx-3); }

.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

.prose code {
  font-family: var(--mono); font-size: .88em;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 5px; color: var(--tx);
}

.prose table { width: 100%; border-collapse: collapse; margin-top: 1.5em; font-size: 14px; }
.prose th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3);
  padding: 0 0 9px; border-bottom: 1px solid var(--line-2); vertical-align: bottom;
}
.prose td { padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th + th, .prose td + td { padding-left: 18px; }
.prose td.num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  text-align: right; white-space: nowrap; color: var(--tx);
}

.pull {
  border-left: 2px solid var(--acc-dim);
  padding: 2px 0 2px 20px;
  margin: 1.8em 0;
  font-size: 18px; line-height: 1.6; color: var(--tx);
}

.note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: 4px;
  padding: 16px 18px;
  font-size: 14px; line-height: 1.7; color: var(--tx-body);
  margin: 1.8em 0;
}
.note b { color: var(--tx); display: block; margin-bottom: 4px; font-weight: 500; }

/* ---------- table of contents ---------- */

.toc { position: sticky; top: 84px; font-size: 12.5px; }
.toc .hd {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--tx-3); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; counter-reset: t; }
.toc li { counter-increment: t; }
.toc li::before {
  content: counter(t) "."; font-family: var(--mono);
  color: var(--tx-3); margin-right: 8px; font-size: 10.5px;
}
.toc a { color: var(--tx-2); }
.toc a:hover, .toc a.on { color: var(--acc); }

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

.crumbs { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--tx-3); letter-spacing: .04em; }
.crumbs a { color: var(--tx-2); }
.crumbs a:hover { color: var(--acc); }

.art-head { max-width: 74ch; margin-top: 18px; }
.art-head h1 { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12; margin: 14px 0 16px; }
.art-head .dek { font-size: 17px; line-height: 1.65; color: var(--tx-2); max-width: 62ch; }
.art-meta {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--tx-3); letter-spacing: .03em;
}

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

.faq { border-top: 1px solid var(--line-2); margin-top: 2.4em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 15px 26px 15px 0; position: relative;
  font-size: 15px; color: var(--tx); font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 2px; top: 13px;
  font-family: var(--mono); color: var(--tx-3); font-size: 16px;
}
.faq details[open] summary::after { content: "−"; color: var(--acc); }
.faq .ans { padding: 0 0 16px; font-size: 14.5px; line-height: 1.72; color: var(--tx-body); max-width: 62ch; }

/* ---------- inline cta ---------- */

.cta-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px 24px; margin: 2.4em 0;
}
.cta-strip .t { font-size: 15px; color: var(--tx); }
.cta-strip .s { font-size: 12.5px; color: var(--tx-2); margin-top: 3px; }

@media (max-width: 1080px) {
  .article { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .prose { font-size: 16px; line-height: 1.72; }
  .cta-strip { flex-direction: column; align-items: flex-start; }
}

/* cost table: amount column right, source column narrow */
.prose .cost-table th:nth-child(1) { width: 31%; }
.prose .cost-table th:nth-child(2) { width: 29%; }
.prose .cost-table th:nth-child(3) { width: 23%; text-align: right; }
.prose .cost-table th:nth-child(4) { width: 46px; text-align: right; }
.prose .cost-table td:nth-child(4) { text-align: right; padding-left: 0; }
.prose .cost-table td:nth-child(3) { color: var(--tx); }

/* prose links must not hijack buttons living inside the article body */
.prose a.btn,
.prose a.btn:hover {
  color: #06120C;
  border-bottom: none;
  padding-bottom: 0;
}
.prose a.btn.ghost { color: var(--tx); }

/* narrow screens: cost table becomes stacked rows, never a squeezed 4-column grid */
@media (max-width: 760px) {
  .prose .cost-table thead { display: none; }
  .prose .cost-table tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) 88px 12px;
    grid-template-rows: auto auto;
    column-gap: 10px; row-gap: 2px;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .prose .cost-table td { border: none; padding: 0; }
  .prose .cost-table td:nth-child(1) { grid-area: 1 / 1; font-size: 13.5px; color: var(--tx); line-height: 1.4; }
  .prose .cost-table td:nth-child(2) { grid-area: 2 / 1; font-size: 11.5px; color: var(--tx-3); line-height: 1.45; }
  .prose .cost-table td:nth-child(3) { grid-area: 1 / 2; text-align: right; font-size: 13px; line-height: 1.5; }
  .prose .cost-table td:nth-child(4) { grid-area: 1 / 3; align-self: center; text-align: right; }
  .prose .cost-table tbody { display: block; width: 100%; }
  .prose .cost-table { display: block; }
}

/* Mobile navigation — stage 1 addition, follows W's tokens (56px bar, 2/4px radius) */
.nav-m { display: none; position: relative; margin-left: 0; }
.nav-m > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-m > summary::-webkit-details-marker { display: none; }
.nav-m[open] > summary { color: var(--acc); border-color: var(--acc); }
.nav-m-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 8px 16px;
  display: grid;
  gap: 0;
  z-index: 50;
}
.nav-m-panel a { font-size: 13px; color: var(--tx-2); padding: 8px 0; border-bottom: 1px solid var(--line); }
.nav-m-panel a:last-child { border-bottom: 0; }
.nav-m-panel a.on { color: var(--acc); }
@media (max-width: 760px) {
  .nav-m { display: block; }
  .tb-right .tiny { display: none; }
  .tb-inner { gap: 12px; }
}

