/* The home page: metal cards under one soft overhead light. */

:root {
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --amber: #ffb35c;
  --lilac: #c9a6ff;
  --warm: #fff1dc;
  --violet-light: #d7b8ff;
}

/* These let the light's colour and width glide between states. */
@property --light {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff1dc;
}

@property --ang {
  syntax: "<angle>";
  inherits: true;
  initial-value: 22deg;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07080a;
}

body {
  font-family: var(--sans);
  color: #d8dadf;
  -webkit-font-smoothing: antialiased;
}

.plain {
  position: fixed;
  top: 40%;
  width: 100%;
  margin: 0;
  font-size: 32px;
  text-align: center;
}

.room {
  --light: #fff1dc;
  --ang: 22deg;
  --bi: 0.6;
  --pw: 2.2;
  --sway: 0deg;
  position: relative;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(#07080a 0%, #050608 60%, #040506 100%);
  transition: --light 1.1s ease, --ang 1.1s var(--ease);
}

/* The light: a cone from above, a bright spot at its source, and a pool on the floor. */
.beam {
  position: absolute;
  inset: -4% 0 0;
  background:
    conic-gradient(from calc(180deg - var(--ang) * 0.62) at 50% 0%, transparent 0deg, color-mix(in srgb, var(--light) 14%, transparent) 0deg, color-mix(in srgb, var(--light) 14%, transparent) calc(var(--ang) * 1.24), transparent calc(var(--ang) * 1.24)),
    conic-gradient(from calc(180deg - var(--ang)) at 50% 0%, transparent 0deg, color-mix(in srgb, var(--light) 7%, transparent) 0deg, color-mix(in srgb, var(--light) 7%, transparent) calc(var(--ang) * 2), transparent calc(var(--ang) * 2));
  filter: blur(40px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.5) 50%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.5) 50%, transparent 94%);
  opacity: var(--bi);
  transform: rotate(var(--sway));
  transform-origin: 50% 0;
  transition: opacity 1s ease, transform 0.6s ease-out;
  pointer-events: none;
}

.fixture {
  position: absolute;
  top: -34px;
  left: 50%;
  width: min(360px, 60vw);
  height: 96px;
  background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--light) 55%, transparent), transparent 68%);
  filter: blur(8px);
  opacity: var(--bi);
  transform: translateX(-50%);
  pointer-events: none;
}

.pool {
  position: absolute;
  top: calc(50% + var(--cw, 280px) * 0.6);
  left: 50%;
  width: calc(var(--cw, 280px) * var(--pw));
  height: calc(var(--cw, 280px) * 0.46);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--light) 17%, transparent), transparent 68%);
  filter: blur(12px);
  opacity: var(--bi);
  transform: translateX(-50%);
  transition: width 1s var(--ease), opacity 1s ease;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 75% at 50% 38%, transparent 26%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}

.deck {
  position: absolute;
  inset: 0;
  perspective: 1700px;
}

/* One card. Position comes from variables the script sets for each state. */
.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--cw, 280px);
  aspect-ratio: 3 / 4.1;
  margin-top: calc(var(--cw, 280px) * -0.683);
  margin-left: calc(var(--cw, 280px) * -0.5);
  z-index: var(--z, 1);
  opacity: var(--o, 1);
  transform: translate3d(var(--x, 0px), var(--y, 0px), var(--d, 0px)) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transform-style: preserve-3d;
  transition: transform 0.85s var(--ease), opacity 0.5s ease;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.card:focus-visible .front {
  box-shadow: inset 0 0 0 2px var(--amber);
}

.flip {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(var(--flip, 0deg));
  transition: transform 0.95s var(--ease);
}

/* Thickness: dark layers between the two faces. */
.edge {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--edge-a), var(--edge-b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 7%, 26px);
  overflow: hidden;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px),
    var(--metal);
  box-shadow:
    inset 0 1px 0 var(--lip),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 -30px 60px rgba(0, 0, 0, 0.35),
    0 30px 60px rgba(0, 0, 0, 0.5);
}

.front {
  transform: translateZ(5.5px);
}

.back {
  transform: rotateY(180deg) translateZ(5.5px);
}

/* The overhead light landing on a face: bright on top, fading down, with a thin rim. */
.lit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--light) 40%, transparent) 0%, color-mix(in srgb, var(--light) 13%, transparent) 34%, transparent 66%);
  mix-blend-mode: soft-light;
  opacity: var(--bi);
  pointer-events: none;
}

.lit::before {
  content: "";
  position: absolute;
  top: 0;
  right: 10%;
  left: 10%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--light) 92%, white), transparent);
  opacity: 0.9;
}

/* Materials */
.graphite {
  --metal: linear-gradient(150deg, #353941 0%, #1a1c21 46%, #121316 70%, #23262c 100%);
  --edge-a: #1a1c21;
  --edge-b: #0d0e10;
  --lip: rgba(255, 255, 255, 0.28);
  --cut: #0e0f12;
  --cut-lip: rgba(255, 255, 255, 0.32);
  --led: var(--amber);
}

.violet {
  --metal: linear-gradient(150deg, #6c47a3 0%, #35205c 42%, #1d1136 68%, #4a2c75 100%);
  --edge-a: #25143f;
  --edge-b: #120a22;
  --lip: rgba(222, 196, 255, 0.34);
  --cut: #170b2a;
  --cut-lip: rgba(226, 204, 255, 0.34);
  --led: var(--lilac);
}

.serial {
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  letter-spacing: 0.24em;
}

/* Cut into the metal. */
.engrave {
  margin: 0;
  color: var(--cut);
  font-size: calc(var(--cw, 280px) * 0.2);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-shadow: 0 1px 0 var(--cut-lip), 0 -1px 0 rgba(0, 0, 0, 0.8);
}

/* VIVA in Six Caps; the A is a V turned upside down. */
.mark {
  font-family: "Six Caps", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-shadow: none;
}

.mark .logo-svg {
  display: block;
  overflow: visible;
  width: auto;
}

h1.engrave.mark {
  font-size: calc(var(--cw, 280px) * 0.52);
  line-height: 0.8;
  text-shadow: 0 1px 0 var(--cut-lip), 0 -1px 0 rgba(0, 0, 0, 0.8);
}

.back h2.mark {
  font-size: calc(var(--cw, 280px) * 0.3);
  line-height: 0.85;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.kind {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--led) 80%, transparent);
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.35;
    box-shadow: 0 0 4px 0 color-mix(in srgb, var(--led) 40%, transparent);
  }
}

/* The back of a card */
.kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.back h2 {
  margin: 0 0 12px;
  color: #eceef3;
  font-size: calc(var(--cw, 280px) * 0.095);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.back p.body {
  margin: 0;
  color: rgba(236, 238, 243, 0.72);
  font-size: calc(var(--cw, 280px) * 0.05);
  line-height: 1.5;
}

.action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--cut);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 0 var(--cut-lip);
  color: #e9ebf0;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, filter 0.2s ease;
}

.action:hover {
  color: #fff;
  filter: brightness(1.2);
}

.action .arrow {
  margin-left: auto;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.action:hover .arrow {
  transform: translateX(4px);
}

/* Light that follows the pointer, on top of the overhead light. */
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 30%) var(--my, 18%), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: soft-light;
}

.hint {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  color: rgba(216, 218, 223, 0.42);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.page-back {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 200;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: rgba(216, 218, 223, 0.7);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.page-back[hidden] {
  display: none;
}

.page-back:hover {
  color: #fff;
}

.toast {
  position: absolute;
  bottom: 64px;
  left: 50%;
  z-index: 200;
  margin: 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(14, 15, 18, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #e9ebf0;
  font-size: 13px;
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .flip,
  .room,
  .beam,
  .pool {
    transition-duration: 0.01s;
  }

  .led {
    animation: none;
  }
}

/* Depth: cards tilt toward the pointer, a faint floor runs back into the dark,
   and dust hangs in the light. */

.tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.35s ease-out;
}

.floor {
  position: absolute;
  top: calc(50% + var(--cw, 280px) * 0.52);
  right: -40%;
  left: -40%;
  height: 120vh;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  transform: perspective(520px) rotateX(74deg);
  transform-origin: 50% 0;
  -webkit-mask-image: radial-gradient(ellipse 36% 70% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 36% 70% at 50% 0%, #000 0%, transparent 78%);
  opacity: var(--bi);
  pointer-events: none;
}

#dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Now playing: a small metal plate, bottom left. It opens into Spotify's player. */

.music {
  position: absolute;
  bottom: 22px;
  left: 24px;
  z-index: 6;
  width: min(340px, calc(100vw - 48px));
}

.music-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(150deg, #2b2e35, #14161a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 14px 30px rgba(0, 0, 0, 0.55);
  color: #e9ebf0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.music-chip:hover {
  filter: brightness(1.12);
}

.music-art {
  display: block;
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: #0e0f12;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
}

.music-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.music-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.music-title,
.music-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-title {
  font-size: 13px;
  font-weight: 700;
}

.music-artist {
  color: rgba(236, 238, 243, 0.6);
  font-size: 12px;
}

.music-led {
  --led: #6e7480;
  flex: none;
  animation: none;
  box-shadow: none;
}

.music-led.on {
  --led: #6be28b;
  animation: breathe 3.2s ease-in-out infinite;
  box-shadow: 0 0 10px 1px color-mix(in srgb, #6be28b 80%, transparent);
}

.music-player {
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 14px;
  background: #0e0f12;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.music-player[hidden] {
  display: none;
}

.music-player iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

@media (max-width: 640px) {
  .music {
    right: 16px;
    bottom: 56px;
    left: 16px;
    width: auto;
  }
}