/* ============================================================================
   Tur Studios — rect version.
   The work travels clockwise around a rectangle. Rest on a piece for a couple
   of seconds and it opens itself, slightly larger, where it sits.
   ========================================================================== */

:root {
  --bg:   #000;
  --fg:   #fff;
  --dim:  rgba(255, 255, 255, 0.52);
  --dim2: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.16);

  --mark: "Jost", "Futura", "Avenir Next", sans-serif;
  --font: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100dvh;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* --- the track ------------------------------------------------------------ */
.track { position: absolute; inset: 0; }

/* Position comes from the rAF loop as a translate, so moving a card never
   triggers layout — only compositing. */
.card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--w);
  aspect-ratio: var(--ar);
  background: #0b0b0b;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
  opacity: 0;
  transition: opacity 0.9s var(--ease), scale 0.5s var(--ease),
              box-shadow 0.4s ease, filter 0.4s ease;
}
/* Full strength at rest — a dimmed resting state reads as soft and washed. */
.card.in { opacity: 1; }

.card img, .card video { width: 100%; height: 100%; object-fit: cover; }
.card video { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease; }
.card.playing video { opacity: 1; }

/* Keyed off a class set when a card is actually entered — `.track:hover` would
   fire anywhere on the page, since the track spans the whole viewport, and dim
   everything whenever the cursor sat in empty space. */
.track.hot .card { filter: brightness(0.4); }
.track.hot .card:hover,
.track .card:focus-visible {
  filter: none;
  opacity: 1;
  scale: 1.18;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 24px 56px -22px #000;
  z-index: 5;
}

/* --- centre --------------------------------------------------------------- */
.core {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0.5rem 1rem;
  pointer-events: none;
}
.core > * { pointer-events: auto; }
.core::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 150%; height: 210%;
  translate: -50% -50%;
  z-index: -1;
  background: radial-gradient(closest-side, #000 46%, rgba(0, 0, 0, 0.86) 70%, transparent 100%);
  pointer-events: none;
}
.mark {
  font-family: var(--mark);
  font-size: clamp(1.15rem, 0.7rem + 2.1vw, 2.35rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  line-height: 1.1;
  white-space: nowrap;
}
/* Credit line under the wordmark — deliberately quiet so it reads as a byline
   rather than competing with the mark or the address. */
.by {
  margin-top: 0.7rem;
  font-size: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42);
}

.mail {
  position: relative;
  display: inline-block;
  margin-top: clamp(1.1rem, 3vh, 1.9rem);
  font-size: clamp(1rem, 0.88rem + 0.6vw, 1.375rem);
  color: var(--fg);
  transition: opacity 0.3s ease;
}
.mail:hover { opacity: 0.75; }

/* Confirms the copy without the address itself flickering away. */
.copied {
  display: block;
  margin-top: 0.6rem;
  height: 1em;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim2);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.copied.on { opacity: 1; }
.mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--fg);
  scale: 0 1;
  transform-origin: left;
  transition: scale 0.45s var(--ease);
}
.mail:hover::after { scale: 1 1; }

/* --- corners -------------------------------------------------------------- */
.corner {
  position: fixed;
  z-index: 10;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim2);
  padding: 1.25rem 1.5rem;
}
.corner.br { bottom: 0; right: 0; }
@media (max-width: 600px) {
  .corner { padding: 1rem 1.15rem; }
  /* Hold roughly the desktop hierarchy (email ~0.59 of the mark); at the old
     sizes the address was almost as large as the wordmark and read flat. */
  /* Tracking tightens as the size drops — wide tracking at 22px would make the
     mark broad enough to squeeze the ring's cards down to nothing. */
  .mark { font-size: 1.375rem; letter-spacing: 0.11em; text-indent: 0.11em; }
  .by { margin-top: 0.5rem; font-size: 0.625rem; letter-spacing: 0.06em; }
  .mail { font-size: 0.8125rem; margin-top: 0.85rem; }
}

/* --- mini player ---------------------------------------------------------- */
.mini {
  position: fixed;
  z-index: 120;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 34px 70px -28px #000;
  transition: left 0.5s var(--ease), top 0.5s var(--ease),
              width 0.5s var(--ease), height 0.5s var(--ease);
}
.mini video { width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
.mini video[controls] { cursor: auto; }

/* Only shown when the browser refused to start with sound. */
.sound {
  position: absolute;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  padding: 5px 9px;
  background: rgba(0, 0, 0, 0.62);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mini.silent .sound { opacity: 1; }
.mini .shut {
  position: absolute;
  bottom: 100%;
  right: 0;
  padding: 0 0 7px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}
.mini .shut:hover { color: var(--fg); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}
body.playing .scrim { opacity: 1; visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .card, .mini { transition-duration: 0.01ms; }
}
