:root {
  --bg: #070b16;
  --bg-soft: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #aebbd0;
  --muted-strong: #d7dfef;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --white: #ffffff;
  --blue: #93c5fd;
  --blue-strong: #3b82f6;
  --danger: #fecaca;
  --warning: #fde68a;
  --success: #bbf7d0;
  --neutral: #e2e8f0;
  --shadow: 0 34px 110px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.30), transparent 30rem),
    radial-gradient(circle at 82% 4%, rgba(14, 165, 233, 0.16), transparent 28rem),
    radial-gradient(circle at 50% 105%, rgba(15, 23, 42, 0.7), transparent 28rem),
    linear-gradient(145deg, var(--bg), var(--bg-soft));
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(147, 197, 253, 0.75);
  outline-offset: 3px;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.header-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: pretty; }

h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2.4rem, 5vw, 5.3rem);
  line-height: 0.91;
  letter-spacing: -0.075em;
}

.intro {
  max-width: 730px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.header-meta {
  min-width: 205px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.header-meta span,
.header-meta strong,
.header-meta small { display: block; }

.header-meta span,
.header-meta small {
  color: var(--muted);
  font-size: 0.82rem;
}

.header-meta strong {
  margin: 4px 0;
  font-size: 1.2rem;
}

.reader-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 34px;
  padding: 16px 18px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(147, 197, 253, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.reader-guide div {
  display: grid;
  gap: 3px;
}

.reader-guide strong { font-size: 0.98rem; }
.reader-guide span {
  color: var(--muted);
  line-height: 1.45;
}

.guide-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.guide-button,
.primary-button {
  border: 0;
  color: #0b1020;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(255, 255, 255, 0.16);
}

.secondary-button {
  min-height: 38px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--line);
}

.guide-button:hover,
.primary-button:hover,
.secondary-button:hover,
.close-button:hover,
.carousel-button:hover {
  transform: translateY(-1px);
}

.featured-section,
.process-section { margin-top: 34px; }

.section-heading { margin-bottom: 16px; }

.split-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.045em;
}

.split-heading > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 36px;
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.24), transparent 26rem),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 22rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.145), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.featured-card::after {
  position: absolute;
  right: -28px;
  top: 28px;
  color: rgba(255, 255, 255, 0.045);
  font-size: clamp(4rem, 11vw, 9rem);
  font-weight: 950;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.featured-copy {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.13);
  color: var(--blue);
  border: 1px solid rgba(147, 197, 253, 0.28);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-copy h3 {
  margin: 22px 0 16px;
  max-width: 820px;
  font-size: clamp(2.4rem, 5vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.078em;
}

.featured-copy p {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted-strong);
  font-size: 1.08rem;
  line-height: 1.58;
}

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.text-link {
  color: var(--muted-strong);
  font-weight: 800;
  text-decoration-color: rgba(255, 255, 255, 0.36);
  text-underline-offset: 4px;
}

.text-link:hover { color: var(--white); }

.featured-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(16px);
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card.danger strong,
.mini-stat.danger strong { color: var(--danger); }
.stat-card.warning strong,
.mini-stat.warning strong { color: var(--warning); }
.stat-card.info strong,
.mini-stat.info strong { color: var(--blue); }
.stat-card.success strong,
.mini-stat.success strong { color: var(--success); }
.stat-card.neutral strong,
.mini-stat.neutral strong { color: var(--neutral); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 16px;
}

.pipeline-step {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted);
  text-align: left;
  display: grid;
  align-content: center;
  gap: 4px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.pipeline-step:hover,
.pipeline-step.active {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.42);
  background: rgba(147, 197, 253, 0.13);
  color: var(--text);
}

.pipeline-step strong {
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pipeline-step span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  font-weight: 750;
}

.carousel-wrap {
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.22);
}

.carousel-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#currentSlideLabel { color: var(--blue); }

.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 30px;
}

.carousel-track {
  display: flex;
  transition: transform 520ms cubic-bezier(.22, .85, .32, 1);
}

.slide {
  flex: 0 0 100%;
  padding: 2px;
}

.report-card {
  position: relative;
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 28px;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(147, 197, 253, 0.18), transparent 28rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.055));
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.26);
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.9), rgba(255, 255, 255, 0.16));
}

.report-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.36);
}

.report-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-card h3 {
  max-width: 820px;
  margin: 44px 0 14px;
  font-size: clamp(2.25rem, 5.2vw, 5.1rem);
  line-height: 0.93;
  letter-spacing: -0.072em;
}

.report-card p {
  max-width: 760px;
  margin: 0;
  color: #d3dcec;
  line-height: 1.55;
  font-size: 1.02rem;
}

.card-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin-top: 36px;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  min-height: 94px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.075);
}

.mini-stat strong {
  display: block;
  margin-bottom: 7px;
  font-size: clamp(1.25rem, 3vw, 2.05rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1020;
  font-weight: 900;
  white-space: nowrap;
}

.carousel-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 180ms ease, background 180ms ease;
}

.carousel-footer {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  padding: 0;
  transition: width 180ms ease, background 180ms ease;
}

.dot.active {
  width: 30px;
  background: var(--white);
}

.progress-shell {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--white));
  transition: width 180ms linear;
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.report-modal.open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(12px);
}

.modal-panel {
  position: absolute;
  inset: 3vh 3vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #0b1020;
  box-shadow: 0 42px 140px rgba(0, 0, 0, 0.72);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.modal-title-wrap { min-width: 0; }

.modal-kicker {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1020;
  font-size: 1.55rem;
  line-height: 1;
  transition: transform 180ms ease;
}

#reportFrame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #ffffff;
}

@media (max-width: 1080px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .site-header,
  .split-heading,
  .featured-card,
  .card-bottom {
    grid-template-columns: 1fr;
  }

  .site-header,
  .split-heading { display: grid; }

  .reader-guide { align-items: flex-start; flex-direction: column; }

  .featured-copy {
    min-height: auto;
    padding: 8px;
  }

  .card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .carousel {
    grid-template-columns: 1fr;
    position: relative;
  }

  .carousel-button {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
  }

  .carousel-button:hover { transform: translateY(calc(-50% - 1px)); }
  .prev-button { left: 14px; }
  .next-button { right: 14px; }

  .modal-panel { inset: 1.5vh 1.5vw; }
  .modal-header { align-items: flex-start; flex-direction: column; }
  .modal-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 20px, 1220px); padding-top: 20px; }
  h1 { letter-spacing: -0.06em; }
  .featured-card,
  .report-card,
  .carousel-wrap { border-radius: 24px; }
  .featured-card,
  .report-card { padding: 18px; }
  .featured-stats,
  .card-stats { grid-template-columns: 1fr; }
  .report-card { min-height: 560px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-step { min-height: 54px; }
  .modal-nav-button { flex: 1 1 42%; }
  #openNewTab { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
