/* ============================================================
   JCW RESEARCH, STYLES
   Palette: deep ink navy + warm gold accent; green/red for P&L.
   ============================================================ */
:root {
  --ink:      #0f1c2e;   /* near-black navy   */
  --ink-2:    #1b2c44;   /* lighter navy      */
  --slate:    #44566c;   /* body text muted   */
  --line:     #e4e2dc;   /* hairline borders  */
  --paper:    #ffffff;   /* cards (stay white to pop) */
  --paper-2:  #f3f1ec;   /* subtle fills / row hover  */
  --bg:       #f6f4ef;   /* page + default sections (soft warm off-white) */
  --bg-alt:   #eeebe3;   /* alternating sections (a touch deeper)         */
  --gold:     #b48a3c;   /* accent            */
  --gold-dk:  #97712c;
  --pos:      #1a7f56;   /* gains green       */
  --neg:      #c0392b;   /* losses red        */
  --flat:     #6b7a8d;
  --radius:   12px;
  --maxw:     1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 740px; }

h1, h2, h3, h4 { font-family: "Newsreader", Georgia, serif; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }

a { color: var(--gold-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; color: var(--ink); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: "Newsreader", serif; font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.brand span { color: var(--gold); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--slate); font-size: 0.93rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff; padding: 96px 0 88px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(180,138,60,0.18), transparent 45%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; font-weight: 600; color: var(--gold); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); color: #fff; margin-bottom: 18px; }
.lede { font-size: 1.18rem; color: #c8d3e0; max-width: 620px; }
.hero-actions { display: flex; gap: 14px; margin: 30px 0 18px; flex-wrap: wrap; }
.disclaimer { font-size: 0.85rem; color: #8497ac; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; transition: transform .15s, background .2s, box-shadow .2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #1a130a; box-shadow: 0 4px 14px rgba(180,138,60,0.35); }
.btn-primary:hover { background: #c79a48; }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: 2rem; margin-bottom: 8px; }
.section-title::after { content: ""; display: block; width: 48px; height: 3px; background: var(--gold); border-radius: 2px; margin-top: 14px; }
.section-intro { color: var(--slate); margin: 18px 0 32px; max-width: 640px; }
.section.narrow p, .container.narrow p { margin-bottom: 16px; color: var(--slate); font-size: 1.05rem; }

/* ---------- Stat cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 3px rgba(15,28,46,0.04); }
.stat-value { font-family: "Newsreader", serif; font-size: 2.1rem; font-weight: 600; color: var(--ink); }
.stat-label { font-weight: 600; font-size: 0.9rem; margin-top: 2px; }
.stat-sub { font-size: 0.82rem; color: var(--flat); margin-top: 4px; }

/* Split stat card: Closed and Open shown with equal weight */
.stat-split { display: flex; align-items: center; justify-content: space-around; gap: 8px; padding: 22px 12px; }
.stat-half { flex: 1; text-align: center; }
.stat-half:last-child { border-left: 1px solid var(--line); }

/* ---------- Track-record layout ---------- */
.record-layout { display: flex; flex-direction: column; gap: 28px; align-items: stretch; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: 0 1px 3px rgba(15,28,46,0.04); }

#pitch-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
#pitch-table th {
  text-align: left; padding: 14px 16px; background: var(--ink); color: #cdd8e6;
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  cursor: pointer; user-select: none; white-space: nowrap;
}
#pitch-table th:hover { color: #fff; }
#pitch-table th.sorted-asc::after  { content: " ▲"; color: var(--gold); }
#pitch-table th.sorted-desc::after { content: " ▼"; color: var(--gold); }
#pitch-table td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
#pitch-table tbody tr:hover { background: var(--paper-2); }

.ticker { font-weight: 700; color: var(--ink); }
.company { display: block; font-weight: 400; font-size: 0.78rem; color: var(--flat); }
.date { display: block; font-size: 0.74rem; color: var(--flat); }

.tag { font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.tag-long  { background: #e6f4ee; color: var(--pos); }
.tag-short { background: #fdf0dd; color: #b45309; }  /* amber/orange, kept distinct from loss-red */

.roi { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .flat { color: var(--flat); }

.cur { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Status badges (iterating on the color scheme) */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 20px; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.status-open   { background: #eef3fb; color: #2f5fa6; }
.status-open   .dot { background: #2f5fa6; box-shadow: 0 0 0 3px rgba(47,95,166,0.15); }
.status-closed { background: #eef1f4; color: #5a6b7d; }
.status-closed .dot { background: #9aa8b6; }
.note { margin-left: 6px; color: var(--flat); cursor: help; font-size: 0.8rem; }

.record-note { font-size: 0.82rem; color: var(--flat); margin: -20px 0 24px; }
#price-status { color: var(--gold-dk); }

/* ---------- Chart card ---------- */
.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 3px rgba(15,28,46,0.04); }
.chart-card h3 { font-size: 1.05rem; margin-bottom: 14px; color: var(--ink); }
.chart-card #chart svg { max-width: 620px; display: block; margin: 0 auto; }
.bar-pos { fill: var(--pos); } .bar-neg { fill: var(--neg); }
.axis { stroke: var(--line); stroke-width: 1.5; }
.bar-label { font: 600 12px Inter, sans-serif; fill: var(--ink); }
.bar-val   { font: 600 11px Inter, sans-serif; }

/* ---------- Models grid ---------- */
.models-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color .2s, transform .15s, box-shadow .2s; }
.model-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,28,46,0.07); }
.model-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--gold-dk); }
.model-card h4 { font-size: 1.08rem; margin: 8px 0 4px; }
.model-date { font-size: 0.8rem; color: var(--flat); }

/* Company research cards: name on top, Pitch + Model boxes beneath */
.research-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .15s, box-shadow .2s;
}
.research-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,28,46,0.07); }
.research-card h4 { font-size: 1.08rem; margin: 0; }
.doc-boxes { display: flex; gap: 10px; }
.doc-box {
  flex: 1; text-align: center; padding: 9px 12px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink);
  transition: background .2s, border-color .2s, color .2s;
}
a.doc-box:hover { background: var(--ink); color: #fff; border-color: var(--ink); text-decoration: none; }
.doc-box--soon { color: var(--flat); cursor: not-allowed; opacity: 0.7; }
.research-meta { display: flex; flex-direction: column; gap: 1px; margin-top: -8px; }
.research-date { font-size: 0.82rem; font-weight: 500; color: var(--slate); }
.research-note { font-size: 0.76rem; color: var(--flat); font-style: italic; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.contact-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--flat); margin-top: 18px; }
.contact-label:first-child { margin-top: 0; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.contact-form input, .contact-form textarea {
  font-family: inherit; font-size: 0.95rem; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.contact-form .btn { align-self: flex-start; cursor: pointer; border: none; }
.form-msg { font-size: 0.88rem; color: var(--pos); font-weight: 600; }
.form-msg.error { color: var(--neg); }
.hidden-field { display: none; }  /* spam honeypot, hidden from real users */

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #8497ac; padding: 36px 0; text-align: center; }
.site-footer p { font-size: 0.88rem; }
.footer-note { color: #5e6f84; font-size: 0.8rem; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .record-layout { grid-template-columns: 1fr; }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { gap: 18px; }
}
@media (max-width: 560px) {
  .nav-links a:not(:last-child) { display: none; } /* keep nav tidy on phones */
  .models-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 72px 0 64px; }
}
