/* ── Reset ─────────────────────────────── */
* {
  margin: 0;
  box-sizing: border-box;
}
button {
  all: unset;
}
button:focus {
  outline: revert;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
  color: inherit;
}

/* ── Tokens ─────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --surface: rgba(255, 255, 255, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.85);
  --text: #f2f2f2;
  --muted: #888;
  --accent: #9d8df5;
}

/* ── Base ─────────────────────────────── */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  padding-bottom: 88px;
}

main,
footer {
  position: relative;
}

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

/* ── Header ─────────────────────────────── */
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.75rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 1.1rem;
  font-weight: 200;
  letter-spacing: 0em;
  color: var(--text);
}

nav ul {
  display: flex;
  gap: 2rem;
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0em;
}

nav a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}
nav a:hover {
  color: var(--text);
}

/* ── Hero ─────────────────────────────── */
.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #000;
}

#player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sound-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  background: transparent;
  cursor: pointer;
}
.sound-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.sound-overlay svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

/* ── Project Section ─────────────────────────────── */
.project-section-label {
  padding: 0 2.5rem;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.project-section {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  padding: 4rem 0 0;
  overflow: hidden;
}

/* Top: info left, video right */
.project-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 0 2.5rem;
  align-items: stretch;
  position: relative;
  z-index: 2;
}

.project-info {
  border: solid 0.4px var(--line);
  display: flex;
  height: fit-content;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  margin-left: 10rem;
  margin-top: 10rem;
  padding: 1.75rem 2rem;
  background: var(--bg);
}
.project-info > * {
  margin: 0;
}

.project-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  overflow: hidden;
  background: var(--bg);
}

.project-frame-media {
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  overflow: hidden;
  /* aspect-ratio set inline from project.video.resolution */
}

.project-frame-media video,
.project-frame-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gallery row — full-width, sits below the info + video row */
.project-row-wrapper {
  margin-top: 2.5rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.gallery-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2.5rem;
  margin-top: 0.5rem;
}

.gallery-nav-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.gallery-nav-btn:hover {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.4);
}
.gallery-nav-btn:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
}

.gallery-hint {
  margin-left: 2rem;
  font-size: 0.85rem;
  font-weight: 100;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  text-transform: underline;
  text-underline-offset: 5px;
  flex-shrink: 0;
}

.gallery-hint-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .gallery-hint-touch {
    display: inline;
  }
  .gallery-hint-mouse {
    display: none;
  }
}

.gallery-nav-indicator {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
}
.gallery-nav-indicator::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid var(--accent);
}

.project-row {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
  overflow-x: scroll;
  scrollbar-width: none;
  cursor: grab;
  align-items: center;
}
.project-row::-webkit-scrollbar {
  display: none;
}
.project-row:active {
  cursor: grabbing;
}

/* CD-styled disc — round with a small concentric hole. */
.project-disc {
  --d: 1;
  --rot: 0deg;
  flex-shrink: 0;
  width: clamp(130px, 13vw, 180px);
  aspect-ratio: 1 / 1;
  height: auto;
  position: relative;
  cursor: pointer;
  margin-right: -2rem;
  /* Distance-based depth-of-field + baseline slant. */
  opacity: calc(1 - var(--d) * 0.22);
  filter: saturate(calc(1 - var(--d) * 0.15));
  transition:
    opacity 0.25s ease,
    filter 0.25s ease,
    transform 0.4s ease;
}

.project-disc:last-child {
  margin-right: 0;
}

/* Inner wrapper owns the visible CD geometry so the tilt rotates the
   whole disc (mask hole + ring + image) as one unit. */
.project-disc .disc-tilt-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #111;
  mask-image: radial-gradient(
    circle at center,
    transparent 0 9%,
    black 9.5% 100%
  );
  -webkit-mask-image: radial-gradient(
    circle at center,
    transparent 0 9%,
    black 9.5% 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(0, 0, 0, 0.35),
    0 6px 16px rgba(0, 0, 0, 0.45);
}

.project-disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  pointer-events: none;
  user-select: none;
}

.project-disc.is-focus {
  opacity: 1;
  filter: saturate(1);
  z-index: 2;
}

.project-disc.active .disc-tilt-inner {
  box-shadow:
    inset 0 0 0 2px var(--accent),
    inset 0 0 18px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.5);
}

.project-disc:focus-visible {
  outline: none;
}
.project-disc:focus-visible .disc-tilt-inner {
  box-shadow:
    inset 0 0 0 2px var(--line-strong),
    inset 0 0 18px rgba(0, 0, 0, 0.35);
}

.disc-playing-badge {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0.35rem 0.4rem;
  height: 18px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.disc-playing-badge span {
  display: block;
  width: 2px;
  height: 10px;
  background: #fff;
  transform-origin: bottom;
  transform: scaleY(0.4);
}
.project-disc.active .disc-playing-badge {
  opacity: 1;
}
.project-disc.active.is-playing .disc-playing-badge span {
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.project-disc.active.is-playing .disc-playing-badge span:nth-child(2) {
  animation-delay: 0.15s;
}
.project-disc.active.is-playing .disc-playing-badge span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes eq-bounce {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

.disc-year-badge {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.18rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f2f2f2;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Project info panel content */
.pi-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.pi-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.pi-year {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
}

.pi-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.pi-skills span:not(:last-child)::after {
  content: " /";
  margin-left: 0.45rem;
  color: rgba(255, 255, 255, 0.2);
}

.pi-description {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  max-width: 52ch;
}

.pi-collabs {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.pi-collab-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pi-collab-link:hover {
  color: var(--text);
}

.pi-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pi-ext-link {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  color: var(--text);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.pi-ext-link:hover {
  background: var(--glass-bg);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Tracklist */
.pi-tracklist {
  display: flex;
  flex-direction: column;
}

.pi-track-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.pi-track-row:hover {
  background: var(--surface);
}
.pi-track-row.no-src {
  cursor: default;
  opacity: 0.35;
}
.pi-track-row.playing {
  color: var(--accent);
}

.pi-track-num {
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  transition: opacity 0.15s;
}
.pi-track-row:hover .pi-track-num,
.pi-track-row.playing .pi-track-num {
  opacity: 0;
}

.pi-track-play {
  position: absolute;
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.pi-track-row:hover .pi-track-play,
.pi-track-row.playing .pi-track-play {
  opacity: 1;
}
.pi-track-play svg {
  width: 12px;
  height: 12px;
}

.pi-track-title {
  flex: 1;
  font-size: 0.88rem;
}
.pi-track-dur {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Footer ─────────────────────────────── */
footer {
  background: var(--bg);
}

.footer_container {
  padding: 4rem 3rem 5rem;
}

.footer_container h2 {
  font-size: 4rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.8rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact_info {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  font-size: 1.4rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
}

.socials {
  display: flex;
  gap: 1rem;
}
.socials a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.socials a:hover {
  color: var(--text);
}
.socials svg {
  width: 1.5rem;
  height: 1.5rem;
}

.credits {
  font-size: 0.8rem;
  color: var(--muted);
}
.credits a {
  text-decoration: underline;
  color: var(--muted);
}
.credits a:hover {
  color: var(--text);
}

/* ── Mobile tab bar (gallery → tabs → content) ─────────── */
.mobile-tabs {
  display: none;
}

.mobile-tab-btn {
  flex: 1;
  padding: 0.75rem 0;
  text-align: center;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.18s,
    border-color 0.18s;
}

.mobile-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

@media (max-width: 767px) {
  .hero {
    height: 65vh;
  }

  .project-section-label {
    padding: 0 1.25rem;
  }

  .project-section {
    padding-top: 1.5rem;
  }

  /* Reorder children: gallery → tabs → info+frame */
  .project-row-wrapper {
    order: 1;
    margin-top: 0;
    padding: 0;
  }

  .mobile-tabs {
    order: 2;
    display: flex;
    margin: 0.5rem 0 0;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--line);
  }

  .project-top {
    order: 3;
    display: block;
    padding: 0 1.25rem;
  }

  .project-info {
    margin-left: 0;
    padding: 1.5rem 0;
  }

  .project-frame {
    height: auto;
    margin-bottom: 1.5rem;
  }

  .project-frame-media {
    width: 100%;
    height: auto;
  }

  /* tab-hidden only takes effect on mobile */
  .tab-hidden {
    display: none !important;
  }
  .project-info {
    border: solid 0.4px var(--line);
    display: flex;
    height: fit-content;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.75rem 2rem;
    background: var(--bg);
  }
}
