:root {
  --bg: #090f1f;
  --bg-soft: #101a32;
  --card: rgba(14, 24, 48, 0.78);
  --line: rgba(153, 185, 255, 0.28);
  --text: #e5efff;
  --muted: #9ab0d1;
  --buy: #30d18f;
  --sell: #ff6b6b;
  --hold: #ffd166;
  --accent: #6ab7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: radial-gradient(1100px 800px at 80% 20%, #123166 0%, transparent 55%),
              radial-gradient(900px 600px at 20% 80%, #2a1147 0%, transparent 62%),
              linear-gradient(155deg, #04070f 0%, #0a1224 52%, #0c1d3b 100%);
}

h1,
h2,
.eyebrow,
.signal,
.metric,
button {
  font-family: "Space Grotesk", sans-serif;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  filter: blur(30px);
  opacity: 0.45;
}

.shape-a {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: #1167ff;
  top: -100px;
  left: -80px;
}

.shape-b {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: #00b9d8;
  bottom: -80px;
  right: -50px;
}

.shell {
  width: min(1100px, 92vw);
  margin: 34px auto;
  display: grid;
  gap: 18px;
}

.topbar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-links a {
  color: #c8defe;
  text-decoration: none;
  font-size: 14px;
}

.topbar-links a:hover {
  color: #ffffff;
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.ghost {
  border: 1px solid #4e75b7;
  border-radius: 10px;
  background: rgba(15, 29, 57, 0.55);
  color: #d5e6ff;
  padding: 7px 12px;
  font-size: 13px;
  font-family: "IBM Plex Sans", sans-serif;
}

.ghost.active {
  border-color: #81b8ff;
  background: rgba(23, 66, 126, 0.7);
  color: #ffffff;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  animation: rise 600ms ease both;
}

.hero {
  padding: 28px;
}

.page-hero h1 {
  font-size: clamp(26px, 4vw, 44px);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
}

.predict-form {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.predict-form label {
  font-size: 14px;
  color: #bfd2ef;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.action-row {
  display: flex;
  gap: 10px;
}

.action-ghost {
  min-width: 170px;
}

input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid #4064a2;
  background: rgba(9, 17, 34, 0.95);
  color: var(--text);
  font-size: 20px;
  padding: 14px 16px;
}

input:focus {
  outline: 2px solid #65a8ff;
  outline-offset: 1px;
}

select {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid #4064a2;
  background: rgba(9, 17, 34, 0.95);
  color: var(--text);
  font-size: 16px;
  padding: 14px 16px;
  cursor: pointer;
}

select:focus {
  outline: 2px solid #65a8ff;
  outline-offset: 1px;
}

button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, #0fa9ff 0%, #39d0b3 100%);
  color: #001828;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.7;
  cursor: progress;
}

button.ghost {
  border: 1px solid #4e75b7;
  border-radius: 10px;
  background: rgba(15, 29, 57, 0.55);
  color: #d5e6ff;
  padding: 7px 12px;
  font-size: 13px;
  font-family: "IBM Plex Sans", sans-serif;
}

button.ghost:hover {
  transform: none;
  filter: none;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: #7e9fc8;
}

.future-links {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-link {
  color: #b9d3ff;
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px dashed rgba(185, 211, 255, 0.55);
}

.ghost-link:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.result-card,
.split-card,
.proba-card,
.footer-card {
  padding: 20px;
}

/* Strategy page flow */
.strategy-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 0;
}
.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  flex: 1;
  min-width: 140px;
  font-size: 13px;
  line-height: 1.4;
}
.flow-num {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  margin-right: 6px;
}
.flow-arrow {
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.signal {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
}

.metric {
  margin: 5px 0 0;
  font-size: 28px;
  font-weight: 700;
}

.meta-emphasis {
  line-height: 1.2;
}

.meta-line {
  display: grid;
  grid-template-columns: 128px 92px;
  justify-content: start;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.meta-pill.win {
  color: #042312;
  background: linear-gradient(120deg, #42f5a4 0%, #1dbd74 100%);
}

.meta-pill.lose {
  color: #2a0202;
  background: linear-gradient(120deg, #ff8e8e 0%, #ff5252 100%);
}

.meta-pill.neutral {
  color: #2d2101;
  background: linear-gradient(120deg, #ffe089 0%, #ffc145 100%);
}

.meta-value {
  display: inline-block;
  width: 92px;
  text-align: right;
  font-size: 30px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.meta-plain {
  font-size: 20px;
}

.meta-proba-row {
  display: grid;
  grid-template-columns: 128px 92px;
  justify-content: start;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.meta-proba-value {
  display: inline-block;
  width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.proba-grid {
  display: grid;
  gap: 10px;
}

.proba-item {
  border: 1px solid rgba(138, 167, 220, 0.3);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 17, 33, 0.5);
}

.proba-item strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  margin-bottom: 3px;
}

.ad-zone {
  padding: 20px;
}

.ad-slot {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(147, 188, 255, 0.45);
  color: #9ec2f8;
  background: rgba(5, 15, 31, 0.45);
  font-size: 13px;
}

.grid-two {
  grid-template-columns: 1fr 1fr;
}

.list-clean {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #d6e8ff;
}

.list-clean li {
  margin-bottom: 8px;
}

.cta-disabled {
  display: inline-block;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid rgba(159, 192, 244, 0.4);
  background: rgba(14, 25, 45, 0.55);
  color: #bfd8ff;
  padding: 10px 14px;
  text-decoration: none;
  cursor: not-allowed;
}

.buy { color: var(--buy); }
.sell { color: var(--sell); }
.hold { color: var(--hold); }
.neutral { color: #d4e2ff; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════
   SECONDARY PAGE ENHANCEMENTS
═══════════════════════════════════════════ */

/* Hero gradient border + inner glow for subpages */
.page-hero {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(130deg, rgba(106,183,255,0.55) 0%, rgba(0,185,216,0.22) 50%, rgba(120,80,240,0.35) 100%) border-box;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(680px 160px at 70% -20%, rgba(106,183,255,0.07) 0%, transparent 70%),
    radial-gradient(280px 280px at -5% 110%, rgba(57,208,179,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Subpage h1 — solid bright white, no gradient (avoids forced-dark-mode issues) */
.page-hero h1 {
  color: #f0f6ff;
  font-size: clamp(28px, 4.5vw, 48px);
}

/* Fancy list with glowing accent bullets */
.list-fancy {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.list-fancy li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #d6e8ff;
}

.list-fancy li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ab7ff 0%, #39d0b3 100%);
  box-shadow: 0 0 8px rgba(106,183,255,0.65);
  margin-top: 6px;
}

/* Gradient top border accent for cards */
.card-accent {
  border-top: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(90deg, #6ab7ff 0%, #39d0b3 100%) border-box;
}

/* Card hover lift for subpages */
.page-card-hover {
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.page-card-hover:hover {
  transform: translateY(-3px);
  box-shadow:
    0 28px 56px rgba(0,0,0,0.42),
    0 0 0 1px rgba(106,183,255,0.14),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Pulsing status badge (COMING SOON / UNDER CONSTRUCTION) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,209,102,0.38);
  background: rgba(48,36,6,0.55);
  color: #ffd166;
  margin-bottom: 10px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 7px rgba(255,209,102,0.9);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* Career timeline table */
.career-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.career-table th {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid rgba(106,183,255,0.2);
  white-space: nowrap;
}

.career-table td {
  padding: 10px 12px 10px 0;
  vertical-align: top;
  border-bottom: 1px solid rgba(106,183,255,0.08);
  color: #d6e8ff;
  line-height: 1.55;
}

.career-table tr:last-child td {
  border-bottom: none;
}

.career-table .period {
  white-space: nowrap;
  color: var(--muted);
  padding-right: 16px;
  min-width: 110px;
}

.career-table .role-org {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  color: #e5efff;
}

.career-table .role-detail {
  font-size: 12px;
  color: var(--muted);
}

/* Skill / technology tag pills */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.skill-tag {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(106,183,255,0.28);
  background: rgba(20,46,96,0.52);
  color: #a8ccf0;
  letter-spacing: 0.02em;
}

/* Contact / email row */
.contact-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(7,16,38,0.72);
  border: 1px solid rgba(106,183,255,0.18);
}

.contact-row span {
  font-size: 12px;
  color: var(--muted);
}

.contact-row a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-family: "IBM Plex Sans", sans-serif;
}

.contact-row a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Improved CTA disabled */
.cta-disabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid rgba(106,183,255,0.2);
  background: linear-gradient(120deg, rgba(16,34,70,0.78) 0%, rgba(14,46,80,0.55) 100%);
  color: #6b9cd3;
  padding: 10px 16px;
  text-decoration: none;
  cursor: not-allowed;
  font-size: 13px;
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: 0.02em;
}

/* LinkedIn / profile link pill */
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13.5px;
  border: 1px solid rgba(106,183,255,0.3);
  border-radius: 999px;
  padding: 7px 16px;
  margin-top: 14px;
  background: rgba(18,42,88,0.46);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.profile-link:hover {
  background: rgba(28,62,130,0.58);
  border-color: rgba(106,183,255,0.55);
  color: #fff;
  border-bottom-color: rgba(106,183,255,0.55);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(106,183,255,0.2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 12px;
}

.performance-section {
  margin-top: 18px;
}

.performance-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.performance-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-stat-card {
  border: 1px solid rgba(106,183,255,0.18);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(12, 31, 69, 0.88) 0%, rgba(8, 20, 48, 0.94) 100%);
}

.card-accent-soft {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.summary-stat-card.alt {
  border-color: rgba(125,240,197,0.24);
  background: linear-gradient(180deg, rgba(9, 40, 47, 0.86) 0%, rgba(7, 28, 33, 0.96) 100%);
}

.summary-stat-label {
  color: #d6e8ff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-stat-value {
  font-size: 30px;
  margin: 8px 0 6px;
}

.summary-stat-meta,
.summary-stat-detail {
  color: #9ab0d1;
}

.summary-stat-breakdown {
  color: #9ab0d1;
  line-height: 1.55;
}

.summary-stat-detail strong,
.summary-stat-breakdown strong {
  color: #f4fbff;
  margin-left: 8px;
}

.performance-section-grid {
  align-items: start;
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.performance-table thead tr {
  background: rgba(10,28,64,0.80);
}

.performance-table th {
  text-align: left;
  padding: 10px 16px;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(106,183,255,0.2);
  white-space: nowrap;
}

.performance-table th:last-child {
  text-align: right;
}

.performance-compare-table th:nth-child(2),
.performance-compare-table th:nth-child(3),
.performance-compare-table td:nth-child(2),
.performance-compare-table td:nth-child(3) {
  text-align: right;
}

.performance-table td {
  padding: 9px 16px;
  border-bottom: 1px solid rgba(106,183,255,0.08);
  color: #d6e8ff;
}

.performance-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.performance-table tbody tr:nth-child(even) {
  background: rgba(106,183,255,0.04);
}

.performance-table tbody tr:hover {
  background: rgba(106,183,255,0.09);
}

.performance-table tr:last-child td {
  border-bottom: none;
}

.chart-wrap {
  width: 100%;
  margin-top: 8px;
}

.performance-chart-wrap {
  min-height: 280px;
}

.range-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.range-btn {
  padding: 5px 10px;
  min-width: 56px;
  font-size: 12px;
}

.performance-error,
.performance-error-detail {
  color: #ffd2d2;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    margin: 16px auto;
  }

  .topbar {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-links {
    gap: 10px;
  }

  .hero,
  .result-card,
  .split-card,
  .proba-card,
  .footer-card {
    padding: 16px;
  }

  .input-row {
    flex-direction: column;
  }

  .action-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .lang-switch .ghost {
    width: auto;
  }

  .meta-value {
    font-size: 24px;
  }

  .performance-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   CAUSAL INFERENCE & FEATURE IMPORTANCE
═══════════════════════════════════════════ */

#causal-section h3,
#importance-section h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  color: var(--accent);
  margin: 20px 0 8px;
  letter-spacing: 0.04em;
}

#causal-section > p,
#importance-section > p {
  margin-bottom: 14px;
}

/* DAG role legend row */
.dag-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

/* DAG node pill (base) */
.dag-node {
  display: inline-block;
  font-size: 11.5px;
  font-family: "IBM Plex Sans", sans-serif;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.dag-treatment {
  color: #042312;
  background: linear-gradient(120deg, #42f5a4 0%, #1dbd74 100%);
}

.dag-confounder {
  color: #2d2101;
  background: linear-gradient(120deg, #ffe089 0%, #ffc145 100%);
}

.dag-mediator {
  color: #001828;
  background: linear-gradient(120deg, #6ab7ff 0%, #0fa9ff 100%);
}

.dag-outcome {
  color: #1a0930;
  background: linear-gradient(120deg, #c78dff 0%, #9b4dff 100%);
}

.dag-unknown,
.dag-unknown_keep {
  color: #e5efff;
  background: rgba(154, 176, 209, 0.3);
  border: 1px solid rgba(154, 176, 209, 0.4);
}

.dag-figure-wrap {
  margin: 10px 0 16px;
  border: 1px solid rgba(122, 168, 212, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 26, 39, 0.42) 0%, rgba(8, 18, 30, 0.22) 100%);
  overflow: hidden;
}

.dag-figure {
  display: block;
  width: 100%;
  height: auto;
}

.dag-figure-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 33 / 19;
}

.dag-edge {
  fill: none;
  stroke: #7aa8d4;
  stroke-width: 2;
  opacity: 0.9;
  marker-end: url(#dagArrow);
}

.dag-box rect {
  stroke-width: 1.4;
}

.dag-box text {
  fill: #f7fbff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dag-treatment-box rect {
  fill: rgba(29, 189, 116, 0.28);
  stroke: rgba(90, 231, 163, 0.92);
}

.dag-confounder-box rect {
  fill: rgba(255, 193, 69, 0.24);
  stroke: rgba(255, 214, 122, 0.94);
}

.dag-mediator-box rect {
  fill: rgba(15, 169, 255, 0.23);
  stroke: rgba(98, 196, 255, 0.92);
}

.dag-outcome-box rect {
  fill: rgba(155, 77, 255, 0.22);
  stroke: rgba(206, 167, 255, 0.95);
}

.dag-feature-table-wrap {
  margin-top: 8px;
}

/* Importance bar */
.importance-bar {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #0fa9ff 0%, #39d0b3 100%);
  min-width: 2px;
  transition: width 300ms ease;
}

#importance-grid .grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 960px) {
  #importance-grid {
    grid-template-columns: 1fr !important;
  }

  .dag-box text {
    font-size: 13px;
  }
}
