/* STATSEI14 visual theme. Local Aptos fonts with existing system fallbacks.
   Cover geometry, gradients and keyframes copied from the author's APROPECH CSS.
   The cover is conceptual decoration, not a scientific display. */
:root {
  --navy-950: #021a2b;
  --navy-900: #062f49;
  --navy-800: #0a4663;
  --teal-700: #087f91;
  --teal-500: #17a9b8;
  --cyan-200: #b9edf1;
  --orange-600: #e85b0c;
  --orange-400: #f6933d;
  --gold-400: #eeb34f;
  --ink: #173142;
  --muted: #58717f;
  --paper: #f7fafb;
  --white: #ffffff;
  --line: #d7e5e9;
  --soft-teal: #e7f5f6;
  --soft-orange: #fff1e8;
}

.reveal { font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 32px; color: var(--ink); background: var(--paper); }
.reveal .slides { text-align: left; }
.reveal .slides section.slide { box-sizing: border-box; padding: 40px 72px 54px; background: var(--paper); }
.reveal h1, .reveal h2, .reveal h3 { font-family: "Aptos Display", "Aptos", "Segoe UI", Arial, sans-serif; color: var(--navy-900); font-weight: 600; text-transform: none; letter-spacing: -.025em; }
.reveal h2 { font-size: 48px; margin: 0 0 28px; padding-bottom: 16px; border-bottom: 2px solid var(--line); line-height: 1.08; }
.reveal p { font-weight: 400; line-height: 1.28; margin: .42em 0; }
.reveal strong { font-weight: 700; color: var(--navy-900); }
.reveal li { font-weight: 400; margin-bottom: .32em; line-height: 1.32; }
.reveal li::marker { color: var(--orange-600); }
.reveal a { color: var(--teal-700); }
.reveal .eyebrow { font-size: 17px; font-weight: 750; letter-spacing: .09em; color: var(--orange-600); text-transform: uppercase; }
.reveal .big-question { font-size: 1.25em; font-weight: 600; color: var(--navy-900); line-height: 1.18; margin: .5em 0 .6em; }
.reveal .takeaway { border-left: 7px solid var(--orange-600); background: var(--soft-orange); color: var(--navy-900); padding: 13px 20px; margin-top: 22px; font-size: 27px; line-height: 1.2; }
.reveal .takeaway p { margin: 0; line-height: inherit; }
.reveal .small-note { font-size: 19px; color: var(--muted); line-height: 1.3; margin-top: 16px; }
.reveal .small-note p { margin: 0; }
.reveal .focus-figure { display: block; object-fit: contain; max-width: 100%; margin: .1em auto; box-sizing: border-box; padding: 12px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(6,47,73,.08); }
.reveal figure, .reveal .quarto-figure { margin: 0; }
.reveal .columns { gap: 44px; align-items: center; }
.reveal .column { min-width: 0; }
.reveal .column p { margin-bottom: .6em; }
.reveal .milestone-row { display: flex; gap: 2em; margin: 1.4em 0 2em; }
.reveal .milestone { flex: 1; border-left: 3px solid var(--line); padding-left: .8em; }
.reveal .milestone h3, .reveal .milestone strong { color: var(--teal-700); font-size: 1.4em; font-style: normal; font-weight: 600; }
.reveal .milestone strong { display: block; margin-bottom: .3em; }
.reveal .equation-focus { font-size: 1.14em; margin: 1.2em 0; }
.reveal .flow-line { color: var(--teal-700); font-size: 1.08em; line-height: 1.4; margin: 1em 0; font-weight: 600; }
.reveal pre { box-sizing: border-box; box-shadow: none; border: 1px solid var(--line); background: #edf4f6; padding: .5em .6em; width: 100%; }
.reveal pre code { max-height: none; line-height: 1.4; }
.reveal table { font-size: .79em; width: 100%; margin: .8em 0; border-collapse: collapse; }
.reveal table td, .reveal table th { font-weight: 400; padding: .65em .5em; line-height: 1.4; }
.reveal table th { color: var(--navy-900); background: var(--soft-teal); font-weight: 650; border-bottom: 2px solid var(--teal-700); }
.reveal table td { border-bottom: 1px solid var(--line); }
.reveal .footer { font-size: 15px; color: var(--muted); }
.reveal .slide-number { background: transparent; color: var(--muted); }
.reveal .progress { color: var(--teal-500); }

/* Preserve all existing instructional diagrams, with the reference palette. */
.reveal .learning-flow { margin: 1.1em 0; color: var(--teal-700); font-weight: 600; }
.reveal .learning-flow > p { display: flex; align-items: center; justify-content: space-between; gap: .45em; }
.reveal .flow-node { flex: 1; text-align: center; color: var(--navy-900); border: 2px solid var(--teal-500); border-radius: 16px 10px 14px 8px; background: var(--soft-teal); padding: .8em .55em; line-height: 1.25; }
.reveal .feedback-flow .flow-node { background: #f0f4f5; border-color: var(--muted); }
.reveal .bin-sequence > p { display: flex; justify-content: center; gap: .4em; margin: 1.1em 0; }
.reveal .bin-sequence span { padding: .7em .5em; border: 2px solid #91a4ad; border-radius: 5px; font-size: 1.05em; }
.reveal .empty-bin { background: #eef1f3; color: #536876; }
.reveal .event-bin { background: var(--soft-orange); border-color: var(--orange-400) !important; color: #6c441c; }

/* ---------- Title and animated CSS background ---------- */

.reveal .slides section.slide.title-slide {
  position: absolute;
  padding: 56px 82px;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 12%, rgba(23, 169, 184, 0.26), transparent 31%),
    radial-gradient(circle at 88% 77%, rgba(232, 91, 12, 0.18), transparent 28%),
    linear-gradient(132deg, #011725 0%, #06314a 56%, #07556a 100%);
}

@media screen {
  .reveal .slides > section.slide.title-slide {
    top: 0 !important;
    height: 100% !important;
  }
}

.title-slide::before {
  content: "";
  position: absolute;
  inset: -22%;
  opacity: 0.38;
  background:
    repeating-radial-gradient(ellipse at 73% 48%, transparent 0 42px, rgba(185, 237, 241, 0.13) 43px 46px, transparent 47px 88px);
  animation: contourDrift 18s ease-in-out infinite alternate;
}

.title-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(1, 23, 37, 0.18), transparent 58%, rgba(1, 23, 37, 0.2));
  pointer-events: none;
}

.title-slide > * {
  position: relative;
  z-index: 2;
}

.title-grid {
  display: grid;
  grid-template-columns: 58fr 42fr;
  gap: 66px;
  align-items: center;
  height: 100%;
}

.title-copy {
  max-width: 900px;
}

.title-slide .eyebrow {
  color: var(--cyan-200);
}

.deck-title {
  margin-top: 26px;
  color: var(--white);
  font-family: "Aptos Display", "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: 70px;
  font-weight: 520;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.deck-title span {
  color: var(--orange-400);
}

.deck-subtitle {
  max-width: 800px;
  margin-top: 28px;
  color: #c6e9ed;
  font-size: 31px;
  font-weight: 350;
  line-height: 1.22;
}

.speaker-line {
  margin-top: 42px;
  color: rgba(255,255,255,0.75);
  font-size: 21px;
  line-height: 1.4;
}

.speaker-line strong {
  color: var(--white);
  font-size: 25px;
}

.current-field {
  position: relative;
  justify-self: center;
  width: 510px;
  height: 610px;
  overflow: hidden;
  border: 1px solid rgba(185, 237, 241, 0.32);
  border-radius: 260px 260px 34px 34px;
  background:
    repeating-radial-gradient(ellipse at 42% 46%, transparent 0 36px, rgba(185, 237, 241, 0.18) 37px 39px, transparent 40px 76px),
    linear-gradient(160deg, rgba(23,169,184,0.12), rgba(1,23,37,0.34));
  box-shadow: inset 0 0 70px rgba(23,169,184,0.08), 0 25px 70px rgba(0,0,0,0.15);
}

.sonar-sweep {
  position: absolute;
  inset: -8%;
  z-index: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg 306deg,
    rgba(185, 237, 241, 0.02) 316deg,
    rgba(23, 169, 184, 0.22) 338deg,
    rgba(246, 147, 61, 0.62) 356deg,
    transparent 360deg
  );
  transform-origin: 50% 50%;
  animation: sonarSweep 5.4s linear infinite;
  will-change: transform;
  pointer-events: none;
}

.current-field::before {
  content: "";
  position: absolute;
  left: -20%;
  top: 49%;
  width: 140%;
  height: 8px;
  background: linear-gradient(90deg, transparent, var(--orange-400) 20%, var(--orange-400) 78%, transparent);
  clip-path: polygon(0 40%, 16% 52%, 34% 22%, 52% 64%, 72% 38%, 87% 58%, 100% 26%, 100% 76%, 87% 88%, 72% 67%, 52% 92%, 34% 52%, 16% 78%, 0 66%);
  opacity: 0.8;
}

.current-field::after {
  content: "data · seismicity· learning";
  position: absolute;
  left: 38px;
  bottom: 32px;
  color: rgba(185,237,241,0.7);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.data-dot {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan-200);
  box-shadow: 0 0 0 7px rgba(185,237,241,0.08), 0 0 20px rgba(185,237,241,0.55);
  animation: dotPulse 3.4s ease-in-out infinite;
}

.d1 { left: 22%; top: 24%; animation-delay: .2s; }
.d2 { left: 70%; top: 31%; animation-delay: 1.1s; }
.d3 { left: 42%; top: 48%; animation-delay: 1.8s; background: var(--orange-400); }
.d4 { left: 76%; top: 64%; animation-delay: 2.4s; }
.d5 { left: 28%; top: 72%; animation-delay: .8s; }

@keyframes contourDrift {
  from { transform: translate3d(-2%, -2%, 0) rotate(-2deg) scale(1.02); }
  to { transform: translate3d(3%, 2%, 0) rotate(2deg) scale(1.06); }
}

@keyframes dotPulse {
  0%, 100% { opacity: .4; transform: scale(.78); }
  50% { opacity: 1; transform: scale(1.22); }
}

@keyframes sonarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* Fit the unchanged tutorial identity and message into the original title grid. */
/* Quarto emits an empty section heading; retain the reference's 28px spacing. */
.reveal #s01 > h2:empty { margin: 0 0 28px; padding: 0; border: 0; line-height: 0; }

.reveal #s01 h2.deck-title { margin: 26px 0 0; padding: 0; border: 0; color: var(--white); font-size: 70px; font-weight: 520; letter-spacing: -.035em; line-height: .98; }
.reveal #s01 .speaker-line strong { color: var(--white); }
.reveal #s01 .title-date { margin-top: 16px; color: rgba(255,255,255,.75); font-size: 21px; }
.reveal #s01 .takeaway { margin-top: 28px; max-width: 710px; padding: 10px 0 10px 18px; border-left: 4px solid var(--orange-400); background: transparent; color: var(--cyan-200); font-size: 24px; line-height: 1.24; }
.reveal #s01 .current-field p { margin: 0; }

/* Only the active title may move. Scientific slides have no animations. */
#s01::before, #s01 .sonar-sweep, #s01 .data-dot { animation-play-state: paused; }
@media screen and (prefers-reduced-motion: no-preference) {
  html:not(.print-pdf) .reveal:not(.overview):not(.paused) #s01.present::before,
  html:not(.print-pdf) .reveal:not(.overview):not(.paused) #s01.present .sonar-sweep,
  html:not(.print-pdf) .reveal:not(.overview):not(.paused) #s01.present .data-dot { animation-play-state: running; }
}

/* Deterministic complete still: no sampled animation time is used in PDF. */
html.print-pdf #s01::before { animation: none !important; transform: none; opacity: .38; }
html.print-pdf #s01 .sonar-sweep { animation: none !important; transform: rotate(28deg); }
html.print-pdf #s01 .data-dot { animation: none !important; transform: scale(1); opacity: 1; }
@media print, (prefers-reduced-motion: reduce) {
  #s01::before { animation: none !important; transform: none; opacity: .38; }
  #s01 .sonar-sweep { animation: none !important; transform: rotate(28deg); }
  #s01 .data-dot { animation: none !important; transform: scale(1); opacity: 1; }
}
@media print {
  .reveal, .reveal .slides section.slide { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.print-pdf .reveal .slides section.slide { box-sizing: border-box !important; padding: 40px 72px 54px !important; }
  html.print-pdf .reveal .slides section.slide.title-slide { top: 0 !important; height: 100% !important; padding: 56px 82px !important; }
}
