/* ========================================
   THESIS PAGES — APEX QUANT
   Reusable styles for individual thesis deep-dives
   ======================================== */

/* ========================================
   NAV
   ======================================== */
.thesis-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 80px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.logo-mark { font-size: 20px; color: var(--accent); }
.logo-text { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 24px; }
.nav-link { font-size: 14px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-link:hover { color: var(--text); }
.nav-link-accent { color: var(--accent); }

/* ========================================
   PAGE HEADER
   ======================================== */
.thesis-hero {
  position: relative;
  padding: 100px 80px 80px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 820px; }

.thesis-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}
.label-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.thesis-headline {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.08;
}

.thesis-sub {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.meta-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 4px;
}
.meta-link { text-decoration: none; color: var(--accent) !important; transition: opacity 0.2s; }
.meta-link:hover { opacity: 0.75; }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ========================================
   THESIS STATEMENT
   ======================================== */
.thesis-statement {
  padding: 80px;
  border-bottom: 1px solid var(--border);
}
.statement-inner { max-width: 820px; }
.statement-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.statement-text {
  font-size: 20px;
  color: var(--text);
  line-height: 1.8;
  font-weight: 400;
}
.statement-text strong { font-weight: 600; color: var(--text); }

/* ========================================
   WHO'S POSITIONED
   ======================================== */
.positioned-section {
  padding: 80px;
  border-bottom: 1px solid var(--border);
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.positioned-layout { display: grid; grid-template-columns: 1fr 280px; gap: 80px; align-items: start; }

.holdings-table-wrap { overflow-x: auto; }
.holdings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.holdings-table thead tr { border-bottom: 1px solid var(--border); }
.holdings-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 16px 16px 0;
  white-space: nowrap;
}
.holdings-table th.num { text-align: right; }
.holdings-table tbody tr { border-bottom: 1px solid var(--border); }
.holdings-table tbody tr:hover { background: var(--surface); }
.holdings-table td { padding: 18px 16px 18px 0; vertical-align: top; }

.ticker-cell { min-width: 70px; }
.ticker-symbol {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.ticker-company { font-size: 12px; color: var(--muted); margin-top: 2px; }

.fund-holding-cell { min-width: 180px; }
.fund-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.fund-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

.alloc-cell { text-align: right; min-width: 80px; }
.alloc-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.alloc-sub { font-size: 11px; color: var(--muted); }

.conviction-cell { min-width: 100px; }
.conviction-badge {
  display: inline-block;
  font-size: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
}
.conviction-badge.high { background: #F7B73133; color: var(--accent); }
.conviction-badge.med  { background: #F7B73118; color: #c4900a; }

.primary-badge {
  display: inline-block;
  font-size: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: #0C0F14;
  margin-top: 4px;
}

.notes-cell { min-width: 160px; }
.notes-text { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Secondary table below */
.secondary-header {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.secondary-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.secondary-table { width: 100%; border-collapse: collapse; }
.secondary-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.secondary-table .ticker-symbol { font-size: 12px; }
.sec-fund { font-weight: 600; color: var(--text); font-size: 12px; }
.sec-alloc { text-align: right; font-family: 'Space Grotesk', sans-serif; font-size: 12px; color: var(--accent); }
.sec-note { color: var(--muted); font-size: 12px; }

/* Sidebar */
.positioned-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.sidebar-label { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.sidebar-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.sidebar-sub { font-size: 12px; color: var(--muted); }

/* ========================================
   SIGNAL LOG
   ======================================== */
.signal-log-section {
  padding: 80px;
  border-bottom: 1px solid var(--border);
}
.signal-log-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.signal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  border-left: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.signal-date {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.signal-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.signal-body { font-size: 13px; color: var(--muted); line-height: 1.6; }
.signal-source {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-top: auto;
}

/* ========================================
   CONVICTION STATE
   ======================================== */
.conviction-section {
  padding: 80px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 60% at 50% 0%, #F7B73106 0%, transparent 70%);
}
.conviction-inner { max-width: 700px; }
.conviction-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.state-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
}
.state-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: 0.05em;
}
.state-time {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}
.reasoning-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  margin-top: 24px;
}
.reasoning-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.reasoning-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
}
.reasoning-text strong { color: var(--text); font-weight: 600; }

/* ========================================
   AGENT BADGE + TIMESTAMP
   ======================================== */
.agent-badge-section {
  padding: 48px 80px;
  border-bottom: 1px solid var(--border);
}
.agent-badge-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.badge-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.agent-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.agent-info-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.agent-info-value { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; color: var(--text); }
.badge-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.badge-item { display: flex; flex-direction: column; gap: 2px; }
.badge-item-label { font-size: 11px; color: var(--muted); }
.badge-item-value { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; color: var(--text); }
.reeval-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid #F7B73133;
  padding: 6px 12px;
  border-radius: 20px;
}

/* ========================================
   EMAIL CTA
   ======================================== */
.cta-section {
  padding: 100px 80px;
  border-bottom: 1px solid var(--border);
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
}
.cta-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.cta-sub { font-size: 16px; color: var(--muted); line-height: 1.65; max-width: 480px; }
.cta-form-wrap { flex-shrink: 0; min-width: 380px; }
.cta-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 8px; }
.email-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.email-input:focus { border-color: var(--accent); }
.cta-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: #0C0F14;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.cta-btn:hover:not(:disabled) { opacity: 0.85; }
.cta-btn:active:not(:disabled) { transform: scale(0.98); }
.cta-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.form-note { font-size: 12px; color: var(--muted); }
.form-success {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #22c55e;
  padding: 12px 16px;
  background: #22c55e12;
  border: 1px solid #22c55e30;
  border-radius: 6px;
}

/* ========================================
   FOOTER
   ======================================== */
.thesis-footer { padding: 40px 80px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-tagline { font-size: 13px; color: var(--muted); margin-left: 8px; }
.footer-powered { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.powered-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: live-pulse 2s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
  .thesis-nav { padding: 16px 40px; }
  .thesis-hero { padding: 80px 40px 60px; }
  .thesis-statement { padding: 60px 40px; }
  .positioned-section { padding: 60px 40px; }
  .positioned-layout { grid-template-columns: 1fr; }
  .positioned-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 1; min-width: 140px; }
  .signal-log-section { padding: 60px 40px; }
  .signal-log-grid { grid-template-columns: 1fr; }
  .conviction-section { padding: 60px 40px; }
  .agent-badge-section { padding: 40px 40px; }
  .cta-section { padding: 80px 40px; }
  .cta-inner { flex-direction: column; gap: 40px; }
  .cta-form-wrap { min-width: 100%; width: 100%; }
  .thesis-footer { padding: 32px 40px; }
}
@media (max-width: 768px) {
  .form-row { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 16px; align-items: flex-start; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-header-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .agent-badge-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .badge-right { flex-wrap: wrap; }
  .conviction-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 640px) {
  .thesis-nav { padding: 12px 24px; }
  .thesis-hero { padding: 60px 24px 48px; }
  .thesis-statement { padding: 48px 24px; }
  .positioned-section { padding: 48px 24px; }
  .signal-log-section { padding: 48px 24px; }
  .conviction-section { padding: 48px 24px; }
  .agent-badge-section { padding: 32px 24px; }
  .cta-section { padding: 60px 24px; }
  .thesis-footer { padding: 24px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rule); }