/* The Migration Journal — Gantt Strip visual.
   Cool grey field, purple accent, timeline bars and phase blocks. No rounded corners. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e2e5eb;
  --grid: #e9ebf0;
  --accent: #7c3aed;
  --accent-dark: #5b21b6;
  --accent-soft: #ede9fe;
  --cs: #7c3aed;
  --co: #0891b2;
  --ms: #2563eb;
  --sc: #be185d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; }

/* ---- top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark { color: var(--accent); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; }
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase; }
.topnav { display: flex; gap: 20px; }
.topnav a { color: var(--ink); font-size: 13px; letter-spacing: 0.6px; text-transform: uppercase; font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
.topnav a:hover { border-bottom-color: var(--accent); text-decoration: none; }

/* ---- route head (home hero) ---- */
.route-head {
  padding: 46px 0 34px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 72px),
    var(--bg);
}
.kicker { color: var(--accent); font-size: 12px; letter-spacing: 2.4px; font-weight: 700; margin-bottom: 12px; }
.route-head h1 { font-size: 36px; line-height: 1.14; max-width: 720px; margin-bottom: 14px; }
.route-lede { max-width: 660px; color: var(--muted); font-size: 17px; }

/* timeline axis with phase blocks */
.route-axis { display: flex; gap: 0; margin-top: 30px; border-top: 2px solid var(--accent); position: relative; }
.route-axis .tick { flex: 1; padding-top: 16px; position: relative; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.route-axis .tick i { position: absolute; top: -6px; left: 0; width: 10px; height: 10px; background: var(--accent); display: block; }
.route-axis .tick b { display: block; font-weight: 650; color: var(--ink); }
.route-axis .tick.t1 i { background: var(--ms); }
.route-axis .tick.t2 i { background: var(--cs); }
.route-axis .tick.t3 i { background: var(--co); }
.route-axis .tick.t4 i { background: var(--sc); }

/* ---- generic strip section ---- */
section { padding: 30px 0; }
.strip-label { font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; font-weight: 700; }
.legend { padding-top: 34px; }

/* ---- lane grid (category nav) ---- */
.lane-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lane-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--ink);
}
.lane-card:hover { border-color: var(--accent); text-decoration: none; }
.lane-bar { display: flex; gap: 3px; }
.lane-bar i { height: 6px; flex: 1; background: currentColor; opacity: 0.35; }
.lane-bar i:first-child { opacity: 1; }
.lane-count { font-size: 12px; color: var(--muted); }
.lane-name { font-weight: 650; font-size: 16px; }
.lane-card.lane-cs { border-left-color: var(--cs); color: var(--cs); }
.lane-card.lane-co { border-left-color: var(--co); color: var(--co); }
.lane-card.lane-ms { border-left-color: var(--ms); color: var(--ms); }
.lane-card.lane-sc { border-left-color: var(--sc); color: var(--sc); }
.lane-card .lane-name, .lane-card .lane-count { color: var(--ink); }
.lane-card .lane-count { color: var(--muted); }

/* ---- lane section ---- */
.lane { border-top: 1px solid var(--line); }
.lane-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.lane-head h2 { font-size: 22px; border-left: 5px solid var(--muted); padding-left: 12px; }
.lane.lane-cs .lane-head h2 { border-left-color: var(--cs); }
.lane.lane-co .lane-head h2 { border-left-color: var(--co); }
.lane.lane-ms .lane-head h2 { border-left-color: var(--ms); }
.lane.lane-sc .lane-head h2 { border-left-color: var(--sc); }
.lane-more { font-size: 13px; white-space: nowrap; }

/* ---- waypoint strip ---- */
.waypoint-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.waypoint {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  display: flex; gap: 0; align-items: stretch;
  background-image: repeating-linear-gradient(90deg, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 48px);
}
.waypoint:hover { border-color: var(--accent); text-decoration: none; }
.wp-rail { flex: 0 0 12px; background: var(--muted); position: relative; }
.waypoint.lane-cs .wp-rail { background: var(--cs); }
.waypoint.lane-co .wp-rail { background: var(--co); }
.waypoint.lane-ms .wp-rail { background: var(--ms); }
.waypoint.lane-sc .wp-rail { background: var(--sc); }
.wp-node { position: absolute; top: 18px; left: -1px; width: 14px; height: 14px; background: var(--surface); border: 3px solid currentColor; color: inherit; }
.wp-body { padding: 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.wp-cat { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; color: var(--muted); }
.waypoint.lane-cs .wp-cat { color: var(--cs); }
.waypoint.lane-co .wp-cat { color: var(--co); }
.waypoint.lane-ms .wp-cat { color: var(--ms); }
.waypoint.lane-sc .wp-cat { color: var(--sc); }
.wp-title { font-weight: 650; font-size: 15.5px; line-height: 1.32; }
.wp-phase { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink); padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wp-phase em { font-style: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
.wp-facts { display: grid; grid-template-columns: 1fr; gap: 4px; }
.wp-facts .wf { font-size: 12px; color: var(--ink); display: flex; gap: 6px; }
.wp-facts .wf b { flex: 0 0 auto; color: var(--muted); font-weight: 700; font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; padding-top: 2px; }
.wp-desc { font-size: 12.5px; color: var(--muted); }

/* ---- page head ---- */
.page-head { padding: 38px 0 10px; border-bottom: 1px solid var(--line); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }
.page-head h1 { font-size: 31px; line-height: 1.18; max-width: 780px; }
.lede { color: var(--muted); margin-top: 8px; }
.page-head.lane-cs { border-bottom: 3px solid var(--cs); }
.page-head.lane-co { border-bottom: 3px solid var(--co); }
.page-head.lane-ms { border-bottom: 3px solid var(--ms); }
.page-head.lane-sc { border-bottom: 3px solid var(--sc); }
.lane-switch { border-top: 1px solid var(--line); }

/* ---- entry layout ---- */
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; padding-top: 26px; padding-bottom: 44px; }

/* phase sheet (fact card) */
.phase-sheet { align-self: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--muted); }
.phase-sheet.lane-cs { border-top-color: var(--cs); }
.phase-sheet.lane-co { border-top-color: var(--co); }
.phase-sheet.lane-ms { border-top-color: var(--ms); }
.phase-sheet.lane-sc { border-top-color: var(--sc); }
.sheet-cap { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sheet-name { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.factstack { display: block; }
.fact-row { display: flex; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fact-row:last-child { border-bottom: 0; }
.fact-row dt { flex: 0 0 40%; padding: 10px 12px; color: var(--muted); border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fact-block { width: 12px; height: 8px; background: var(--accent); flex: 0 0 auto; }
.fact-row dd { flex: 1; padding: 10px 12px; }

/* prose */
.prose { background: var(--surface); border: 1px solid var(--line); padding: 26px 30px; }
.prose .sec { margin-bottom: 26px; }
.prose .sec:last-child { margin-bottom: 0; }
.prose h2 { font-size: 19px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-soft); }
.sec-num { color: var(--accent); font-size: 13px; font-weight: 700; border: 1px solid var(--accent); padding: 0 6px; }
.prose p { margin-bottom: 12px; color: #374151; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 a { color: var(--accent); }
.related-list { list-style: none; }
.related-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.related-list li:last-child { border-bottom: 0; }

/* ---- footer ---- */
.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 20px; padding: 30px 0; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.foot-brand { flex: 1 1 320px; }
.foot-brand p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.foot-nav { display: flex; gap: 16px; }
.foot-nav a { color: var(--ink); font-size: 14px; }
.copyright { flex: 1 1 100%; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .lane-grid { grid-template-columns: repeat(2, 1fr); }
  .waypoint-strip { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lane-grid, .waypoint-strip { grid-template-columns: 1fr; }
  .bar-inner { flex-direction: column; gap: 10px; align-items: flex-start; }
  .topnav { gap: 14px; }
  .route-head h1 { font-size: 27px; }
  .route-axis { flex-wrap: wrap; gap: 12px; }
  .route-axis .tick { flex: 1 1 40%; }
  .prose { padding: 20px 18px; }
  .page-head h1 { font-size: 24px; }
}
