/* ============================================================
   Phoenix Roadmap — styles
   ============================================================ */
:root {
  --bg: #0a0e1a;
  --bg-2: #0e1422;
  --bg-alt: #0c1120;
  --surface: #131a2c;
  --surface-2: #182135;
  --border: #232d45;
  --border-soft: #1b2436;
  --text: #e8ecf6;
  --text-dim: #9aa6c2;
  --text-faint: #6b7798;

  --accent: #7c8cff;
  --accent-2: #56e0c8;

  /* phase accents */
  --p0: #56e0c8;
  --p1: #4ea8ff;
  --p2: #b07cff;
  --p3: #ffb454;
  --p4: #5ce08a;

  --critical: #ff6b8b;

  --maxw: 1080px;
  --radius: 14px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  font-synthesis: none;
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.86em;
  background: rgba(124, 140, 255, 0.12);
  color: #c7d0ff;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  white-space: nowrap;
}

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

/* ---------- scroll progress ---------- */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--p0), var(--p1), var(--p2), var(--p3), var(--p4));
  z-index: 100; transition: width 0.1s linear;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-mark {
  font-size: 0.95rem; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.brand-text { font-size: 0.98rem; }
.topnav { display: flex; gap: 6px; }
.topnav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.88rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: all 0.15s;
}
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.active { color: var(--accent); background: rgba(124, 140, 255, 0.1); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---------- hero / doc header ---------- */
.hero { position: relative; padding: 64px 0 40px; border-bottom: 1px solid var(--border-soft); }
.doc-eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; line-height: 1.08;
  letter-spacing: -0.02em; margin-bottom: 16px;
}
.hero-sub { font-size: clamp(1rem, 2vw, 1.12rem); color: var(--text-dim); max-width: 760px; }
.hero-sub strong { color: var(--text); font-weight: 600; }

.doc-meta {
  display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin-top: 32px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  width: fit-content; max-width: 100%;
}
.doc-meta > div { padding: 14px 22px; border-right: 1px solid var(--border-soft); }
.doc-meta > div:last-child { border-right: none; }
.doc-meta dt { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 4px; }
.doc-meta dd { font-size: 0.9rem; color: var(--text); font-weight: 500; }

/* ---------- roadmap board (gantt) ---------- */
.board {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  --label-col: 240px;
}
.board-axis, .lane {
  display: grid;
  grid-template-columns: var(--label-col) repeat(12, 1fr);
  align-items: stretch;
}
.board-axis { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.axis-label { border-right: 1px solid var(--border); }
.horizon {
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); padding: 12px 14px; grid-column: span 3;
  border-right: 1px solid var(--border-soft);
}
.horizon:last-child { border-right: none; color: var(--p4); }

.lane { border-top: 1px solid var(--border-soft); min-height: 60px; }
.lane:first-child { border-top: none; }
.lane-label {
  grid-column: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; font-size: 0.9rem; font-weight: 600; color: var(--text);
  text-decoration: none; border-right: 1px solid var(--border); transition: background 0.15s;
}
.lane-label:hover { background: var(--surface-2); }
.lane-num {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 800; padding: 3px 7px; border-radius: 6px;
  color: #0a0e1a;
}
.n0 { background: var(--p0); } .n1 { background: var(--p1); } .n2 { background: var(--p2); }
.n3 { background: var(--p3); } .n4 { background: var(--p4); }

.lane-track {
  grid-column: 2 / -1; position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); align-items: center;
  background-image: repeating-linear-gradient(90deg, transparent, transparent calc(8.333% - 1px), var(--border-soft) calc(8.333% - 1px), var(--border-soft) 8.333%);
  padding: 11px 0;
}
.bar {
  grid-column: var(--start) / var(--end);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 38px; padding: 0 14px; border-radius: 8px; margin: 0 3px;
  font-size: 0.84rem; font-weight: 600; color: #08101e; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  text-decoration: none; cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.bar:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* brief highlight when a phase is opened from the board */
.phase.flash { box-shadow: 0 0 0 2px var(--pc); transition: box-shadow 0.3s ease; }
.bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-flag {
  flex-shrink: 0; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 7px; border-radius: 5px; background: rgba(8,16,30,0.22);
}
.b0 { background: var(--p0); } .b1 { background: var(--p1); } .b2 { background: var(--p2); }
.b3 { background: var(--p3); } .b4 { background: var(--p4); }
.b2 { box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 0 0 1px var(--critical), 0 0 18px -4px var(--critical); }

.board-legend {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 18px;
  font-size: 0.82rem; color: var(--text-dim);
}
.board-legend span { display: flex; align-items: center; gap: 7px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.flag-now { background: var(--p0); }
.flag-critical { background: var(--p2); }
.flag-interim { background: var(--p3); }
.flag-dest { background: var(--p4); }
.legend-note { color: var(--text-faint); font-style: italic; margin-left: auto; }
/* flag colors when used as text chips on bars stay dark-on-color via parent */
.bar .flag-now, .bar .flag-critical, .bar .flag-interim, .bar .flag-dest { background: rgba(8,16,30,0.22); }

/* ---------- sections ---------- */
.section { padding: 80px 0; border-top: 1px solid var(--border-soft); }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 40px; }
.kicker {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.section-intro, .section-head .section-intro { color: var(--text-dim); margin-top: 10px; font-size: 1.02rem; }
.lead { font-size: 1.1rem; color: var(--text-dim); max-width: 820px; margin-bottom: 38px; }
.lead strong { color: var(--text); }

/* pain grid */
.pain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 40px; }
.pain-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; border-left: 3px solid var(--critical);
}
.pain-icon {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--critical); margin-bottom: 12px;
}
.pain-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.pain-card p { font-size: 0.92rem; color: var(--text-dim); }
.pain-card em { color: var(--text); font-style: italic; }

/* callout */
.callout {
  display: flex; gap: 20px; padding: 30px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2); border-radius: var(--radius);
}
.callout-mark { font-size: 1.8rem; color: var(--accent-2); flex-shrink: 0; }
.callout h3 { font-size: 1.2rem; margin-bottom: 10px; }
.callout p { color: var(--text-dim); margin-bottom: 12px; }
.callout p:last-child { margin-bottom: 0; }
.callout-key strong { color: var(--accent-2); }

/* evidence */
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 38px; }
.evidence-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.ev-tag {
  display: inline-block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); padding-bottom: 14px;
}
.evidence-card ul { list-style: none; }
.evidence-card li { font-size: 0.9rem; color: var(--text-dim); padding: 8px 0 8px 18px; position: relative; border-top: 1px solid var(--border-soft); }
.evidence-card li:first-of-type { border-top: none; }
.evidence-card li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.good { color: var(--p4); font-weight: 600; }

.principle {
  padding: 26px 30px; background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.principle h3 { font-size: 1.1rem; margin-bottom: 8px; }
.principle p { color: var(--text-dim); }
.principle strong { color: var(--text); }

/* ---------- timeline / phases ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; }
.phase {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.2s;
  --pc: var(--accent);
}
.phase-0 { --pc: var(--p0); }
.phase-1 { --pc: var(--p1); }
.phase-2 { --pc: var(--p2); }
.phase-3 { --pc: var(--p3); }
.phase-4 { --pc: var(--p4); }
.phase.open { border-color: var(--pc); }
.phase.linchpin { box-shadow: 0 0 0 1px rgba(176, 124, 255, 0.2); }
.phase.destination { background: linear-gradient(135deg, var(--surface), rgba(92, 224, 138, 0.04)); }

.phase-header {
  width: 100%; display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  background: none; border: none; cursor: pointer; text-align: left; color: var(--text);
}
.phase-marker {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.25rem; font-weight: 800;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc) 40%, transparent);
}
.phase-titleblock { flex: 1; }
.phase-titleblock h3 { font-size: 1.18rem; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phase-tag { font-size: 0.85rem; color: var(--text-faint); margin-top: 3px; }
.phase-chevron { font-size: 1.4rem; color: var(--text-faint); transition: transform 0.25s; }
.phase.open .phase-chevron { transform: rotate(180deg); color: var(--pc); }

.pill { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; }
.pill-critical { color: var(--critical); background: rgba(255, 107, 139, 0.12); border: 1px solid rgba(255, 107, 139, 0.35); }
.pill-dest { color: var(--p4); background: rgba(92, 224, 138, 0.12); border: 1px solid rgba(92, 224, 138, 0.35); }

.phase-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 24px 0 88px;
}
.phase.open .phase-body { max-height: 1600px; padding-bottom: 26px; }
.phase-intro { color: var(--text-dim); margin-bottom: 16px; }
.phase-intro strong { color: var(--text); }
.sub { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pc); margin: 18px 0 10px; }
.sub:first-child { margin-top: 0; }
.phase-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.phase-list li { font-size: 0.94rem; color: var(--text-dim); padding-left: 22px; position: relative; }
.phase-list li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); }
.phase-list strong { color: var(--text); }
.exit {
  margin-top: 18px; padding: 14px 18px; font-size: 0.9rem; color: var(--text-dim);
  background: color-mix(in srgb, var(--pc) 7%, transparent);
  border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--pc) 30%, transparent);
}
.exit-label {
  display: inline-block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--pc); margin-right: 10px;
}

/* ---------- portability table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.port-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.port-table th, .port-table td { text-align: left; padding: 16px 22px; font-size: 0.94rem; }
.port-table thead th {
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.port-table tbody tr { border-top: 1px solid var(--border-soft); }
.port-table tbody tr:hover { background: var(--surface); }
.port-table td:first-child { color: var(--text-dim); }
.ph-ref { font-size: 0.7rem; font-weight: 700; color: var(--accent); background: rgba(124, 140, 255, 0.12); padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.verdict { font-weight: 600; white-space: nowrap; }
.verdict.yes { color: var(--p4); }
.verdict.maybe { color: var(--p3); }
.verdict.no { color: var(--critical); white-space: normal; }

/* ---------- risks ---------- */
.risk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.risk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; border-top: 3px solid var(--p3);
}
.risk-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.risk-card p { font-size: 0.92rem; color: var(--text-dim); }

/* ---------- verification ---------- */
.verify-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.verify-row {
  display: flex; gap: 18px; align-items: flex-start; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.verify-row p { font-size: 0.94rem; color: var(--text-dim); }
.verify-badge {
  flex-shrink: 0; font-weight: 800; font-size: 0.85rem; padding: 6px 12px; border-radius: 8px;
  color: #0a0e1a;
}
.v0 { background: var(--p0); } .v1 { background: var(--p1); } .v2 { background: var(--p2); }
.v3 { background: var(--p3); } .v4 { background: var(--p4); }

.status-box {
  padding: 30px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--p3);
}
.status-box h3 { font-size: 1.25rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p3); }
.status-box p { color: var(--text-dim); }
.status-box strong { color: var(--text); }

/* ---------- footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--border-soft); text-align: center; }
.footer p { color: var(--text-dim); font-size: 0.9rem; }
.footer-sub { color: var(--text-faint); font-size: 0.82rem; margin-top: 6px; }

/* ---------- reveal animation ---------- */
.section, .phase { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.section.in, .phase.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .section, .phase { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .pain-grid, .evidence-grid, .risk-grid { grid-template-columns: 1fr; }
  .doc-meta { grid-template-columns: 1fr 1fr; width: 100%; }
  .doc-meta > div:nth-child(2) { border-right: none; }
  .doc-meta > div:nth-child(1), .doc-meta > div:nth-child(2) { border-bottom: 1px solid var(--border-soft); }

  /* collapse the gantt into stacked rows */
  .board { --label-col: 1fr; }
  .board-axis { display: none; }
  .lane { grid-template-columns: 1fr; }
  .lane-label { border-right: none; border-bottom: 1px solid var(--border-soft); padding: 12px 16px; }
  .lane-track { grid-column: 1; background-image: none; padding: 12px 16px; }
  .bar { grid-column: 1 / -1 !important; margin: 0; width: 100%; }
  .legend-note { margin-left: 0; width: 100%; }
  .topnav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 12px;
    display: none;
  }
  .topnav.open { display: flex; }
  .nav-toggle { display: block; }
  .callout { flex-direction: column; gap: 12px; }
  .phase-body { padding-left: 24px; }
  .phase.open .phase-body { padding-left: 24px; }
}
