/* FuzzyFi slides: same look as the app. White page, black pills, grey boxes, rounded black banner. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #000;
  --muted: #595959;
  --box: #dedede;
  --line: #e6e6e6;
  --swarm: #1f5bff;
  --bar: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: clamp(15px, 1.15vw + 6px, 21px);
  line-height: 1.5;
}

h1, h2, h3, p, ol, ul, figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--swarm);
  outline-offset: 3px;
}

/* Top and bottom bars */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--bar);
  padding: 0 30px;
  background: var(--paper);
  font-size: 15px;
}

.top {
  top: 0;
}

.bottom {
  bottom: 0;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.where {
  margin-right: auto;
  color: var(--muted);
}

.dots {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  padding: 0;
  background: var(--paper);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dot:hover {
  transform: scale(1.3);
}

.dot[aria-selected="true"] {
  background: var(--ink);
}

.count {
  min-width: 56px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
}

.progress i {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.35s;
}

/* Buttons */
.pill {
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 11px 24px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
}

.pill:hover:not(:disabled) {
  transform: translateY(-1px);
}

.pill:disabled {
  opacity: 0.3;
  cursor: default;
}

.pill.small {
  padding: 7px 18px;
  font-size: 15px;
}

.pill-outline {
  background: var(--paper);
  color: var(--ink);
}

.pill-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.pill-light {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

/* Slides */
.deck {
  position: fixed;
  inset: var(--bar) 0;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: 2vh 30px 3vh;
  visibility: hidden;
  opacity: 0;
  transform: translateX(var(--from, 40px));
  transition: opacity 0.4s, transform 0.4s, visibility 0s 0.4s;
}

.slide.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.4s, transform 0.4s, visibility 0s;
}

.slide.is-before {
  --from: -40px;
}

.inner {
  width: 100%;
  max-width: 1180px;
  margin: auto;
}

.inner.center {
  max-width: 900px;
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 5vw;
}

.split.even {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  margin-top: 28px;
}

.kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 600;
}

h1 {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

h2 {
  margin-bottom: 0.6em;
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

h3 {
  font-size: 1.1em;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lead {
  color: var(--muted);
}

.lead + .lead {
  margin-top: 0.8em;
}

.lead strong {
  color: var(--ink);
}

.small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8em;
}

/* Title slides */
.tag {
  display: inline-block;
  margin-bottom: 28px;
  border-radius: 999px;
  padding: 6px 18px;
  background: var(--box);
  font-size: 0.75em;
  font-weight: 600;
}

.subtitle {
  max-width: 30ch;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 1.3em;
  line-height: 1.35;
  text-wrap: balance;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 640px;
  margin: 48px auto 0;
  border-radius: 40px;
  padding: 18px 22px 18px 40px;
  background: var(--ink);
  color: var(--paper);
  text-align: left;
}

.banner-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.banner-note {
  color: #a6a6a6;
  font-size: 0.85em;
}

/* Title slide: the names stay small so FuzzyFi leads */
.title-slide .banner {
  max-width: 500px;
  margin-top: 40px;
  border-radius: 32px;
  padding: 12px 14px 12px 30px;
  font-size: 0.8em;
}

.title-slide .banner .pill {
  padding: 8px 20px;
}

.hint {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.75em;
}

/* Boxes */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.fact,
.box {
  padding: 16px 18px;
  background: var(--box);
}

.fact strong {
  display: block;
  font-size: 1.5em;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fact span,
.box span {
  color: var(--muted);
  font-size: 0.85em;
}

.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.box strong {
  display: block;
  margin-bottom: 4px;
}

.note {
  margin-top: 20px;
  padding: 12px 18px;
  background: var(--box);
}

.formula {
  margin-top: 14px;
  border-radius: 24px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  text-align: center;
}

.formula.big {
  padding: 22px 28px;
  font-size: 1.25em;
}

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.big-box {
  height: 100%;
  padding: 28px 30px;
  background: var(--box);
}

.big-box.dark {
  background: var(--ink);
  color: var(--paper);
}

.big-box strong {
  display: block;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.big-box span {
  display: block;
  margin-top: 10px;
  opacity: 0.8;
}

.vs {
  color: var(--muted);
  font-weight: 600;
}

/* Two technique cards */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card {
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: 26px 30px 28px;
  transition: background 0.2s, color 0.2s;
}

.card:hover {
  background: var(--ink);
  color: var(--paper);
}

.card-label {
  font-size: 0.8em;
  opacity: 0.7;
}

.card h3 {
  margin: 4px 0 10px;
  font-size: 1.4em;
}

.picture {
  margin-top: 14px;
  border-top: 1px solid currentColor;
  padding-top: 14px;
  opacity: 0.8;
}

/* Fuzzy slides */
.membership {
  display: block;
  width: 100%;
}

.membership + .membership {
  margin-top: 8px;
}

.grades {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.grades li {
  display: grid;
  grid-template-columns: 7em 1fr 3em;
  align-items: center;
  gap: 12px;
}

.grades i {
  display: block;
  height: 10px;
  background: var(--box);
}

.grades b {
  display: block;
  height: 100%;
  background: var(--ink);
}

.grades span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

th {
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.rules tbody tr {
  color: #8a8a8a;
}

.rules tr.fired {
  color: var(--ink);
  font-weight: 600;
}

.rules tr.fired td:last-child {
  color: var(--swarm);
}

.scale {
  position: relative;
  height: 60px;
  margin: 64px 12px 0;
  color: var(--muted);
  font-size: 0.85em;
}

.scale::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 14px;
  border: 1px solid var(--ink);
  background: linear-gradient(to right, #000, #fff);
}

.scale span {
  position: absolute;
  top: 22px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.scale span:nth-of-type(1) { left: 0; transform: none; }
.scale span:nth-of-type(2) { left: 33.33%; }
.scale span:nth-of-type(3) { left: 66.67%; }
.scale span:nth-of-type(4) { right: 0; transform: none; }

.scale i {
  position: absolute;
  top: -14px;
  width: 4px;
  height: 42px;
  margin-left: -2px;
  background: var(--swarm);
  box-shadow: 0 0 0 2px var(--paper);
}

.scale em {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--swarm);
  color: var(--paper);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

/* PSO slides */
.terms {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.steps {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--box);
}

.steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8em;
}

.maps {
  display: grid;
  gap: 12px;
}

/* Both maps must fit the screen height together, so their width follows the height */
.maps figure {
  width: min(100%, calc((100dvh - 2 * var(--bar) - 130px) / 2 * 5 / 3));
  margin-left: auto;
}

.floor {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  border: 3px solid var(--ink);
  background: var(--ink);
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8em;
}

figcaption strong {
  color: var(--ink);
}

.worked {
  font-size: 0.9em;
}

.worked h3 {
  margin-bottom: 6px;
}

.sum {
  margin-top: 8px;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--paper);
  font-weight: 500;
}

/* Code flow */
.flow,
.flow ol {
  display: flex;
  align-items: stretch;
  gap: 22px;
  padding: 0;
  list-style: none;
}

.flow > li,
.flow ol > li {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
  background: var(--box);
  font-size: 0.85em;
}

.flow li + li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -22px;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

.flow strong {
  font-family: Consolas, "Courier New", monospace;
}

.flow span {
  color: var(--muted);
}

.flow > li.loop {
  flex: 4.4;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--paper);
}

.loop > p {
  margin-bottom: 10px;
  font-weight: 600;
  text-align: center;
}

.flow ol > li {
  font-size: 1em;
}

/* Results */
.results {
  display: grid;
  grid-template-columns: 1fr 1fr 0.85fr;
  align-items: start;
  gap: 20px;
}

.chart-box h3 {
  margin-bottom: 8px;
  font-size: 0.9em;
}

#chart {
  display: block;
  width: 100%;
  overflow: visible;
}

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.8em;
}

.legend i {
  flex: 1;
  height: 10px;
  border: 1px solid var(--ink);
  background: linear-gradient(to right, #000, #fff);
}

.sub {
  margin: 32px 0 10px;
}

/* Thank you */
.team {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.member {
  width: 260px;
  padding: 26px 20px 24px;
  background: var(--box);
  transition: transform 0.2s;
}

.member:hover {
  transform: translateY(-4px);
}

.avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.4em;
  font-weight: 600;
  transition: background 0.2s;
}

.member:hover .avatar {
  background: var(--swarm);
}

.course {
  margin: 28px 0 24px;
  color: var(--muted);
}

.course a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 4px;
}

/* Slide content rises in */
.slide.is-active .inner > * {
  animation: rise 0.5s both;
}

.slide.is-active .inner > :nth-child(2) { animation-delay: 0.05s; }
.slide.is-active .inner > :nth-child(3) { animation-delay: 0.1s; }
.slide.is-active .inner > :nth-child(4) { animation-delay: 0.15s; }
.slide.is-active .inner > :nth-child(n + 5) { animation-delay: 0.2s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Smaller screens: slides scroll, and columns stack */
@media (max-width: 1000px) {
  .results {
    grid-template-columns: 1fr 1fr;
  }

  .chart-box {
    grid-column: 1 / -1;
  }

  .flow,
  .flow ol {
    flex-direction: column;
    gap: 14px;
  }

  .flow li + li::before {
    top: -14px;
    left: 50%;
    width: 2px;
    height: 14px;
  }
}

@media (max-width: 760px) {
  :root {
    --bar: 56px;
  }

  .bar {
    gap: 12px;
    padding: 0 16px;
  }

  .where,
  .dots {
    display: none;
  }

  .top .pill {
    margin-left: auto;
  }

  .count {
    flex: 1;
    text-align: center;
  }

  .slide {
    padding: 16px 16px 24px;
  }

  .inner {
    margin: 0 auto auto;
  }

  .inner.center {
    margin: auto;
  }

  .split,
  .split.even,
  .duo,
  .three,
  .results,
  .versus {
    grid-template-columns: minmax(0, 1fr);
  }

  .split {
    gap: 24px;
  }

  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .banner {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 32px;
    padding: 22px 26px;
  }

  .team {
    flex-direction: column;
    align-items: center;
  }

  .member {
    width: 100%;
    max-width: 300px;
  }

  .rules th,
  .rules td {
    padding: 8px 4px;
    font-size: 0.8em;
  }

  .formula {
    padding: 14px 18px;
    font-size: 0.9em;
  }
}

/* Short screens, like a 1366 x 768 laptop: tighter spacing so each slide fits */
@media (max-height: 860px) and (min-width: 761px) {
  .slide {
    padding-top: 1vh;
    padding-bottom: 1vh;
  }

  h2 {
    margin-bottom: 0.4em;
  }

  th,
  td {
    padding: 6px 8px;
  }

  .formula {
    margin-top: 10px;
    padding: 12px 24px;
  }

  .note {
    margin-top: 14px;
    padding: 10px 16px;
  }

  .split.even {
    margin-top: 18px;
  }

  .steps {
    margin-top: 14px;
  }

  .steps li {
    padding: 7px 12px;
  }
}

@media (max-width: 760px) {
  .maps figure {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Printing gives one slide per page, handy for a PDF handout */
@media print {
  body {
    overflow: visible;
  }

  .bar {
    display: none;
  }

  .deck {
    position: static;
  }

  .slide {
    position: relative;
    min-height: 100vh;
    visibility: visible;
    opacity: 1;
    transform: none;
    break-after: page;
  }
}
