/* RegardAlert — public web styles
 * Hand-written CSS replacing the Tailwind + shadcn frontend.
 * Single sheet, ~6KB gz. Variables drive the dark/light themes
 * (dark by default; `?theme=light` or system pref toggles).
 */

:root {
  --bg: #0a0a0a;
  --fg: #fafafa;
  --muted: #a3a3a3;
  --muted-fg: #b4b4b4;
  --border: rgba(255, 255, 255, 0.10);
  --card: #111111;
  --secondary: rgba(255, 255, 255, 0.04);
  --secondary-hover: rgba(255, 255, 255, 0.08);
  --primary: #ff7a1f;
  --primary-hover: #ff8a3a;
  --primary-fg: #ffffff;
  --emerald: #10b981;
  --red: #ef4444;
  --radius: 8px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #525252;
    --muted-fg: #404040;
    --border: rgba(0, 0, 0, 0.10);
    --card: #ffffff;
    --secondary: rgba(0, 0, 0, 0.03);
    --secondary-hover: rgba(0, 0, 0, 0.06);
    --primary: #ea6010;
    --primary-hover: #d65410;
    --primary-fg: #ffffff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Monaco, Consolas, monospace; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 760px; }
.container-sm { max-width: 540px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(8px);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
  max-width: 1280px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--primary); color: var(--primary-fg);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; font-size: 14px; font-weight: 500;
  color: var(--muted); border-radius: 6px;
}
.nav a:hover { background: var(--secondary); color: var(--fg); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--secondary); color: var(--fg);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--secondary-hover); }
.btn--primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--lg { padding: 10px 20px; font-size: 15px; }
.btn--block { width: 100%; justify-content: center; }

/* Hero */
.hero { border-bottom: 1px solid var(--border); padding: 64px 0 32px; text-align: center; }
.hero__pill {
  display: inline-block; padding: 6px 12px; margin-bottom: 24px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  border-radius: 4px;
}
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 20px; }
.hero p.lead { font-size: 18px; color: var(--muted-fg); max-width: 560px; margin: 0 auto 28px; line-height: 1.55; }

/* Live feed */
.live-feed {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); margin: 0 auto 32px; max-width: 900px;
  overflow: hidden;
}
.live-feed__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--secondary); font-size: 12px; letter-spacing: 0.04em;
  color: var(--muted); text-transform: uppercase;
}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px;
  background: var(--emerald); box-shadow: 0 0 0 0 var(--emerald);
  animation: live-ping 2s ease-out infinite;
}
@keyframes live-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald) 60%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: inherit;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--secondary); }
.row__left { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.row__ticker { font-family: ui-monospace, monospace; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.row__title { font-size: 14px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.row__right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: 12px; }
.row__pct { font-family: ui-monospace, monospace; font-weight: 600; font-size: 13px; }
.row__age { color: var(--muted); font-size: 12px; }
.row__type { color: var(--primary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.pos { color: var(--emerald); }
.neg { color: var(--red); }
.flat { color: var(--muted); }

/* Outcome cards */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section h2 { font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 8px; }
.section .eyebrow {
  display: block; color: var(--primary); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
}
.section .section-head { text-align: center; margin-bottom: 32px; }

.grid { display: grid; gap: 14px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); max-width: 800px; margin: 0 auto; }

.card-outcome {
  display: block; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--secondary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card-outcome:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: 0 4px 14px rgba(0,0,0,0.10); }
.card-outcome__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-outcome__title { font-size: 14px; color: var(--muted-fg); margin: 0 0 16px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.card-outcome__pct { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

.cat-tile {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--secondary); font-size: 14px; font-weight: 500; text-align: center;
}
.cat-tile:hover { background: var(--secondary-hover); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }

/* CTA */
.cta-grad {
  padding: 56px 0; background: linear-gradient(135deg, var(--primary) 0%, #d65410 100%);
  color: var(--primary-fg); text-align: center;
}
.cta-grad h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; line-height: 1.2; }
.cta-grad p { font-size: 16px; opacity: 0.85; margin: 0 0 28px; }
.cta-grad .btn { background: rgba(0,0,0,0.30); border-color: rgba(255,255,255,0.30); color: white; }
.cta-grad .btn:hover { background: rgba(0,0,0,0.45); }

.cta-inline {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--secondary); padding: 20px; text-align: center;
}
.cta-inline h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.cta-inline p { margin: 0 0 14px; font-size: 14px; color: var(--muted-fg); }

/* Article (alert page) */
.article { padding: 32px 16px 96px; }
.article header { margin-bottom: 24px; }
.article .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.article h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
.article .body { color: var(--muted-fg); font-size: 16px; line-height: 1.55; margin: 0 0 8px; }
.article .ctx { color: var(--muted); font-size: 14px; margin-top: 8px; }

.chart-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px; margin-bottom: 12px; }
.headline-outcome { font-size: 24px; font-weight: 700; margin-bottom: 32px; }
.headline-outcome .lbl { font-size: 16px; font-weight: 400; color: var(--muted); margin-left: 8px; }

.outcome-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 40px; }
.outcome-cell {
  border: 1px solid var(--border); border-radius: 6px; background: var(--card);
  padding: 10px 6px; text-align: center;
}
.outcome-cell .window { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.outcome-cell .pct { font-size: 14px; font-weight: 600; }

/* Ticker page */
.ticker-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ticker-head h1 { font-size: 36px; margin: 0; letter-spacing: -0.01em; }
.ticker-head .company { font-size: 18px; color: var(--muted); }
.ticker-meta { margin-top: 8px; font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.ticker-chart { margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ticker-chart > div { width: 100%; height: 420px; }

/* Earnings */
.earn-day { margin-bottom: 24px; }
.earn-day h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.earn-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.earn-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.earn-row:last-child { border-bottom: 0; }
.earn-row__ticker { font-family: ui-monospace, monospace; font-weight: 700; }
.earn-row__company { font-size: 13px; color: var(--muted); }
.earn-row__pct { font-family: ui-monospace, monospace; font-weight: 600; font-size: 13px; }
.earn-row__timing { font-size: 12px; color: var(--muted); }

/* Category list nav */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  font-size: 12px; font-weight: 500;
}
.chip:hover { color: var(--fg); background: var(--secondary); }

/* Search */
.search { position: relative; }
.search input {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px 6px 30px; font-size: 13px; height: 32px;
  width: 200px;
}
.search input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.search::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background: 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='%23a3a3a3' stroke-width='2'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat center;
}
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  z-index: 60; max-height: 360px; overflow-y: auto; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.20);
}
.search-results[data-open="true"] { display: block; }
.search-results > a {
  display: flex; gap: 12px; padding: 8px 12px; font-size: 13px; align-items: center;
}
.search-results > a:hover, .search-results > a.active {
  background: var(--secondary);
}
.search-results .res-ticker { font-family: ui-monospace, monospace; font-weight: 700; min-width: 60px; }
.search-results .res-name { color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sticky bottom CTA */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 95%, transparent); backdrop-filter: blur(8px);
}
@media (min-width: 768px) { .sticky-cta { display: none; } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 0;
  font-size: 13px; color: var(--muted);
}
.site-footer .inner {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
}
.site-footer a:hover { color: var(--fg); }

/* Empty states */
.empty { padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }

/* Responsive tweaks */
@media (max-width: 640px) {
  .nav { display: none; }
  .outcome-grid { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .search input { width: 130px; }
}

/* Holdings table — 13F structured alerts */
.holdings-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; margin: 16px 0;
}
.holdings-table th {
  text-align: left; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border-bottom: 1px solid var(--border);
  padding: 8px 4px;
}
.holdings-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 4px; font-variant-numeric: tabular-nums;
}
.holdings-table .t-left { text-align: left; }
.holdings-table .t-right { text-align: right; }
.holdings-table a { color: var(--fg); font-weight: 500; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.pill--pos { background: color-mix(in srgb, var(--emerald) 18%, transparent); color: var(--emerald); }
.pill--neg { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
