:root {
  --bg: #f4efe5;
  --surface: rgba(254, 249, 241, 0.78);
  --surface-strong: rgba(255, 248, 236, 0.95);
  --ink: #1f2430;
  --muted: #5a5f6d;
  --line: rgba(31, 36, 48, 0.1);
  --amber: #db8a3d;
  --rust: #b44c2d;
  --olive: #526447;
  --teal: #2f6d73;
  --shadow: 0 18px 60px rgba(65, 47, 30, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(219, 138, 61, 0.24), transparent 26%),
    radial-gradient(circle at 85% 15%, rgba(47, 109, 115, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f1e7 0%, #efe6d7 100%);
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.section {
  margin-top: 28px;
}

.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.topbar,
.hero-grid,
.drivers-layout,
.timeline-shell,
.split-grid,
.peace-layout,
.synthesis-grid,
.chatbot-actions,
.chatbot-header {
  display: grid;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 16px;
}

.eyebrow,
.kicker,
.card-tag {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--rust);
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  font-family: 'Cormorant Garamond', serif;
  line-height: 0.95;
  margin: 0;
}

h1 {
  font-size: clamp(3.4rem, 8vw, 6rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  max-width: 14ch;
}

h3 {
  font-size: 2rem;
  margin-bottom: 12px;
}

p {
  line-height: 1.65;
  color: var(--muted);
}

.hero-grid {
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin-top: 28px;
}

.hero-copy,
.hero-map,
.timeline-shell,
.driver-display,
.peace-display,
.synthesis-section,
.final-cta,
.chatbot {
  border-radius: 28px;
  animation: rise-in 700ms ease both;
}

.hero-copy,
.hero-map,
.timeline-shell,
.synthesis-section,
.final-cta {
  padding: 28px;
}

.hero-text {
  font-size: 1.12rem;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.secondary-button,
.ghost-button,
.driver-button,
.timeline-step,
.peace-item,
.chat-fab {
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-button,
.secondary-button,
.ghost-button,
.chat-fab {
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
}

.primary-button {
  background: var(--ink);
  color: #fff8ef;
}

.secondary-button,
.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.chat-fab:hover,
.driver-button:hover,
.timeline-step:hover,
.peace-item:hover {
  transform: translateY(-2px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.hero-metrics article,
.synthesis-grid article {
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(31, 36, 48, 0.07);
}

.hero-metrics span,
.synthesis-grid span {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.hero-map {
  min-height: 500px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(31, 36, 48, 0.95), rgba(59, 52, 42, 0.88)),
    radial-gradient(circle at 50% 50%, rgba(219, 138, 61, 0.28), transparent 38%);
}

.island-chain span,
.radial,
.map-label {
  position: absolute;
}

.island-chain span {
  width: 52px;
  height: 52px;
  border-radius: 54% 46% 58% 42%;
  background: linear-gradient(145deg, rgba(244, 239, 229, 0.92), rgba(219, 138, 61, 0.5));
  box-shadow: 0 0 0 12px rgba(255, 248, 236, 0.05);
  animation: drift 8s ease-in-out infinite;
}

.island-chain span:nth-child(1) { top: 70px; left: 88px; }
.island-chain span:nth-child(2) { top: 148px; left: 170px; width: 66px; height: 66px; }
.island-chain span:nth-child(3) { top: 232px; left: 132px; width: 88px; height: 88px; }
.island-chain span:nth-child(4) { top: 328px; left: 194px; width: 48px; height: 48px; }
.island-chain span:nth-child(5) { top: 394px; left: 118px; width: 74px; height: 74px; }

.radial {
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 236, 0.18);
  animation: pulse 6s ease-in-out infinite;
}

.radial-a { inset: 42px 54px auto auto; width: 220px; height: 220px; }
.radial-b { inset: 124px 32px auto auto; width: 280px; height: 280px; }
.radial-c { inset: auto auto 36px 40px; width: 300px; height: 300px; }

.map-label {
  color: #fff2dc;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.08);
  border: 1px solid rgba(255, 248, 236, 0.12);
}

.map-label-1 { top: 50px; right: 36px; }
.map-label-2 { top: 212px; right: 62px; }
.map-label-3 { bottom: 72px; right: 40px; }
.map-label-4 { bottom: 34px; left: 34px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading.narrow {
  display: block;
}

.drivers-layout,
.peace-layout {
  grid-template-columns: 0.88fr 1.12fr;
  gap: 18px;
}

.driver-buttons,
.peace-list,
.sources-list {
  display: grid;
  gap: 12px;
}

.driver-button,
.peace-item {
  text-align: left;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid transparent;
}

.driver-button.active,
.peace-item.active,
.timeline-step.active {
  background: var(--ink);
  color: #fff8ef;
}

.driver-button.active p,
.peace-item.active p,
.timeline-step.active p,
.timeline-step.active span {
  color: rgba(255, 248, 236, 0.78);
}

.driver-button strong,
.peace-item strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.driver-display,
.peace-display {
  padding: 28px;
}

.driver-display h3,
.timeline-card h3,
.peace-display h3 {
  margin-bottom: 12px;
}

.keywords,
.timeline-card ul,
.peace-display ul,
.split-grid ul {
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.keywords li,
.timeline-card li,
.peace-display li,
.split-grid li,
.loop-node {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(31, 36, 48, 0.06);
  color: var(--ink);
}

.timeline-shell {
  gap: 24px;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.timeline-step {
  text-align: left;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.timeline-step span {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.timeline-card {
  padding: 12px 8px 8px 4px;
}

.split-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.tilt-card {
  border-radius: 28px;
  padding: 26px;
  color: #fffaf2;
  min-height: 320px;
  box-shadow: var(--shadow);
}

.escalation-card {
  background: linear-gradient(145deg, #a9452a, #d38336);
}

.deescalation-card {
  background: linear-gradient(145deg, #2e6468, #6f8c54);
}

.tilt-card p,
.tilt-card li,
.final-cta p {
  color: rgba(255, 250, 242, 0.84);
}

.loop-ring {
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.loop-node {
  position: absolute;
  width: 180px;
  min-height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 800;
  background: var(--surface-strong);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.loop-center {
  position: absolute;
  inset: 56% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 1px dashed rgba(31, 36, 48, 0.2);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

.peace-display .impact-stat {
  display: inline-flex;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(47, 109, 115, 0.1);
  color: var(--teal);
  font-weight: 800;
}

.synthesis-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.sources-list {
  grid-template-columns: repeat(2, 1fr);
}

.source-item {
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.source-item p,
.source-item a {
  font-size: 0.94rem;
}

.source-item a {
  color: var(--rust);
}

.final-cta {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.chatbot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(82vh, 760px);
  padding: 18px;
  background: rgba(255, 249, 240, 0.96);
  border: 1px solid rgba(31, 36, 48, 0.08);
  box-shadow: 0 24px 80px rgba(31, 36, 48, 0.22);
  display: none;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  z-index: 20;
}

.chatbot.open {
  display: grid;
}

.chatbot-body {
  min-height: 280px;
  max-height: 48vh;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.chat-message {
  border-radius: 18px;
  padding: 14px;
  max-width: 90%;
}

.chat-message.user {
  background: var(--ink);
  color: #fff8ef;
  margin-left: auto;
}

.chat-message.assistant {
  background: rgba(31, 36, 48, 0.06);
}

.chatbot-form textarea {
  width: 100%;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.1);
  padding: 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.78);
}

.chatbot-actions {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#chat-status {
  margin: 0;
  font-size: 0.92rem;
}

.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: #fff8ef;
  box-shadow: 0 12px 40px rgba(31, 36, 48, 0.28);
  z-index: 10;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(4deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .drivers-layout,
  .peace-layout,
  .split-grid,
  .synthesis-grid,
  .sources-list,
  .timeline-track {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-map {
    min-height: 380px;
  }

  .section-heading {
    display: block;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 1180px);
    padding-top: 14px;
  }

  .hero-copy,
  .hero-map,
  .timeline-shell,
  .driver-display,
  .peace-display,
  .synthesis-section,
  .final-cta,
  .chatbot {
    border-radius: 22px;
  }

  .hero-copy,
  .hero-map,
  .timeline-shell,
  .driver-display,
  .peace-display,
  .synthesis-section,
  .final-cta,
  .chatbot {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .chatbot {
    right: 9px;
    bottom: 9px;
  }

  .chat-fab {
    right: 12px;
    bottom: 12px;
  }
}
