/* styles.css */

:root {
  --bg: #1a1a1e;
  --surface: #242428;
  --surface2: #2e2e32;
  --text: #f0ede8;
  --muted: #9a9790;
  --border: rgba(255,255,255,0.08);
  --tooltip-bg: #111215;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); overflow: hidden; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.header-top h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.header-top .sub {
  font-size: 11px;
  color: var(--muted);
}

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

.mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 4px;
}

.brand-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.2);
}

.brand-link:visited {
  color: var(--muted);
}

.brand-link:hover {
  color: var(--text);
  text-decoration-color: rgba(255,255,255,0.5);
}
/* ── Layout ──────────────────────────────────────────────────────────────── */

.main {
  display: grid;
  grid-template-columns: 20fr 35fr 45fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cluster-panel,
.nodes-panel,
.detail-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cluster-panel { border-right: 1px solid var(--border); }
.nodes-panel   { border-right: 1px solid var(--border); }

/* ── Panel headers ───────────────────────────────────────────────────────── */

.panel-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.panel-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 16px;
  line-height: 1.25;
}

.panel-subtitle {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ── Scrollable bodies ───────────────────────────────────────────────────── */

.cluster-list,
.nodes-list,
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* ── Cluster cards ───────────────────────────────────────────────────────── */

.cluster-list { display: flex; flex-direction: column; gap: 10px; }

.cluster-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.cluster-card:hover {
  background: rgba(255,255,255,0.03);
  transform: translateY(-1px);
}

.cluster-card.active { background: rgba(255,255,255,0.045); }

.cluster-badge,
.detail-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}

.cluster-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.cluster-desc { font-size: 11px; line-height: 1.65; color: var(--muted); }

/* ── Node cards ──────────────────────────────────────────────────────────── */

.nodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: min-content;
  gap: 10px;
  align-content: start;
}

.node-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.node-card:hover {
  background: rgba(255,255,255,0.03);
  transform: translateY(-1px);
}

.node-card.active { background: rgba(255,255,255,0.055); }

.node-title  { font-size: 12px; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.node-subtitle { font-size: 11px; font-style: italic; color: var(--muted); margin-bottom: 7px; }
.node-divider  { height: 1px; background: var(--border); margin: 6px 0 8px; }
.node-desc     { font-size: 11px; line-height: 1.6; color: var(--muted); }

/* ── Detail panel ────────────────────────────────────────────────────────── */

.detail-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-subtitle { font-size: 12px; font-style: italic; color: var(--muted); line-height: 1.45; }

.detail-section { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }

.detail-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-text  { font-size: 12px; line-height: 1.75; color: var(--text); }
.detail-muted { font-size: 12px; line-height: 1.75; color: var(--muted); }

/* ── Overview panel ──────────────────────────────────────────────────────── */

.overview-box    { display: flex; flex-direction: column; gap: 18px; }
.overview-section { display: flex; flex-direction: column; gap: 6px; }
.overview-title  { font-size: 14px; font-weight: 700; color: var(--text); }

.overview-quote {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.overview-text { font-size: 12px; line-height: 1.7; color: var(--muted); }

/* ── Content blocks ──────────────────────────────────────────────────────── */

.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.content-block + .content-block { margin-top: 10px; }

.content-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface2);
}

.content-caption {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.content-quote { padding: 14px 14px 12px; }

.content-quote-text {
  font-size: 12px;
  line-height: 1.75;
  color: var(--text);
  font-style: italic;
  margin-bottom: 8px;
}

.content-quote-source { font-size: 11px; color: var(--muted); }
.content-text { padding: 12px 14px; font-size: 12px; line-height: 1.75; color: var(--muted); }

/* ── Timeline (vertical fallback) ────────────────────────────────────────── */

.timeline { padding: 10px 12px; }
.timeline-list { display: flex; flex-direction: column; gap: 8px; position: relative; }

.timeline-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
  cursor: default;
}

.timeline-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.8;
  padding-top: 2px;
}

.timeline-dotwrap { position: relative; padding-left: 14px; }

.timeline-dotwrap::before {
  content: "";
  position: absolute;
  left: 4px; top: 7px; bottom: -12px;
  width: 1px;
  background: var(--border);
}

.timeline-item:last-child .timeline-dotwrap::before { display: none; }

.timeline-dotwrap::after {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #b8b8b8;
}

.timeline-title { font-size: 11.5px; line-height: 1.45; color: var(--text); }

/* ── Timeline tooltip ────────────────────────────────────────────────────── */

.timeline-tooltip {
  position: fixed;
  max-width: 240px;
  background: var(--tooltip-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text);
  pointer-events: none;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer-note {
  flex-shrink: 0;
  padding: 7px 24px;
  font-size: 10.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .main { grid-template-columns: 18fr 34fr 48fr; }
}

@media (max-width: 980px) {
  body { overflow: auto; }

  .main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .cluster-panel,
  .nodes-panel,
  .detail-panel {
    min-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nodes-list { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRESENTATION MODE
   ══════════════════════════════════════════════════════════════════════════ */

#pres-overlay {
  position: fixed;
  inset: 0;
  background: #0f0f11;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

/* Slide container — scrolls if content overflows */
#pres-slide-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Base slide — full width, generous padding */
.pres-slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: pres-fade 0.18s ease;
}

@keyframes pres-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Inner content wrapper — controls horizontal margins */
.pres-inner {
  width: 100%;
  padding: 64px 80px;
}

/* Full-width variant — small side margins, fills screen */
.pres-inner--full {
  padding: 48px 60px;
}

/* Centred variant — vertically and horizontally centred */
.pres-inner--center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 80px 120px;
}

/* Scrollable inner — allows overflow without clipping */
.pres-inner--scroll {
  overflow-y: auto;
  min-height: unset;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

.pres-eyebrow {
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

/* Title slide */
.pres-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 24px;
  max-width: 1100px;
}

.pres-subtitle-text {
  font-size: clamp(20px, 2.2vw, 30px);
  color: var(--muted);
  line-height: 1.5;
  max-width: 900px;
}

/* Section headings used on overview + cluster slides */
.pres-section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 36px;
  max-width: 100%;
}

/* ── Title slide ─────────────────────────────────────────────────────────── */

.pres-title-slide {
  background: #0f0f11;
}

/* ── Inquiry slide ───────────────────────────────────────────────────────── */

.pres-inquiry-slide {
  background: #12121a;
}

.pres-inquiry-q {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(24px, 3vw, 42px);
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
  border-left: 4px solid rgba(255,255,255,0.18);
  padding-left: 36px;
  margin: 0 0 28px 0;
  max-width: 1000px;
}

.pres-inquiry-guidance {
  font-size: clamp(18px, 2vw, 24px);
  color: var(--muted);
  padding-left: 40px;
  line-height: 1.7;
  max-width: 920px;
}

/* ── Cluster overview slide — 2-column card grid ────────────────────────── */

.pres-ov-slide {
  background: #0f0f11;
}

.pres-ov-header {
  margin-bottom: 36px;
}

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

.pres-ov-card {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 28px 32px;
}

.pres-ov-card-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.25;
}

.pres-ov-card-desc {
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.7;
  color: var(--muted);
}

/* ── Per-cluster slide — header + 2-column node grid ────────────────────── */

.pres-cluster-slide {
  min-height: 100%;
}

.pres-cluster-top {
  margin-bottom: 36px;
}

.pres-cluster-label {
  position: relative;
  padding-left: 20px;
}

.pres-cluster-accent-bar {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  opacity: 0.7;
}

.pres-cluster-desc {
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.7;
  color: var(--muted);
  margin-top: 12px;
  max-width: 100%;
}

/* Node grid — 2 columns, generous card size */
.pres-node-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.pres-node-card {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 26px 28px;
  background: rgba(255,255,255,0.04);
}

.pres-node-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.pres-node-subtitle {
  font-size: clamp(14px, 1.4vw, 17px);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.45;
}

.pres-node-desc {
  font-size: clamp(15px, 1.6vw, 20px);
  line-height: 1.75;
  color: rgba(240,237,232,0.82);
}

/* ── Navigation controls ─────────────────────────────────────────────────── */

#pres-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #0a0a0c;
}

#pres-controls button {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 20px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#pres-controls button:hover:not(:disabled) { background: rgba(255,255,255,0.13); }
#pres-controls button:disabled { opacity: 0.2; cursor: default; }

#pres-counter {
  font-size: 13px;
  color: var(--muted);
  min-width: 72px;
  text-align: center;
  letter-spacing: 0.06em;
}

#pres-exit {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 2001;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pres-exit:hover { background: rgba(255,255,255,0.13); color: var(--text); }

/* ── Responsive for smaller screens / projectors ─────────────────────────── */

@media (max-width: 900px) {
  .pres-inner--center { padding: 60px 48px; }
  .pres-inner--full   { padding: 40px 36px; }
  .pres-ov-grid       { grid-template-columns: 1fr; }
  .pres-node-grid     { grid-template-columns: 1fr; }
}