:root {
  --bg: #171715;
  --fg: #ebe6df;
  --serif: "Times New Roman", Times, serif;

  /* type scale */
  --title: clamp(1.5rem, 4vw, 2.75rem);
  --small: clamp(0.8rem, 1.6vw, 1rem);
  --spaced: 0.14em;

  /* timings, mirrored in site.js */
  --pulse: 1s;    /* one fade 100% -> 20% (and back again) */
  --veil: 350ms;  /* white fade out / in between pages */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--small);
  letter-spacing: var(--spaced);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- custom cursor: a lagging dot (site.js moves it) ---------- */

@media (pointer: fine) {
  html, body, a, button { cursor: none; }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  opacity: 0;
}

@media (pointer: coarse) { .cursor-dot { display: none; } }

/* ---------- the 100% -> 20% opacity pulse ---------- */

@keyframes pulse {
  from { opacity: 1; }
  to   { opacity: 0.2; }
}

.pulse,
.link:hover {
  animation: pulse var(--pulse) ease-in-out infinite alternate;
}

/* ---------- clickable text ---------- */

.link {
  display: inline-block;
  transition: transform 300ms ease;
}

.link:hover,
.link.blinking { transform: scale(1.15); }

/* while blinking: solid, no pulse; site.js toggles visibility */
.link.blinking { animation: none; opacity: 1; }

/* ---------- white veil for page transitions ---------- */

#veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--veil) ease-in-out;
}

html.veiled #veil { opacity: 1; }

/* ---------- enter screen ---------- */

#enter {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.enter-btn {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

html.entered #enter { display: none; }

/* ---------- countdown lock (until midnight tonight) ---------- */

/* while locked the enter screen always shows the countdown, never "enter" */
html.gated #enter { display: grid; }
html.gated .enter-btn { display: none; }
html:not(.gated) .gate,
html:not(.gated) .gate-pass { display: none; }
html:not(.gated) .enter-btn:not(.blinking) { animation: fade-in 1.2s ease, pulse var(--pulse) ease-in-out 1.2s infinite alternate; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* same look as the KISS countdown */
.gate-count {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  font-size: clamp(2.25rem, 8vw, 5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  animation: fade-in 1.6s ease;
}
.gate-count .unit { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.gate-count .label {
  font-size: clamp(0.6rem, 1.3vw, 0.8rem);
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  color: rgba(255, 255, 255, 0.55);
}

/* very small password option at the bottom */
.gate-pass {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
}
.gate-toggle {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  opacity: 0.35;
  transition: opacity 200ms ease;
}
.gate-toggle:hover, .gate-toggle:focus-visible { opacity: 0.8; outline: none; }
.gate-pass input {
  width: 9rem;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--fg);
  font: inherit;
  letter-spacing: 0.3em;
  text-align: center;
  outline: none;
  cursor: text;
}
.gate-pass.wrong { animation: shake 300ms ease; }
@keyframes shake {
  25% { transform: translateX(calc(-50% - 5px)); }
  75% { transform: translateX(calc(-50% + 5px)); }
}

/* ---------- home ---------- */

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  background: var(--bg);
}

/* title + countdown on the left, menu on the right, both vertically centered */
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1.5rem, 5vw, 5rem);
}

.release {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  text-align: left;
  color: #fff;
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

.home .title {
  font-size: var(--title);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* slightly smaller than the title */
.countdown {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-size: calc(var(--title) * 0.8);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1;
}

.countdown .unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.countdown .label {
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  letter-spacing: 0.34em;
  padding-left: 0.34em; /* balance the trailing letter-space so it centers */
  color: rgba(255, 255, 255, 0.55);
}

.home .menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.9rem;
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
}

/* the wave: site.js sets each item's scale from its distance to the cursor */
.home .menu .link {
  position: relative;
  transform-origin: right center;
  transition: transform 220ms ease-out, color 200ms ease;
}

/* soft dark glow behind the hovered item so it reads clearly */
.home .menu .link::before {
  content: "";
  position: absolute;
  inset: -0.7em -1.1em;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 200ms ease;
}

.home .menu .link:hover { color: #fff; }
.home .menu .link:hover::before { opacity: 1; }

/* ---------- sub pages ---------- */

.back {
  position: fixed;
  top: 1.5rem;
  left: 1.75rem;
  z-index: 10;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 7rem 1.75rem 5rem;
}

.page h1 {
  font-weight: normal;
  font-size: calc(var(--small) * 1.4);
  margin-bottom: 2.5rem;
}

/* behind the scenes: masonry of small photos, like the seams diary (376px columns, 12px gaps) */
.diary { max-width: calc(376px * 3 + 12px * 2 + 3.5rem); }
.diary .entries { columns: 3 376px; column-gap: 12px; }
.entry {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 12px;
  break-inside: avoid;
}
.entry img { display: block; width: 100%; height: auto; }
.entry time { opacity: 0.6; }
.entry figcaption { letter-spacing: normal; line-height: 1.55; }

/* gray text cards between the photos, like the seams diary */
.note {
  gap: 0;
  padding: 14px 16px 16px;
  background: #2c2b28;
  color: var(--fg);
  letter-spacing: normal;
}
.note h2 { font-weight: normal; font-size: 1.1em; }
.note time { display: block; margin: 0.2rem 0 0.55rem; opacity: 0.55; font-size: 0.85em; letter-spacing: 0.06em; }
.note p { line-height: 1.5; white-space: pre-wrap; }
.note .blank { display: none; }

/* photo zoom: 50% black backdrop, photo grows from the grid to the center */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

html.lightbox-open .lightbox { opacity: 1; pointer-events: auto; }

.lightbox-item {
  position: fixed;
  z-index: 95;
  transform-origin: 0 0;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-item { transition: none; }
}

/* tracks: title left, length right, click to open the about text */
.tracks-page { max-width: 34rem; }
.tracks { list-style: none; border-top: 1px solid rgba(235, 230, 223, 0.14); }
.track { border-bottom: 1px solid rgba(235, 230, 223, 0.14); }
.track-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
.track-row:hover .track-title,
.track.open .track-title { animation: pulse var(--pulse) ease-in-out infinite alternate; }
.track-row:disabled { cursor: default; }
.track-row:disabled:hover .track-title { animation: none; }
.track-row:focus-visible { outline: 1px solid rgba(235, 230, 223, 0.5); outline-offset: 4px; }
.track-length { font-variant-numeric: tabular-nums; opacity: 0.6; }
.track-about {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.track.open .track-about { grid-template-rows: 1fr; }
.track-about > div { overflow: hidden; }
.track-about p {
  padding: 0 0 1.2rem;
  letter-spacing: normal;
  line-height: 1.6;
  white-space: pre-wrap;
  opacity: 0.75;
}

/* socials: one centered row, like the enter screen */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem clamp(2rem, 5vw, 4rem);
  font-size: calc(var(--small) * 0.85);
  letter-spacing: 0.2em;
}

/* shows */
.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
