/* ════════════════════════════════════════════════════════════
   DIZKO - go.dizko.app
   One screen, no scroll. Recreates the in-app hero: "What's the
   plan? / Dizkover <event type> in <city>", then sign up.
   palette: cream #F4F2EA · volt #C4F236 · night #0B0C07
   ════════════════════════════════════════════════════════════ */

:root {
  --cream: #F4F2EA;
  --volt: #C4F236;
  --night: #0B0C07;
  --ink: #16170F;

  --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Wheel geometry, in em of the headline. The clip box has to sit lower
     than the baseline or descenders (the p in "exhibits", the y in
     "comedy") get sheared off flat. */
  --descender: 0.22em;
  --word-box: 1.14em;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Nothing scrolls. This is one screen. */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--night);
  color: var(--cream);
  font-family: "Instrument Sans Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, select):focus-visible {
  outline: 3px solid var(--volt);
  outline-offset: 4px;
  border-radius: 999px;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--volt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(calc(-100% - 24px));
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* ─── splash ───────────────────────────────────────────────
   Full-bleed brand plate that leaves by hard cut, never a fade.
   JS owns the timing; CSS only owns what it looks like.        */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 44px;
  background: var(--volt);
}
.splash[hidden] { display: none; }

.splash__mark { width: clamp(96px, 26vw, 150px); }

.splash__spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(22, 23, 15, 0.2);
  border-top-color: var(--ink);
  border-radius: 50%;
  opacity: 0;
  animation: spin 700ms linear infinite;
}
.splash__spinner.is-on { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── hero ─── */
.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--pad) + 54px) var(--pad) calc(var(--pad) + 26px);
}

.hero__frames { position: absolute; inset: 0; }

/* Long enough to feel tied to the word roll, short enough that two
   photographs are never both half visible for long. */
.frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
.frame.is-on { opacity: 1; }
.frame img {
  width: 100%; height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: 50% 34%;
}

.hero__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(115% 80% at 50% 52%, rgba(11, 12, 7, 0.52) 0%, rgba(11, 12, 7, 0.8) 100%),
    linear-gradient(180deg, rgba(11, 12, 7, 0.78) 0%, rgba(11, 12, 7, 0.42) 30%, rgba(11, 12, 7, 0.5) 62%, rgba(11, 12, 7, 0.88) 100%);
}

.hero__mark {
  position: absolute;
  top: max(var(--pad), env(safe-area-inset-top));
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-family: "Anton", sans-serif;
  font-size: clamp(19px, 2.2vw, 26px);
  letter-spacing: 0.06em;
  color: var(--cream);
}
.hero__mark img { width: clamp(24px, 2.6vw, 32px); }
.hero__mark:hover { opacity: 0.82; }

/* Top right, and quiet. A returning visitor is looking for this, so it has
   to be present and legible; everyone else is here for the pills, so it
   must not read as a third choice competing with them. */
.hero__corner {
  position: absolute;
  top: max(var(--pad), env(safe-area-inset-top));
  right: var(--pad);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__account {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* The one control on the page that has to survive being unreadable: a
   visitor who does not speak the language it is written in still has to
   find it. Hence a bordered box rather than the bare text the account
   links use, and a code rather than a word. */
.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(244, 242, 234, 0.42);
  border-radius: 999px;
  background: transparent;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(244, 242, 234, 0.9);
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

/* 32px of box, 44px of tap target. The corner has to stay light, and a
   44px tall pill next to 12px text reads as a button competing with the
   two the page is actually selling. */
.lang-toggle::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
}

.lang-toggle:hover { color: var(--volt); border-color: var(--volt); }
.lang-toggle:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; }

/* display:inline-flex is an author rule and beats the UA's
   [hidden] { display: none }. Same trap as .btn[hidden] below. */
.lang-toggle[hidden] { display: none; }

.account-link {
  display: inline-flex;
  align-items: center;
  /* 44px of tap target, achieved with padding rather than a box, so the
     two links stay text and the corner stays empty-looking. */
  min-height: 44px;
  padding: 0 10px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 242, 234, 0.9);
  white-space: nowrap;
  transition: color 140ms ease;
}
.account-link:hover { color: var(--volt); }

/* A centred wordmark and a right-hand nav collide well before the phone
   breakpoint, so the wordmark takes the left corner instead. The corner
   now holds one link rather than two, which is what retired the rule that
   used to drop the second one at 320px in Spanish and French. */
@media (max-width: 700px) {
  .hero__mark { left: var(--pad); transform: none; }
  .hero__corner { gap: 6px; }
  .lang-toggle { min-height: 30px; padding: 0 9px; font-size: 11px; }
  .account-link { font-size: 11px; padding: 0 8px; }
}

.hero__stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 82rem;
  text-align: center;
}

.hero__question {
  margin-bottom: clamp(10px, 1.6vh, 26px);
  font-size: clamp(2.5rem, 6.5vw, 7rem);
  font-weight: 750;
  line-height: 0.86;
  letter-spacing: -0.055em;
  /* Full strength. Size already says which line leads; dimming the larger
     one as well made the two signals argue, and left the headline looking
     like it had failed to load. */
  color: var(--cream);
}

.hero__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.14em 0.22em;
  /* Sized so the longest pairing, "nightlife" with "San Francisco", still
     holds one line on a desktop. A line that wraps only for some words
     would bounce the buttons every time the wheel turned. */
  font-size: clamp(2rem, 4.6vw, 4.6rem);
  font-weight: 750;
  line-height: 0.88;
  letter-spacing: -0.055em;
  color: var(--cream);
}

/* Below the desktop breakpoint the line always breaks in the same place,
   so the stack height never depends on which word is showing. */
.hero__break { flex-basis: 100%; height: 0; }

/* ─── word wheels ─────────────────────────────────────────────
   The slot is measured, not fixed. A fixed em slot is what clips
   a word the moment it renders wider than the author assumed
   (a fallback face, a longer word), and it leaves a crater of
   empty space around the short ones. Width animates to the real
   measured width, so the line stays optically centred and no
   glyph is ever cut. */
.wheel {
  position: relative;
  display: inline-block;
  flex: none;
  top: calc(0.085em + var(--descender));
  height: calc(var(--word-box) + var(--descender));
  width: 0;
  /* Masks vertically for the roll but never horizontally. overflow:hidden
     would shear a long word for as long as the slot is still widening
     under it, which is the artefact this whole wheel exists to avoid. */
  clip-path: inset(0 -50vw);
  transition: width 620ms var(--ease);
}

.wheel__cell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--descender);
  white-space: nowrap;
}

.wheel__cell.is-next { opacity: 0; }

/* The roll: current leaves upward, next arrives from below. */
.wheel.is-turning .wheel__cell.is-current { animation: wheel-exit 620ms var(--ease) forwards; }
.wheel.is-turning .wheel__cell.is-next { animation: wheel-enter 620ms var(--ease) forwards; }

@keyframes wheel-exit {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-88%); opacity: 0; }
}
@keyframes wheel-enter {
  from { transform: translateY(88%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── city picker ─────────────────────────────────────────────
   The city used to be a second wheel. It is a native select now:
   IP geo preselects it and one tap corrects a wrong guess, with
   the OS picker doing the heavy lifting on phones. Dressed as the
   wheel was: volt, underlined, the headline's own face. */
.city-picker {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  border-bottom: 0.055em solid var(--volt);
}

.city-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: var(--volt);
  padding: 0 0.62em 0.06em 0;
  cursor: pointer;
  transition: width 620ms var(--ease);
}
.city-select option { color: var(--ink); background: var(--cream); font-size: 18px; }

.city-picker__chevron {
  position: absolute;
  right: 0.02em;
  bottom: 0.16em;
  font-size: 0.34em;
  color: var(--volt);
  pointer-events: none;
}

/* Offscreen ruler used to measure a word before it is shown. */
.wheel-ruler {
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
  top: -9999px;
  left: -9999px;
}

/* Equal pills without a magic number: 1fr auto-columns resolve to the
   widest label's max-content, so both pills take the size of the longest
   of them whatever the language says. "Explore Dizko Online" is far wider
   than "iOS App", and the promoted web door has to match Telegram's
   width too, which no hand-picked min-width survives across seven
   languages. Rows on a phone, where a pair would not fit anyway. */
.hero__actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(20px, 3.6vh, 44px);
}

@media (max-width: 700px) {
  .hero__actions { grid-auto-flow: row; justify-items: center; }
}

/* display:inline-flex is an author rule and beats the UA's
   [hidden] { display: none }, so without this the Telegram door stayed on
   screen for every city and pointed a Tokyo visitor at the Berlin bot. */
.btn[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(54px, 5.4vh, 62px);
  /* Both pills land on the min-width rather than on their own label, so
     the pair is symmetrical. That only holds while the padding leaves the
     longest label inside the min: keep it well clear, and nowrap so a tight
     fit breaks the line visibly here rather than silently in production. */
  min-width: clamp(184px, 17vw, 232px);
  padding: 0 22px;
  white-space: nowrap;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(0.985); }

.btn--primary { background: var(--volt); color: var(--ink); }
.btn--primary:hover { background: #D2FF4E; }

/* The no-install door. Backfilled just enough to stay legible over the
   brightest photographs without going frosted. */
.btn--ghost {
  background: rgba(11, 12, 7, 0.34);
  color: var(--cream);
  border: 1.5px solid rgba(244, 242, 234, 0.44);
}
.btn--ghost:hover { border-color: var(--volt); color: var(--volt); }

/* The quieter doors, on their own line. Set in the page's tertiary voice,
   the same mono the flyer strip labels use, so they are legibly a different
   tier from the pills instead of a smaller copy of them. Still 44px tall,
   which is the tap target floor, not a decoration. */
.hero__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 28px;
  margin-top: clamp(4px, 0.8vh, 10px);
}

.btn--quiet {
  min-height: 44px;
  min-width: 0;
  padding: 0 2px;
  background: none;
  border: none;
  font-family: "Space Mono", ui-monospace, monospace;
  /* Measured over the real scrim, 11px at 66% cleared AA on paper and was
     still hard to read: at this size a thin mono face with wide tracking
     loses its word shapes against a photograph long before the contrast
     ratio says so. The tier is carried by the face, the case and the size,
     never by dimming, so the colour goes back up near full cream. */
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 242, 234, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(244, 242, 234, 0.5);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.btn--quiet:hover { color: var(--volt); text-decoration-color: var(--volt); }

/* Last in the stack, and quieter than the links above it by size and face
   rather than by fading it into the photograph. */
.hero__legal {
  margin-top: clamp(10px, 1.6vh, 18px);
  font-size: clamp(12px, 1.1vw, 13px);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(244, 242, 234, 0.75);
}

/* ─── this week: live flyers along the bottom edge ──────────
   Proof over promise: real events from the database, sitting in
   the darkest band of the scrim. Hidden until the fetch lands;
   the hero re-centres itself above it via the padding rule below. */
.hero { transition: padding-bottom 420ms var(--ease); }

.tonight {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(calc(var(--pad) * 0.75), env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease);
}
.tonight[hidden] { display: none; }
.tonight.is-on { opacity: 1; pointer-events: auto; }

.tonight__label {
  padding: 0 var(--pad);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 242, 234, 0.85);
}

.tonight__row {
  display: flex;
  gap: 10px;
  padding: 0 var(--pad) 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tonight__row::-webkit-scrollbar { display: none; }

.card-flyer { flex: none; width: clamp(88px, 9vw, 110px); }
.card-flyer:focus-visible { border-radius: 10px; }
.card-flyer img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(244, 242, 234, 0.16);
  background: rgba(244, 242, 234, 0.06);
}
.card-flyer__meta {
  display: block;
  margin-top: 6px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 242, 234, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The strip only exists on screens tall enough to hold it below the
   stack. Anything shorter keeps the page exactly as it was.

   The floor is measured, not guessed: on the live page with real cards,
   the stack plus the 200px strip band fits from 660px of height at 360px
   wide and up, and needs 720px on a 320px screen, where German and
   Japanese wrap the hero line onto an extra row and eat the difference.
   The old flat 760px was a hundred pixels too conservative and landed
   squarely on the one case that matters most: an iPhone in Safari shows
   about 750px once the browser chrome is counted, so the strip was hidden
   from nearly every phone the ads pay for.

   The two queries below are exact complements. Change one and you must
   change the other, and the JS gate in loadWeek() that mirrors them, or
   the page reserves a band it never fills. */
@media (min-width: 360px) and (min-height: 660px), (min-height: 720px) {
  body.has-tonight .hero { padding-bottom: 200px; }
}
@media (max-height: 659px), (max-width: 359px) and (max-height: 719px) {
  .tonight { display: none; }
}

@media (min-width: 900px) {
  .tonight__label { text-align: center; }
  .tonight__row { justify-content: center; }
}

@media (min-width: 900px) {
  .hero__break { display: none; }
}

/* ─── Japanese word order ─────────────────────────────────────
   「東京の テクノを Dizkover」: city, の, then the word with its を
   folded in, then the brand as the trailing verb. Same DOM,
   reordered by flex; the mobile break lands before the brand word. Instrument Sans has no kana,
   so hand the CJK glyphs to a real Japanese face at the same
   weight instead of whatever sans-serif falls out of the stack. */
html[lang="ja"] body {
  font-family: "Instrument Sans Variable", "Hiragino Sans", "Noto Sans JP", "Helvetica Neue", sans-serif;
}
html[lang="ja"] .hero__line { gap: 0.08em 0.14em; }
html[lang="ja"] .hero__line .city-picker { order: 1; }
html[lang="ja"] .hero__line #heroIn { order: 2; }
html[lang="ja"] .hero__line #wordWheel { order: 3; }
html[lang="ja"] .hero__line .hero__break { order: 4; }
html[lang="ja"] .hero__line #heroBrand { order: 5; }

/* On a short landscape window the headline is what has to give. */
@media (max-height: 560px) {
  .hero__question { font-size: clamp(1.9rem, 5vw, 3rem); }
  .hero__line { font-size: clamp(1.7rem, 4.4vw, 2.8rem); }
  .btn { min-height: 48px; }
}

/* ─── reduced motion: no splash, no roll, no photo change ─── */
@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
  .splash__spinner { animation: none; }
  .frame { transition: none; }
  .wheel { transition: none; }
  .wheel.is-turning .wheel__cell.is-current,
  .wheel.is-turning .wheel__cell.is-next { animation: none; }
  .btn, .skip-link { transition: none; }
  .hero, .tonight, .city-select { transition: none; }
}
