/* Sugoi Station — arriving soon.
   One page, two colors: a very dark blue and the off-white from the logo file. */

:root {
  --night: #06172b;   /* background; also set in the theme-color meta tag and favicon.svg */
  --ink: #fcf7f2;     /* off-white; the logo SVGs have this color built in */
  --orange: #ff8503;  /* the orange from the logo file (option C, "Amber #1"); used for the date only */

  /* The arrival, in order. Change the lengths here. */
  --arrive: 3.6s;       /* the name rolls in from the left and slows to a stop */
  --tagline-at: 3.9s;   /* "California Izakaya" starts to fade in */
  --details-at: 5.3s;   /* the capybara, "Arriving soon…" and the sound button start to fade in */
  --fade: 1.2s;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: "Readex Pro", "Avenir Next", "Century Gothic", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vh, 60px);
  padding: 48px 24px;
  text-align: center;
  overflow: hidden;   /* the name starts off-screen; no sideways scrollbar */
  position: relative;
}

/* Play button: the only thing on the page until it is pressed. */

.play {
  position: absolute;
  z-index: 2;   /* above the still-invisible logo and text, which would otherwise swallow clicks in the middle */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s, background 0.15s ease, color 0.15s ease;
}

.js .play { display: grid; }

.play:hover { background: var(--ink); color: var(--night); }
.play:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }

.is-playing .play { opacity: 0; visibility: hidden; pointer-events: none; }

/* Until play is pressed, everything else waits at its starting point. */
.js:not(.is-playing) .wordmark,
.js:not(.is-playing) .tagline,
.js:not(.is-playing) .soon,
.js:not(.is-playing) .capy,
.js:not(.is-playing) .controls { animation-play-state: paused; }

/* Logo. Sizes and spacing follow the designer's file, as shares of the name's width:
   the capybara is 20.33% wide and sits 5.03% above the name;
   the tagline is 83.05% wide and sits 5.17% below it. */

.logo,
.logo h1 {
  margin: 0;
  width: min(100%, 680px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo h1 { width: 100%; }

/* The capybara is a button: clicking it replays the arrival. */
.capy {
  width: 20.33%;
  margin: 0 0 5.03%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: appear var(--fade) ease-out var(--details-at) both;
}

.capy img { width: 100%; }
.capy:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 8px; }

/* Fades in, and cannot be clicked or tabbed to until it does. */
@keyframes appear {
  from { opacity: 0; visibility: hidden; }
  to   { opacity: 1; visibility: visible; }
}

.logo img { display: block; height: auto; }
.wordmark { width: 100%; }
.tagline { width: 83.05%; margin-top: 5.17%; }

/* The name arrives like a train: already moving as it enters, slowing steadily to a stop. */
.wordmark { animation: arrive var(--arrive) cubic-bezier(0.215, 0.61, 0.355, 1) both; }

@keyframes arrive {
  from { transform: translateX(-100vw); }
  to   { transform: translateX(0); }
}

.tagline { animation: fade-in var(--fade) ease-out var(--tagline-at) both; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.soon {
  margin: 0;
  /* padding-left balances the trailing letter-space so the lines sit truly centered */
  padding-left: 0.26em;
  font-size: clamp(0.7rem, 3vw, 1rem);
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  animation: fade-in-soft var(--fade) ease-out var(--details-at) both;
}

@keyframes fade-in-soft {
  from { opacity: 0; }
  to   { opacity: 0.85; }
}

.soon .date { color: var(--orange); font-weight: 500; }   /* a touch heavier: orange reads thinner than off-white at this size */

/* The credit line, set like a film credit: a quiet lower-case lead-in,
   then the name in the same spaced capitals as the lines above, a size down. */
.soon .byline {
  display: block;
  margin-top: 0.9em;
  font-size: 0.82em;
}

.soon .byline .lead-in {
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.75;
}

/* The name never breaks in the middle; on a narrow screen it drops to its own line. */
.soon .byline a { color: inherit; text-decoration: none; white-space: nowrap; margin-left: 0.5em; }
.soon .byline a:hover,
.soon .byline a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* Sound button */

.controls { animation: appear var(--fade) ease-out var(--details-at) both; }

.sound {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: rgba(252, 247, 242, 0.6);   /* the off-white, held back until hovered or switched on */
  cursor: pointer;
  transition: color 0.15s ease;
}

.sound:hover,
.sound.is-on { color: var(--ink); }

.sound:focus-visible { color: var(--ink); outline: 2px solid var(--ink); outline-offset: 4px; }

.sound .sound-on { display: none; }
.sound.is-on .sound-on { display: inline; }
.sound.is-on .sound-off { display: none; }

/* Replay: the page fades out, then the arrival starts again from the beginning. */
.is-leaving main { opacity: 0; transition: opacity 0.4s ease; }

.is-resetting .wordmark,
.is-resetting .tagline,
.is-resetting .soon,
.is-resetting .capy,
.is-resetting .controls { animation: none; }

/* Visitors who ask their device for less motion get the finished page without the arrival. */
@media (prefers-reduced-motion: reduce) {
  .wordmark, .tagline, .soon, .capy, .controls { animation-duration: 0.01s; animation-delay: 0s; }
}
