:root {
  color-scheme: light;
  --ink: #1b1b1b;
  --muted: #5a5a5a;
  --paper: #f6f1ea;
  --paper-strong: #efe6db;
  --accent: #1f5b78;
  --accent-soft: #d9edf8;
  --accent-warm: #ff9257;
  --border: rgba(17, 31, 44, 0.12);
  --shadow: 0 30px 60px rgba(27, 27, 27, 0.12);
  --radius: 20px;
  --radius-lg: 28px;
  --mono: "Courier New", Courier, monospace;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: "Gill Sans", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff1df, #f9f4ef 45%, #f3efe9 100%);
  min-height: 100vh;
}

button,
input,
select,
textarea,
a {
  font-family: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 146, 87, 0.18), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(31, 91, 120, 0.18), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 201, 120, 0.22), transparent 50%);
  mix-blend-mode: multiply;
  z-index: 0;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  padding: 56px clamp(24px, 6vw, 84px) 32px;
  align-items: start;
}

.hero__text {
  align-self: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0 0 16px;
  font-weight: 600;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 3.4vw, 3.6rem);
  margin: 0 0 18px;
  line-height: 1.08;
}

.subhead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
}

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

.controls.small {
  margin-bottom: 16px;
}

.search,
.select {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  min-width: 220px;
  box-shadow: 0 18px 30px rgba(27, 27, 27, 0.08);
}

.search span,
.select span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.search input,
.select select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  font-family: var(--sans);
}

.hero__stat {
  display: grid;
  gap: 16px;
  align-content: start;
  justify-self: start;
  max-width: 360px;
  width: 100%;
  margin-top: 22px;
}

.hero-graphic {
  background: #ffffffcc;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px;
}

.hero-graphic img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  animation: heroFloat 10s ease-in-out infinite;
}

.hero-steps {
  display: grid;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(31, 91, 120, 0.12);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.hero-steps.hidden {
  display: none;
}

.hero-chat-visual {
  display: none;
}

.hero-chat-visual.active {
  display: block;
}

.chat-visual-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 91, 120, 0.12);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.chat-visual-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.chat-visual-line {
  font-size: 0.95rem;
  color: var(--muted);
}

.chat-visual-bubbles {
  display: grid;
  gap: 8px;
}

.chat-visual-bubbles .bubble {
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.9rem;
  max-width: 88%;
}

.chat-visual-bubbles .bubble.user {
  background: rgba(31, 91, 120, 0.12);
  color: var(--primary);
  justify-self: end;
}

.chat-visual-bubbles .bubble.assistant {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 91, 120, 0.15);
}

.chat-visual-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-visual-pills span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 91, 120, 0.1);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(120deg, #2e7a92, #3db6b1);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

.step-title {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.step-body {
  color: var(--muted);
  font-size: 1.05rem;
}


@keyframes heroFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-graphic img {
    animation: none;
  }
}

.stat-card {
  background: var(--paper-strong);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-number {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 8px;
  word-break: break-word;
}

.stat-card--hook .stat-number {
  font-size: 2.2rem;
  line-height: 1.1;
}

.stat-card--hook .stat-label {
  font-size: 1rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 12px;
  padding: 12px clamp(24px, 6vw, 84px);
  background: rgba(249, 244, 239, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 24px rgba(31, 91, 120, 0.25);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view {
  position: relative;
}

.view::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 91, 120, 0.08), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(255, 146, 87, 0.08), transparent 45%),
    radial-gradient(circle at 40% 80%, rgba(61, 182, 177, 0.08), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 32px;
  padding: 24px clamp(24px, 6vw, 84px) 64px;
  align-items: start;
}


.layout .topics::-webkit-scrollbar,
.layout .detail::-webkit-scrollbar {
  width: 8px;
}

.layout .topics::-webkit-scrollbar-thumb,
.layout .detail::-webkit-scrollbar-thumb {
  background: rgba(31, 91, 120, 0.25);
  border-radius: 999px;
}

.layout .topics::-webkit-scrollbar-track,
.layout .detail::-webkit-scrollbar-track {
  background: transparent;
}

.layout.single {
  grid-template-columns: 1fr;
}

.section-title h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.6rem;
}

.section-title p {
  margin: 0 0 20px;
  color: var(--muted);
}

.topics .section-title p {
  text-align: center;
}

.topic-list {
  display: grid;
  gap: 16px;
}

.topic-list {
  position: relative;
  padding-left: 22px;
}

.topic-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(31, 91, 120, 0.15), rgba(31, 91, 120, 0.45), rgba(31, 91, 120, 0.15));
}


.topic-card {
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #ffffffd9;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  animation: fadeUp 0.4s ease both;
  position: relative;
  padding-left: 36px;
}

.topic-card::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(31, 91, 120, 0.35);
  box-shadow: 0 0 0 6px rgba(31, 91, 120, 0.08);
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(31, 91, 120, 0.18);
  border-color: rgba(31, 91, 120, 0.3);
}

.topic-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(46, 122, 146, 0.12), rgba(255, 255, 255, 0.95));
  box-shadow: 0 20px 40px rgba(31, 91, 120, 0.25);
  position: relative;
}

.topic-card.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(31, 91, 120, 0.18);
}

.topic-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-family: var(--serif);
}

.topic-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.topic-guests {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.detail-body {
  display: grid;
  gap: 18px;
}

.guest-card,
.result-card {
  background: #ffffffcc;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  box-shadow: 0 18px 30px rgba(27, 27, 27, 0.08);
  animation: fadeUp 0.35s ease both;
  position: relative;
}

.guest-card::before {
  content: none;
}

.guest-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.guest-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-family: var(--serif);
}

.segment-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--mono);
}

.snippet {
  margin: 12px 0 16px;
  color: #2c2c2c;
  line-height: 1.5;
}

.summary {
  margin: 10px 0 12px;
  color: #2f2f2f;
  line-height: 1.5;
  font-weight: 600;
}

.summary-block {
  background: #fff3dc;
  border: 1px solid rgba(255, 146, 87, 0.35);
  border-radius: 16px;
  padding: 12px 14px;
}

.intro {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary-block {
  display: none;
}

.summary-block.open {
  display: block;
}

.toggle {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.toggle.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.segments {
  margin-top: 16px;
  display: none;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  gap: 12px;
}

.segments.open {
  display: grid;
}

.segment {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.segment .meta {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: 6px;
}

.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.link-row .toggle {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


.link-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.heatmap-tile {
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  background: hsl(var(--hue, 200) 55% calc(92% - (var(--heat, 0) * 10%)));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  box-shadow: 0 12px 22px rgba(31, 91, 120, 0.08);
  cursor: pointer;
}

.heatmap-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(31, 91, 120, 0.16);
  border-color: rgba(31, 91, 120, 0.25);
}

.heatmap-tile strong {
  display: block;
  margin-bottom: 6px;
}

.footer {
  padding: 32px clamp(24px, 6vw, 84px) 60px;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.chat-banner {
  margin: 8px 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 91, 120, 0.18);
  background: rgba(31, 91, 120, 0.08);
  color: var(--primary);
  font-size: 0.9rem;
}

.chat-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(20px, 3vw, 36px);
}

.chat-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.chat-side {
  display: grid;
  gap: 18px;
}

.chat-mode-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chat-mode-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 91, 120, 0.12);
  color: var(--primary);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.chat-mode-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.chat-mode-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.chat-mode-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.moment-list {
  display: grid;
  gap: 10px;
}

.moment-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 91, 120, 0.12);
  background: rgba(245, 249, 252, 0.8);
}

.moment-time {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

.moment-text {
  color: var(--text);
  font-size: 0.95rem;
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 10px 6px 6px;
  background: rgba(245, 249, 252, 0.6);
  border-radius: 18px;
  border: 1px solid rgba(31, 91, 120, 0.12);
  scroll-behavior: smooth;
}

.chat-card {
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 31, 44, 0.08);
  box-shadow: 0 10px 18px rgba(17, 31, 44, 0.08);
  max-width: 88%;
}

.chat-card.intro {
  padding: 10px 12px;
  font-size: 0.92rem;
  max-width: 76%;
}

.chat-card.user {
  justify-self: end;
  background: rgba(31, 91, 120, 0.12);
  border-color: rgba(31, 91, 120, 0.25);
}

.chat-card.assistant {
  justify-self: start;
}

.chat-card .role {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-card .content {
  font-size: 0.98rem;
  line-height: 1.5;
}

.chat-response {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 31, 44, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(31, 91, 120, 0.04);
}

.chat-response .cite-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 91, 120, 0.12);
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.chat-response .cite-link:hover {
  background: rgba(31, 91, 120, 0.2);
}

.cite-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 91, 120, 0.12);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 6px;
}

.chat-sources li {
  display: grid;
  gap: 6px;
}

.cite-preview {
  font-size: 0.85rem;
  color: var(--muted);
}

.evidence-toggle {
  margin-top: 12px;
  border: 1px solid rgba(31, 91, 120, 0.18);
  background: rgba(31, 91, 120, 0.08);
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.chat-sources {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 31, 44, 0.1);
}

.chat-sources .label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-sources ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.chat-sources a {
  color: var(--primary);
  text-decoration: none;
}

.chat-sources a:hover {
  text-decoration: underline;
}

.chat-sources li:hover .cite-preview {
  color: var(--text);
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  padding-top: 12px;
}

.chat-input input {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 1rem;
  background: #ffffff;
}

.mic-button {
  border: 1px solid rgba(31, 91, 120, 0.2);
  background: rgba(31, 91, 120, 0.08);
  color: var(--primary);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.mic-button.is-listening {
  background: rgba(31, 91, 120, 0.2);
  box-shadow: 0 0 0 4px rgba(31, 91, 120, 0.12);
}

.chat-hint {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.drawer {
  display: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .hero__stat {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .layout .topics,
  .layout .detail {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .controls {
    flex-direction: column;
  }

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

  .tabs {
    flex-wrap: wrap;
  }

  .layout .detail {
    display: none;
  }

  .drawer {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 28, 0.45);
    display: none;
    align-items: flex-end;
    z-index: 1000;
  }

  .drawer.open {
    display: flex;
  }

  .drawer-card {
    width: 100%;
    max-height: 88vh;
    background: #f8fbfc;
    border-radius: 18px 18px 0 0;
    padding: 16px 18px 24px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .drawer-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
  }

  .drawer-close {
    border: none;
    background: #0f2e3a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
  }

  .drawer-title {
    font-weight: 700;
    font-size: 1.15rem;
  }

  .drawer-sub {
    color: var(--muted);
    font-size: 0.95rem;
  }

  .drawer-body {
    overflow-y: auto;
    padding-right: 6px;
  }
}
