:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --ink: #1d1d1f;
  --muted: #6e6a64;
  --accent: #d7332f;
  --line: #d8d1c7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.deck {
  width: 100vw;
  height: 100svh;
}

.cover-slide {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: clamp(28px, 6vw, 76px);
  background-image:
    linear-gradient(
      180deg,
      rgba(4, 8, 18, 0.16),
      rgba(4, 8, 18, 0.34) 48%,
      rgba(4, 8, 18, 0.22)
    ),
    var(--cover-image);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.cover-content {
  width: min(86vw, 980px);
  text-align: center;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.58);
}

.cover-title {
  margin: 0;
  font-size: clamp(64px, 11vw, 156px);
  font-weight: 880;
  line-height: 0.9;
}

.cover-byline {
  margin: clamp(18px, 2.8vw, 36px) 0 0;
  font-size: clamp(30px, 5vw, 72px);
  font-weight: 780;
  line-height: 1;
}

.slide {
  display: grid;
  grid-template-columns: minmax(120px, 18vw) 1fr;
  gap: clamp(20px, 4vw, 56px);
  width: 100%;
  height: 100%;
  padding: clamp(24px, 5vw, 64px);
  cursor: pointer;
}

.letter-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.letter {
  margin: 0;
  color: var(--accent);
  font-size: clamp(96px, 16vw, 220px);
  font-weight: 850;
  line-height: 0.82;
}

.hint {
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.2;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 28px);
  min-width: 0;
  min-height: 0;
}

.logo-tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 44px;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, 2.2vw, 28px);
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.logo-tile:focus-visible {
  outline: 4px solid #2068d8;
  outline-offset: 4px;
}

.logo-frame {
  container-type: size;
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.logo-frame img {
  display: block;
  max-width: min(80%, 360px);
  max-height: min(72cqh, 240px);
  object-fit: contain;
  filter:
    blur(var(--blur, 18px))
    grayscale(var(--gray, 0))
    contrast(var(--contrast, 1));
  transform: scale(var(--scale, 1.03));
  transition: filter 220ms ease, transform 220ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-tile[data-revealed="true"] img {
  --blur: 0;
  --scale: 1;
}

.caption {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 780;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transition: opacity 160ms ease;
}

.logo-tile[data-revealed="true"] .caption {
  opacity: 1;
}

.logo-tile[data-missing="true"] {
  cursor: default;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.28);
}

.missing-mark {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  text-align: center;
}

.controls {
  position: fixed;
  left: clamp(16px, 3vw, 40px);
  bottom: clamp(16px, 3vw, 32px);
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-areas:
    ". up ."
    "left down right";
  gap: 8px;
}

#prevSlide {
  grid-area: left;
}

#revealStep {
  grid-area: up;
}

#blurStep {
  grid-area: down;
}

#nextSlide {
  grid-area: right;
}

.controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #b9b1a6;
  border-bottom-width: 4px;
  border-radius: 7px;
  background: linear-gradient(#fffdf9, #ece5dc);
  box-shadow: 0 2px 0 rgba(29, 29, 31, 0.12);
  cursor: pointer;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.controls button:active {
  border-bottom-width: 1px;
  box-shadow: none;
  transform: translateY(3px);
}

@media (max-width: 780px) {
  .slide {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 18px;
    padding: 22px;
    padding-bottom: 86px;
  }

  .letter-panel {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }

  .letter {
    font-size: clamp(72px, 28vw, 120px);
  }

  .hint {
    max-width: 15ch;
    margin-top: 0;
    text-align: right;
  }

  .logo-grid {
    gap: 12px;
  }

  .logo-tile {
    grid-template-rows: minmax(0, 1fr) 34px;
    padding: 12px;
  }

  .caption {
    font-size: clamp(15px, 4vw, 20px);
  }
}
