:root {
  --bg: #08111f;
  --bg-soft: #101d31;
  --panel: rgba(12, 25, 42, 0.84);
  --panel-strong: rgba(8, 18, 31, 0.92);
  --line: rgba(157, 187, 221, 0.2);
  --text: #ebf4ff;
  --muted: #9ab2cf;
  --accent: #ffd166;
  --accent-strong: #ff8c42;
  --mint: #8ae6cf;
  --rose: #ff8a8a;
  --sky: #96b7ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --display: "Georgia", "Palatino Linotype", "Book Antiqua", serif;
  --body: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--body);
  background:
    radial-gradient(circle at top right, rgba(255, 140, 66, 0.18), transparent 28%),
    radial-gradient(circle at 12% 12%, rgba(138, 230, 207, 0.16), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #0d1729 42%, #06101d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.52), transparent 90%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.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;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(6, 16, 29, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.topnav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.clock-card,
.story-card,
.graph-card,
.feature-panel,
.console-card,
.agent-rail,
.article-card,
.status-strip,
.info-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  padding: 38px;
  border-radius: 32px;
}

.clock-card {
  grid-column: 1;
  grid-row: 1;
  padding: 26px;
  border-radius: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 209, 102, 0.13), transparent 42%),
    var(--panel-strong);
}

.digital-clock {
  padding: 22px 20px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(4, 10, 18, 0.82);
  box-shadow: inset 0 0 28px rgba(0,0,0,0.24);
}
.digital-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}
.digital-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.digital-time span {
  min-width: 62px;
  text-align: center;
}
.digital-time b {
  display: block;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-shadow: 0 0 18px rgba(255,209,102,0.2);
}
.digital-time small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.digital-time i {
  color: rgba(255,255,255,0.38);
  font-style: normal;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
}
.clock-copy h2 { margin: 0; font-family: var(--display); font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.05; }
.clock-time { margin-top: 12px; font-variant-numeric: tabular-nums; }
.clock-note { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.clock-dates { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: 0.78rem; }
.source-link { display: inline-block; margin-top: 14px; color: var(--sky); font-size: 0.88rem; }
.source-link:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .digital-time { gap: 3px; }
  .digital-time span { min-width: 50px; }
  .digital-time b { font-size: 1.7rem; }
  .digital-time small { font-size: 0.45rem; }
  .digital-time i { font-size: 1.45rem; }
}

.hero-copy h1,
.section-heading h1,
.section-heading h2,
.agent-rail h1,
.console-header h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.02;
}

.hero-copy h1 {
  font-size: clamp(2.7rem, 5vw, 4.9rem);
  max-width: 12ch;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 60ch;
}

.narrow {
  max-width: 46rem;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #fff2a8);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-grid,
.graph-grid,
.split-panel,
.article-grid,
.brief-grid {
  display: grid;
  gap: 20px;
}

.story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card,
.graph-card,
.feature-panel,
.article-card,
.info-card {
  border-radius: 24px;
}

.story-card {
  padding: 24px;
}

.story-card h2,
.graph-header h3,
.feature-panel h3,
.article-card h3,
.info-card h3 {
  margin-top: 0;
  font-family: var(--display);
}

.story-card p,
.graph-header p,
.feature-panel p,
.article-card p,
.agent-note,
.composer-hint,
.briefing-meta,
#briefing-status,
.info-card p,
.article-list {
  color: var(--muted);
  line-height: 1.65;
}

.section-heading {
  margin: 42px 0 18px;
}

.section-heading h2,
.section-heading h1,
.agent-rail h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  max-width: 15ch;
}

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

.graph-card {
  padding: 24px;
}

.graph {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 20px;
  overflow: visible;
}

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

.feature-panel {
  padding: 26px;
  min-height: 240px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.feature-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 209, 102, 0.34);
}

.feature-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--mint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.agent-rail,
.console-card {
  border-radius: 28px;
}

.agent-rail {
  padding: 28px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.agent-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.agent-option {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.agent-option:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
}

.agent-option img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
}

.agent-option-copy,
.agent-option-copy strong,
.agent-option-copy span {
  display: block;
  min-width: 0;
}

.agent-option-copy span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.agent-option.active {
  border-color: rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.08);
}

.prompt-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.prompt-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.console-card {
  padding: 24px;
  min-height: 72vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.console-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.active-agent {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.active-agent > img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: contain;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
  border: 1px solid rgba(255, 209, 102, 0.24);
}

.active-agent-note {
  margin: 6px 0 0;
  max-width: 55ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mode-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  white-space: nowrap;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0;
  overflow: auto;
}

.message {
  max-width: min(74ch, 92%);
  padding: 16px 18px;
  border-radius: 20px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.message.user {
  align-self: end;
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #ffe9a0);
}

.message.assistant {
  align-self: start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.composer {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.briefing-head {
  margin-top: 10px;
}

.briefing-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 18px;
  margin-bottom: 20px;
}

.source-pill {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
}

.source-pill.ok {
  background: rgba(138, 230, 207, 0.12);
  color: var(--mint);
}

.source-pill.info {
  background: rgba(150, 183, 255, 0.12);
  color: var(--sky);
}

.source-pill.alert {
  background: rgba(255, 138, 138, 0.13);
  color: #ffaaaa;
}

.article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card,
.info-card {
  padding: 22px;
}

.featured-article {
  grid-column: 1 / -1;
  background:
    linear-gradient(125deg, rgba(255, 94, 94, 0.1), transparent 48%),
    var(--panel-strong);
  border-color: rgba(255, 138, 138, 0.3);
}

.featured-article h3 {
  max-width: 24ch;
  font-family: var(--display);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.featured-article > p {
  max-width: 78ch;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-kind {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  text-transform: capitalize;
}

.article-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
}

.article-list {
  padding-left: 18px;
}

.article-list li + li {
  margin-top: 8px;
}

.muted-inline {
  color: var(--muted);
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  margin-bottom: 56px;
}

.comparison-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.clocks-card {
  container-type: inline-size;
}

.comparison-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.comparison-header h3 {
  margin: 0 0 7px;
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.7vw, 2.25rem);
  line-height: 1.05;
}

.comparison-header p,
.comparison-note,
.clock-side p {
  color: var(--muted);
  line-height: 1.55;
}

.comparison-header p { margin: 0; }
.comparison-number {
  display: grid;
  flex: 0 0 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(255, 209, 102, 0.08);
  font-family: var(--display);
}

.risk-bars { display: grid; gap: 18px; }
.risk-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: -6px 0 24px; color: var(--muted); font-size: 0.78rem; }
.risk-legend span { display: inline-flex; gap: 7px; align-items: center; }
.risk-legend i { display: inline-block; flex: 0 0 auto; }
.legend-line { width: 22px; height: 4px; border-radius: 999px; background: var(--accent); }
.legend-dot { width: 10px; height: 10px; border: 2px solid #dce9ff; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 3px rgba(150, 183, 255, 0.16); }
.legend-dash { width: 20px; border-top: 2px dashed rgba(255, 255, 255, 0.34); }
.risk-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.5fr) 64px;
  gap: 14px;
  align-items: center;
}
.risk-label { display: flex; flex-direction: column; gap: 3px; }
.risk-label span { color: var(--muted); font-size: 0.8rem; }
.risk-row > b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.risk-track { position: relative; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.risk-fill { display: block; height: 100%; min-width: 8px; border-radius: inherit; }
.benchmark-marker { position: absolute; top: 50%; width: 12px; height: 12px; border: 2px solid #f4f8ff; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(150, 183, 255, 0.2); transform: translate(-50%, -50%); }
.no-benchmark { position: absolute; top: 50%; right: 8px; width: 24px; border-top: 2px dashed rgba(255, 255, 255, 0.3); transform: translateY(-50%); }
.risk-ai { background: linear-gradient(90deg, #ff8c42, #ff5e5e); }
.risk-pandemic { background: linear-gradient(90deg, #ffd166, #ff8c42); }
.risk-nuclear { background: linear-gradient(90deg, #96b7ff, #cf8cff); }
.risk-space { background: linear-gradient(90deg, #8ae6cf, #96b7ff); }
.comparison-note { margin: 24px 0 0; font-size: 0.9rem; }
.comparison-sources { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.clock-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.clock-side {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(4, 10, 18, 0.6);
}
.clock-side strong {
  display: block;
  margin-top: 13px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}
.clock-side p { margin: 12px 0 0; font-size: 0.9rem; }
.clock-tag { color: var(--accent); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; }
.doomsday-side .clock-tag { color: var(--sky); }
.versus-mark { align-self: center; color: var(--muted); font-family: var(--display); font-size: 0.85rem; }

@container (max-width: 620px) {
  .clock-comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .versus-mark {
    justify-self: center;
  }
}

@media (max-width: 980px) {
  .hero,
  .chat-layout,
  .graph-grid,
  .split-panel,
  .story-grid,
  .article-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .agent-rail {
    position: static;
  }

  .hero-copy {
    padding: 28px;
  }

  .clock-card {
    grid-template-columns: 1fr;
  }

.hero-copy h1,
  .section-heading h2,
  .section-heading h1,
  .agent-rail h1 {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .composer-actions,
  .briefing-meta,
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    gap: 10px;
    padding: 12px;
  }

  .brand {
    font-size: 1.25rem;
    white-space: nowrap;
  }

  .topnav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 2px;
  }

  .topnav a {
    padding: 8px 6px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .chat-layout,
  .agent-rail,
  .console-card,
  .console-header,
  .message-list,
  .composer {
    width: 100%;
    min-width: 0;
  }

  .agent-rail,
  .console-card {
    padding: 20px;
  }

  .agent-rail h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
  }

  .console-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .active-agent > img {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .mode-pill {
    max-width: 100%;
    white-space: normal;
  }

  .agent-note,
  .message,
  .composer-hint {
    overflow-wrap: anywhere;
  }

  .message {
    max-width: 100%;
  }

  .risk-row {
    grid-template-columns: 1fr 58px;
  }

  .risk-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .clock-comparison {
    grid-template-columns: 1fr;
  }

  .versus-mark {
    justify-self: center;
  }
}
