/* ================================================================
   Pigeon-SG Topical Strategy IA Preview — Shared Tokens
   Matches the existing pigeon-sg.pages.dev portal styling
   ================================================================ */

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

:root {
  --c-coral:        #D26A5C;
  --c-coral-deep:   #B85546;
  --c-coral-soft:   #F4DDD7;
  --c-coral-tint:   #FBF1EE;
  --c-text:         #1c1917;
  --c-text-2:       #57534e;
  --c-text-mute:    #78716c;
  --c-bg:           #fafaf8;
  --c-bg-card:      #ffffff;
  --c-border:       #e7e5e4;
  --c-border-soft:  #f5f5f4;

  --c-t1: #D26A5C;
  --c-t2: #6B95C7;
  --c-t3: #A8A29E;
  --c-success: #10b981;
  --c-warn:    #f59e0b;

  --ff:        'Inter', system-ui, -apple-system, sans-serif;
  --ff-serif:  'Lora', Georgia, serif;
  --ff-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-card: 12px;
  --r-pill: 999px;
  --r-btn:  8px;

  --shadow-card:        0 1px 3px rgba(28,25,23,.06), 0 4px 16px rgba(28,25,23,.04);
  --shadow-card-hover:  0 4px 12px rgba(28,25,23,.08), 0 16px 32px rgba(28,25,23,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-coral); text-decoration: none; }
a:hover { color: var(--c-coral-deep); text-decoration: underline; }

.font-serif { font-family: var(--ff-serif); }
.font-mono { font-family: var(--ff-mono); }

/* ── Top bar / sticky nav ────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--c-text);
  text-decoration: none;
  font-size: 0.95rem;
}
.topbar-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-coral); }
.topbar-brand:hover { color: var(--c-coral); text-decoration: none; }
.topbar-nav { display: flex; gap: 0.25rem; margin-left: auto; flex-wrap: wrap; }
.topbar-nav a {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-2);
  text-decoration: none;
  border-radius: var(--r-btn);
}
.topbar-nav a.active { color: var(--c-coral); background: var(--c-coral-tint); }
.topbar-nav a:hover { color: var(--c-text); background: var(--c-border-soft); text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 2.5rem;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: var(--c-coral-tint);
  border: 1px solid var(--c-coral-soft);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-coral-deep);
  margin-bottom: 1rem;
}
.hero-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-coral); }
h1.hero-h1 {
  font-family: var(--ff-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--c-text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
h1.hero-h1 .accent { color: var(--c-coral); }
.hero-lead {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--c-text-2);
  max-width: 720px;
  line-height: 1.55;
}

/* ── Page headers (non-hero pages) ──────────────────────────────── */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-family: var(--ff-serif);
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.page-header .subtitle { color: var(--c-text-2); font-size: 1rem; }

.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--c-border);
  margin: 2rem 0 1.25rem;
}
.section-header h2 {
  font-family: var(--ff-serif);
  font-size: 1.35rem;
  font-weight: 700;
}
.section-header .badge {
  font-size: 0.78rem;
  color: var(--c-text-mute);
  font-weight: 500;
}

/* ── Metrics strip ──────────────────────────────────────────────── */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 0;
}
.metric {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 1rem 1.15rem;
}
.metric .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-text-mute); font-weight: 600; margin-bottom: 0.3rem; }
.metric .value { font-family: var(--ff-serif); font-size: 1.45rem; font-weight: 700; color: var(--c-text); }
.metric .delta { font-size: 0.78rem; color: var(--c-text-2); margin-top: 0.15rem; }

/* ── Nav cards (overview page) ──────────────────────────────────── */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}
.nav-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 1.25rem 1.35rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 150ms ease;
  position: relative;
}
.nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-coral);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
  color: inherit;
}
.nav-card::after {
  content: '→';
  position: absolute;
  bottom: 1rem; right: 1.25rem;
  font-size: 1.1rem;
  color: var(--c-coral);
  transition: transform 150ms ease;
}
.nav-card:hover::after { transform: translateX(3px); }
.nav-card .nav-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--c-coral-tint);
  color: var(--c-coral-deep);
  border-radius: 6px;
  font-weight: 700; font-size: 0.78rem;
  margin-bottom: 0.6rem;
}
.nav-card .nav-title { font-family: var(--ff-serif); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; padding-right: 1.5rem; }
.nav-card .nav-desc { font-size: 0.88rem; color: var(--c-text-2); line-height: 1.5; padding-right: 1.5rem; }

/* ── Cluster cards ──────────────────────────────────────────────── */
.cluster-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 1.4rem 1.5rem 1.25rem;
  margin-bottom: 1rem;
}
.cluster-card .row1 { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.cluster-card h3 { font-family: var(--ff-serif); font-size: 1.2rem; font-weight: 700; }
.cluster-card .tier { font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: var(--r-pill); font-weight: 700; letter-spacing: 0.04em; }
.cluster-card .tier-T1 { background: rgba(210, 106, 92, 0.12); color: var(--c-coral-deep); }
.cluster-card .tier-T2 { background: rgba(107, 149, 199, 0.12); color: #4d6f95; }
.cluster-card .tier-T3 { background: rgba(168, 162, 158, 0.16); color: #57534e; }
.cluster-card .meta { font-size: 0.82rem; color: var(--c-text-mute); }
.cluster-card .cluster-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin: 0.85rem 0 0.85rem; }
.cluster-card .stat { padding: 0.5rem 0.65rem; background: var(--c-coral-tint); border-radius: 6px; }
.cluster-card .stat .label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-mute); font-weight: 600; }
.cluster-card .stat .value { font-family: var(--ff-serif); font-size: 1rem; font-weight: 700; }
.cluster-card .top-kws { font-size: 0.85rem; color: var(--c-text-2); }
.cluster-card .top-kws strong { color: var(--c-text); font-weight: 600; }

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  overflow: hidden;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--c-border-soft);
}
.data-table th {
  background: var(--c-coral-tint);
  font-weight: 600;
  color: var(--c-text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--c-border-soft); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .mono { font-family: var(--ff-mono); font-size: 0.8rem; }
.data-table .badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
}
.data-table .badge-t1 { background: rgba(210, 106, 92, 0.12); color: var(--c-coral-deep); }
.data-table .badge-t2 { background: rgba(107, 149, 199, 0.14); color: #4d6f95; }
.data-table .badge-t3 { background: rgba(168, 162, 158, 0.16); color: #57534e; }
.data-table .badge-aio { background: rgba(245, 158, 11, 0.14); color: #92400e; }
.data-table .badge-paa { background: rgba(16, 185, 129, 0.12); color: #065f46; }

/* ── Sprint timeline ────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--c-coral-soft); }
.timeline .phase { margin-bottom: 2rem; }
.timeline .phase-header { font-family: var(--ff-serif); font-size: 1.05rem; font-weight: 700; color: var(--c-coral-deep); margin-bottom: 0.5rem; padding-left: 0.5rem; }
.timeline .sprint { padding-left: 0.5rem; margin-bottom: 0.75rem; position: relative; }
.timeline .sprint::before {
  content: ''; position: absolute; left: -1.91rem; top: 0.4rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--c-coral);
}
.timeline .sprint-name { font-weight: 600; color: var(--c-text); font-size: 0.92rem; }
.timeline .sprint-list { font-size: 0.85rem; color: var(--c-text-2); margin-top: 0.25rem; }

/* ── Tree (ia-tree page) ───────────────────────────────────────── */
.tree { background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--r-card); padding: 1.5rem 1.75rem; font-family: var(--ff-mono); font-size: 0.82rem; line-height: 1.75; }
.tree .branch { color: var(--c-text-mute); }
.tree .cluster { color: var(--c-coral-deep); font-weight: 700; }
.tree .hub { color: var(--c-text); font-weight: 600; }
.tree .spoke { color: var(--c-text-2); }
.tree .new-tag { display: inline-block; padding: 0 0.4rem; margin-left: 0.4rem; background: var(--c-success); color: white; font-size: 0.65rem; border-radius: 4px; font-family: var(--ff); font-weight: 700; }
.tree .existing-tag { display: inline-block; padding: 0 0.4rem; margin-left: 0.4rem; background: var(--c-border); color: var(--c-text-2); font-size: 0.65rem; border-radius: 4px; font-family: var(--ff); font-weight: 600; }

/* ── Decisions list ─────────────────────────────────────────────── */
.decision {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-coral);
  border-radius: var(--r-card);
  padding: 1.25rem 1.4rem 1.1rem;
  margin-bottom: 0.85rem;
}
.decision .label { font-size: 0.7rem; font-weight: 700; color: var(--c-coral-deep); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.decision h3 { font-family: var(--ff-serif); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.decision .body { font-size: 0.92rem; color: var(--c-text-2); line-height: 1.55; }
.decision .anti { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--c-border); font-size: 0.82rem; color: var(--c-text-mute); }
.decision .anti strong { color: var(--c-text); }

/* ── Glossary ──────────────────────────────────────────────────── */
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.85rem; }
.gloss-term { background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--r-card); padding: 0.85rem 1rem; }
.gloss-term dt { font-weight: 700; color: var(--c-coral-deep); font-size: 0.9rem; margin-bottom: 0.2rem; }
.gloss-term dd { font-size: 0.85rem; color: var(--c-text-2); line-height: 1.5; }

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.82rem;
  color: var(--c-text-mute);
  text-align: center;
}
footer .legal { margin-top: 0.5rem; font-size: 0.76rem; }

/* ── Filter chips (pages table) ─────────────────────────────────── */
.filter-bar { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--c-border);
  background: var(--c-bg-card);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 120ms ease;
}
.chip:hover { border-color: var(--c-coral); }
.chip.active { background: var(--c-text); color: white; border-color: var(--c-text); }
.chip .count { background: var(--c-border-soft); color: var(--c-text-mute); border-radius: var(--r-pill); padding: 0 0.45rem; font-size: 0.7rem; font-weight: 700; }
.chip.active .count { background: rgba(255,255,255,0.18); color: white; }

/* ── Callout boxes ──────────────────────────────────────────────── */
.callout {
  background: var(--c-coral-tint);
  border-left: 4px solid var(--c-coral);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.callout h4 { font-family: var(--ff-serif); font-size: 0.95rem; font-weight: 700; color: var(--c-coral-deep); margin-bottom: 0.3rem; }
.callout p { font-size: 0.9rem; color: var(--c-text-2); margin: 0; }
.callout .lock-date { font-weight: 700; color: var(--c-coral-deep); }

/* ── Responsive tweaks ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar-nav { width: 100%; overflow-x: auto; }
  .container { padding: 1.25rem 0.85rem 3rem; }
  .hero { padding: 2rem 0 1.5rem; }
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
  .topbar { display: none; }
  body { background: white; }
  .nav-card, .cluster-card { break-inside: avoid; }
}
