/* Tunnel of love: one full-screen scene, with the words and the controls over it. */

:root {
  --tol-background: #1c0511;
  --tol-ink: #ffe6f0;
  --tol-pink: #ff2d7a;
  --tol-gold: #ffc94a;
  --tol-deep: #2b0a1d;
  --tol-font: Georgia, "Times New Roman", serif;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--tol-background);
  color: var(--tol-ink);
  font-family: var(--tol-font);
  font-size: 17px;
  line-height: 1.5;
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

.tol {
  position: fixed;
  inset: 0;
}

.tol-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: ew-resize;
}

/* The second canvas carries the bursts, the popups and the vignette over the scene. */
.tol-fx {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* While the postcard is shown, the top bar and the progress bar step aside. */
.tol.is-end .tol-top,
.tol.is-end .tol-progress {
  display: none;
}

/* Top bar: the way back, the three counts. */
.tol-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px clamp(16px, 3vw, 40px) 40px;
  background: linear-gradient(180deg, rgb(28 5 17 / .85) 0%, rgb(28 5 17 / 0) 100%);
  pointer-events: none;
}

.tol-back,
.tol-count {
  pointer-events: auto;
}

.tol-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgb(28 5 17 / .55);
  box-shadow: inset 0 0 0 1.5px rgb(255 230 240 / .4);
  color: var(--tol-ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.tol-back img {
  display: block;
  width: 18px;
  height: 18px;
  filter: invert(92%) sepia(10%);
}

.tol-count {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  font-size: 16px;
  line-height: 1;
}

.tol-count b {
  margin-left: 4px;
  color: var(--tol-gold);
  font-size: 22px;
  font-weight: 700;
}

/* Progress along the tunnel. */
.tol-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 6px;
  background: rgb(255 230 240 / .14);
}

.tol-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--tol-pink);
  box-shadow: 0 0 12px var(--tol-pink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .2s linear;
}

/* A note read aloud by the tunnel: it stays for a few seconds. */
.tol-toast {
  position: absolute;
  left: 50%;
  bottom: 76px;
  z-index: 2;
  width: min(560px, calc(100% - 32px));
  margin: 0;
  padding: 14px 20px;
  border-radius: 20px;
  background: rgb(28 5 17 / .72);
  box-shadow: inset 0 0 0 1px rgb(255 230 240 / .25);
  font-size: 19px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.tol-toast.is-shown {
  opacity: 1;
}

/* Steering and pause, for touch and for a mouse. */
.tol-controls {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

.tol-steer {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: rgb(28 5 17 / .6);
  box-shadow: inset 0 0 0 1.5px rgb(255 230 240 / .45);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.tol-steer img {
  display: block;
  filter: invert(92%) sepia(10%);
}

.tol-pause {
  min-width: 120px;
  padding: 16px 22px;
  border: 0;
  border-radius: 999px;
  background: rgb(28 5 17 / .6);
  box-shadow: inset 0 0 0 1.5px rgb(255 230 240 / .45);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.tol-steer:focus-visible,
.tol-pause:focus-visible,
.tol-btn:focus-visible,
.tol-link:focus-visible,
.tol-back:focus-visible {
  outline: 3px solid var(--tol-gold);
  outline-offset: 3px;
}

/* Panels: the opening over the moving scene, the postcard after the gate. */
.tol-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  box-sizing: border-box;
  padding: 96px clamp(20px, 5vw, 72px) 56px;
}

.tol-panel--start {
  align-items: flex-start;
  max-width: 680px;
  background: linear-gradient(90deg, rgb(28 5 17 / .9) 0%, rgb(28 5 17 / .55) 65%, rgb(28 5 17 / 0) 100%);
}

.tol-panel--start .tol-title {
  font-size: clamp(56px, 9vw, 132px);
}

.tol-kicker {
  margin: 0;
  color: var(--tol-gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
}

.tol-title {
  margin: 0;
  font-size: clamp(48px, 7vw, 112px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--tol-ink);
  text-wrap: balance;
}

.tol-lead {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.4;
}

.tol-hint {
  margin: 0;
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.45;
  opacity: .8;
}

.tol-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.tol-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--tol-pink);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  cursor: pointer;
}

.tol-btn img {
  display: block;
  filter: brightness(0) invert(1);
}

.tol-btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tol-ink);
  color: var(--tol-ink);
}

.tol-link {
  color: var(--tol-ink);
  font-size: 18px;
  text-underline-offset: 6px;
}

.tol-panel--end {
  justify-content: flex-start;
  overflow-y: auto;
  background: rgb(20 3 13 / .94);
  padding: 72px clamp(16px, 4vw, 56px) 40px;
}

.tol-end-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.tol-card {
  margin: 0;
}

.tol-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78svh;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .7);
}

.tol-end-text {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.tol-title--end {
  font-size: clamp(48px, 6vw, 84px);
}

.tol-note {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.tol-field {
  display: grid;
  gap: 6px;
  width: 100%;
  font-size: 15px;
  font-weight: 700;
}

.tol-field input {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgb(255 230 240 / .3);
  border-radius: 16px;
  background: rgb(0 0 0 / .3);
  font-size: 17px;
  font-weight: 400;
}

.tol-field input:focus-visible {
  outline: 3px solid var(--tol-gold);
  outline-offset: 2px;
}

.tol-links {
  margin: 0;
}

@media (max-width: 760px) {
  .tol-panel--start {
    justify-content: flex-start;
    padding-top: 112px;
    padding-bottom: 40px;
    background: linear-gradient(180deg, rgb(28 5 17 / .94) 0%, rgb(28 5 17 / .82) 58%, rgb(28 5 17 / 0) 84%);
  }

  .tol-panel--start .tol-title {
    font-size: clamp(48px, 15vw, 72px);
  }

  .tol-end-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tol-card canvas {
    max-height: none;
  }

  .tol-count {
    font-size: 14px;
    gap: 6px 12px;
  }

  .tol-count b {
    font-size: 19px;
  }

  .tol-toast {
    bottom: 96px;
    width: calc(100% - 40px);
    font-size: 17px;
    padding: 12px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tol-progress span,
  .tol-toast {
    transition: none;
  }
}
