/* the long road in: the home page's ride, ribbon and two ways in.
   loaded after cover.css: colours, fonts, --line, --wobble, --edge and the .rink, .rideBar,
   .pixel, .visually-hidden classes all come from there. */

/* the page: one column, a little narrower than the cover's 1080px */
main > section.entrance {
  max-width: 880px;
  padding: 0.9rem var(--edge) 2.5rem;
}

@media (min-width: 900px) {
  main > section.entrance { max-width: 1400px; }
}

main > section.entrance .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 1rem;
  margin-bottom: 0.8rem;
}

.entrance h1 {
  font-size: clamp(2.2rem, 9vw, 3.6rem);
}

.entrance .lead {
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.3rem);
}

/* the distance ribbon: the four stages, filling in gold as you travel */
.ribbon {
  margin-bottom: 0.6rem;
}

.ribbon .bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 8px 12px 7px 12px / 12px 7px 12px 8px;
}

.ribbon .bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  border-right: 3px solid var(--ink);
}

.ribbon .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 30% 0 / 2px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 55% 0 / 2px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 77% 0 / 2px 100% no-repeat;
}

.stops {
  display: grid;
  grid-template-columns: 30fr 25fr 22fr 23fr;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--pixel);
  font-size: 0.68rem;
  line-height: 1.3;
}

.stops li {
  max-width: none;
  padding-right: 2px;
  white-space: nowrap;
}

.stops li.on {
  text-decoration: underline wavy 1.5px;
  text-underline-offset: 3px;
}

/* the rink: .rink and .rideBar are cover.css's. the canvas is 160 x 60 (160 x 90 below 520px), drawn at a whole-number
   multiple of its size: entrance.js sets the canvas's own size and --rinkW (rink + border), and the ribbon, rink and
   hint bar all take that width, centred, so no pixel column is ever stretched unevenly */
.ribbon,
.entrance .rink,
.entrance .rideBar {
  width: var(--rinkW, 100%);
  margin-inline: auto;
}

.entrance .rink canvas {
  display: block;
}

.entrance .rideBar {
  margin-top: 0.3rem;
  gap: 0 1.2rem;
}

.rink:disabled {
  cursor: default;
}

#hint {
  font-size: 1rem;
}

.quiet {
  min-height: 44px;
  padding: 0 0.3rem;
  background: none;
  border: 0;
  font: inherit;
  font-size: 1rem;
  color: color-mix(in srgb, var(--ink) 80%, var(--cream));
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.quiet:hover {
  color: var(--clay);
}

/* the two ways in: plaques hung from the doorways */
.doors {
  margin-top: 16px;
}

.doors h2 {
  margin: 0 0 16px;
  padding: 0 0.2rem;
  font-family: var(--pixel);
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
}

.plaques {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.plaques li {
  position: relative;
  display: flex;
  max-width: none;
}

.js .plaques li::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 3px;
  height: 16px;
  background: var(--ink);
}

.plaque {
  --accent: var(--clay);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  min-height: 12rem;
  padding: 1.5rem 0.9rem 0.9rem;
  background: linear-gradient(var(--accent) 0 0.55rem, var(--cream) 0.55rem 0.7rem, var(--ink) 0.7rem);
  color: var(--cream);
  text-decoration: none;
  border: var(--line);
  border-radius: var(--wobble);
  line-height: 1.4;
}

.plaque.purist {
  --accent: var(--dusk);
}

.plaque:hover {
  color: var(--cream);
  transform: rotate(-1deg);
}

.plaque:focus-visible {
  outline-color: var(--ink);
  outline-offset: 5px;
}

.pName {
  font-family: var(--bubble);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1;
  color: var(--gold);
}

.pSay {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
}

.pSay strong {
  font-family: var(--bubble);
  font-weight: 400;
  font-size: 1.25em;
  color: var(--gold);
}

.pGo {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--gold);
  text-decoration: underline wavy 2px;
  text-underline-offset: 0.25em;
}

.doorsFoot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

@media (max-width: 520px) {
  .plaque {
    min-height: 11rem;
    padding-inline: 0.7rem;
  }

  .pGo {
    font-size: 0.95rem;
  }
}

/* progressive enhancement: without script the page is the title, the two ways in, the footer */
html:not(.js) .ribbon,
html:not(.js) .rink,
html:not(.js) .rideBar,
html:not(.js) #again {
  display: none;
}

html.js[data-phase="ride"] .doors {
  display: none;
}

html[data-phase="doors"] .rideBar {
  display: none;
}

.js[data-phase="doors"] .doors {
  animation: rise 0.35s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .js[data-phase="doors"] .doors {
    animation: none;
  }

  .plaque:hover {
    transform: none;
  }
}

/* dress up (board only) and the note about what is kept: both follow the rink's width, both need script */
.entrance .dressUp,
.entrance .keep {
  width: var(--rinkW, 100%);
  margin-inline: auto;
}

.entrance .keep {
  margin-top: 0.1rem;
  font-size: 1rem;
}

html:not(.js) .dressUp,
html:not(.js) .keep,
html[data-phase="doors"] .keep {
  display: none;
}

/* the door made of your ride: the scraps carried in, pinned along the tourist plaque's foot */
.plaque {
  position: relative;
}

.plaque.hasScraps {
  padding-bottom: 2.1rem;
}

.pScraps {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pScraps i {
  width: 10px;
  height: 13px;
  border-radius: 2px 3px 2px 3px / 3px 2px 3px 2px;
  outline: 1px solid color-mix(in srgb, var(--cream) 70%, var(--ink));
}

/* your road in: the whole road as a thin strip, a gold dot per dandelion, and what the ride came to in words */
.roadIn {
  margin-top: 1.4rem;
}

.roadIn h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  line-height: 1.3;
  font-weight: 400;
}

.roadStrip .bar {
  position: relative;
  height: 10px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 6px 9px 5px 9px / 9px 5px 9px 6px;
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink));
  background-size: 2px 100%;
  background-repeat: no-repeat;
  background-position: 30% 0, 55% 0, 77% 0;
}

.roadStrip .bar i {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--gold);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

#roadSentence {
  margin: 0.5rem 0 0;
  max-width: none;
}

html:not(.js) .roadIn {
  display: none;
}
