/* CAROÜSEL
   One screen, nothing scrolls. The night on top, the floor below, the dancer standing on the line between them.
   Three colours only. Type: ITC Avant Garde Gothic Medium, one size, sentence case, the button in Title Case. */

@font-face {
  font-family: "ITC Avant Garde Gothic";
  src: url("fonts/AvantGarde-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --carousel: #960446;
  --night: #0a0a0a;
  --light: #ededed;
  --type: "ITC Avant Garde Gothic", "TeX Gyre Adventor", "URW Gothic", "Century Gothic", "Avenir Next", sans-serif;
  --size: clamp(13px, 11px + 0.5vw, 17px);
  --gutter: clamp(20px, 4.4vw, 56px);
  --h: 1vh;                         /* one hundredth of the visible screen height */
  --logo-max: calc(var(--h) * 162); /* on wide, short screens the height limits CAROÜSEL, so the dancer keeps its room */
}
@supports (height: 1dvh) { :root { --h: 1dvh; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--night); }
body {
  margin: 0;
  color: var(--light);
  font-family: var(--type);
  font-size: var(--size);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
::selection { background: var(--light); color: var(--night); }

/* Instagram, top right */
.ig {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  /* lines up with the right edge of CAROÜSEL, also when the logo is narrower than the screen */
  right: max(calc(env(safe-area-inset-right, 0px) + var(--gutter)), calc((100vw - var(--logo-max)) / 2));
  z-index: 2;
  display: flex;
  align-items: center;
  height: 30px;
  text-decoration: none;
}
.ig:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }

/* the countdown to the doors, top left, level with Instagram and lined up with the left edge of CAROÜSEL.
   Days, hours, minutes, seconds. The digits of this typeface are all the same width, so nothing jumps. */
.countdown {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: max(calc(env(safe-area-inset-left, 0px) + var(--gutter)), calc((100vw - var(--logo-max)) / 2));
  z-index: 2;
  display: flex;
  align-items: center;
  height: 30px;
  margin: 0;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.countdown:not(.ready) { visibility: hidden; }   /* nothing shows until the first real value is in */
.countdown[hidden] { display: none; }
/* while the session is on: a small diamond that breathes, then "Session is Live", spaced like the other words */
.countdown.is-live { letter-spacing: 0.01em; }
.countdown.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 10px;
  background: var(--light);
  transform: rotate(45deg);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.page {
  height: 100vh;
  height: calc(var(--h) * 100);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

/* the night: the dancer stands on the edge of the floor */
.night { position: relative; min-height: 0; }
/* The couple scales itself inside this box and stands on its bottom edge. The box is as wide as CAROÜSEL,
   so they never dance past the logo, and at most 42% of the screen height, so CAROÜSEL stays the biggest
   thing on the page. On phones the width decides their size, on wide screens the height does.
   The box reaches one pixel under the floor and the floor is painted over it, so the feet end exactly on the
   top edge of the floor: no gap, no hairline, and nothing drawn on the floor itself. */
.dancer {
  position: absolute;
  left: max(calc(env(safe-area-inset-left, 0px) + var(--gutter)), calc((100vw - var(--logo-max)) / 2));
  right: max(calc(env(safe-area-inset-right, 0px) + var(--gutter)), calc((100vw - var(--logo-max)) / 2));
  bottom: -1px;
  height: 42vh;
  height: min(calc(100% - 52px - env(safe-area-inset-top, 0px)), calc(var(--h) * 42));
  color: var(--light);
}
.dancer svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* the part you can click or tap is the box of the drawing, not the whole width of the screen */
.dancer .hit { fill: none; }
.dancer.is-live .hit { pointer-events: all; cursor: pointer; }
.dancer:focus { outline: none; }
.dancer:focus .hit { stroke: var(--light); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.dancer:focus:not(:focus-visible) .hit { stroke: none; }

/* the floor */
.floor {
  position: relative;
  z-index: 1;
  background: var(--carousel);
  padding:
    clamp(18px, 2.6vw, 34px)
    calc(env(safe-area-inset-right, 0px) + var(--gutter))
    calc(env(safe-area-inset-bottom, 0px) + clamp(18px, 2.4vw, 30px))
    calc(env(safe-area-inset-left, 0px) + var(--gutter));
}
/* CAROÜSEL as wide as the screen */
.floor-inner { width: min(100%, var(--logo-max)); margin: 0 auto; }
.wordmark { margin: 0; line-height: 0; }
.wordmark svg { display: block; width: 100%; height: auto; }

/* phones: the place and the date on the left, the tickets button on the right.
   The button starts level with the first line and is as tall as the two lines. */
.facts {
  list-style: none;
  margin: clamp(12px, 1.6vw, 22px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 16px;
}
.facts li:nth-child(1), .facts li:nth-child(2) { grid-column: 1; white-space: nowrap; }
.facts .go { grid-column: 2; grid-row: 1 / span 2; justify-self: end; display: flex; }

/* the button to tickets and guestlist: a piece of the night on the floor */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--night);
  background: var(--night);
  color: var(--light);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease;
}
/* a taller place to tap than the button looks */
.btn::after { content: ""; position: absolute; top: -7px; bottom: -7px; left: 0; right: 0; }
.btn:focus-visible { border-color: var(--light); outline: 1px solid var(--light); outline-offset: 3px; }
.btn:active { background: transparent; border-color: var(--light); }

/* very narrow phones: the date goes to the right of the place and the button under both, full width */
@media (max-width: 349px) {
  .facts { row-gap: 12px; }
  .facts li:nth-child(2) { grid-column: 2; text-align: right; white-space: normal; }
  .facts .go { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
  .btn { flex: 1; height: 44px; }
}

/* wide screens: the place, the date and the button on one line, under the left edge, the middle and the right edge of CAROÜSEL */
@media (min-width: 700px) {
  .facts { grid-template-columns: 1fr auto 1fr; column-gap: 24px; align-items: center; }
  .facts li:nth-child(n) { grid-column: auto; grid-row: auto; }
  .facts li:nth-child(2) { text-align: center; }
  .btn { height: 44px; padding: 0 28px; }
}

/* hover only where there is a mouse */
@media (hover: hover) {
  .ig:hover { text-decoration: underline; text-underline-offset: 4px; }
  .btn:hover { border-color: var(--light); }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .countdown.is-live::before { animation: none; }
}

/* phones on their side */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --logo-max: max(calc(var(--h) * 136), 462px); --size: 13px; }   /* never narrower than the place, the date and the button in a row */
  .dancer { height: min(calc(100% - 40px - env(safe-area-inset-top, 0px)), calc(var(--h) * 42)); }
}
/* and wide enough for the place, the date and the button in one row. A short window that is narrower
   (a phone with the screen split in two) keeps the phone layout above. */
@media (max-height: 480px) and (orientation: landscape) and (min-width: 480px) {
  .facts { grid-template-columns: auto auto auto; justify-content: space-between; column-gap: 16px; row-gap: 0; align-items: center; }
  .facts li:nth-child(n) { grid-column: auto; grid-row: auto; text-align: left; white-space: nowrap; }
  .facts .go { justify-self: end; }
  .btn { flex: none; height: 36px; padding: 0 16px; }
}
@media (max-height: 480px) and (orientation: landscape) and (min-width: 480px) and (max-width: 519px) {
  .facts { column-gap: 10px; }
  .btn { padding: 0 10px; }
}
/* a screen too short to hold everything may scroll */
@media (max-height: 300px) {
  html, body { height: auto; overflow: auto; }
  .page { height: auto; min-height: calc(var(--h) * 100); }
  .night { min-height: 150px; }
}
