/* Stock Convexity, shared theme
   Colors/fonts ported 1:1 from the original Manus-built site
   (client/src/index.css in the StockConvexity.com Backup), so every
   new page stays visually identical to Research/Case Studies/etc. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --radius: 0.5rem;
  --background: oklch(0.13 0.015 260);
  --foreground: oklch(0.93 0.005 260);
  --card: oklch(0.16 0.015 260);
  --card-foreground: oklch(0.93 0.005 260);
  --primary: oklch(0.72 0.19 155);
  --primary-foreground: oklch(0.13 0.015 260);
  --secondary: oklch(0.20 0.015 260);
  --secondary-foreground: oklch(0.80 0.005 260);
  --muted: oklch(0.22 0.012 260);
  --muted-foreground: oklch(0.60 0.015 260);
  --accent: oklch(0.22 0.012 260);
  --border: oklch(0.25 0.015 260);
  --gold: oklch(0.80 0.16 85);
  --teal: oklch(0.70 0.14 195);
  --negative: oklch(0.63 0.24 25);

  --font-sans: "Inter", "system-ui", "sans-serif";
  --font-serif: "Playfair Display", "Georgia", "serif";
  --font-mono: "JetBrains Mono", "monospace";
}

* { box-sizing: border-box; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ---------- Backgrounds ---------- */
.terminal-grid {
  background-image:
    linear-gradient(oklch(0.25 0.015 260 / 0.3) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.25 0.015 260 / 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
}
.glow-green { box-shadow: 0 0 20px oklch(0.72 0.19 155 / 0.15), 0 0 40px oklch(0.72 0.19 155 / 0.05); }

/* ---------- Navbar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 90%, transparent);
  backdrop-filter: blur(10px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 2.25rem; height: 2.25rem; border-radius: 0.5rem;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: var(--primary-foreground); flex-shrink: 0;
}
.brand-mark svg { width: 1.1rem; height: 1.1rem; }
.brand-name { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; line-height: 1.2; }
.brand-sub { font-size: 9px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.2em; line-height: 1.2; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a, .nav button.nav-link {
  padding: 0.5rem 0.75rem; border-radius: 0.375rem;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--muted-foreground); background: none; border: none; cursor: pointer;
  font-family: var(--font-sans);
  transition: color .15s, background-color .15s;
}
.nav a:hover, .nav button.nav-link:hover { color: var(--foreground); background: color-mix(in oklch, var(--secondary) 50%, transparent); }
.nav a.active, .nav a[aria-current="page"] { color: var(--primary); background: color-mix(in oklch, var(--primary) 10%, transparent); }
.nav-menu-toggle { display: none; }

.mobile-nav { display: none; }
@media (max-width: 899px) {
  .nav { display: none; }
  .nav-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 0.375rem; border: none;
    background: none; color: var(--foreground); cursor: pointer;
  }
  .mobile-nav.open {
    display: flex; flex-direction: column; gap: 0.25rem;
    border-top: 1px solid var(--border); background: var(--card);
    padding: 0.5rem 1rem 1rem;
  }
  .mobile-nav a { padding: 0.6rem 0.75rem; border-radius: 0.375rem; font-size: 0.85rem; color: var(--muted-foreground); }
  .mobile-nav a.active { color: var(--primary); background: color-mix(in oklch, var(--primary) 10%, transparent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.75rem 1.75rem; border-radius: 0.5rem; border: 1px solid transparent;
  cursor: pointer; transition: opacity .15s, background-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: color-mix(in oklch, var(--secondary) 60%, transparent); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn svg { width: 1rem; height: 1rem; }

/* ---------- Badge / pill ---------- */
.badge-pill {
  display: inline-block; padding: 0.35rem 1rem; border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent);
  background: color-mix(in oklch, var(--primary) 6%, transparent);
  color: var(--primary); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
}

.tag {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  background: color-mix(in oklch, var(--secondary) 80%, transparent);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}
.tag-primary { color: var(--primary); border-color: color-mix(in oklch, var(--primary) 30%, transparent); background: color-mix(in oklch, var(--primary) 8%, transparent); }
.tag-gold { color: var(--gold); border-color: color-mix(in oklch, var(--gold) 30%, transparent); background: color-mix(in oklch, var(--gold) 8%, transparent); }
.tag-teal { color: var(--teal); border-color: color-mix(in oklch, var(--teal) 30%, transparent); background: color-mix(in oklch, var(--teal) 8%, transparent); }

/* ---------- Typography helpers ---------- */
h1, h2, h3, .font-serif { font-family: var(--font-serif); }
.eyebrow {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.muted { color: var(--muted-foreground); }
.mono { font-family: var(--font-mono); }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: color-mix(in oklch, var(--card) 60%, transparent); margin-top: auto; }
.site-footer .container { padding: 2.5rem 1rem; }
@media (min-width: 640px) { .site-footer .container { padding: 2.5rem 1.5rem; } }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(5, 1fr); } }
.footer-grid h4 {
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em; color: var(--foreground);
  margin: 0 0 0.75rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid ul li a, .footer-grid ul li { font-size: 0.75rem; color: var(--muted-foreground); }
.footer-grid ul li a:hover { color: var(--primary); }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.75rem; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--muted-foreground); text-align: center;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; text-align: left; } }

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* ---------- Product detail pages (pcs-500.html, etc.) ---------- */
.breadcrumb { font-size: 0.78rem; color: var(--muted-foreground); display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1.5rem; }
.breadcrumb a:hover { color: var(--primary); }

.pd-hero { padding: 3rem 0 2.5rem; position: relative; overflow: hidden; }
.pd-hero-top { display: flex; align-items: flex-start; gap: 1.25rem; flex-wrap: wrap; }
.pd-hero .icon-wrap {
  width: 3.5rem; height: 3.5rem; border-radius: 0.85rem; flex-shrink: 0;
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.pd-hero.tier-1 .icon-wrap { background: color-mix(in oklch, var(--gold) 12%, transparent); color: var(--gold); }
.pd-hero.tier-master .icon-wrap { background: color-mix(in oklch, var(--teal) 12%, transparent); color: var(--teal); }
.pd-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0; line-height: 1.1; }
.pd-hero .pd-sub { font-size: 0.9rem; color: var(--muted-foreground); margin-top: 0.35rem; }
.pd-hero .tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.85rem; }
.pd-hero .lede { font-size: 1.05rem; color: var(--muted-foreground); line-height: 1.65; max-width: 46rem; margin: 1.5rem 0 0; }
.pd-hero .hero-cta { display: flex; gap: 1rem; margin-top: 1.75rem; flex-wrap: wrap; }

.pd-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .pd-layout { grid-template-columns: 1.4fr 1fr; } }

.pd-block { margin-bottom: 2.25rem; }
.pd-block:last-child { margin-bottom: 0; }
.pd-block h2 { font-size: 1.35rem; margin: 0 0 0.9rem; }
.pd-block p { color: var(--muted-foreground); line-height: 1.7; font-size: 0.95rem; margin: 0 0 1rem; }
.pd-block ul.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.pd-block ul.check-list li { display: flex; gap: 0.65rem; font-size: 0.9rem; color: var(--muted-foreground); line-height: 1.55; }
.pd-block ul.check-list li svg { flex-shrink: 0; margin-top: 0.2rem; color: var(--primary); width: 1rem; height: 1rem; }
.pd-block ul.cross-list li svg { color: var(--negative); }

.specs-card { padding: 1.5rem; position: sticky; top: 5.5rem; }
.specs-card h3 { font-family: var(--font-sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-foreground); margin: 0 0 1.1rem; }
.specs-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.83rem; }
.specs-row:last-child { border-bottom: none; padding-bottom: 0; }
.specs-row dt { color: var(--muted-foreground); }
.specs-row dd { margin: 0; font-weight: 600; text-align: right; }
.specs-card .btn { width: 100%; margin-top: 1.25rem; }

.code-block {
  background: oklch(0.10 0.015 260); border: 1px solid var(--border); border-radius: 0.6rem;
  padding: 1.1rem 1.25rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.78rem;
  line-height: 1.6; color: oklch(0.85 0.05 155);
}
.code-block .k { color: var(--teal); }
.code-block .s { color: var(--gold); }
.code-caption { font-size: 0.7rem; color: var(--muted-foreground); margin-top: 0.6rem; font-style: italic; }

.who-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .who-grid { grid-template-columns: repeat(3, 1fr); } }
.who-card { padding: 1.25rem; }
.who-card h4 { font-family: var(--font-sans); font-size: 0.88rem; margin: 0 0 0.5rem; }
.who-card p { font-size: 0.82rem; margin: 0; }

.other-products { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .other-products { grid-template-columns: repeat(4, 1fr); } }
.other-product-card { padding: 1.1rem; text-align: center; }
.other-product-card .icon-wrap {
  width: 2.25rem; height: 2.25rem; border-radius: 0.55rem; margin: 0 auto 0.75rem;
  background: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.other-product-card h5 { font-family: var(--font-sans); font-size: 0.85rem; margin: 0 0 0.3rem; }
.other-product-card p { font-size: 0.72rem; color: var(--muted-foreground); margin: 0; }
.other-product-card:hover { border-color: color-mix(in oklch, var(--primary) 40%, transparent); }

/* ---------- Tier Changes page ---------- */
.tier-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 999px;
  font-weight: 700; font-size: 0.82rem; font-family: var(--font-mono); flex-shrink: 0;
}
.tier-pill-1 { background: color-mix(in oklch, var(--primary) 15%, transparent); color: var(--primary); }
.tier-pill-2 { background: color-mix(in oklch, var(--gold) 15%, transparent); color: var(--gold); }
.tier-pill-3 { background: color-mix(in oklch, var(--muted-foreground) 15%, transparent); color: var(--muted-foreground); }
.tier-pill-4 { background: color-mix(in oklch, var(--negative) 15%, transparent); color: var(--negative); }

.meta-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.25rem; font-size: 0.8rem; color: var(--muted-foreground); }
.meta-row strong { color: var(--foreground); font-weight: 600; }

.change-list-card { padding: 0; overflow: hidden; }
.change-list-head { display: flex; align-items: center; gap: 0.9rem; padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--border); }
.change-list-head .icon-wrap {
  width: 2.5rem; height: 2.5rem; border-radius: 0.65rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.change-list-card.up .icon-wrap { background: color-mix(in oklch, var(--primary) 12%, transparent); color: var(--primary); }
.change-list-card.down .icon-wrap { background: color-mix(in oklch, var(--negative) 12%, transparent); color: var(--negative); }
.change-list-head h3 { font-family: var(--font-sans); font-size: 1.05rem; margin: 0; }
.change-list-head p { font-size: 0.78rem; color: var(--muted-foreground); margin: 0.15rem 0 0; }
.change-list-head .count-badge {
  margin-left: auto; font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700;
}
.change-list-card.up .count-badge { color: var(--primary); }
.change-list-card.down .count-badge { color: var(--negative); }

.change-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border); }
.change-row:last-child { border-bottom: none; }
.change-row .name-block { min-width: 0; }
.change-row .ticker { font-weight: 700; font-size: 0.92rem; }
.change-row .company-name { font-size: 0.76rem; color: var(--muted-foreground); }
.change-path { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.change-path svg { color: var(--muted-foreground); width: 1rem; height: 1rem; flex-shrink: 0; }

.methodology-card { padding: 1.5rem 1.75rem; display: flex; gap: 1.25rem; align-items: flex-start; }
.methodology-card .icon-wrap {
  width: 2.5rem; height: 2.5rem; border-radius: 0.65rem; flex-shrink: 0;
  background: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.methodology-card p { margin: 0; font-size: 0.85rem; color: var(--muted-foreground); line-height: 1.65; }
.methodology-card p + p { margin-top: 0.6rem; }
.methodology-card strong { color: var(--foreground); }
