:root {
  --bg-light: #e8e3db;
  --bg-dark: #1a1816;
  --text-on-light: #1a1816;
  --text-on-dark: #e8e3db;
  --dim-on-light: #6b6560;
  --dim-on-dark: #7a746c;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.10);

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --title: clamp(3.5rem, 10vw, 9rem);
  --h2: clamp(2.2rem, 5.5vw, 4.5rem);
  --body: clamp(1.2rem, 2.2vw, 1.7rem);
  --small: clamp(0.75rem, 1.3vw, 1rem);
  --stat: clamp(3.5rem, 10vw, 8rem);
  --quote: clamp(1.8rem, 4vw, 3.2rem);
  --section-num: clamp(12rem, 35vw, 26rem);

  --pad: clamp(2.5rem, 8vw, 8rem);
  --gap: clamp(1.2rem, 3vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === SLIDES === */
.slide {
  position: absolute; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(4rem, 12vh, 10rem);
  overflow: hidden;
  opacity: 0; pointer-events: none; z-index: 0;
}
.slide.active { opacity: 1; pointer-events: auto; z-index: 1; }
.slide.entering { animation: fadeIn 0.5s var(--ease) forwards; }
.slide > * { position: relative; z-index: 1; }

.slide.center {
  justify-content: center;
  padding-bottom: var(--pad);
  text-align: center;
  align-items: center;
}

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

/* === VARIANTS === */
.light { background: var(--bg-light); color: var(--text-on-light); }
.dark { background: var(--bg-dark); color: var(--text-on-dark); }
.dark .dim { color: var(--dim-on-dark); }
.light .dim { color: var(--dim-on-light); }

/* === TYPOGRAPHY === */
h1 {
  font-family: var(--font-display);
  font-size: var(--title); font-weight: 800;
  line-height: 0.92; letter-spacing: -0.03em;
}
h2 {
  font-family: var(--font-display);
  font-size: var(--h2); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em;
  max-width: min(90vw, 900px);
}
p { font-size: var(--body); line-height: 1.55; max-width: min(85vw, 700px); }
.accent { color: var(--accent); }

.tag {
  font-family: var(--font-display);
  font-size: var(--small); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: clamp(0.6rem, 1.2vw, 1.2rem);
}
.subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  letter-spacing: 0.04em;
}

/* === SECTION NUMBER (watermark) === */
.section-bg-num {
  position: absolute;
  bottom: clamp(1rem, 4vh, 3rem);
  right: clamp(1rem, 5vw, 5rem);
  font-family: var(--font-display);
  font-size: var(--section-num); font-weight: 800;
  line-height: 1; pointer-events: none; z-index: 0;
}
.light .section-bg-num { color: rgba(0,0,0,0.035); }
.dark .section-bg-num { color: rgba(255,255,255,0.035); }

/* === REVEALS === */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-blur {
  opacity: 0; filter: blur(14px); transform: scale(0.97);
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal-scale {
  opacity: 0; transform: scale(0.88);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.slide.active .reveal,
.slide.active .reveal-blur,
.slide.active .reveal-scale {
  opacity: 1; transform: translateY(0) scale(1); filter: blur(0);
}
.slide.active .reveal:nth-child(2) { transition-delay: 0.12s; }
.slide.active .reveal:nth-child(3) { transition-delay: 0.24s; }
.slide.active .reveal:nth-child(4) { transition-delay: 0.36s; }
.slide.active .reveal:nth-child(5) { transition-delay: 0.48s; }
.slide.active .reveal-blur { transition-delay: 0.1s; }
.slide.active .reveal-scale { transition-delay: 0.1s; }

/* === STATS === */
.stats-row { display: flex; gap: clamp(3rem, 6vw, 6rem); justify-content: center; }
.stat { text-align: center; }
.stat .number {
  font-family: var(--font-display);
  font-size: var(--stat); font-weight: 800;
  color: var(--accent); letter-spacing: -0.03em; line-height: 1;
}
.stat .label {
  font-size: var(--small); text-transform: uppercase;
  letter-spacing: 0.12em; font-family: var(--font-display); font-weight: 600;
  margin-top: clamp(0.25rem, 0.5vw, 0.4rem);
}
.light .stat .label { color: var(--dim-on-light); }
.dark .stat .label { color: var(--dim-on-dark); }

/* === WEAVE TIMELINE === */
.weave {
  display: flex; flex-direction: column;
  width: min(92vw, 960px);
  margin-top: var(--gap);
}
.weave-row {
  display: flex; align-items: flex-start;
}
.weave-top { align-items: flex-end; }
.weave-bottom { align-items: flex-start; }
.weave-node { flex: 1; text-align: center; }
.weave-spacer { flex: 1; }
.weave-line {
  width: 100%; height: clamp(30px, 5vh, 50px);
  display: block;
}
.weave-node .year {
  font-family: var(--font-display); font-size: var(--small);
  color: var(--accent); font-weight: 700; letter-spacing: 0.05em;
}
.weave-node .company {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.5rem); font-weight: 700;
  margin: clamp(0.1rem, 0.3vw, 0.2rem) 0;
}
.weave-node .role { font-size: clamp(0.7rem, 1.1vw, 0.95rem); color: var(--dim-on-light); }

/* === AGENDA === */
.agenda-list {
  list-style: none; font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.6rem); font-weight: 700; line-height: 2.4;
}
.agenda-list .num {
  display: inline-block; width: clamp(2.5rem, 4vw, 4rem);
  color: var(--accent); font-weight: 800;
}

/* === SKILL TAGS === */
.skill-tags { display: flex; gap: clamp(0.5rem, 1vw, 0.8rem); flex-wrap: wrap; margin-top: var(--gap); }
.skill-tag {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.5vw, 1.15rem); font-weight: 600;
  color: var(--accent);
  padding: clamp(0.3rem, 0.6vw, 0.5rem) clamp(0.7rem, 1.2vw, 1rem);
  border: 1.5px solid rgba(37,99,235,0.25); border-radius: 6px;
  background: var(--accent-soft);
}

/* === PARTICIPATION === */
.prompt-cards { display: flex; gap: clamp(1rem, 2.5vw, 2.5rem); margin-top: var(--gap); }
.prompt-card {
  flex: 1; max-width: min(50vw, 480px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1.5px solid rgba(0,0,0,0.06); border-radius: 14px;
  background: rgba(255,255,255,0.25);
}
.prompt-card .tag { margin-bottom: clamp(0.3rem, 0.5vw, 0.4rem); }
.prompt-card p { font-size: clamp(1.1rem, 1.8vw, 1.4rem); color: var(--dim-on-light); }
.url-display {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700;
  color: var(--accent); margin-top: var(--gap);
}

/* === CODE BLOCK === */
.code-block {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: clamp(0.6rem, 1.1vw, 0.9rem);
  line-height: 1.55;
  background: var(--bg-dark);
  color: #c9c4bc;
  padding: 1.5vw 2vw;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre;
  text-align: left;
}
.code-block code { font-family: inherit; }
.code-comment { color: #6b6560; font-style: italic; }
.code-kw { color: #7eb6f6; }
.code-fn { color: #c4b5fd; }
.code-str { color: #86d9a0; }

/* === SPLIT SLIDE (text left, image right) === */
.split-slide {
  flex-direction: row;
  align-items: flex-end;
  gap: 5vw;
}
.split-text { flex: 0 1 45%; }
.split-img {
  flex: 0 1 50%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
}

/* === QUOTE === */
.big-quote {
  font-family: var(--font-display);
  font-size: var(--quote); font-weight: 700;
  line-height: 1.25; max-width: min(85vw, 800px); letter-spacing: -0.01em;
}

.light .strikethrough { color: rgba(0,0,0,0.18); text-decoration: line-through; }

/* === PROGRESS / COUNTER === */
#progress {
  position: fixed; bottom: 0; left: 0; height: 3px;
  background: var(--accent); transition: width 0.4s var(--ease); z-index: 100;
}
#counter {
  position: fixed; bottom: clamp(10px,2vh,18px); right: clamp(16px,3vw,28px);
  font-family: var(--font-display); font-size: var(--small);
  font-weight: 600; letter-spacing: 0.1em; z-index: 100;
  transition: color 0.4s ease;
}
body.slide-dark #counter { color: var(--dim-on-dark); }
body.slide-light #counter { color: var(--dim-on-light); }

/* === NOTES PANEL (S key) === */
#notes-panel {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 40vh; padding: clamp(14px,2.5vw,24px) var(--pad);
  overflow-y: auto; z-index: 200; backdrop-filter: blur(20px);
  border-top: 1px solid rgba(37,99,235,0.15);
}
body.slide-light #notes-panel { background: rgba(232,227,219,0.97); color: var(--text-on-light); }
body.slide-dark #notes-panel { background: rgba(26,24,22,0.97); color: var(--text-on-dark); }
#notes-panel.visible { display: block; }
#notes-panel h4 {
  font-family: var(--font-display); font-size: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--accent); opacity: 0.5; margin-bottom: 0.5rem;
}
#notes-panel .notes-summary {
  font-size: 0.85rem; line-height: 1.5; opacity: 0.5;
  margin-bottom: 0.8rem; font-style: italic; max-width: none;
}
#notes-panel .notes-full {
  font-size: 0.95rem; line-height: 1.7; opacity: 0.8;
  max-width: none; white-space: pre-wrap;
}

/* === CARD WALL === */
#card-wall {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dealt-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: clamp(0.8rem, 1.5vw, 1.2rem) clamp(1rem, 2vw, 1.5rem);
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  color: var(--text-on-light);
  max-width: clamp(180px, 22vw, 260px);
  line-height: 1.4;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  will-change: transform, opacity;
}

/* === RESPONSIVE === */
@media (max-width: 800px) {
  .split-slide { flex-direction: column; }
  .split-text { flex: none; width: 100%; }
  .split-img { flex: none; width: 100%; max-height: 40vh; }
}

@media (max-height: 700px) {
  :root {
    --pad: clamp(1.5rem, 5vw, 4rem);
    --title: clamp(2.5rem, 8vw, 5.5rem);
    --h2: clamp(1.8rem, 4.5vw, 3.2rem);
    --stat: clamp(2.5rem, 7vw, 5rem);
    --quote: clamp(1.4rem, 3vw, 2.2rem);
    --section-num: clamp(8rem, 25vw, 18rem);
  }
  .slide { padding-bottom: clamp(2rem, 8vh, 5rem); }
}
@media (max-height: 500px) {
  :root {
    --pad: clamp(1rem, 3vw, 2rem);
    --title: clamp(1.8rem, 6vw, 3.5rem);
    --h2: clamp(1.4rem, 3.5vw, 2.2rem);
    --body: clamp(0.85rem, 1.5vw, 1.1rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15s !important;
  }
}
