/* mikeos-stocks-web — stocks.osmike.com
   The MikeOS system (Fraunces + Manrope) in its ANALYTICAL register. Weather
   takes the same family warm — ink biased toward coral, a dawn wash overhead.
   Financial data wants the cool end: the ground is ink pushed toward peri, the
   data hues are peri and sky, and the family's coral->rose->peri gradient is
   held back for the brand mark alone.

   The one rule this file is built around: SEMANTIC COLOUR IS NOT THE ACCENT.
   Gain/loss green and red appear only on delta chips and negative bars, so a
   number that moved never competes with a number that is merely selected.
   Fonts are self-hosted; this page makes no third-party request of any kind. */

@font-face { font-family: "Fraunces"; font-weight: 300 600; font-display: swap; src: url("/fonts/fraunces.woff2") format("woff2"); }
@font-face { font-family: "Manrope";  font-weight: 400 700; font-display: swap; src: url("/fonts/manrope.woff2")  format("woff2"); }

:root {
  /* ground — near-black carrying a violet bias toward the peri accent */
  --bg: #0C0B10;
  --card: #16151D;
  --raise: #1F1D29;
  --line: #2A2836;
  --line-soft: #201E2A;

  /* text */
  --paper: #F4F2F7;
  --muted: #9A94AC;
  --faint: #6B6580;

  /* MikeOS family accents */
  --coral: #FF8A5B;
  --rose: #FF6FA5;
  --peri: #7C7CFF;
  --sky: #4FC4E8;
  --grad: linear-gradient(100deg, var(--coral), var(--rose) 42%, var(--peri) 82%);

  /* semantic — deliberately NOT the accent hues */
  --gain: #3FCF8E;
  --loss: #F2605C;

  --disp: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;              /* the body never scrolls sideways */
  min-height: 100vh;
}

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

:focus-visible {
  outline: 2px solid var(--peri);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Every figure in the page lines up in its column. */
.num, td.num, th.num, .fig, .card-val, .readout, .filings td:nth-child(2),
.filings td:nth-child(3) { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* One still wash behind the masthead — the only decorative element on the page. */
.veil {
  position: fixed; inset: 0 0 auto 0; height: 62vh;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.veil::before, .veil::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: .22;
}
.veil::before {
  width: 70vw; height: 70vw; left: -24vw; top: -32vw;
  background: radial-gradient(circle at 50% 50%, var(--peri), transparent 62%);
}
.veil::after {
  width: 54vw; height: 54vw; right: -18vw; top: -26vw;
  background: radial-gradient(circle at 50% 50%, var(--sky), transparent 62%);
}
.content { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------------------------------------------------- masthead ---- */

.top { padding: 22px 0 4px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.logo .mark { width: 21px; height: 21px; border-radius: 7px; background: var(--grad); flex: none; }
.logo .sub-name { color: var(--faint); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 14px; font-weight: 600; }
.ghost {
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted);
  background: none; border: 0; padding: 6px 2px; cursor: pointer; transition: color .18s;
}
.ghost:hover { color: var(--paper); }

/* ------------------------------------------------------------- gate ----- */

.gate { padding: 8vh 0 10vh; }
.gate-inner { max-width: 720px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 20px;
}
.gate-title {
  font-family: var(--disp); font-weight: 400; font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08; letter-spacing: -.02em; margin: 0 0 22px; text-wrap: balance;
}
.gate-sub { color: var(--muted); font-size: 17.5px; max-width: 60ch; margin: 0 0 32px; }
.gate-note { color: var(--faint); font-size: 14px; margin: 14px 0 0; }
.gate-note.bad { color: var(--loss); }

.cta {
  font-family: var(--sans); font-size: 16px; font-weight: 700; color: #12101A;
  background: var(--grad); border: 0; border-radius: 999px; padding: 14px 30px;
  cursor: pointer; transition: transform .18s, filter .18s;
}
.cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta:disabled { opacity: .55; cursor: default; transform: none; }

.gate-stats {
  display: flex; flex-wrap: wrap; gap: 34px; margin: 46px 0 0;
  padding: 26px 0 0; border-top: 1px solid var(--line-soft);
}
.gate-stats div { display: flex; flex-direction: column; gap: 3px; }
.gate-stats dt { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.gate-stats dd { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ search ---- */

.app { flex: 1; padding-bottom: 60px; }

.finder {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 17px; margin: 26px 0 0;
  box-shadow: 0 30px 64px -50px rgba(0,0,0,.95);
}
.field { flex: 1 1 320px; min-width: 0; }
.field label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 8px 3px;
}
.field input {
  width: 100%; font-family: var(--sans); font-size: 18px; font-weight: 500;
  color: var(--paper); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 15px; transition: border-color .18s;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; border-color: var(--peri); }
.finder .cta { padding: 13px 28px; }

.hint { color: var(--faint); font-size: 14px; margin: 12px 0 0; padding-left: 4px; }
.linkish {
  font-family: var(--mono); font-size: 13.5px; color: var(--sky); background: none;
  border: 0; padding: 1px 3px; cursor: pointer; border-radius: 4px;
}
.linkish:hover { color: var(--paper); background: var(--raise); }

.status {
  margin: 26px 0 0; padding: 16px 18px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 15.5px;
}
.status.bad { border-color: #4A2630; color: #FFC9C6; }
.status.busy::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px;
  border-radius: 50%; background: var(--peri); animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ----------------------------------------------------------- results ---- */

.results { margin: 26px 0 0; display: flex; flex-direction: column; gap: 9px; }
.result {
  display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 18px; cursor: pointer; font-family: var(--sans); color: var(--paper);
  transition: border-color .18s, background .18s;
}
.result:hover { border-color: var(--peri); background: var(--raise); }
.result .rname { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; }
.result .rtick {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--sky);
  background: rgba(79,196,232,.10); border-radius: 5px; padding: 2px 7px;
}
.result .rcik { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }

/* --------------------------------------------------------- identity ----- */

.company { margin: 30px 0 0; }
.ident {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft);
}
.ident h1 {
  font-family: var(--disp); font-weight: 400; font-size: clamp(27px, 4.4vw, 42px);
  line-height: 1.1; letter-spacing: -.02em; margin: 0 0 11px; text-wrap: balance;
}
.ident-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tick {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--sky);
  background: rgba(79,196,232,.10); border: 1px solid rgba(79,196,232,.22);
  border-radius: 6px; padding: 2px 8px;
}
.cik { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.copy { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; white-space: nowrap; }
.copy:hover { border-color: var(--peri); }
.copy.done { color: var(--gain); border-color: var(--gain); }

/* ------------------------------------------------------------ cards ----- */

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 13px; margin: 24px 0 0;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 17px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.card-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--faint);
}
.card-val { font-size: 25px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-period { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.delta {
  font-size: 12.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta.up { color: var(--gain); background: rgba(63,207,142,.11); }
.delta.down { color: var(--loss); background: rgba(242,96,92,.11); }
.delta.flat { color: var(--faint); background: var(--raise); }
.spark { display: block; width: 100%; height: 34px; margin-top: 2px; }

/* ------------------------------------------------------------ chart ----- */

.chart-panel, .filings-panel {
  margin: 26px 0 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.panel-head h2 {
  font-family: var(--disp); font-weight: 400; font-size: 24px; letter-spacing: -.02em; margin: 0;
}
.metric-tabs { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.metric-tabs button {
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted);
  background: var(--raise); border: 1px solid transparent; border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: color .18s, border-color .18s, background .18s;
}
.metric-tabs button:hover { color: var(--paper); }
.metric-tabs button[aria-selected="true"] {
  color: var(--paper); border-color: var(--peri); background: rgba(124,124,255,.13);
}
.basis { display: flex; gap: 2px; background: var(--raise); border-radius: 999px; padding: 3px; flex: none; }
.basis button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-radius: 999px; padding: 6px 15px; cursor: pointer;
  transition: color .18s, background .18s;
}
.basis button.on { color: var(--paper); background: var(--bg); }

.chart-figure { margin: 0; }
.chart-figure figcaption {
  font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 12px;
}
.canvas-wrap { position: relative; width: 100%; }
#chart { display: block; width: 100%; height: 320px; }
.readout {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--bg); border: 1px solid var(--peri); border-radius: var(--r-sm);
  padding: 8px 11px; font-size: 13px; line-height: 1.45; white-space: nowrap;
  box-shadow: 0 14px 34px -18px #000;
}
.readout b { font-size: 15px; font-variant-numeric: tabular-nums; }
.readout span { color: var(--faint); }
.chart-note { color: var(--faint); font-size: 13px; margin: 14px 0 0; }
.empty { color: var(--muted); font-size: 15px; padding: 40px 0; text-align: center; }

/* ---------------------------------------------------------- filings ----- */

.form-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.form-filter button {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--raise); border: 1px solid transparent; border-radius: 6px;
  padding: 5px 10px; cursor: pointer; transition: color .18s, border-color .18s;
}
.form-filter button:hover { color: var(--paper); }
.form-filter button.on { color: var(--paper); border-color: var(--peri); background: rgba(124,124,255,.13); }

/* Wide content scrolls inside its own box, never the page. */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.filings { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
.filings th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint); padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--line);
}
.filings th.num, .filings td.num { text-align: right; padding-right: 14px; }
.filings td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.filings tr:last-child td { border-bottom: 0; }
.filings .form-cell { width: 1%; white-space: nowrap; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--paper); background: var(--raise); border-radius: 5px; padding: 3px 9px;
}
/* The periodic reports are what people came for; insider forms are noise. */
.chip.key { color: var(--peri); background: rgba(124,124,255,.13); }
.filings a { color: var(--sky); font-weight: 600; }
.filings a:hover { text-decoration: underline; }
.filings .mirror { color: var(--faint); font-weight: 500; margin-left: 10px; font-size: 13px; }
.filings .mirror:hover { color: var(--muted); }

/* ------------------------------------------------------------- foot ----- */

.foot {
  margin-top: auto; padding: 34px 0 40px; border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 13.5px;
}
.foot p { margin: 0 0 8px; max-width: 78ch; }
.foot strong { color: var(--muted); font-weight: 600; }
.foot .disclaim { margin: 0; }

@media (max-width: 620px) {
  .finder { padding: 14px; }
  .chart-panel, .filings-panel { padding: 15px; border-radius: var(--r-md); }
  #chart { height: 260px; }
  .gate-stats { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}
