/* futuresspecs.com - "exchange spec sheet" look: paper, ruled lines, mono figures. */
:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-grid: rgba(22, 20, 15, 0.035);
  --card: #fcfbf8;
  --ink: #16140f;
  --ink-2: #4f4b43;
  --muted: #7d776b;
  --rule: #dcd6c8;
  --rule-strong: #16140f;
  --accent: #b93d0c;
  --accent-wash: #f7e2d4;
  --warn: #8a5a00;
  --warn-wash: #fbefd2;
  --good: #006300;
  --zone: rgba(22, 20, 15, 0.05);
  --s1: #2a78d6;  /* chart series - validated palette, fixed order */
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --grid: #e6e1d5;
  --axis: #c3bcab;

  --f-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wrap: 1120px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111110;
    --paper-grid: rgba(255, 255, 255, 0.025);
    --card: #1a1a19;
    --ink: #f1eee6;
    --ink-2: #c3c2b7;
    --muted: #938d80;
    --rule: #2e2d2a;
    --rule-strong: #f1eee6;
    --accent: #f08048;
    --accent-wash: #3a2217;
    --warn: #f2b84b;
    --warn-wash: #33280f;
    --good: #0ca30c;
    --zone: rgba(255, 255, 255, 0.06);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --grid: #2a2a28;
    --axis: #45443f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111110; --paper-grid: rgba(255,255,255,0.025); --card: #1a1a19; --ink: #f1eee6; --ink-2: #c3c2b7;
  --muted: #938d80; --rule: #2e2d2a; --rule-strong: #f1eee6; --accent: #f08048; --accent-wash: #3a2217;
  --warn: #f2b84b; --warn-wash: #33280f; --good: #0ca30c; --zone: rgba(255,255,255,0.06);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --grid: #2a2a28; --axis: #45443f;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 16px/1.55 var(--f-sans);
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 0.94em; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--card); padding: 8px 12px; }

/* ---- masthead */
.masthead { border-bottom: 2px solid var(--rule-strong); background: var(--paper); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wm-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  background: var(--ink); color: var(--paper); font: 700 13px/1 var(--f-mono); letter-spacing: -0.5px;
}
.wm-text { font: 500 19px/1 var(--f-cond); letter-spacing: -0.2px; }
.wm-text b { font-weight: 700; }
.topnav { display: flex; gap: 20px; font: 600 13px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; }
.topnav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---- hero */
.hero { padding: 40px 0 0; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: end; }
.ticker { justify-self: start;
  font: 600 clamp(84px, 14vw, 168px)/0.78 var(--f-mono); letter-spacing: -0.06em;
  color: var(--ink); padding-bottom: 6px; position: relative;
  animation: rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.ticker::after { content: ""; position: absolute; left: 0; right: 0.12em; bottom: -10px; height: 6px; background: var(--accent); }
.eyebrow { font: 600 12px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin: 0 0 12px; }
h1 { font: 700 clamp(28px, 3.6vw, 40px)/1.08 var(--f-cond); letter-spacing: -0.01em; margin: 0 0 12px; }
.h1-sym { color: var(--muted); font-weight: 500; }
.home-h1 { font-size: clamp(32px, 5vw, 56px); max-width: 18ch; }
.lede { color: var(--ink-2); font-size: 17px; max-width: 62ch; margin: 0; }
.hero-copy { animation: rise .6s .08s cubic-bezier(.2,.7,.2,1) both; }
.hero-home { padding-bottom: 32px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

.keyfigs {
  display: grid; grid-template-columns: repeat(5, 1fr); margin: 40px 0 0;
  border: 2px solid var(--rule-strong); background: var(--card);
  animation: rise .6s .16s cubic-bezier(.2,.7,.2,1) both;
}
.kf { padding: 14px 16px 16px; border-left: 1px solid var(--rule); min-width: 0; }
.kf:first-child { border-left: 0; }
.kf dt { font: 600 11px/1.2 var(--f-cond); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.kf dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.kf-big { font: 600 22px/1.1 var(--f-mono); letter-spacing: -0.02em; }
.kf-unit { color: var(--ink-2); font-size: 13px; }
.kf-accent { background: var(--accent-wash); }
.kf-accent dt { color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1.2 var(--f-sans); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status.open .status-dot { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 20%, transparent); }
.status.closed .status-dot { background: var(--accent); }
.status small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; }

/* ---- section nav */
.sectnav {
  position: sticky; top: 0; z-index: 10; margin-top: 32px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.sectnav-inner { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.sectnav-inner::-webkit-scrollbar { display: none; }
.sectnav a {
  flex: none; padding: 13px 0 11px; text-decoration: none; border-bottom: 2px solid transparent;
  font: 600 13px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2);
}
.sectnav a:hover, .sectnav a.is-current { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- blocks */
.sheet { padding-top: 8px; padding-bottom: 56px; }
.block { padding: 40px 0 8px; border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.block-head { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; margin-bottom: 20px; }
.block-no { font: 500 13px/1 var(--f-mono); color: var(--accent); border: 1.5px solid var(--accent); padding: 4px 6px; }
.block-head h2 { font: 700 26px/1.15 var(--f-cond); margin: 0; letter-spacing: -0.01em; }
.block-meta { grid-column: 2; margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

.spec-list { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 24px; border-top: 2px solid var(--rule-strong); }
.spec-list > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.spec-list > div:nth-child(odd) { padding-right: 24px; }
.spec-list > div:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--rule); }
.spec-list dt { font: 600 12px/1.5 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 2px; }
.spec-list dd { margin: 0; }

/* ---- tables */
.table-scroll { overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border-top: 2px solid var(--rule-strong); font-size: 15px; }
table.data caption { caption-side: top; text-align: left; font-size: 14px; color: var(--ink-2); padding: 0 0 8px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; white-space: nowrap; }
table.data thead th { font: 600 11px/1.2 var(--f-cond); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); background: var(--paper); }
table.data tbody th { font-weight: 500; }
table.data .r { text-align: right; }
table.data.compact th, table.data.compact td { padding: 7px 10px; font-size: 14px; }
table.data tr.is-active { background: var(--accent-wash); }
table.data tr.is-active th { box-shadow: inset 3px 0 0 var(--accent); }
.sym { font-weight: 600; }
tr.planned th, tr.planned td { color: var(--muted); }
.tag {
  display: inline-block; font: 600 10.5px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 6px 2px; background: var(--ink); color: var(--paper); vertical-align: 1px;
}
.tag-warn { background: var(--warn-wash); color: var(--warn); }

.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 32px; font-size: 15px; color: var(--ink-2); }
.notes p { margin: 0 0 10px; }
.notes b { color: var(--ink); }
.notes-inline { font-size: 14px; color: var(--ink-2); max-width: 80ch; }
.source { font-size: 13px; color: var(--muted); margin: 8px 0 24px; }
.callout { background: var(--card); border-left: 3px solid var(--ink); padding: 12px 16px; margin: 0 0 16px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-wash); }

/* ---- COT */
.cot-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 2px solid var(--rule-strong); background: var(--card); margin-bottom: 28px; }
.cot-card { padding: 18px 18px 16px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.cot-card:first-child { border-left: 0; }
.cot-card h3 { display: flex; align-items: center; gap: 8px; font: 600 13px/1.2 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px; }
.cot-net { margin: 0; }
.cot-net-val { font: 600 30px/1 var(--f-mono); letter-spacing: -0.03em; }
.cot-net .unit { font-size: 13px; color: var(--ink-2); }
.cot-delta { font-size: 13px; color: var(--ink-2); margin: 6px 0 14px; }
.cot-idx { display: grid; gap: 10px; margin-bottom: 12px; }
.idx-label { display: block; font: 600 11px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.cot-move { font-size: 14px; margin: 0 0 10px; }
.cot-role { font-size: 13px; color: var(--ink-2); margin: auto 0 0; padding-top: 10px; border-top: 1px dotted var(--rule); }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
.swatch.s1 { background: var(--s1); } .swatch.s2 { background: var(--s2); }
.swatch.s3 { background: var(--s3); } .swatch.s4 { background: var(--s4); }

.meter { display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 10px; }
.meter-track { position: relative; height: 8px; background: var(--paper); border-radius: 4px; overflow: visible; }
.meter-zone { position: absolute; top: 0; bottom: 0; background: var(--zone); }
.meter-zone.lo { left: 0; border-radius: 4px 0 0 4px; }
.meter-zone.hi { border-radius: 0 4px 4px 0; }
.meter-pin { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--card); }
.meter-val { font: 600 14px/1 var(--f-mono); text-align: right; }

.chart-fig { margin: 0 0 28px; background: var(--card); border: 1px solid var(--rule); padding: 16px 16px 8px; }
.chart-fig figcaption { font-size: 15px; margin-bottom: 8px; }
.chart-fig figcaption .muted { font-size: 13px; margin-left: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; height: 300px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.chart .zone { fill: var(--zone); }
.chart .tick { fill: var(--muted); font: 11px var(--f-mono); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { stroke: var(--card); stroke-width: 2; }
.chart .end-label { fill: var(--ink-2); font: 500 11px var(--f-mono); }
.chart .xhair { stroke: var(--ink-2); stroke-width: 1; }
.chart .hover-dot { stroke: var(--card); stroke-width: 2; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 180px;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-strong);
  box-shadow: 4px 4px 0 var(--zone); padding: 8px 10px; font-size: 13px; line-height: 1.5;
}
.tooltip b { display: block; font: 600 12px var(--f-mono); margin-bottom: 2px; }
.tooltip div { display: flex; align-items: center; gap: 6px; }
.tooltip .v { margin-left: auto; padding-left: 12px; font-family: var(--f-mono); }

details.history, details.method { margin: 0 0 16px; border-top: 1px solid var(--rule); padding-top: 12px; }
details summary { cursor: pointer; font-weight: 600; }
details.method ul { color: var(--ink-2); font-size: 15px; padding-left: 20px; max-width: 80ch; }
details.method li { margin-bottom: 6px; }

/* ---- calculator */
.calc { background: var(--card); border: 2px solid var(--rule-strong); display: grid; grid-template-columns: 1.6fr 1fr; }
.calc-fields { border: 0; margin: 0; padding: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.calc label { display: grid; gap: 6px; font: 600 11px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.calc input, .calc select {
  font: 500 16px/1.2 var(--f-mono); color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); padding: 9px 10px; border-radius: 0; width: 100%;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.calc-out { display: grid; align-content: center; gap: 14px; padding: 18px; border-left: 1px solid var(--rule); background: var(--paper); }
.calc-out span { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.calc-out small { font: 600 11px/1 var(--f-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.calc-out b { font: 600 20px/1 var(--f-mono); }
.calc-pnl { border-top: 1px solid var(--rule); padding-top: 14px; }
.calc-pnl b { font-size: 28px; }
.calc-pnl b.pos { color: var(--good); }
.calc-pnl b.neg { color: var(--accent); }

/* ---- faq */
.faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.faq summary { font: 600 17px/1.35 var(--f-sans); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 20px/1 var(--f-mono); color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--ink-2); margin: 10px 0 0; max-width: 75ch; }

.ad-slot { min-height: 100px; margin: 24px 0; }

/* ---- footer */
.footer { border-top: 2px solid var(--rule-strong); background: var(--card); padding: 28px 0 36px; font-size: 13px; color: var(--ink-2); }
.footer p { max-width: 90ch; margin: 0 0 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font: 600 14px var(--f-mono); color: var(--ink); margin-bottom: 14px !important; }
.footer-meta { color: var(--muted); }
.footer-links a { color: var(--ink); }
.prose { max-width: 75ch; }
.prose h2 { font: 700 20px/1.2 var(--f-cond); margin: 28px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }

/* ---- responsive */
@media (max-width: 900px) {
  .keyfigs { grid-template-columns: repeat(2, 1fr); }
  .kf { border-left: 0; border-top: 1px solid var(--rule); }
  .kf:nth-child(-n+2) { border-top: 0; }
  .kf:nth-child(even) { border-left: 1px solid var(--rule); }
  .kf:last-child { grid-column: 1 / -1; border-left: 0; }
  .spec-list { grid-template-columns: 1fr; }
  .spec-list > div:nth-child(n) { padding: 11px 0; border-left: 0; }
  .cot-cards { grid-template-columns: 1fr; }
  .cot-card { border-left: 0; border-top: 1px solid var(--rule); }
  .cot-card:first-child { border-top: 0; }
  .notes { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .calc-out { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .hero { padding-top: 28px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .ticker { font-size: 88px; }
  .spec-list > div { grid-template-columns: 1fr; gap: 2px; }
  .topnav { gap: 14px; font-size: 12px; }
  .wm-text { font-size: 17px; }
  .chart { height: 240px; }
  .calc-fields { grid-template-columns: 1fr 1fr; }
  table.data { font-size: 14px; }
}
@media print {
  .sectnav, .calc, .ad-slot, .masthead nav { display: none; }
  body { background: #fff; }
}
