/*
  wall.css : every style for the opening page.

  The page as written here, with no classes on <html>, is the plain page: each scene is an
  ordinary block with its still picture behind its words. wall.js adds "wall-on" to <html> to
  switch the 3D art wall on (tall sections, pinned words, canvas behind), then "wall-ready"
  once the first frame is drawn (the still picture fades away over the live canvas).
*/

@font-face { font-family: "Big Shoulders Display"; src: url(/assets/fonts/big-shoulders-display-900.woff2) format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url(/assets/fonts/unbounded-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/assets/fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --ink: #07010D;
  --cream: #F6E3CB;
  --orange: #F26A2E;
  --crimson: #D7322B;
  --teal: #2BA89A;
  --edge: clamp(16px, 5.2vw, 88px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 500 1.0625rem/1.45 "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;      /* for browsers that do not know "clip" (iPhones before 2022) */
  overflow-x: clip;
}
img, svg { display: block; }
p, h1 { margin: 0; }

/* ------------------------------------------------------------------ the canvas, the grain */

.wall { display: none; }
.wall-on .wall { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; }
.wall-canvas { display: block; width: 100%; height: 100%; }

.grain {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh;
  z-index: 2; pointer-events: none;
  background-repeat: repeat;
}
.grain::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 46%, rgba(7, 1, 13, 0) 52%, rgba(7, 1, 13, .5) 100%);
}

/* ------------------------------------------------------------------ scenes */

.trip { position: relative; }
.scene { position: relative; }
.stick {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; overflow: clip;
  padding: max(22px, env(safe-area-inset-top)) var(--edge) 104vw;
}

/* the still picture of the scene: the whole picture in the plain page, a poster while the wall loads */
.stick::before {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  left: 4%; width: 92%; bottom: 0; aspect-ratio: 4 / 5;
  background: var(--still) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%), linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 14%), linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

/* a scene is travelled over (--screens minus one) screens of scrolling */
#road-in { --screens: 3; --still: url(/assets/opening/still-1-1024.webp); }
#layers { --screens: 6; --still: url(/assets/opening/still-2-1024.webp); }
#doorway { --screens: 3.4; --still: url(/assets/opening/still-3-1024.webp); }

/* a scene with no words (the arrival on the beach) is just its picture on the plain page */
.stick:empty, #doorway .stick { min-height: 0; padding-top: 0; }
/* ... and, on the plain page, our flyer lying on that picture, a little askew (the 3D wall flies it past instead) */
html:not(.wall-on) .doorway-flyer {
  position: absolute; z-index: 2; left: 50%; bottom: 20vw; width: min(44vw, 420px); height: auto;
  transform: translateX(-50%) rotate(-6deg); filter: drop-shadow(0 .5rem .9rem rgba(7, 1, 13, .5));
}

.wall-on .scene { height: calc(var(--screens, 3) * 100vh); }
.wall-on .stick { position: sticky; top: 0; z-index: 3; height: 100vh; height: 100svh; min-height: 0; padding: 0; }
.wall-on .stick::before { transition: opacity .9s ease; }
.wall-ready .stick::before { opacity: 0; }
/* With the wall on, only the first scene keeps its still picture (the poster while the wall loads).
   The others are never seen there, so they are not made and their pictures are never fetched
   (taking the picture's address away is what stops the fetch; "content: none" alone does not). */
.wall-on .scene:not(#road-in) { --still: none; }
.wall-on .scene:not(#road-in) .stick::before { content: none; }

/* ------------------------------------------------------------------ the logo and the event name */

.masthead { position: relative; z-index: 3; container-type: inline-size; max-width: 31rem; }

.logo { width: min(100%, 23rem); height: auto; margin: 0 0 clamp(14px, 2.4vh, 26px) -1.5%; }

.label { margin: 0 0 clamp(8px, 1.3vh, 16px); }
.sticker {
  display: inline-block;
  font: 700 clamp(.62rem, 2.9vw, .78rem)/1.2 "Unbounded", "Arial Black", Arial, sans-serif;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--cream);
  padding: .62em .9em .58em;
  transform: rotate(-2deg);
  box-shadow: 4px 4px 0 var(--crimson);
}

.name {
  font-family: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  font-weight: 900; text-transform: uppercase; letter-spacing: .005em;
  font-size: clamp(2.1rem, 22vw, 10.5rem);
  font-size: max(2.1rem, min(10.5rem, 26cqi, 12.2vh));
  line-height: .86;
}
.name span { display: block; }
.name-a, .name-b, .name-c {
  text-shadow: .013em 0 0 var(--ink), -.013em 0 0 var(--ink), 0 .013em 0 var(--ink), 0 -.013em 0 var(--ink), .06em .06em 0 var(--shadow), .08em .08em 0 var(--ink);
}
.name-a { font-size: .5em; line-height: .95; color: var(--teal); --shadow: var(--crimson); }
.name-b { font-size: 1em; color: var(--orange); --shadow: var(--crimson); }
.name-c { font-size: .8em; line-height: .9; color: var(--cream); --shadow: var(--crimson); }

.stars { display: flex; gap: .16em; font-size: clamp(1.2rem, 3vh, 2rem); margin: clamp(8px, 1.5vh, 18px) 0 0; }
.stars svg { width: 1em; height: 1em; fill: var(--cream); filter: drop-shadow(.11em .11em 0 var(--crimson)); }

/* While the 3D wall is on, the wall itself shows these (the name is lettered on the billboard):
   hidden from sight, still read out by screen readers. */
.wall-on .on-the-wall {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.wall-on .masthead { position: static; max-width: none; container-type: normal; }
.wall-on .stars { display: none; }
/* The logo stands where the 3D logo will be while the wall loads, then hands over to it.
   Same place and size as the piece 'brand' in scenes.js. Upright screens: 90% of the width
   (at most 30% of the height tall), centred, bottom edge 37% down. */
.wall-on .logo {
  position: absolute; z-index: 3; margin: 0; pointer-events: none;
  left: 50vw; width: min(90vw, 50.36vh); width: min(90vw, 50.36lvh); max-width: none;
  bottom: calc(100% - 37vh); bottom: calc(100% - 37lvh);
  transform: translateX(-50%);
  transition: opacity .9s ease;
}
.wall-ready .logo { opacity: 0; }
/* The tagline under the logo. Plain page: centred under the picture. Wall on: it stands under the
   logo picture while the wall loads, exactly where the tagline lettered under the 3D logo will be
   (scenes.js, the sheet on 'logo-sky'), and hands over with it; it stays in the page to be read out. */
.tagline { width: min(100%, 23rem); margin: calc(-1 * clamp(8px, 1.5vh, 16px)) 0 clamp(14px, 2.4vh, 26px) -1.5%; text-align: center; font: 700 clamp(.78rem, 3.85vw, 1.02rem)/1.2 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; color: var(--cream); }
.wall-on .tagline {
  z-index: 3; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; pointer-events: none;
  left: 50vw; top: calc(37vh + min(4.21vw, 2.36vh)); top: calc(37lvh + min(4.21vw, 2.36lvh));
  font-size: min(3.95vw, 2.21vh); font-size: min(3.95vw, 2.21lvh); line-height: 1;
  transform: translateX(-50%); transition: opacity .9s ease;
}
.wall-ready .tagline { opacity: 0; }
@media (min-aspect-ratio: 1/1) {
  .tagline { width: min(86%, 46vh); }
  .wall-on .tagline {
    width: auto; left: 26.5vw; top: calc(54.5vh + min(1.938vw, 3.401vh)); top: calc(54.5lvh + min(1.938vw, 3.401lvh));
    font-size: min(1.731vw, 3.038vh); font-size: min(1.731vw, 3.038lvh);
  }
}

/* ------------------------------------------------------------------ the words */

.words {
  position: relative; z-index: 3; max-width: 31rem;
  will-change: opacity, transform;
}
/* a soft dark shade behind the words, so they read over anything */
.words::before {
  content: ""; position: absolute; z-index: -1; inset: -34% -16% -30% -16%;
  background: radial-gradient(closest-side, rgba(7, 1, 13, .6), rgba(7, 1, 13, .32) 60%, rgba(7, 1, 13, 0));
  pointer-events: none;
}

.intro { max-width: 21em; margin-top: clamp(10px, 1.6vh, 18px); font-size: clamp(1.05rem, 2.25vh, 1.25rem); line-height: 1.36; text-wrap: balance; text-shadow: 0 1px 0 var(--ink), 0 0 12px rgba(7, 1, 13, .8); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .2em 1.7em;
  font: 700 .82rem/1 "Unbounded", "Arial Black", Arial, sans-serif;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--orange);
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--cream);
  transition: transform .15s ease, box-shadow .15s ease;
}
.words .button { margin-top: clamp(12px, 1.9vh, 22px); }
.button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--cream); }
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--cream); }
.button:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; }

/* wall on: words that wait for their moment stay out of sight until the engine brings them in ... */
.wall-on [data-wall-show] { opacity: 0; }
.wall-on:not(.wall-ready) [data-wall-show] { pointer-events: none; }
/* ... and these stand in the open sky above the billboard while the camera reads it */
.wall-on .words {
  position: absolute; left: var(--edge); right: var(--edge); max-width: none;
  bottom: calc(100% - 39vh); bottom: calc(100% - 39lvh);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.wall-on .intro { margin-top: 0; font-size: clamp(1.1rem, 2.5vh, 1.35rem); }

/* the small arrow on the first screen (wall on only), with the word "Scroll" over it: the arrow bobs
   slowly, and both leave when the trip starts. (No transform here: wall.js moves .cue with one.) */
.cue { display: none; }
.wall-on .cue {
  display: flex; flex-direction: column; align-items: center; gap: 7px; position: absolute; z-index: 3; pointer-events: none;
  left: 0; right: 0; margin-inline: auto; width: max-content; bottom: calc(92px + env(safe-area-inset-bottom));
}
.cue-word {
  font: 700 .66rem/1 "Unbounded", "Arial Black", Arial, sans-serif; text-transform: uppercase; letter-spacing: .2em;
  color: var(--cream); padding: .5em .7em .5em .9em; border-radius: 999px; background: rgba(7, 1, 13, .55);
}
.cue-dot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(7, 1, 13, .5); }
.cue svg { width: 22px; height: 22px; fill: none; stroke: var(--cream); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: cue-bob 2.8s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

/* ------------------------------------------------------------------ the facts (scene 2)
   While the 3D wall is on, the facts are lettered on the signs among the ranges and this list is
   hidden from sight (class "on-the-wall"). On the plain page each fact is two or three lines of
   display lettering, set like a poster: every line is sized to a share of the block's width
   (--w), so the big lines fill it and the small ones jump down. --k is the line's font size as
   a share of --w. */

.facts {
  --w: min(74vw, 21rem);
  position: relative; z-index: 3; list-style: none; margin: 0; padding: 0; width: var(--w);
  display: grid; gap: calc(var(--w) * .13);
}
.fact {
  position: relative;
  font-family: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  font-weight: 900; text-transform: uppercase; letter-spacing: .005em; white-space: nowrap;
  will-change: opacity, transform;
}
.fact span {
  display: block; font-size: calc(var(--w) * var(--k)); line-height: .88; color: var(--cream); --shadow: var(--crimson);
  text-shadow: .013em 0 0 var(--ink), -.013em 0 0 var(--ink), 0 .013em 0 var(--ink), 0 -.013em 0 var(--ink), .06em .06em 0 var(--shadow), .08em .08em 0 var(--ink);
}
.fact-days .line-1 { --k: .15; }
.fact-days .line-2 { --k: .09; line-height: 1.02; color: var(--teal); --shadow: var(--ink); }
.fact-days .line-3 { --k: .177; color: var(--orange); --shadow: var(--ink); }
.fact-doors .line-1 { --k: .19; line-height: .95; color: var(--teal); --shadow: var(--ink); }
.fact-doors .line-2 { --k: .3; }
.fact-play .line-1 { --k: .42; line-height: .84; color: var(--orange); --shadow: var(--ink); }
.fact-play .line-2 { --k: .217; }
.fact-age .line-1 { --k: .43; line-height: .86; }
.fact-age .line-2 { --k: .232; color: var(--teal); --shadow: var(--ink); }
.fact-place .line-1 { --k: .171; }
.fact-place .line-2 { --k: .182; line-height: .95; color: var(--orange); --shadow: var(--ink); }

.banner { position: relative; z-index: 3; margin: calc(var(--edge) * .6 + 18px) 0 0; will-change: opacity, transform; }
.banner .sticker { font-size: clamp(.95rem, 5.2vw, 1.5rem); line-height: 1.25; max-width: min(100%, 15em); text-wrap: balance; padding: .7em 1em .64em; }

/* ------------------------------------------------------------------ booking (empty for now) */

.book { position: relative; min-height: 22vh; }
.wall-on .book { min-height: 100vh; }
.book:focus { outline: none; }

/* (The menu button fixed at the bottom of the screen has its own stylesheet, wall-menu.css.) */

/* ------------------------------------------------------------------ wide screens: words left, art right */

@media (min-aspect-ratio: 1/1) {
  .stick { padding: clamp(18px, 4.5vh, 48px) var(--edge) 13vh; }
  .stick::before {
    left: calc(68vw - 40vh); width: 80vh; top: 0; bottom: auto; height: 100%; aspect-ratio: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
    -webkit-mask-composite: source-over; mask-composite: add;
  }
  .stick:empty, #doorway .stick { min-height: 86vh; padding-top: 0; }
  html:not(.wall-on) .doorway-flyer { left: 68vw; bottom: 16vh; width: 36vh; }
  .masthead, .words { max-width: min(35rem, 40vw); }
  .facts { --w: min(34vw, 24rem, 50vh); }
  .banner .sticker { font-size: clamp(1.05rem, 4vh, 2.3rem); max-width: none; }
  .logo { width: min(86%, 46vh); }
  .name { font-size: clamp(2.1rem, 9vw, 10.5rem); font-size: max(2.1rem, min(10.5rem, 26cqi, 13vh)); }
  .sticker { font-size: clamp(.6rem, 1.5vh, .8rem); }
  .intro { max-width: none; }

  /* wall on: the logo fills the open sky on the left (44% of the width, at most 46% of the height
     tall, centred 26.5% across, bottom edge 54.5% down) ... */
  .wall-on .logo { left: 26.5vw; width: min(44vw, 77.22vh); width: min(44vw, 77.22lvh); bottom: calc(100% - 54.5vh); bottom: calc(100% - 54.5lvh); }
  /* ... and the words stand in the open sky to the right of the billboard */
  .wall-on .words {
    left: 71.5vw; right: var(--edge); width: auto; max-width: 27rem;
    top: 23vh; top: 23lvh; bottom: auto;
    align-items: flex-start; text-align: left;
  }
  .wall-on .intro { font-size: clamp(1.15rem, 2.6vh, 1.5rem); line-height: 1.32; }
  .words::before { inset: -28% -22% -28% -26%; }

  .wall-on .cue { bottom: max(26px, env(safe-area-inset-bottom)); }
  .cue-word { font-size: .76rem; }
}
@media (min-width: 900px), (min-height: 900px) {
  #road-in { --still: url(/assets/opening/still-1-1600.webp); }
  #layers { --still: url(/assets/opening/still-2-1600.webp); }
  #doorway { --still: url(/assets/opening/still-3-1600.webp); }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .cue svg { animation: none; }
}
