/* ============================================================
   site.css -- every colour and size the site uses.

   The colours are set once as "tokens" at the top. Change a token
   and it changes everywhere, so you never hunt through the file.
   ============================================================ */

:root {
  /* surfaces */
  --ground: #F6F7F9;          /* the page behind everything */
  --panel: #FFFFFF;           /* cards */
  --raised: #F1F3F6;          /* buttons, inset strips */
  --table-head: #F8F9FB;
  --border: #DDE2E8;
  --border-strong: #C9D1DA;
  --divider: #E8ECF1;
  --row-rule: #EDF0F4;

  /* text */
  --ink: #131720;             /* headings and numbers */
  --secondary: #5B6573;       /* supporting text */
  --muted: #6B7480;           /* labels */

  /* meaning */
  --up: #12805C;              /* green, price up */
  --down: #C0343C;            /* red, price down */
  --calls: #1E5FBF;           /* blue, same as your viewer */
  --puts: #C2681F;            /* orange, same as your viewer */
  --accent: #B4721E;          /* links */
  --accent-strong: #74490F;
  --gold: #C8912A;            /* the mark in the wordmark */

  /* the at-the-money row and the in-the-money tints */
  --atm-row: #FFF3CF;
  --atm-edge: #E8C97A;
  --atm-strike: #FAE4AE;
  --atm-strike-ink: #7A4E0E;
  --calls-itm: #EEF3FC;
  --puts-itm: #FDF2EC;

  --button-ink: #1B2330;      /* the dark primary button */

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Consolas', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

/* the page is a column, so the footer always sits at the bottom */
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  min-width: 1200px;          /* desktop only: the page never squeezes narrower */
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

.wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 28px; }
body > .wrap { padding-bottom: 40px; }   /* space above the footer */

/* ---------- header, the same on both pages ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1400px; margin: 0 auto; padding: 0 28px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}
.wordmark {
  font-family: var(--serif); font-size: 25px; letter-spacing: -0.2px;
  color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark .dot { color: var(--gold); }
.site-nav { display: flex; gap: 20px; margin-left: 6px; }
.site-nav a { color: var(--secondary); font-size: 13.5px; padding: 4px 0; }
/* the nav links darken on hover instead of underlining -- an underline in a
   header looks like a mistake rather than a design */
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }


.btn {
  display: inline-block; border: 1px solid var(--border-strong);
  background: var(--raised); color: var(--ink);
  border-radius: 6px; padding: 8px 14px; font-size: 13.5px;
  font-family: var(--sans); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #E8EBF0; text-decoration: none; }
.btn.primary {
  background: var(--button-ink); border-color: var(--button-ink); color: #FFFFFF;
}
.btn.primary:hover { background: #2A3444; color: #FFFFFF; }
.btn.on { background: var(--button-ink); border-color: var(--button-ink); color: #FFFFFF; }
.btn:disabled { opacity: 0.45; cursor: default; }

select, input[type="text"] {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 8px 10px;
}

/* ---------- footer, the same on every page ---------- */
.site-footer {
  margin-top: auto; background: var(--panel); border-top: 1px solid var(--border);
  color: var(--secondary); font-size: 13.5px;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-top: 40px; padding-bottom: 28px; }
.footer-brand p { margin: 10px 0 0; max-width: 340px; line-height: 1.6; }
.site-footer h4 {
  margin: 6px 0 14px; font-size: 12px; font-weight: 600; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.site-footer a { display: block; color: var(--secondary); margin-bottom: 10px; }
.site-footer a:hover { color: var(--ink); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--divider); padding-top: 18px; padding-bottom: 22px; color: var(--muted); font-size: 12px; }
.footer-bottom p { margin: 0 0 6px; line-height: 1.6; }

/* ============================================================
   HOME PAGE -- one banner that fills the space above the footer
   ============================================================ */
.banner {
  flex: 1; display: flex; align-items: center; padding: 50px 0;
  background: linear-gradient(135deg, #EAF1FC 0%, #F7F9FC 55%, #FDF3E7 100%);
}
.banner-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 50px; align-items: center; }
.banner-tag {
  display: inline-block; background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px; font-size: 12.5px; color: var(--calls); font-weight: 500;
}
.banner h1 { font-size: 54px; font-weight: 600; line-height: 1.12; letter-spacing: -1.2px; margin: 20px 0 20px; }
.banner h1 .blue { color: var(--calls); }
.quote {
  color: var(--secondary); font-size: 17px; line-height: 1.6; font-style: italic;
  max-width: 440px; margin: 0 0 32px; padding-left: 14px; border-left: 3px solid var(--gold);
}
.btn.pill { border-radius: 30px; padding: 13px 28px; font-size: 15px; }
.banner-img { width: 100%; height: auto; }

/* ---------- About, Contact, Disclaimer: plain text pages ---------- */
.text-page { max-width: 760px; padding-top: 50px; padding-bottom: 20px; }
.text-page h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; margin: 0 0 20px; }
.text-page p { color: var(--secondary); font-size: 16px; line-height: 1.7; }
.big-link { font-size: 20px !important; }

/* ============================================================
   REPLAY PAGE
   ============================================================ */
.page-title-row {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  padding: 26px 0 16px;
}
/* Index, Date, Expiry -- each a small caption with its dropdown under it. */
.pickers { margin-left: auto; display: flex; align-items: flex-end; gap: 10px; }
.picker { display: flex; flex-direction: column; gap: 5px; }
.picker > span {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
}
.picker select { min-width: 150px; }
.page-title-row h1 {
  font-family: var(--serif); font-weight: 400; font-size: 34px;
  margin: 0; letter-spacing: -0.3px;
}

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px;
}

/* the row of controls */
.controls {
  padding: 11px 14px 12px; margin-bottom: 14px;

  /* The bar follows you down the page, so Play, the speeds and the timeline
     are still under your hand when you have scrolled to a far strike.
     Change `top` if you ever want it to sit lower than the very top. */
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 var(--border), 0 6px 14px -12px rgba(19, 23, 32, .45);
}
.controls-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.controls .spacer { flex: 1; }
.controls .hint { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* back / play / forward, sitting together */
.transport { display: flex; align-items: center; gap: 6px; }
.btn.icon {
  padding: 7px 0; width: 36px; text-align: center;
  color: var(--secondary); font-size: 12px;
}
.transport .btn.primary { min-width: 104px; padding: 7px 14px; }

/* the speed switch: one inset strip, the chosen speed filled in */
.segmented {
  display: flex; gap: 2px; padding: 2px;
  background: var(--raised); border: 1px solid var(--border); border-radius: 8px;
}
.segmented .btn {
  border: none; background: transparent; color: var(--secondary);
  padding: 5px 10px; font-size: 12.5px; border-radius: 6px;
}
.segmented .btn:hover { background: #E3E7ED; }
.segmented .btn.on { background: var(--button-ink); color: #FFFFFF; }

.checkbox { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--secondary); white-space: nowrap; }
.frame-counter {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap;
}

/* ---------- the timeline ----------
   A rail, a filled part for where you have been, a dot for where you are,
   and the session time riding underneath the dot. The real <input> sits on
   top of all of it, invisible, so dragging and the arrow keys both work. */
.scrub-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 11px; }
.scrub-edge {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  white-space: nowrap; padding-top: 3px;
}
.track { position: relative; flex: 1; height: 30px; }
.track-rail, .track-fill {
  position: absolute; top: 5px; height: 4px; border-radius: 999px;
}
.track-rail { left: 0; right: 0; background: var(--divider); }
.track-fill { left: 0; width: 0; background: var(--button-ink); }
.track-dot {
  position: absolute; top: 1px; left: 0; width: 12px; height: 12px;
  margin-left: -6px; border-radius: 50%;
  background: var(--button-ink); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--button-ink);
}
.track-time {
  position: absolute; top: 16px; left: 0; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.track input[type="range"] {
  -webkit-appearance: none; appearance: none;
  position: absolute; top: 0; left: 0; width: 100%; height: 14px;
  margin: 0; background: transparent; opacity: 0; cursor: pointer;
}
/* the invisible thumb has to be the same size as the dot, or the dot and
   your finger drift apart as you drag */
.track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
}
.track input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border: none; border-radius: 50%;
}

/* the six numbers */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.tile { padding: 12px 14px; }
.tile .name {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.9px;
  text-transform: uppercase; color: var(--muted);
}
.tile .value { font-family: var(--mono); font-size: 22px; margin-top: 7px; color: var(--ink); }
.up { color: var(--up); }
.down { color: var(--down); }

/* the option chain, calls | strike | puts */
.chain-card { overflow: hidden; }
/* The group header must use the same column widths as the rows below it,
   otherwise CALLS and PUTS sit slightly off from their columns. */
.chain-head-groups {
  display: grid; grid-template-columns: 4.9fr 1.15fr 4.9fr;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; text-align: center;
}
.chain-head-groups .calls { background: var(--calls-itm); color: var(--calls); padding: 8px 0; }
.chain-head-groups .mid { background: var(--table-head); }
.chain-head-groups .puts { background: var(--puts-itm); color: var(--puts); padding: 8px 0; }

/* One shared column layout for the header row and every data row, so the
   columns line up. Change these numbers to make a column wider. */
.chain-row {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr 0.9fr 0.95fr 1.15fr 0.95fr 0.9fr 0.9fr 0.9fr 1.25fr;
}
.chain-head {
  background: var(--table-head); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); position: sticky; top: 0; z-index: 2;
}
.chain-head > div { padding: 7px 10px; text-align: right; }
.chain-head > div.strike { text-align: center; }
/* position: relative matters: it makes each row's offsetTop measured from
   this box, which is what the "keep ATM centred" scrolling relies on. */
.chain-scroll { max-height: 620px; overflow-y: auto; position: relative; }
.chain-row.data { border-bottom: 1px solid var(--row-rule); font-family: var(--mono); font-size: 12.5px; }
.chain-row.data > div { padding: 7px 10px; text-align: right; position: relative; }
.chain-row.data .strike {
  text-align: center; font-family: var(--sans); font-weight: 600;
  background: var(--table-head); color: var(--ink);
}
.chain-row.data.atm { background: var(--atm-row); }
.chain-row.data.atm > div { border-top: 1px solid var(--atm-edge); border-bottom: 1px solid var(--atm-edge); }
.chain-row.data.atm .strike { background: var(--atm-strike); color: var(--atm-strike-ink); }
.chain-row.data .ce-itm { background: var(--calls-itm); }
.chain-row.data .pe-itm { background: var(--puts-itm); }
.chain-row.data.atm .ce-itm, .chain-row.data.atm .pe-itm { background: transparent; }
.chain-row.data:hover { filter: brightness(0.985); }

/* the little bar behind an OI cell, showing its share of the biggest OI */
.oi-bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.16; }
.oi-bar.ce { background: var(--calls); }
.oi-bar.pe { background: var(--puts); }
/* over the gold ATM row the bar tint muddies the colour, so quieten it */
.chain-row.data.atm .oi-bar { opacity: 0.09; }
.cell-text { position: relative; }

.empty { margin-top: 26px;
  padding: 60px 28px; text-align: center; color: var(--secondary);
}
.empty code {
  font-family: var(--mono); background: var(--raised); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; font-size: 12.5px;
}
