@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #111214;
  --fg: #e8dac4;
  --muted: #b3a797;
  --font-body: "Lato", "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
  --w-light: 300;
  --w-bold: 400;
  color-scheme: dark;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
}

button {
  font: inherit;
  color: inherit;
}

/* ---------------------------------------------------------------- player */

body.player {
  overflow: hidden;
  height: 100dvh;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}

.deck {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* a native image drag would swallow the swipe gesture */
.deck img {
  -webkit-user-drag: none;
  user-drag: none;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade, 0.7s) ease, visibility 0s linear var(--fade, 0.7s);
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  transition: opacity var(--fade, 0.7s) ease, visibility 0s;
}

/* the outgoing slide stays fully visible underneath while the new one fades in (crossfade) */
.slide.leaving {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: none;
}

/* ---------------------------------------------------------------- start screen */

.start {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgb(10 10 12 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.6s ease;
}

.start.gone {
  opacity: 0;
  pointer-events: none;
}

.start-btn {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  padding: 2.5rem 3rem;
  margin: 1rem;
  background: rgb(17 18 20 / 0.7);
  border: 1px solid rgb(206 187 175 / 0.5);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.start-name {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-dates {
  color: var(--muted);
  font-weight: 300;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
}

.start-cta {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.start-cta .tri {
  width: 0.6em;
  height: 0.72em;
  margin-right: 0.5em;
  fill: currentColor;
  vertical-align: -0.02em;
}

.start-btn:hover .start-cta,
.start-btn:focus-visible .start-cta {
  background: var(--fg);
  color: var(--bg);
}

/* resume panel (arriving on slide 2+): the card isn't a button itself, its two actions are */
.start-btn.resume {
  cursor: default;
}

.resume-where {
  color: var(--muted);
  font-size: 0.95rem;
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.resume-actions .start-cta {
  margin: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.resume-actions .start-cta.quiet {
  border-color: rgb(206 187 175 / 0.45);
  color: var(--muted);
}

.resume-actions .start-cta:hover,
.resume-actions .start-cta:focus-visible {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.start-btn[hidden] {
  display: none;
}

/* back to the site's home page, under the panel */
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
}

.home-link svg {
  width: 0.6em;
  height: 0.72em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--fg);
  background: rgb(255 255 255 / 0.1);
}

/* ---------------------------------------------------------------- controls */

.controls {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  transform: translateX(-50%);
  background: rgb(17 18 20 / 0.72);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.4s ease;
}

body.idle .controls,
body.starting .controls {
  opacity: 0;
  pointer-events: none;
}

.controls button,
.controls a {
  display: grid;
  place-items: center;
  color: inherit;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.controls button:hover,
.controls button:focus-visible,
.controls a:hover,
.controls a:focus-visible {
  background: rgb(255 255 255 / 0.12);
}

.controls svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controls .play .i-play,
.controls .play.paused .i-pause,
.controls .music .i-off,
.controls .music.muted .i-on {
  display: none;
}

.controls .play.paused .i-play,
.controls .music.muted .i-off {
  display: inline;
}

.controls .play .i-play {
  fill: currentColor;
}

.counter {
  min-width: 4.5em;
  text-align: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* screenshot mode: no chrome */
body.shot .controls,
body.shot .start {
  display: none;
}

body.shot .slide {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.active {
    transition-duration: 0s;
  }
}
