@font-face {
  font-family: Anton;
  src: url('assets/anton.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url('assets/barlow-condensed-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #151518;
  color: #fff5f3;
  --text-muted: #eadce6;
  --pink: #ffc0d1;
  --control-surface: #111113d9;
  --gutter: clamp(1.5rem, 5vw, 5rem);
  --rim: clamp(1.25rem, 3.7vh, 2.5rem);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
[hidden] { display: none !important; }

.screen {
  position: relative;
  display: grid;
  grid-template: auto minmax(28rem, 1fr) auto / minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  padding: var(--rim) var(--gutter);
  background: #151518;
}

.artwork, .scene, .city { position: absolute; inset: 0; }
.artwork { z-index: -1; overflow: hidden; }
.scene { opacity: 0; transition: opacity .85s ease; }
.scene.is-active, .scene.is-outgoing { opacity: 1; }
.scene.is-active { z-index: 1; animation: reveal .85s ease both; }
.city { width: 100%; height: 100%; object-fit: cover; object-position: center var(--horizon, 50%); }
.cast {
  position: absolute;
  display: block;
  right: var(--cast-right, 0%);
  bottom: -2%;
  height: var(--cast-height, 96%);
  width: auto;
  max-width: none;
  filter: drop-shadow(-10px 12px 20px #0007);
  transform-origin: bottom center;
}

.rooftop {
  --cast-height: 89%; --cast-right: 0%;
  --cast-from: 4%; --cast-to: -5%; --cast-zoom: 1.075;
  --mobile-from: 54%; --mobile-to: 46%; --cast-duration: var(--cycle);
}
.getaway { --cast-height: 92%; --cast-right: -3%; }
.shore { --cast-height: 94%; --cast-right: -4%; }
.marina { --cast-height: 92%; --cast-right: -2%; }
.boulevard { --cast-height: 86%; --cast-right: -5%; }
.motel { --cast-from: -1.5%; --cast-to: -3%; --cast-zoom: 1.025; }
.motel .cast {
  right: 0; bottom: 0; height: auto;
  max-width: 66vw; max-height: 88%; transform-origin: bottom right;
}
.scene:is(.is-active, .is-outgoing) .city { animation: drift-city 18s ease-out both; }
.scene:is(.is-active, .is-outgoing) .cast { animation: drift-cast var(--cast-duration, 18s) ease-out both; }
.screen[data-paused] .scene img { animation-play-state: paused; }

@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift-city { from { transform: scale(1.045) translateX(-.6%); } to { transform: scale(1.1) translateX(1%); } }
@keyframes drift-cast { from { transform: translateX(var(--cast-from, 1.1%)) scale(1); } to { transform: translateX(var(--cast-to, -1.3%)) scale(var(--cast-zoom, 1.055)); } }

.masthead { grid-row: 1; justify-self: end; display: flex; align-items: stretch; gap: .4rem; }
#music { cursor: pointer; padding: .5rem .7rem; border: 0; background: var(--control-surface); color: #fff; font: inherit; font-size: .875rem; }
#music:hover, #music:focus-visible { color: var(--pink); }
.source { display: block; padding: .5rem .7rem; background: var(--control-surface); color: var(--text-muted); font-size: .875rem; text-underline-offset: .25em; text-decoration-color: #fff8; }
.source:hover { color: #fff; text-decoration-color: #fff; }

.countdown { grid-row: 2; align-self: center; padding: 2.5rem 0 1.25rem; width: fit-content; max-width: 100%; }
.countdown-panel { padding: clamp(1rem, 2vw, 1.65rem); border-inline-start: 2px solid #ffc0d180; background: var(--control-surface); }
h1 {
  font: 400 clamp(3.3rem, 5.25vw, 6.25rem)/1.02 Anton, Impact, sans-serif;
  letter-spacing: -.015em;
  margin: 0 0 clamp(1.65rem, 4vh, 2.75rem);
}
h1 span {
  display: block;
  font: 600 clamp(1.4rem, 2.5vw, 2.3rem)/1 Barlow, sans-serif;
  letter-spacing: .22em;
  margin: 0 0 .5em;
}
h1 strong { display: block; font-weight: 400; color: var(--pink); }
.clock { width: min(100%, 27rem); }
.clock-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid #f4c3d66b; padding-top: .9rem; }
.clock-header p { font-size: 1rem; font-weight: 650; margin: 0; }
#timezone { color: var(--text-muted); font-size: .875rem; text-align: right; }
.clock-parts { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: .45rem; align-items: start; }
.clock-parts div { display: grid; text-align: center; }
.number, .colon { font: 600 clamp(4.3rem, 7.2vw, 6.65rem)/1.05 Barlow, Impact, sans-serif; font-variant-numeric: tabular-nums; }
.colon { color: #f5b1c6b3; }
.unit { color: var(--text-muted); font-size: .875rem; }
.noscript { margin: 1rem 0 0; font-size: .875rem; }

.store-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: 1.25rem; }
.store-links a {
  display: grid;
  place-items: center;
  min-height: 2.95rem;
  padding: .65rem .5rem;
  border: 1px solid var(--pink);
  border-radius: 2px;
  background: #242427;
  font-size: .875rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.store-links a:hover, .store-links a:focus-visible { color: #210f28; background: var(--pink); }

.gallery { grid-row: 3; justify-self: end; display: flex; align-items: center; gap: 1.4rem; padding: .6rem .75rem .6rem 1rem; background: var(--control-surface); }
.scene-caption { width: 14rem; }
.scene-caption p { margin: 0; font-size: 1rem; font-weight: 600; }
.scene-select { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .3rem; }
.scene-select button {
  display: grid;
  place-items: center;
  height: 1.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.scene-select span { position: relative; width: 100%; height: 3px; overflow: hidden; background: #ffffff44; }
.scene-select button:hover span, .scene-select [aria-current] span { background: #ffd1da88; }
.scene-select span::after { content: ''; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: #fff0f4; }
.scene-select .filling span::after { animation: progress var(--cycle) linear both; }
@keyframes progress { to { transform: scaleX(1); } }

.transport { display: flex; flex: none; gap: .5rem; }
.transport button {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 1px solid #f9ccd669;
  border-radius: 50%;
  color: #fff5f3;
  background: #242427;
  cursor: pointer;
}
.transport button:hover { color: #210f28; background: var(--pink); }
.track { display: flex; align-items: center; gap: 2px; }
.track::before, .screen[data-paused] .playback-icon::before { content: ''; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.track::after { content: ''; width: 2px; height: 10px; background: currentColor; }
.track.backwards { transform: scaleX(-1); }
.playback-icon { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.screen[data-paused] .playback-icon { display: grid; place-items: center; border: 0; }

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

@media (max-width: 940px) {
  .getaway, .shore, .marina { --cast-right: -13%; --cast-height: 86%; }
  .rooftop { --cast-right: -4%; --cast-height: 79%; }
}

@media (max-width: 660px) {
  .screen {
    grid-template-rows: auto minmax(27rem, 1fr) auto;
    --gutter: clamp(1.1rem, 5vw, 2rem);
  }
  .countdown { align-self: end; width: 100%; padding: max(13rem, 24vh) 0 1.25rem; }
  h1 { font-size: clamp(1.7rem, 8.5vw, 3.8rem); margin-bottom: 1.15rem; }
  .clock { width: 100%; max-width: 25rem; }
  .clock-header { padding-top: .65rem; }
  .number, .colon { font-size: clamp(3.5rem, 13vw, 5.6rem); }
  .gallery { justify-self: start; justify-content: space-between; width: 100%; gap: .7rem; padding: .6rem .7rem; }
  .scene-caption { flex: 1; min-width: 0; max-width: 14rem; }
  .cast { right: 50%; bottom: auto; top: min(11vh, 6rem); height: clamp(18rem, min(57vh, 125vw), 34rem); margin-right: -2.75rem; mask-image: linear-gradient(#000 85%, transparent); }
  .rooftop .cast { height: min(52vh, 111vw, 31rem); margin-right: .5rem; }
  .marina .cast { height: min(57vh, 120vw, 33rem); margin-right: -1.4rem; }
  .boulevard .cast { height: min(57vh, 116vw, 33rem); margin-right: min(28vw, 8rem); }
  .motel .cast {
    right: 50%; top: clamp(5rem, 16vh, 9rem); bottom: auto; margin: 0;
    max-width: 94vw; max-height: 53vh; transform-origin: bottom center; mask-image: none;
  }
  .scene:is(.is-active, .is-outgoing) .cast { animation-name: drift-mobile; }
  @keyframes drift-mobile { from { transform: translateX(var(--mobile-from, 50%)) scale(1); } to { transform: translateX(var(--mobile-to, 49%)) scale(var(--cast-zoom, 1.05)); } }
}

@media (max-width: 380px) {
  .store-links { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .transport { gap: .3rem; }
  .scene-select { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .scene.is-active,
  .scene:is(.is-active, .is-outgoing) .city,
  .scene:is(.is-active, .is-outgoing) .cast,
  .scene-select .filling span::after { animation: none; transition: none; }
  .cast { transform: translateX(0); }
  @media (max-width: 660px) { .cast { transform: translateX(50%); } }
}
