/* =============================================================
   CTI · INDIA — "From Reactive to Proactive"
   India-rooted editorial deck
   Design system: khadi paper + indigo dye, high-contrast serif,
   jaali lattice + Ashoka-chakra shield motifs, bilingual type.
   ============================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Palette — rooted in Indian pigments/textiles */
  --paper:      #F5F1E8;   /* khadi ivory */
  --paper-alt:  #EFE9DC;   /* alt panel */
  --ink:        #1A1712;   /* near-black */
  --ink-dim:    #6B6459;   /* muted */
  --indigo:     #25306B;   /* primary accent */
  --indigo-deep:#1A2350;   /* dark-slide bg */
  --indigo-tint:#5566A8;   /* lighter indigo */
  --marigold:   #E8862A;   /* haldi highlight */
  --madder:     #A5342B;   /* sindoor / alert */
  --saffron:    #F0912B;   /* tiranga — kesari */
  --india-green:#177E4C;   /* tiranga — green */
  --stage:      #171510;   /* letterbox behind the slides */
  --hair:       #D6CDBB;   /* hairline on light */
  --hair-dark:  rgba(245,241,232,.18);

  /* Type — technical / security-console system */
  --serif:  "Space Grotesk", "Helvetica Neue", Arial, sans-serif;  /* display headlines */
  --grotesk:"Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body:   "IBM Plex Sans", system-ui, sans-serif;
  --mono:   "IBM Plex Mono", "SFMono-Regular", monospace;
  --deva:   "Tiro Devanagari Hindi", serif;
  --pixel:  "IBM Plex Mono", "SFMono-Regular", monospace;  /* numbers / markers */

  /* Fluid type scale */
  --fs-hero:   clamp(3.2rem, 8vw, 7rem);
  --fs-h1:     clamp(2.2rem, 4.6vw, 4rem);
  --fs-h2:     clamp(1.5rem, 2.6vw, 2.4rem);
  --fs-stat:   clamp(2.6rem, 6vw, 5.2rem);
  --fs-body:   clamp(1rem, 1.25vw, 1.22rem);
  --fs-small:  clamp(.72rem, .85vw, .86rem);

  --slide-pad: clamp(2.2rem, 5vw, 5.5rem);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--stage);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
img, svg { display: block; max-width: 100%; }

/* ---------- Theme variants (toggle with T) ---------- */
/* Twilight — a mid-tone kraft/greige, between light and dark */
body[data-theme="twilight"] {
  --paper: #C9BFAC;
  --paper-alt: #C1B6A1;
  --ink: #23201A;
  --ink-dim: #5A5343;
  --hair: #AFA48E;
  --stage: #2A241A;
}
/* Dark — deep indigo */
body[data-theme="dark"] {
  --paper: #1A2350;
  --paper-alt: #222C5E;
  --ink: #F1EBDD;
  --ink-dim: #9AA0C2;
  --hair: rgba(241,235,221,.16);
  --indigo: #8390D8;
  --indigo-tint: #9AA6E0;
  --stage: #0E1120;
}
/* dark accents — warmer & more vibrant */
body[data-theme="dark"] em.hi,
body[data-theme="dark"] .kicker,
body[data-theme="dark"] .stat .figure,
body[data-theme="dark"] .levels .lv .n span { color: var(--marigold); }
body[data-theme="dark"] .chart .plot-line { stroke: var(--marigold); }
body[data-theme="dark"] .chart .dot { fill: var(--marigold); }

/* theme indicator toast */
.theme-toast {
  position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%) translateY(8px);
  z-index: 90; pointer-events: none;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .18em;
  color: var(--ink); background: var(--paper-alt); border: 1px solid var(--hair);
  padding: .5rem 1.1rem; opacity: 0; transition: opacity .3s, transform .3s;
}
.theme-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.theme-toast b { color: var(--madder); font-weight: 500; }

/* ---------- 3. Reveal.js slide scaffold ---------- */
.reveal { font-family: var(--body); color: var(--ink); }
.reveal .slides { text-align: left; }
/* layout — the .present variant is needed to beat reveal.js's own rules */
.reveal .slides > section.slide,
.reveal .slides > section.slide.present {
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  width: 1280px !important; height: 720px !important;
  top: 0 !important;
  padding: clamp(1.7rem, 3.4vw, 3.2rem) clamp(2.4rem, 5vw, 5.2rem);
  overflow: hidden;
  box-sizing: border-box;
}
/* colour — kept separate so the dark variant isn't overridden by .present */
.reveal .slides > section.slide { background: var(--paper); color: var(--ink); }
.reveal .slides > section.slide--dark,
.reveal .slides > section.slide--dark.present { background: var(--indigo-deep); color: var(--paper); }

/* reveal.js resets some inherited bits — restore ours */
.reveal .slides section { font-size: inherit; line-height: 1.5; }
.reveal h1, .reveal h2, .reveal h3 { text-transform: none; text-shadow: none; margin: 0; }
.reveal p, .reveal ol, .reveal ul, .reveal li { margin: 0; line-height: inherit; }
.reveal .slides section img { border: 0; box-shadow: none; }

/* progress bar as a subtle tiranga stripe */
.reveal .progress { height: 4px; background: rgba(214,205,187,.5); }
.reveal .progress span { background: linear-gradient(to right, var(--saffron), #f4efe4, var(--india-green)) !important; }
.slide--dark .kicker,
.slide--dark .masthead,
.slide--dark .slide__foot { color: rgba(245,241,232,.6); }
.slide--dark .hair,
.slide--dark .slide__head,
.slide--dark .slide__foot { border-color: var(--hair-dark); }
.slide--dark .lead { color: rgba(245,241,232,.82); }

/* ---------- 4. Masthead / header / footer ---------- */
.slide__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
/* terminal-style slide header: prompt + topic */
.masthead { font-family: var(--mono); font-weight: 500; font-size: clamp(1rem, 1.3vw, 1.22rem); letter-spacing: .04em; color: var(--ink); }
.masthead::before { content: "▸ "; color: var(--madder); }
.masthead b { color: var(--madder); font-weight: 600; }
.slide__head span:last-child { align-self: baseline; }

.slide__foot {
  display: flex; justify-content: center; align-items: center;
  gap: 0;
  padding-top: .85rem;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: clamp(.95rem, 1.15vw, 1.14rem);
  letter-spacing: .02em;
  color: var(--ink-dim);
  text-align: center;
}
.slide__foot .src { font-style: normal; max-width: none; }
/* dotted separator between the two footer items when both are present */
.slide__foot .src:not(:empty) + span:not(:empty)::before { content: "·"; margin: 0 .95rem; color: var(--ink-dim); }

/* Tiranga tricolor stripe — Indian-flag signature */
.tricolor { display: inline-flex; width: 168px; height: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--hair); }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: var(--saffron); }
.tricolor i:nth-child(2) { background: #FBF8F1; }
.tricolor i:nth-child(3) { background: var(--india-green); }
.slide__foot--mark { padding-top: 1rem; }

/* Body region */
.slide__body {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 0;
  padding: clamp(1rem, 3vh, 2.4rem) 0;
}

/* ---------- 5. Editorial primitives ---------- */
.kicker {
  font-family: var(--grotesk);
  font-size: var(--fs-small);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--madder);
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: 1.1rem;
}
.kicker .deva { font-family: var(--deva); letter-spacing: .02em; text-transform: none; color: var(--ink-dim); }
.slide--dark .kicker { color: var(--marigold); }
.slide--dark .kicker .deva { color: rgba(245,241,232,.5); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; letter-spacing: -.02em; }
.slide h1 { font-size: var(--fs-h1); }
.slide h2 { font-size: var(--fs-h2); font-weight: 500; }
.title-hero { font-size: var(--fs-hero); font-weight: 500; line-height: 1; letter-spacing: -.03em; }
em.hi { font-style: normal; font-weight: 600; color: var(--madder); }
.slide--dark em.hi { color: var(--marigold); }
body[data-theme="dark"] em.hi { color: var(--marigold); }

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  max-width: 62ch; color: var(--ink-dim); line-height: 1.5;
  margin-top: 1rem;
}

.deva { font-family: var(--deva); }
.num-deva { font-family: var(--deva); }

/* Marker numeral (pixel signature) */
.marker {
  font-family: var(--pixel);
  color: var(--marigold);
  line-height: 1;
  font-weight: 500;
}

/* ---------- 6. Components ---------- */

/* Numbered agenda list */
.agenda { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 3.5rem; }
.agenda li {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 1.1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--hair);
}
.agenda .n { font-family: var(--pixel); font-size: 1.5rem; color: var(--indigo); min-width: 2.4ch; }
.agenda .t { font-family: var(--serif); font-size: clamp(1.1rem,1.7vw,1.6rem); font-weight: 360; }
.agenda .t small { display:block; font-family: var(--deva); font-size: .8rem; color: var(--ink-dim); font-weight: 400; margin-top: .1rem; }

/* Agenda — foundation line + 3-act map */
.agenda-start { font-family: var(--serif); font-size: clamp(1.15rem, 1.7vw, 1.5rem); color: var(--ink); margin: .3rem 0 .2rem; }
.agenda-start b { color: var(--madder); font-weight: 500; }
.agenda-start .deva { font-family: var(--deva); color: var(--ink-dim); font-size: .8em; }
.agenda3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.6rem, 3.5vw, 4rem); margin-top: 1.2rem; }
.act { border-top: 2px solid var(--madder); padding-top: 1rem; }
.act__k { font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .22em; font-size: .74rem; color: var(--ink-dim); }
.act__h { font-family: var(--serif); font-weight: 400; font-size: clamp(1.45rem, 2.1vw, 2rem); line-height: 1.05; margin: .45rem 0 1.5rem; }
.act__h small { display: block; font-family: var(--deva); font-size: .5em; color: var(--ink-dim); margin-top: .2rem; }
.act ol { list-style: none; display: grid; gap: 0; }
.act li {
  display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: baseline;
  font-family: var(--serif); font-size: clamp(1.08rem, 1.4vw, 1.3rem);
  padding: 1rem 0; border-bottom: 1px solid var(--hair);
}
.act li b { font-family: var(--pixel); color: var(--indigo); font-weight: 500; font-size: 1.05rem; }

/* Stat blocks */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(1.4rem, 3vw, 3rem); }
.stat { border-top: 2px solid currentColor; padding-top: .8rem; }
.stat .figure {
  font-family: var(--serif); font-weight: 500;
  font-size: var(--fs-stat); line-height: .92; letter-spacing: -.02em;
  color: var(--indigo);
}
.slide--dark .stat .figure { color: var(--marigold); }
.stat .figure .u { font-size: .42em; color: var(--ink-dim); letter-spacing: 0; }
.slide--dark .stat .figure .u { color: rgba(245,241,232,.6); }
.stat .label {
  font-family: var(--grotesk); font-size: var(--fs-small);
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
  margin-top: .7rem; line-height: 1.35;
}
.slide--dark .stat .label { color: rgba(245,241,232,.68); }

/* Two-column editorial split */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; height: 100%; }
.split--wide { grid-template-columns: 1fr 1.25fr; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 1.6rem; } }

/* Bullet lists — editorial */
.list { list-style: none; display: grid; gap: 0; }
.list li {
  display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start;
  padding: .95rem 0; border-bottom: 1px solid var(--hair);
}
.list li:first-child { border-top: 1px solid var(--hair); }
.list .m { font-family: var(--pixel); color: var(--marigold); font-size: 1.1rem; line-height: 1.4; }
.list .h { font-family: var(--serif); font-size: 1.2rem; font-weight: 420; display: block; margin-bottom: .15rem; }
.list .d { color: var(--ink-dim); font-size: .96rem; line-height: 1.45; }
.slide--dark .list .d { color: rgba(245,241,232,.66); }
.list b { color: var(--madder); font-weight: 600; }
.slide--dark .list b { color: var(--marigold); }

/* Pull quote */
.pull { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem,3vw,2.8rem); line-height: 1.15; letter-spacing: -.02em; max-width: 24ch; }

/* Level cards (What is CTI) — each level self-contained so name + description read together */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.levels .lv {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1.1rem; row-gap: .28rem;
  align-items: baseline; background: var(--paper); padding: 1rem 1.4rem;
}
.levels .lv .k { grid-row: 1 / span 2; align-self: center; font-family: var(--pixel); color: var(--indigo); font-size: 1.5rem; }
.levels .lv .n { font-family: var(--serif); font-size: 1.22rem; font-weight: 440; line-height: 1.1; }
.levels .lv .n span { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--madder); margin-top: .18rem; }
.levels .lv .x { grid-column: 2; color: var(--ink-dim); font-size: .92rem; line-height: 1.42; }

/* What-is-CTI slide — centred to use the full height */
.whatis .slide__body { justify-content: center; gap: .55rem; }
.whatis h1 { font-size: clamp(1.9rem, 3.6vw, 3.2rem); }
.whatis .flow { margin: 1.1rem 0 .4rem; }
.whatis .flow .step { padding: 1rem 1.2rem; }
.whatis .levels .lv { padding: 1.2rem 1.4rem; }
.whatis .kicker { margin-bottom: .6rem; }

/* label above the four level-cards */
.levels-label {
  font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .16em;
  font-size: var(--fs-small); color: var(--ink-dim); margin: .5rem 0 .7rem;
  display: flex; align-items: baseline; gap: .6rem;
}
.levels-label .deva { font-family: var(--deva); text-transform: none; letter-spacing: 0; color: var(--madder); }

/* Flow (data→info→intel) */
.flow { display: flex; align-items: stretch; gap: 0; margin: 1.4rem 0; flex-wrap: wrap; }
.flow .step { flex: 1 1 0; min-width: 120px; padding: 1rem 1.2rem; border: 1px solid var(--hair); border-right: none; }
.flow .step:last-child { border-right: 1px solid var(--hair); }
.flow .step .lab { font-family: var(--grotesk); text-transform: uppercase; letter-spacing:.12em; font-size:.72rem; color: var(--ink-dim); }
.flow .step .v { font-family: var(--serif); font-size: 1.35rem; margin-top:.3rem; }
.flow .step:last-child { background: var(--indigo); color: var(--paper); border-color: var(--indigo); }
.flow .step:last-child .lab, .flow .step:last-child .v { color: var(--paper); }

/* Waffle (pixel) chart */
.waffle-wrap { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem,3vw,3rem); align-items: center; }
.waffle { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: clamp(210px, 26vw, 320px); aspect-ratio: 1; }
.waffle i {
  aspect-ratio: 1; background: var(--hair);
  transform: scale(0); transition: transform .32s var(--ease);
  image-rendering: pixelated;
}
.present .waffle i { transform: scale(1); }
.waffle i.c1 { background: var(--madder); }
.waffle i.c2 { background: var(--marigold); }
.waffle i.c3 { background: var(--indigo); }
.legend { list-style: none; display: grid; gap: .9rem; }
.legend li { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: baseline; padding-bottom:.7rem; border-bottom: 1px solid var(--hair); }
.legend .sw { width: 14px; height: 14px; margin-top: 3px; }
.legend .nm { font-family: var(--serif); font-size: 1.1rem; }
.legend .pc { font-family: var(--pixel); font-size: 1.2rem; color: var(--indigo); }

/* Charts */
.chart { width: 100%; height: 100%; }
.chart .grid-line { stroke: var(--hair); stroke-width: 1; }
.slide--dark .chart .grid-line { stroke: var(--hair-dark); }
.chart .axis-label { font-family: var(--mono); font-size: 11px; fill: var(--ink-dim); letter-spacing: .04em; }
.slide--dark .chart .axis-label { fill: rgba(245,241,232,.55); }
.chart .plot-line { fill: none; stroke: var(--madder); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.slide--dark .chart .plot-line { stroke: var(--marigold); }
.chart .dot { fill: var(--madder); }
.slide--dark .chart .dot { fill: var(--marigold); }
.chart .bar { fill: var(--marigold); }
.chart .bar-val { font-family: var(--pixel); font-size: 13px; fill: var(--paper); }
.chart .anno { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-dim); }
.slide--dark .chart .anno { fill: rgba(245,241,232,.6); }
.chart .anno-tick { stroke: var(--indigo); stroke-width: 1; stroke-dasharray: 3 3; }
.slide--dark .chart .anno-tick { stroke: rgba(245,241,232,.4); }

/* Lifecycle ring */
.cycle { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; height: 100%; }
.cycle .stages { list-style: none; display: grid; gap: 0; }
.cycle .stages li { display:grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: baseline; padding: .9rem 0; border-bottom: 1px solid var(--hair); }
.cycle .stages li:first-child { border-top: 1px solid var(--hair); }
.cycle .stages .k { font-family: var(--pixel); color: var(--indigo); font-size: 1.35rem; }
.cycle .stages .n { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; line-height: 1.15; }
.cycle .stages .n small { display:block; font-family: var(--body); color: var(--ink-dim); font-size:.98rem; font-weight:400; margin-top: .15rem; }

/* Ecosystem grid */
.eco { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.eco .cell { background: var(--paper); padding: 1.1rem 1.2rem; }
.eco .cell__hd { display: flex; align-items: center; gap: .7rem; margin-bottom: .35rem; }
.eco .cell h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 440; }
.eco .cell p { color: var(--ink-dim); font-size: .9rem; margin-top: .3rem; line-height: 1.4; }
/* logo badge (monogram fallback; holds an <img> logo when present) */
.logo-slot { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--indigo); border-radius: 7px;
  background: var(--paper-alt);
  font-family: var(--grotesk); font-weight: 600; font-size: .88rem; letter-spacing: .01em; color: var(--indigo); }
.logo-slot:has(img) { background: #fff; border-color: var(--hair); padding: 4px; }
.logo-slot img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 820px){ .eco { grid-template-columns: 1fr 1fr; } }

/* Chip row */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.chip { font-family: var(--mono); font-size: .8rem; letter-spacing: .03em; padding: .35rem .8rem; border: 1px solid var(--hair); color: var(--ink-dim); }
.slide--dark .chip { border-color: var(--hair-dark); color: rgba(245,241,232,.72); }

/* ---------- 7. Title slide ---------- */
.title-slide .slide__body { justify-content: center; }
.title-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; }
.byline { font-family: var(--mono); font-size: var(--fs-small); color: var(--ink-dim); letter-spacing:.04em; line-height: 1.8; }
.byline b { color: var(--ink); font-weight: 600; }
.edition { font-family: var(--grotesk); text-transform: uppercase; letter-spacing:.3em; font-size: var(--fs-small); color: var(--madder); }

/* Shield mark (Ashoka-chakra derived) inside a targeting reticle */
.shield-rig { position: relative; width: clamp(160px, 21vw, 270px); aspect-ratio: 1; justify-self: end; display: grid; place-items: center; }
.shield { position: relative; z-index: 2; width: 52%; height: auto; }
.shield .spoke { stroke: var(--indigo); stroke-width: 2; opacity: 0; transform-origin: center; }
.title-slide.present .shield .spoke { animation: spoke-in .5s var(--ease) forwards; }
.shield .rim { fill: none; stroke: var(--indigo); stroke-width: 3; }
.shield .body { fill: none; stroke: var(--madder); stroke-width: 3; }
@keyframes spoke-in { to { opacity: 1; } }

/* Targeting reticle around the shield */
.reticle { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.reticle .ret-ring { fill: none; stroke: rgba(232,134,42,.32); stroke-width: 1; }
.reticle .ret-ticks line { stroke: rgba(232,134,42,.5); }
.reticle .ret-cnr { fill: none; stroke: var(--marigold); stroke-width: 2; opacity: 0; }
.reticle .ret-ticks { transform-box: view-box; transform-origin: 120px 120px; }
.title-slide.present .reticle .ret-ticks { animation: ret-spin 26s linear infinite; }
.title-slide.present .reticle .ret-cnr { animation: reveal .5s var(--ease) .3s forwards; }
.title-slide.present .reticle .ret-ring { animation: lock-breath 3.4s ease-in-out 1s infinite; }
@keyframes ret-spin { to { transform: rotate(360deg); } }
@keyframes lock-breath { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Jaali lattice backdrop */
.jaali { position: absolute; inset: 0; pointer-events: none; opacity: .5; z-index: 0; }
.jaali svg { width: 100%; height: 100%; }
.jaali path, .jaali line, .jaali circle { stroke: var(--hair); fill: none; stroke-width: 1; }
.slide--dark .jaali path, .slide--dark .jaali line, .slide--dark .jaali circle { stroke: var(--hair-dark); }
.slide__head, .slide__body, .slide__foot { position: relative; z-index: 1; }

/* Closing */
.closing .pull { max-width: 20ch; }

/* ---------- Section-divider (chapter) slides ---------- */
.divider .slide__body { grid-row: 1 / -1; justify-content: center; align-items: flex-start; }
.divider__num { font-family: var(--pixel); font-size: 1.05rem; letter-spacing: .34em; color: var(--marigold); margin-bottom: .6rem; }
.divider__k { font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .3em; font-size: .92rem; color: var(--ink-dim); margin-bottom: 1rem; }
.divider__h { font-family: var(--serif); font-weight: 500; font-size: clamp(3rem, 7vw, 5.8rem); line-height: 1; letter-spacing: -.03em; margin: 0 0 1.1rem; }
.divider__h .deva { font-family: var(--deva); font-size: .34em; color: var(--marigold); font-weight: 400; margin-left: .5em; vertical-align: middle; }
.divider__sub { font-family: var(--body); font-size: clamp(1.15rem, 1.8vw, 1.55rem); color: var(--ink-dim); max-width: 42ch; margin-bottom: 2.2rem; }
.divider__toc { list-style: none; display: flex; flex-wrap: wrap; gap: 2.8rem; margin-top: 0; }
.divider__toc li { font-family: var(--mono); font-size: 1rem; color: var(--ink-dim); display: flex; gap: .7rem; align-items: baseline; }
.divider__toc b { font-family: var(--pixel); color: var(--marigold); font-weight: 500; }

/* dividers render DARK in every theme — dramatic chapter breaks that merge dark into the deck */
.reveal .slides > section.slide.divider { background: var(--indigo-deep); color: #F1EBDD; }
.divider .divider__k { color: rgba(245,241,232,.66); }
.divider .divider__h { color: #F5F0E6; }
.divider .divider__h .deva { color: var(--marigold); }
.divider .divider__sub { color: rgba(245,241,232,.78); }
.divider .divider__toc li { color: rgba(245,241,232,.74); }
.divider .divider__toc b { color: var(--marigold); }
.divider .jaali { opacity: .22; }
.divider .jaali path, .divider .jaali line, .divider .jaali circle { stroke: rgba(245,241,232,.14); }

/* ---------- Image placeholder (swap with <img>) ---------- */
.imgph {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: clamp(220px, 42vh, 460px);
  border: 1.5px dashed var(--hair);
  background:
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(37,48,107,.03) 11px 12px);
  color: var(--ink-dim);
}
.imgph::before, .imgph::after {
  content: ""; position: absolute; width: 12px; height: 12px; background: var(--marigold);
  image-rendering: pixelated;
}
.imgph::before { top: 10px; left: 10px; }
.imgph::after  { bottom: 10px; right: 10px; }
.imgph__tag { font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; color: var(--indigo); }
.imgph__hint { font-family: var(--mono); font-size: .74rem; opacity: .7; }
.imgph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Lifecycle ring ---------- */
.ring-wrap { display: flex; align-items: center; justify-content: center; }
.ring { width: clamp(280px, 34vw, 440px); height: auto; overflow: visible; }
.ring-track { fill: none; stroke: var(--hair); stroke-width: 1.5; stroke-dasharray: 5 6; }
.ring .arrow { fill: var(--indigo); opacity: 0; }
.present .ring .arrow { animation: reveal .5s var(--ease) forwards; animation-delay: 1s; }
.ring-node { fill: var(--paper); stroke: var(--indigo); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.present .ring-node { animation: node-in .4s var(--ease) forwards; }
.ring-node-n { font-family: var(--pixel); fill: var(--indigo); font-size: 13px; opacity: 0; }
.present .ring-node-n { animation: reveal .4s var(--ease) forwards; }
.ring-c1 { font-family: var(--serif); font-size: 26px; fill: var(--ink); }
.ring-c2 { font-family: var(--grotesk); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; fill: var(--ink-dim); }
@keyframes node-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 900px){ .cycle { grid-template-columns: 1fr; } .ring-wrap { display: none; } }

/* ---------- 8. Cyber layer — console frame + schematic grid ---------- */
.cyber-hud { position: fixed; inset: 0; pointer-events: none; z-index: 60; font-family: var(--mono); }

/* targeting corner brackets */
.cx { position: fixed; width: 24px; height: 24px; border: 2px solid var(--madder); opacity: .7; }
.cx-tl { top: 13px; left: 13px; border-right: 0; border-bottom: 0; }
.cx-tr { top: 13px; right: 13px; border-left: 0; border-bottom: 0; }
.cx-bl { bottom: 13px; left: 13px; border-right: 0; border-top: 0; }
.cx-br { bottom: 13px; right: 13px; border-left: 0; border-top: 0; }

/* HUD slide counter (console chrome) */
.hud-br { position: fixed; bottom: 15px; right: 46px; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: #8f8878; }
.hud-br em { color: var(--madder); font-style: normal; }

/* faint schematic grid + pixel nodes behind content slides — reads as blueprint/console */
.reveal .slides > section.slide:not(.divider):not(.title-slide):not(.closing) {
  background-image:
    radial-gradient(rgba(37,48,107,.09) 1.2px, transparent 1.5px),
    repeating-linear-gradient(0deg,  transparent 0 47px, rgba(37,48,107,.028) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(37,48,107,.028) 47px 48px);
  background-size: 48px 48px, auto, auto;
  background-position: 47px 47px, 0 0, 0 0;
}
body[data-theme="dark"] .reveal .slides > section.slide:not(.divider):not(.title-slide):not(.closing) {
  background-image:
    radial-gradient(rgba(245,241,232,.1) 1.2px, transparent 1.5px),
    repeating-linear-gradient(0deg,  transparent 0 47px, rgba(245,241,232,.035) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(245,241,232,.035) 47px 48px);
  background-size: 48px 48px, auto, auto;
  background-position: 47px 47px, 0 0, 0 0;
}

/* command-line header on the dark divider slides */
.divider__cmd { font-family: var(--mono); font-size: clamp(.8rem, 1vw, .95rem); letter-spacing: .04em; color: rgba(245,241,232,.55); margin-bottom: 1.1rem; display: block; }
.divider__cmd b { color: var(--india-green); font-weight: 500; }
.divider__cmd i { color: var(--marigold); font-style: normal; }
.divider__cmd .cur { animation: caret 1.1s steps(1) infinite; }

/* CRT screen layer — faint scanlines + subtle flicker (kept low so text stays crisp) */
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 58; }
.scanlines::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(26,23,18,.028) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  animation: crt-flicker 4.5s steps(1) infinite;
}
.scanlines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 160px;
  background: linear-gradient(to bottom, transparent, rgba(37,48,107,.045), transparent);
  animation: crt-sweep 9s linear infinite;
}
@keyframes crt-sweep { 0% { transform: translateY(-180px); } 100% { transform: translateY(100vh); } }
/* irregular opacity flicker, like an old screen */
@keyframes crt-flicker {
  0%, 12%, 34%, 60%, 74%, 100% { opacity: .55; }
  13%, 33%              { opacity: .78; }
  61%, 73%              { opacity: .35; }
  35%, 59%              { opacity: .62; }
}

/* keep all slide content above the jaali background layer */
.reveal .slides > section.slide > *:not(.jaali) { position: relative; z-index: 1; }

/* terminal-prompt kicker + caret */
.kicker::before { content: ">"; font-family: var(--mono); letter-spacing: 0; opacity: .6; margin-right: -.2em; }
.kicker::after { content: "_"; font-family: var(--mono); letter-spacing: 0; opacity: .8; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* one-shot glitch on the title accent word */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; font-style: italic; }
.glitch::before { color: var(--madder); }
.glitch::after  { color: var(--indigo-tint); }
.title-slide.present .glitch::before { animation: gl-a .5s steps(2) .25s 2 both; }
.title-slide.present .glitch::after  { animation: gl-b .5s steps(2) .25s 2 both; }
@keyframes gl-a { 0% { opacity: .9; transform: translate(-3px,-1px); clip-path: inset(0 0 60% 0);} 50% { opacity: .9; transform: translate(2px,1px); clip-path: inset(52% 0 8% 0);} 100% { opacity: 0; transform: none; } }
@keyframes gl-b { 0% { opacity: .8; transform: translate(3px,1px); clip-path: inset(42% 0 18% 0);} 50% { opacity: .8; transform: translate(-2px,-1px); clip-path: inset(8% 0 54% 0);} 100% { opacity: 0; transform: none; } }

/* chips as security tags */
.chip::before { content: "# "; opacity: .45; }

/* radar scan-line that sweeps a chart as it draws */
.chart-scan { stroke: var(--marigold); stroke-width: 2.5; }


/* ---------- 9. Reveal animation ---------- */
[data-reveal] > * { opacity: 0; transform: translateY(12px); }
.present [data-reveal] > * { animation: reveal .6s var(--ease) forwards; }
.present [data-reveal] > *:nth-child(1){ animation-delay: .10s; }
.present [data-reveal] > *:nth-child(2){ animation-delay: .18s; }
.present [data-reveal] > *:nth-child(3){ animation-delay: .26s; }
.present [data-reveal] > *:nth-child(4){ animation-delay: .34s; }
.present [data-reveal] > *:nth-child(5){ animation-delay: .42s; }
.present [data-reveal] > *:nth-child(6){ animation-delay: .50s; }
.present [data-reveal] > *:nth-child(7){ animation-delay: .58s; }
.present [data-reveal] > *:nth-child(8){ animation-delay: .66s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
  [data-reveal] > * { opacity: 1; transform: none; }
  .glitch::before, .glitch::after { opacity: 0 !important; }  /* no frozen RGB-split */
}

/* ---------- 10. Print / PDF export (reveal ?print-pdf) ---------- */
/* reveal.js handles slide pagination; we just force content visible. */
@media print {
  .cyber-hud, .scanlines, .theme-toast { display: none !important; }
  [data-reveal] > * { opacity: 1 !important; transform: none !important; }
  .shield .spoke, .reticle .ret-cnr, .ring-node, .ring-node-n, .ring .arrow { opacity: 1 !important; }
  .kicker::after { display: none !important; }   /* no blinking caret in PDF */
}
