/* === Design Tokens === */
:root {
  --bg: #16191B;
  --amber: #D4A853;
  --amber-dim: rgba(212, 168, 83, 0.15);
  --text: #F5F2ED;
  --muted: rgba(245, 242, 237, 0.72);
  --dim: rgba(245, 242, 237, 0.15);
  --teal: #5B8A8A;
  --teal-dim: rgba(91, 138, 138, 0.1);
  --paper: #E8DCC8;
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.1);
  --surface: #1e2226;
  --surface2: #252a2f;
  --border: rgba(212, 168, 83, 0.08);
  --border-bright: rgba(212, 168, 83, 0.18);
  --font: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --slide-transition: 400ms ease-out;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Structural grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      rgba(245, 242, 237, 0.02) 0px,
      rgba(245, 242, 237, 0.02) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(245, 242, 237, 0.02) 0px,
      rgba(245, 242, 237, 0.02) 1px,
      transparent 1px,
      transparent 40px
    );
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.05) 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

/* === Slide Container === */
.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  padding: 3rem 6rem 4rem;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  overflow-y: auto;
}

/* Fallback for browsers without safe center — use margin auto trick */
@supports not (justify-content: safe center) {
  .slide {
    justify-content: flex-start;
  }
  .slide::before {
    content: '';
    flex: 1;
  }
  .slide::after {
    content: '';
    flex: 1;
  }
}

.slide--active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* --- Transitions --- */
.slide--enter {
  animation: slideEnter var(--slide-transition) forwards;
}

.slide--exit-left {
  animation: slideExitLeft var(--slide-transition) forwards;
  z-index: 0;
}

.slide--exit-right {
  animation: slideExitRight var(--slide-transition) forwards;
  z-index: 0;
}

.slide--enter-right {
  transform: translateX(60px);
  opacity: 0;
}

.slide--enter-left {
  transform: translateX(-60px);
  opacity: 0;
}

@keyframes slideEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideExitLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-60px); }
}

@keyframes slideExitRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}

/* === Typography === */
.slide__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.slide__display {
  font-size: clamp(48px, 8vw, 100px);
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 0.95;
  text-wrap: balance;
}

.slide__heading {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.15;
  text-wrap: balance;
}

.slide__body {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  line-height: 1.6;
  color: var(--muted);
}

.slide__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* === Bullets === */
.slide__bullets { list-style: none; padding: 0; }
.slide__bullets li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  line-height: 1.5;
  color: var(--muted);
}
.slide__bullets li::before {
  content: '';
  position: absolute;
  left: 0; top: 1rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
}
.slide__bullets li strong { color: var(--text); font-weight: 600; }

/* === The Signal Slide === */
.scan-field--bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  z-index: 0;
}

.signal-quote {
  max-width: 52rem;
  text-align: center;
  margin: 0.5rem 0 1.5rem;
}

.signal-quote__ground {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--muted);
}

.signal-quote__thesis {
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.signal-quote__thesis .highlight {
  color: var(--amber);
}

.verb-em {
  color: var(--amber);
}

.slide__subtitle .highlight {
  color: var(--amber);
  font-weight: 600;
}

/* === Scan Field (overrides shared/scan-field.css) === */
.scan-field {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 80vw);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

/* === Pills === */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}
.pill--teal { background: var(--teal-dim); color: var(--teal); border: 1px solid rgba(91, 138, 138, 0.2); }
.pill--amber { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(212, 168, 83, 0.2); }
.pill--green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, 0.2); }

/* === Highlight Box === */
.highlight-box {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: clamp(1rem, 2.5vh, 1.5rem) clamp(1rem, 2vw, 1.5rem);
}

/* === Split Slides === */
.slide--split { padding: 0; align-items: stretch; }
.slide--split .slide__panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}
.slide--split .slide__panel {
  padding: 3rem 3rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Autonomy slide: full-height backgrounds, content top-aligned and centered */
#autonomy .slide__panel {
  justify-content: flex-start;
  padding-top: clamp(6rem, 20vh, 12rem);
}


/* === Pipeline === */
.pipeline__wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
  width: 100%;
}
.pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
  padding: clamp(4px, 1vh, 16px) 0;
}
.pipeline__row {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 820px;
}
.pipeline__step {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  flex: 0 0 min(520px, 60%);
}
.pipeline__number {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.2vw, 0.8rem);
  font-weight: 700;
  color: var(--amber);
  min-width: 24px;
  text-align: right;
  letter-spacing: 1px;
}
.pipeline__node {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--amber);
  border-radius: 10px;
  padding: clamp(0.6rem, 1.4vh, 1rem) clamp(0.8rem, 1.8vw, 1.25rem);
}
.pipeline__node-title {
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  font-weight: 700;
  color: var(--text);
}
.pipeline__node-desc {
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}
.pipeline__arrow-center {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 820px;
  padding-left: calc(24px + min(520px, 60%) / 2 - 24px);
}
.pipeline__arrow-center svg { display: block; }
.pipeline__callout {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.pipeline__callout-box {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.1vw, 0.7rem);
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border: 1px dashed;
  border-radius: 8px;
  background: var(--bg);
  white-space: nowrap;
}

/* === Tool Grid === */
.tool-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  width: 100%;
  max-width: 960px;
}
.tool-grid__horizontal {
  background: var(--surface);
  border: 2px solid var(--amber);
  border-radius: 14px;
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.tool-grid__verticals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(1rem, 2.5vh, 1.75rem) clamp(1rem, 2vw, 1.5rem);
}
.tool-card__name {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.tool-card__desc {
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* === Layer Cards === */
.layer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--amber);
}
.layer-card__num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 1px;
}
.layer-card__title {
  font-weight: 600;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  margin-top: 0.25rem;
}
.layer-card__desc {
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* === Model Cards === */
.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.model-card__name {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  font-weight: 700;
  color: var(--amber);
}
.model-card__meta {
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}
a.model-card:hover {
  border-color: var(--amber) !important;
  text-decoration: none !important;
}

/* === Big Number === */
.big-number {
  font-size: clamp(120px, 20vw, 200px);
  font-weight: 700;
  color: var(--amber);
  line-height: 0.85;
  letter-spacing: -6px;
}

/* === Data Table === */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 1200px;
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--surface2);
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.1vw, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: left;
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid var(--border-bright);
  white-space: nowrap;
}
.data-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--amber-dim); }
.data-table .amount {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  font-weight: 600;
  white-space: nowrap;
}
.data-table .total-row td {
  border-top: 2px solid var(--amber);
  font-weight: 700;
  color: var(--text);
}

/* === KPI Grid === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(160px, 22vw, 260px), 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  width: 100%;
  max-width: 960px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 2vw, 1.5rem);
}
.kpi-card__val {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-card__label {
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 0.5rem;
}
.kpi-card__sub {
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  margin-top: 0.4rem;
  color: var(--muted);
  line-height: 1.4;
}

/* === Conclusion === */
.conclusion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
}
.conclusion__signal { margin-bottom: 0.5rem; }
.conclusion__email {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.conclusion__email:hover { text-decoration: underline; }
.conclusion__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.conclusion__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.conclusion__link:hover {
  border-color: var(--amber);
  color: var(--text);
  background: rgba(212, 168, 83, 0.05);
  text-decoration: none;
}

/* === Chapter Bar === */
.chapter-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  height: 32px;
}

.chapter-segment {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.chapter-segment__label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.chapter-segment--future .chapter-segment__label { color: rgba(245, 242, 237, 0.15); }
.chapter-segment--past .chapter-segment__label { color: rgba(212, 168, 83, 0.4); }
.chapter-segment--active .chapter-segment__label { color: var(--amber); }

.chapter-segment__track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(245, 242, 237, 0.06);
}

.chapter-segment__fill {
  height: 100%;
  width: 0%;
  border-radius: 0 1px 1px 0;
  transition: width 0.4s ease-out, background 0.3s ease;
}

.chapter-segment--past .chapter-segment__fill { width: 100%; background: rgba(212, 168, 83, 0.3); }
.chapter-segment--active .chapter-segment__fill { background: var(--amber); box-shadow: 0 0 8px rgba(212, 168, 83, 0.5); }
.chapter-segment--future .chapter-segment__fill { width: 0%; background: transparent; }

/* === Slide Counter === */
.slide-counter {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  z-index: 100;
  font-variant-numeric: tabular-nums;
}

/* === Chapter Dividers === */
.chapter-divider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 6rem;
}

/* === Founder === */
.founder-link:hover {
  border-color: var(--amber) !important;
  color: var(--text) !important;
  background: rgba(212, 168, 83, 0.05) !important;
}

/* === Case Study Deliverables === */
a.highlight-box:hover {
  border-color: var(--amber) !important;
  background: rgba(212, 168, 83, 0.03) !important;
}

/* === Responsive === */
@media (max-width: 768px) {
  .slide { padding: 2rem 1.5rem 3rem; }
  .slide--split .slide__panels { grid-template-columns: 1fr; }
  .slide--split .slide__panel { padding: 2rem 1.5rem; }
  .tool-grid__verticals { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .pipeline__row { flex-direction: column; align-items: stretch; }
  .pipeline__step { flex: auto; }
  .pipeline__callout { margin-left: 0; margin-top: 0.5rem; }
  .conclusion__links { flex-direction: column; align-items: center; }
}
