/* wall-end.css : styles for find the spot, the sign-up and the last lines. Loaded after wall.css.

   As in wall.css, what is written first is the plain page (no 3D wall): the heading and the
   address as display lettering, the four links as plates, the sign-up as a postcard, then the
   last lines. The ".wall-on" rules further down place the links between the posts of the
   highway sign and the postcard beside the mailbox, at the moments the camera stops there. */

#find { --screens: 3.3; --still: url(/assets/opening/still-7-1024.webp); }
#signup { --screens: 3.3; --still: none; }

/* ------------------------------------------------------------------ find the spot */

.end-spot { position: relative; z-index: 3; max-width: 31rem; }
.end-h, .end-address {
  margin: 0;
  font-family: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  font-weight: 900; text-transform: uppercase; letter-spacing: .005em;
  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);
}
.end-h { font-size: clamp(2.6rem, 17vw, 5.4rem); line-height: .9; color: var(--orange); --shadow: var(--crimson); text-wrap: balance; }
.end-address { margin-top: .32em; font-size: clamp(1.5rem, 9.6vw, 3.05rem); line-height: .96; color: var(--cream); --shadow: var(--crimson); }
.end-address span { display: block; }
.end-address span + span { color: var(--teal); }

/* the four links: plates, like the small ones bolted under a highway sign */
.end-plates {
  position: relative; z-index: 3; list-style: none; margin: clamp(18px, 3vh, 30px) 0 0; padding: 0;
  display: grid; gap: 8px; max-width: 22rem;
  will-change: opacity, transform;
}
.end-plate {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 48px; padding: .3em 1.6em;
  /* never larger than the plate can hold on one line, also when the browser's text size is doubled */
  font: 600 1.04rem/1.15 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; font-size: min(1.04rem, 4.6vw); letter-spacing: .01em;
  overflow-wrap: anywhere;
  color: var(--cream); text-decoration: none; text-align: center;
  background: #0D5E4C linear-gradient(178deg, rgba(255, 255, 255, .07), rgba(7, 1, 13, .16));
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px #0D5E4C, inset 0 0 0 4px rgba(246, 227, 203, .88), 3px 4px 0 rgba(7, 1, 13, .6);
  transition: transform .15s ease, box-shadow .15s ease;
}
/* a bolt at each end */
.end-plate::before, .end-plate::after {
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e9e2cf, #8d8873 70%);
  box-shadow: 0 1px 0 rgba(7, 1, 13, .55);
}
.end-plate::before { left: 12px; }
.end-plate::after { right: 12px; }
.end-plate-go {
  font: 700 .84rem/1 "Unbounded", "Arial Black", Arial, sans-serif; font-size: min(.84rem, 3.8vw); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--orange) linear-gradient(178deg, rgba(255, 255, 255, .12), rgba(7, 1, 13, .08));
  box-shadow: inset 0 0 0 2px var(--orange), inset 0 0 0 4px rgba(7, 1, 13, .82), 3px 4px 0 rgba(7, 1, 13, .6);
}
.end-plate:hover { transform: translate(-1px, -1px); }
.end-plate:active { transform: translate(2px, 2px); }
.end-plate:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

/* ------------------------------------------------------------------ the sign-up: a postcard */

.end-list-h { position: relative; z-index: 3; max-width: 6.2em; font-size: clamp(2.3rem, 13.4vw, 4.4rem); color: var(--cream); }

.end-post { position: relative; z-index: 3; max-width: 24rem; margin-top: clamp(18px, 3vh, 30px); will-change: opacity, transform; }
.end-card {
  position: relative; margin: 0; padding: 15px 17px 12px;
  color: #3B1A5E;
  background: #F1DEBD linear-gradient(170deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 38%, rgba(160, 110, 50, .14));
  border-radius: 3px;
  box-shadow: 5px 6px 0 rgba(7, 1, 13, .55);
  transform: rotate(-1.3deg);
}
/* the printed frame of the card */
.end-card::before { content: ""; position: absolute; inset: 5px; border: 1.5px solid rgba(59, 26, 94, .3); border-radius: 2px; pointer-events: none; }
/* its stamp: a star, printed a little out of register */
.end-stamp {
  position: absolute; top: 12px; right: 13px; width: 40px; height: 46px;
  display: grid; place-items: center;
  background: #2FA89B; border: 3px dotted #F1DEBD;
  transform: rotate(3deg);
}
.end-stamp svg { width: 21px; height: 21px; fill: #FF3D8E; filter: drop-shadow(2px 1.5px 0 #3B1A5E); }
.end-note { max-width: calc(100% - 52px); font: 600 .93rem/1.28 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; text-wrap: balance; }
.end-label { display: block; margin-top: 11px; font: 700 .64rem/1.2 "Unbounded", "Arial Black", Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.end-row { position: relative; display: flex; gap: 9px; margin-top: 6px; }
.end-input {
  flex: 1 1 auto; min-width: 0; height: 50px; margin: 0; padding: 0 12px;
  font: 600 1.05rem/1 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; color: #2A1147;
  background: rgba(255, 252, 244, .72); border: 2px solid #3B1A5E; border-radius: 4px;
  -webkit-appearance: none; appearance: none;
}
.end-input:focus-visible { outline: 3px solid #FF3D8E; outline-offset: 2px; }
.end-send {
  flex: 0 0 auto; min-height: 50px; margin: 0 3px 3px 0; padding: 0 1.25em;
  font: 700 .78rem/1 "Unbounded", "Arial Black", Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #F6E3CB; background: #3B1A5E; border: 0; border-radius: 4px;
  box-shadow: 3px 3px 0 #FF3D8E; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.end-send:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #FF3D8E; }
.end-send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #FF3D8E; }
.end-send:focus-visible { outline: 3px solid #FF3D8E; outline-offset: 3px; }
.end-status { min-height: 1.3em; margin-top: 8px; font: 600 .86rem/1.3 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; }
.end-status[data-state="error"] { color: #9C1318; font-weight: 700; }
.end-status[data-state="error"]::before { content: "\26A0\FE0E\00a0"; content: "\26A0\FE0E\00a0" / ""; }
/* while the address is on its way the button rests */
.end-card[aria-busy="true"] .end-send { opacity: .6; cursor: progress; transform: translate(2px, 2px); box-shadow: 1px 1px 0 #FF3D8E; }
/* the field no person should fill in: kept off the screen */
.end-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* The tagline. While the 3D wall is on it is lettered under the logo that returns in the sky at the
   end (scenes-end.js) and this line is hidden from sight (class "on-the-wall"); on the plain page it
   closes the sign-up, small and cream, as under the logo at the top. */
.end-tagline {
  position: relative; z-index: 3; max-width: 24rem; margin: clamp(26px, 5vh, 44px) 0 0;
  font: 700 clamp(.78rem, 3.85vw, 1.02rem)/1.2 "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  text-align: center; color: var(--cream);
}

/* the sign-up has no picture of its own on the plain page: it follows straight on from "find the spot" */
html:not(.wall-on) #signup .stick { min-height: 0; padding-top: 6px; padding-bottom: clamp(28px, 6vh, 56px); }
html:not(.wall-on) #signup .stick::before { display: none; }

/* ------------------------------------------------------------------ the last lines */

.end-foot {
  position: relative; z-index: 4;
  padding: 30px var(--edge) calc(112px + env(safe-area-inset-bottom));
  font: 500 .8rem/1.5 "Space Grotesk", "Helvetica Neue", Arial, sans-serif; text-align: center;
  color: rgba(246, 227, 203, .88);
}
.end-foot p { margin: 0; }
.end-legal { margin-top: 2px; }
.end-legal a { display: inline-block; padding: 13px 10px; margin: -6px 0; color: var(--cream); font-weight: 700; text-underline-offset: 3px; }
.end-legal a:focus-visible { outline: 3px solid var(--cream); outline-offset: -4px; }
.end-legal span { display: block; text-wrap: balance; }

/* ------------------------------------------------------------------ the 3D wall is on */

/* The links hang between the posts of the highway sign while the camera reads it.
   --end-sign is how wide the sign stands on the screen at that moment (scenes-end.js: the pace
   stops of 'end-sign'); the lens holds the middle of its panel 27% down the screen, and the
   panel's lower edge is a fifth of the sign's width below that. */
.wall-on .end-plates {
  --end-sign: min(102vw, 83vh);
  position: absolute; margin: 0; max-width: none;
  left: calc(50% - var(--end-sign) * .43); width: calc(var(--end-sign) * .86);
  top: calc(27vh + var(--end-sign) * .207);
}
/* The postcard stands under the tag and the mailbox, clear of the bookstrip. */
.wall-on .end-post {
  position: absolute; margin: 0 auto; max-width: none;
  left: 0; right: 0; width: min(92vw, 23.5rem);
  bottom: calc(102px + env(safe-area-inset-bottom));
}
/* Short upright screens (a phone browser with its own strips showing: 664 px on an iPhone, less on a
   small one): the card is compact and sits lower, so the whole tag stays clear above it. The
   menu button (52 px, 12 px up) keeps its room underneath. */
@media (max-aspect-ratio: 1/1) and (max-height: 760px) {
  .wall-on .end-post { --end-card: 138px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .wall-on .end-card { padding: 10px 14px 8px; }
  .wall-on .end-note { font-size: .84rem; }
  .wall-on .end-label { margin-top: 7px; }
  .wall-on .end-input, .wall-on .end-send { height: 46px; min-height: 46px; }
  .wall-on .end-stamp { transform: rotate(3deg) scale(.8); transform-origin: top right; }
  .wall-on .end-status:empty { min-height: 0; margin-top: 0; }
}
/* Upright screens, where the browser knows the large screen height (lvh, which the picture is drawn
   to): the card hangs straight under the tag, whether the browser's own strips show or not. The lens holds the
   tag's middle 34% down the screen and the tag is at most 85.4% of the width or 39% of the height
   tall (scenes-end.js, the stops on 'end-tag'). It never comes lower than just above the menu
   button (--end-card is about how tall the card is). */
@supports (height: 1lvh) {
  @media (max-aspect-ratio: 1/1) {
    .wall-on .end-post {
      bottom: auto;
      top: min(calc(34lvh + min(42.7vw, 19.5lvh) + 14px), calc(100svh - 76px - max(12px, env(safe-area-inset-bottom)) - var(--end-card, 184px)));
    }
  }
}
/* the last lines lie over the foot of the picture */
.wall-on .end-foot {
  margin-top: -1px;
  background: linear-gradient(to top, rgba(7, 1, 13, .86), rgba(7, 1, 13, .6) 55%, rgba(7, 1, 13, 0));
  padding-top: 64px;
  text-shadow: 0 1px 0 var(--ink), 0 0 10px rgba(7, 1, 13, .8);
}
@supports (height: 1lvh) {
  .wall-on .end-plates { --end-sign: min(102vw, 83lvh); top: calc(27lvh + var(--end-sign) * .207); }
}

/* ------------------------------------------------------------------ wide screens */

@media (min-aspect-ratio: 1/1) {
  .end-h { font-size: clamp(2.6rem, 8vw, 6rem); font-size: max(2.6rem, min(6rem, 8vw, 15vh)); }
  .end-address { font-size: max(1.5rem, min(3.4rem, 4.5vw, 8.5vh)); }
  .end-list-h { font-size: max(2.3rem, min(4.6rem, 6.4vw, 12vh)); }
  .end-foot { text-align: left; font-size: .84rem; padding: 26px calc(var(--edge) + 17rem) max(26px, env(safe-area-inset-bottom)) var(--edge); }
  .end-legal a { margin: -6px 6px -6px -10px; }
  .end-legal span { display: inline; }

  .wall-on .end-plates { --end-sign: min(48vw, 104vh); top: calc(28vh + var(--end-sign) * .207); }
  /* the card leans on the mailbox post, in its flowers. The lens holds the tag's middle 27% across
     and halfway down; --end-unit is one unit of the scene on the screen there (the tag is 3 tall and
     at most 12.5% of the width or 46% of the height: scenes-end.js); the post stands 1.15 units
     right of the tag's middle. */
  .wall-on .end-post {
    --end-unit: min(9.62vw, 15.34vh);
    left: calc(27vw + var(--end-unit) * 1.32); right: auto; margin: 0; width: min(30rem, 39vw);
    top: calc(50% + var(--end-unit) * .62); bottom: auto;
  }
  .wall-on .end-card { padding: 19px 22px 15px; }
  .wall-on .end-note { font-size: 1.02rem; }
  .wall-on .end-input, .wall-on .end-send { height: 54px; min-height: 54px; }
  .wall-on .end-card { transform: translateY(-50%) rotate(-1.3deg); }
  .wall-on .end-foot { padding-top: 54px; }
}
@supports (height: 1lvh) {
  @media (min-aspect-ratio: 1/1) {
    .wall-on .end-plates { --end-sign: min(48vw, 104lvh); top: calc(28lvh + var(--end-sign) * .207); }
  }
}
/* wide but low (a phone on its side): the plates go two by two */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .wall-on .end-plates { grid-template-columns: 1fr 1fr; }
  .end-plate { font-size: .92rem; padding: .3em 1.5em; }
}

@media (min-width: 900px), (min-height: 900px) {
  #find { --still: url(/assets/opening/still-7-1600.webp); }
}

@media (prefers-reduced-motion: reduce) {
  .end-plate, .end-send { transition: none; }
}
