:root {
  --bg: #050505;
  --paper: #f4f4f2;
  --mute: rgba(244, 244, 242, .62);
  --faint: rgba(244, 244, 242, .42);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
}

body.is-stage {
  height: 100%;
  overflow: hidden;
}

body:not(.is-stage) .field,
body:not(.is-stage) .scrim,
body:not(.is-stage) main { display: none; }

body.is-stage .gallery { display: none; }

button { font: inherit; color: inherit; }

.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.field-layer {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.15) brightness(.55);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .8s var(--ease);
}

.field-layer.is-on { opacity: .9; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 68% 46%, transparent 0%, rgba(5, 5, 5, .35) 46%, var(--bg) 74%),
    linear-gradient(90deg, rgba(5, 5, 5, .72) 0%, rgba(5, 5, 5, .2) 34%, transparent 58%);
}

main {
  position: relative;
  z-index: 2;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 48px;
  padding: 36px 40px 32px 44px;
}

.col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  padding: 4px 0 6px;
}

.mark,
.count,
.kicker,
.line,
h1 { margin: 0; }

.mark {
  font-size: 15px;
  font-weight: 500;
}

.mark a {
  color: inherit;
  text-decoration: none;
}

.mark a:hover { text-decoration: underline; text-underline-offset: 3px; }

.kicker:empty { display: none; }

.count {
  margin-top: 8px;
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.kicker {
  color: var(--mute);
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  font-family: var(--display);
  font-size: clamp(2.35rem, 3.1vw, 3.05rem);
  font-weight: 400;
  letter-spacing: -.018em;
  line-height: 1.02;
}

.line {
  margin-top: 14px;
  max-width: 34ch;
  color: var(--mute);
  font-size: 15px;
  line-height: 1.45;
}

.line:empty { display: none; }

.words.is-swap h1,
.words.is-swap .line,
.words.is-swap .kicker {
  animation: rise .45s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.viewport:focus-visible {
  outline: 1px solid rgba(244, 244, 242, .7);
  outline-offset: 4px;
}

.edge {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  padding: 0;
  border: 1px solid rgba(244, 244, 242, .28);
  border-radius: 50%;
  background: rgba(5, 5, 5, .62);
  color: var(--paper);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.edge svg { width: 26px; height: 26px; }

.edge-prev { left: 18px; }
.edge-next { right: 18px; }

.edge:hover,
.edge:focus-visible {
  background: #22d3ee;
  border-color: #22d3ee;
  color: #04222a;
}

.edge:focus-visible {
  outline: 1px solid #22d3ee;
  outline-offset: 3px;
}

.meter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  height: 6px;
  background: linear-gradient(90deg, rgba(34, 211, 238, .35), rgba(163, 230, 53, .35) 70%, rgba(245, 185, 66, .35));
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22d3ee, #a3e635 70%, #f5b942);
  box-shadow: 0 0 18px rgba(34, 211, 238, .7);
}

.meter i.run { animation: fill var(--hold, 8s) linear; }

@keyframes fill {
  from { width: 0; }
  to { width: 100%; }
}

.live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.viewport {
  position: absolute;
  inset: 0;
  perspective: 1800px;
  outline: none;
  touch-action: pan-y;
}

.slide {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  width: auto;
  height: auto;
  border-radius: 12px;
  background: #141414;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .14),
    0 30px 70px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.985);
  transition: opacity .6s var(--ease), transform .8s var(--ease);
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

@media (max-width: 800px) {
  body { overflow: auto; }
  main {
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 22px;
    padding: 18px 16px 22px;
  }
  .stage { order: -1; height: auto; flex: none; }
  .viewport { position: relative; height: auto; }
  .slide {
    position: relative;
    left: auto;
    top: auto;
    display: none;
    width: 100%;
    height: auto;
    max-width: 100%;
    transform: none;
    border-radius: 8px;
  }
  .slide.is-active {
    display: block;
    opacity: 1;
    transform: none;
  }
  .col { gap: 22px; }
  h1 { font-size: 2.15rem; }
  .edge { width: 44px; height: 44px; margin-top: -22px; }
  .edge svg { width: 22px; height: 22px; }
  .edge-prev { left: 10px; }
  .edge-next { right: 10px; }
}

main.is-title {
  display: flex;
  align-items: stretch;
}

main.is-title .col {
  width: min(100%, 920px);
}

main.is-title .stage { display: none; }

main.is-title h1 {
  max-width: 13ch;
  font-size: clamp(2.9rem, 5.4vw, 4.8rem);
  font-weight: 400;
  letter-spacing: -.018em;
  line-height: .98;
}

@media (max-width: 800px) {
  main.is-title { display: flex; }
  main.is-title h1 { font-size: 2.7rem; }
}

.gallery {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 36px 24px;
}

.gallery header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}

.gallery .now,
.gallery .host {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.gallery .host { margin: 0; }

.gallery .room {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 28px;
}

.gallery .room-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 28px;
  align-items: end;
  color: inherit;
  text-decoration: none;
}

.gallery h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 2.8vw, 2.65rem);
  font-weight: 400;
  letter-spacing: -.018em;
  line-height: 1.05;
}

.gallery .url {
  margin: 8px 0 0;
  max-width: 70ch;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gallery .open {
  color: var(--faint);
  font-size: 14px;
}

.gallery .room-link:hover .open,
.gallery .room-link:focus-visible .open { color: var(--paper); }

.gallery .room-link:focus-visible {
  outline: 1px solid rgba(244, 244, 242, .7);
  outline-offset: 6px;
}

.gallery .tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.gallery .tiles a {
  display: block;
  min-width: 0;
  aspect-ratio: 1783 / 949;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(244, 244, 242, .16);
  background: #101010;
}

.gallery .tiles img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}

.gallery .tiles a:hover img,
.gallery .tiles a:focus-visible img { transform: scale(1.03); }

.gallery .tiles a:focus-visible {
  outline: 1px solid rgba(244, 244, 242, .7);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .gallery { padding: 22px 18px 18px; }
  .gallery header { align-items: start; }
  .gallery .room { justify-content: start; }
  .gallery .tiles { grid-template-columns: 1fr; gap: 8px; }
  .gallery h2 { font-size: 2.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
