/* ============================================================
   RGEN MUSIC PORTFOLIO — styles.css
   Cosmic, deep-space aesthetic. Pure CSS — no preprocessors, no
   build step. Edit the design tokens below to recolour the site.
   ============================================================ */


/* === DESIGN TOKENS ===
   Single source of truth for colour and core dimensions.
   Change a value here and it propagates everywhere. */
:root {
  --bg:           #0a0e20;   /* Darker, deeper blue-black */
  --text:         #e8eaf0;   /* Soft white */
  --text-muted:   #7a8299;   /* Muted blue-grey for secondary text */
  --nebula-violet:#b026ff;
  --nebula-cyan:  #00d4ff;
  --nebula-orange:#ff7b3a;
  --nebula-rose:  #e040fb;
  --accent:       #00d4ff;   /* Primary interactive accent = nebula cyan */

  --nav-height:    48px;
  --player-height: 56px;
}


/* === RESET ===
   Predictable cross-browser baseline. Nothing fancy. */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* Smooth scrolling for in-page anchor links; offset so the heading isn't
     tucked under the fixed nav after a jump. */
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  /* Prevent the parallax shift from creating a horizontal scrollbar on edges. */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Disable iOS tap highlight flash — taps are for interaction, not visual feedback. */
  -webkit-tap-highlight-color: transparent;
  /* Prevent iOS callout menu (long-press) which interrupts canvas interaction. */
  -webkit-touch-callout: none;
}

a       { color: inherit; text-decoration: none; }
button  { font-family: inherit; }


/* === CANVAS BACKGROUND ===
   Fills the viewport, sits behind every other element. Never receives clicks.
   Uses dvh (dynamic viewport height) where supported so the canvas doesn't
   jump when the iOS Safari URL bar collapses or the iPhone notch is honoured. */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;            /* fallback for older browsers */
  height: 100dvh;           /* modern: matches the actually-visible viewport */
  z-index: 0;
  display: block;
  /* Force canvas to be non-interactive in all browsers (especially Safari fixed-pos edge case) */
  pointer-events: none !important;
}


/* === ENTRY SCREEN ===
   Full-viewport overlay shown on first load. Clicking anywhere triggers the
   entry transition (see .exit). The canvas is visible behind it. */
.entry {
  position: fixed;
  inset: 0;
  z-index: 100;                                 /* above the page until dismissed */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  transition: opacity 600ms ease-out, transform 600ms ease-out;
  transform-origin: center;
}

/* When .exit is added (by JS on click), the screen fades out and scales up slightly,
   then JS removes it from the DOM so it can't block clicks/focus. */
.entry.exit {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}


/* === LOGO ===
   Big static block-capital "RGEN". By design: zero animation on the logo itself —
   the cosmic feeling comes entirely from the canvas behind it. */
.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  letter-spacing: 0.25em;
  font-size: clamp(3rem, 10vw, 7rem);
  color: var(--text);
  margin: 0;
  /* Wide letter-spacing pushes the last letter rightward, so the visual
     centre shifts. The padding-left compensates. */
  padding-left: 0.25em;
  user-select: none;
}

/* === ENTRY INLINE ACTIONS ===
   "Press Play | Enter Site" row below the RGEN logo. No button boxes — pure typography.
   Each action is a <button> with all default styling stripped. Opacity dims at rest and
   lifts to full on hover/focus for a subtle interactive cue without any border or background.
   The | separator is a non-interactive <span> with matching opacity.
   min-height 44px ensures the tap target meets WCAG 2.1 AA on touch devices. */
.entry-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.entry-action {
  /* Strip all default button chrome. */
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  /* Typography — matches the logo's weight and spacing family. */
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  /* Dim at rest; glow to full on hover/focus. */
  opacity: 0.55;
  cursor: pointer;
  /* min-height for touch targets — inline-flex keeps the text vertically centred. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: opacity 220ms ease-out;
}

.entry-action:hover,
.entry-action:focus-visible {
  opacity: 1;
}

.entry-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

/* The | separator between actions. Same opacity as actions at rest; not interactive. */
.entry-sep {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--text);
  opacity: 0.3;
  user-select: none;
  pointer-events: none;
}

/* === HUB PRESS PLAY BUTTON ===
   Shown below the centred nav hub (after Enter Site or on refresh). Same typographic
   style as entry-action. Hidden by default (display:none); JS sets display:inline-flex
   when nav goes .centered. Hidden again when the user picks a section (nav pins to top)
   or when Press Play is clicked. */
.hub-play-btn {
  display: none;          /* JS overrides to inline-flex when active */
  position: fixed;
  /* 60px below the nav's vertical centre (nav is at top:50%) so it never overlaps. */
  top: calc(50% + 60px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  white-space: nowrap;    /* Prevent wrapping on narrow screens */
}


/* === TOP NAV ===
   Two-state nav managed by JS classes:
   1. .centered  — viewport-centre (just after entry)
   2. .pinned    — top bar (after a section is selected)
   The transition between the two is a JS-driven fade-out / reposition / fade-in.
   Opacity transitions on all state changes; position switches instantly while faded. */
.top-nav {
  position: fixed;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;                                      /* separators handle spacing */
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease-out,
              background 200ms ease-out,
              backdrop-filter 200ms ease-out;
}

/* Centred state: sits in the middle of the viewport after entry click. */
.top-nav.centered {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}

/* Pinned state: moves to the top bar after the user selects a section. */
.top-nav.pinned {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: var(--nav-height);
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

/* Frosted backdrop only once pinned to the top and the user has scrolled. */
.top-nav.pinned.scrolled {
  background: rgba(10, 14, 32, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Nav links: no border, no background — clean text only. */
.top-nav a {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  transition: color 250ms ease-out, text-shadow 250ms ease-out;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.55);
  outline: none;
}

/* Larger text in the centred state — more dramatic first impression. */
.top-nav.centered a {
  font-size: 0.85rem;
  letter-spacing: 0.45em;
  padding: 0.8rem 2rem;
}

/* Pipe separator between nav items. No pointer events — purely visual. */
.nav-sep {
  color: rgba(232, 234, 240, 0.25);
  font-size: 0.65rem;
  pointer-events: none;
  user-select: none;
  align-self: center;
}


/* === MAIN CONTENT WRAPPER ===
   Container for all sections. Hidden by default; sections toggle individually.
   Bottom padding includes the iOS safe-area inset so content never tucks under
   the iPhone home indicator. */
.main {
  position: relative;
  z-index: 1;
  padding: calc(var(--nav-height) + 2rem) 1.25rem
           calc(var(--player-height) + 2rem + env(safe-area-inset-bottom, 0px));
  max-width: 1100px;
  margin: 0 auto;
  display: none;                                   /* hidden by default */
}

.main.show {
  display: block;
}

/* === INDIVIDUAL SECTIONS ===
   Each section can be shown/hidden independently. Hidden sections are removed from
   the document flow entirely (display: none) so they don't create extra space.
   Visible sections fade in smoothly.
   scroll-margin-top reserves space for the pinned nav so scrollIntoView() lands
   the section heading just below the nav, not hidden behind it. */
.main > section {
  display: none;                                   /* remove from flow when hidden */
  scroll-margin-top: calc(var(--nav-height) + 0.5rem);
}

.main > section.visible {
  display: block;
  opacity: 0;
  pointer-events: auto;
  /* Cinematic fade-in: longer duration + slight scale gives the section a
     "lens-coming-into-focus" feel. Animation runs once, then settles at 1/0.
     Pure transform+opacity (no filter) keeps it cheap on mobile GPUs. */
  animation: fadeInSection 650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInSection {
  0%   { opacity: 0; transform: translateY(28px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0)    scale(1);     }
}


/* === SECTION HEADINGS ===
   Tiny, muted, widely-tracked uppercase labels — used for "bio", "releases", "contact". */
.section-heading {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  text-align: center;
}


/* === VIDEO FRAME ===
   Generic 16:9 frame reused by the featured release + each release card. */
.video-frame {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border: 1px solid rgba(232, 234, 240, 0.06);
  overflow: hidden;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* === BIO ===
   Magazine-style two-column layout: text on left, portrait on right.
   Stacks vertically on mobile (≤768px).
   Wider max-width (95ch) to accommodate the side-by-side layout — was 65ch when single-column. */
.bio {
  margin: 0 auto 4rem;
  max-width: 95ch;
}

/* The two-column grid. Text column flexes, image column is fixed at ~320px wide.
   gap creates breathing room between the columns.
   align-items: start so the portrait doesn't stretch to match the long text. */
.bio-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.bio-body p {
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.85;
  letter-spacing: 0.005em;
  margin: 0 0 1.1rem;
  color: var(--text);
}

/* First paragraph leads with a slightly larger size to draw the eye in. */
.bio-body p:first-of-type {
  font-size: 1.08rem;
  color: #f1f3f8;
}

/* === BIO PORTRAIT ===
   Single portrait sitting in the right column. position: sticky keeps it visible
   while the text scrolls past on long-text screens. top offset accounts for the pinned nav. */
.bio-portrait {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  position: sticky;
  /* Stick just below the nav with a small visual buffer. Uses the same var as scroll-padding. */
  top: calc(var(--nav-height) + 1.5rem);
}

.bio-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* On tablets and smaller: stack the columns vertically, image on top. */
@media (max-width: 768px) {
  .bio-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Image first on mobile — same visual hierarchy as the magazine references. */
  .bio-portrait {
    order: -1;
    position: static;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* === INSTAGRAM SECTION ===
   Hosts the Behold.so live Instagram feed widget + a "Follow on Instagram" CTA.
   display: flex column centers the Follow CTA while the widget stretches full-width. */
.instagram {
  margin: 0 auto 4rem;
  max-width: 95ch;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Wrapper around the Behold widget. The widget itself is a custom element that
   manages its own internal grid — we just give it room to breathe and a bottom margin
   to separate it from the Follow CTA. */
.instagram-feed-wrapper {
  width: 100%;
  margin-bottom: 2rem;
  min-height: 200px;             /* prevents layout shift while the widget loads */
}

/* The widget custom element is a block-level container by default in its own logic,
   but force it explicit so it always fills the wrapper cleanly. */
.instagram-feed-wrapper behold-widget {
  display: block;
  width: 100%;
}

/* Heading and widget stretch full-width; only the Follow button stays centred. */
.instagram .section-heading,
.instagram-feed-wrapper {
  align-self: stretch;
}

/* Follow CTA — bold pill button below the grid. */
.instagram-follow-btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  margin: 0 auto;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  text-decoration: none;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.instagram-follow-btn:hover,
.instagram-follow-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}


/* === RELEASES ===
   Featured release (The Unexpected) at top, then grid of remaining releases below. */
.releases { margin: 0 auto 2.5rem; }

/* Featured release: large, prominent video frame */
.featured-release {
  margin: 0 auto 3rem;
  text-align: center;
  max-width: 900px;
}

.featured-release .video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border: 1px solid rgba(232, 234, 240, 0.06);
  overflow: hidden;
  margin: 0 auto 0.75rem;
}

.featured-release .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.featured-release-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Grid of remaining releases: smaller cards, 2 columns on desktop */
.releases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.release-card {
  display: flex;
  flex-direction: column;
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Cinematic lift on hover — the frame floats slightly with a soft cyan glow. */
.release-card:hover {
  transform: translateY(-3px);
}

.release-card:hover .release-frame {
  box-shadow: 0 18px 48px rgba(0, 212, 255, 0.18);
  border-color: rgba(0, 212, 255, 0.18);
}

.release-card:hover .release-title {
  color: var(--text);
}

.release-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Subtle shimmer while waiting for the iframe to load — stops once .loaded is added. */
  background: linear-gradient(120deg, #07101f 0%, #0a1628 50%, #07101f 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  border: 1px solid rgba(232, 234, 240, 0.06);
  overflow: hidden;
  transition: box-shadow 350ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 350ms ease-out;
}

.release-frame.loaded {
  animation: none;
  background: var(--bg);
}

.release-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.release-title {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* === RELEASE DESCRIPTION EXPANDER ===
   A <details>/<summary> panel that sits below each release title.
   Collapsed by default so the grid stays clean; tap/click to expand.
   The summary chevron rotates 180° when open (CSS-only, no JS needed).
   Respects prefers-reduced-motion by skipping the height transition. */

.release-desc {
  margin: 0.5rem 0 0;
  border-top: 1px solid rgba(232, 234, 240, 0.07);
}

/* "about this release" toggle row */
.release-desc-toggle {
  list-style: none;           /* hide default triangle in Firefox */
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  transition: color 200ms ease;
}

/* Hide the default WebKit/Firefox disclosure triangle */
.release-desc-toggle::-webkit-details-marker { display: none; }

/* Custom chevron via ::after — rotates open when <details> is open */
.release-desc-toggle::after {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 220ms ease;
  flex-shrink: 0;
  margin-top: -0.15rem; /* optical centre */
}

.release-desc[open] .release-desc-toggle::after {
  transform: rotate(-135deg);
  margin-top: 0.1rem;
}

.release-desc-toggle:hover {
  color: var(--text);
}

/* Description body — revealed when <details> is open */
.release-desc-text {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-muted);
}

/* On the featured release the text can be a touch larger */
.featured-release .release-desc-text {
  font-size: 0.82rem;
}

/* Credits line — smaller, more muted, separated from the body copy by a faint rule.
   Uses · as a separator between roles/names in the content string itself. */
.release-desc-credits {
  margin: 0 0 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(232, 234, 240, 0.06);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(232, 234, 240, 0.35);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .release-desc-toggle::after,
  .release-desc[open] .release-desc-toggle::after {
    transition: none;
  }
}

@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* === SOUND ENGINEER SECTION ===
   Sub-section beneath the main releases grid. A divider line + label separates it visually.
   The grid reuses .releases-grid so cards look identical to the produced releases above.
   The heading is smaller and more muted than .section-heading — it's a subcategory, not a page section. */

.sound-eng-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(232, 234, 240, 0.08);
}

.sound-eng-heading {
  margin: 0 0 1.5rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* === CONTACT ICONS ===
   Three icons centred, no text labels. Each <a> has an aria-label set in JS.
   Min 44×44 touch target per accessibility guidelines. */
.contact { margin: 0 auto 2rem; text-align: center; }

.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}

/* === CONTACT LINKS ===
   Each contact link displays an icon with accompanying text label.
   Flexbox layout stacks icon above label vertically. */
.contact-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 200ms ease-out, transform 200ms ease-out;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--accent);
  transform: scale(1.08);
  outline: none;
}

.contact-link svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.contact-link-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  max-width: 80px;
  line-height: 1.3;
}


/* === CONTACT EMAIL BUTTON ===
   Prominent email call-to-action in the contact section.
   Opens the user's email client via mailto: link.
   Styled with gradient background and hover lift effect. */
.contact-email-btn {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--nebula-violet), var(--accent));
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  /* Explicit properties only — 'transition: all' would needlessly watch every CSS property. */
  transition: transform 300ms ease-out, box-shadow 300ms ease-out;
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.25);
}

.contact-email-btn:hover,
.contact-email-btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 212, 255, 0.4);
  outline: none;
}

.contact-email-btn:active {
  transform: translateY(-1px);
}

/* === DEMOS PASSWORD MODAL ===
   Full-viewport overlay that locks interaction until the correct password is entered.
   Hidden by default; .is-open makes it visible and traps focus inside the box.
   The backdrop is semi-transparent so the starfield shows through subtly. */
.demos-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 32, 0.85);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}

.demos-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.demos-modal-box {
  background: #12162e;
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  width: min(340px, 90vw);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.demos-modal-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 0.4rem;
}

.demos-modal-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0 1.4rem;
  letter-spacing: 0.04em;
}

/* Password input — centred, minimal styling to match the dark theme */
.demos-modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  padding: 0.65rem 0.85rem;
  text-align: center;
  outline: none;
  transition: border-color 200ms;
  font-family: inherit;
}

.demos-modal-input:focus {
  border-color: var(--accent);
}

/* Error message — hidden until JS sets textContent */
.demos-modal-error {
  font-size: 0.65rem;
  color: #ff5c5c;
  letter-spacing: 0.04em;
  min-height: 1.2em;
  margin: 0.5rem 0 0;
}

.demos-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.4rem;
}

.demos-modal-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 200ms ease-out;
  font-family: inherit;
}

/* Cancel: ghost style */
.demos-modal-btn--cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

.demos-modal-btn--cancel:hover,
.demos-modal-btn--cancel:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
  outline: none;
}

/* Unlock: accent gradient, matches site CTA style */
.demos-modal-btn--submit {
  background: linear-gradient(135deg, var(--nebula-violet), var(--accent));
  color: var(--bg);
}

.demos-modal-btn--submit:hover,
.demos-modal-btn--submit:focus-visible {
  opacity: 0.9;
  transform: translateY(-1px);
  outline: none;
}




/* === PLAYER TABS ===
   Slim playlist switcher at the left of the player bar.
   Active tab glows with the accent colour; inactive is muted. */
.player-tabs {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.player-tab {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 3px;
  transition: color 200ms ease-out, background 200ms ease-out;
}

.player-tab:hover,
.player-tab:focus-visible {
  color: var(--text);
  background: rgba(232, 234, 240, 0.06);
  outline: none;
}

.player-tab.active {
  color: var(--accent);
}

/* === TRACK LIST POPOVER ===
   Floating dropdown above player tabs. Hidden by default, shown with .is-open class.
   Uses opacity + max-height + pointer-events transition (NOT display:none) so the
   popover animates cleanly on BOTH open and close. display:none + @keyframes only
   animates opening — removing the class instantly hides the element before the
   close animation can play. */
.track-list {
  /* Always display:block so CSS transitions fire on both open and close */
  display: block;
  position: absolute;
  bottom: calc(var(--player-height) + 2px);
  left: 0;
  background: rgba(10, 14, 32, 0.95);
  border: 1px solid rgba(232, 234, 240, 0.1);
  border-radius: 4px;
  /* max-height animates between 0 and the open value — allows height transition */
  max-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 61;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* Hidden state: invisible + not interactive */
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 180ms ease-out,
    max-height 180ms ease-out,
    transform 180ms ease-out;
}

/* Open state: visible, interactive, fully expanded */
.track-list.is-open {
  max-height: 320px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.track-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out;
}

.track-item:hover {
  background: rgba(232, 234, 240, 0.08);
  color: var(--text);
}

.track-item.active {
  color: var(--accent);
  background: rgba(138, 43, 226, 0.1);
  font-weight: 500;
}


/* === AUDIO PLAYER ===
   Fixed-bottom slim bar with frosted backdrop. Hidden until entry click.
   padding-bottom honours the iOS home-indicator safe area so buttons remain
   tappable on notch-era iPhones. */
.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  min-height: var(--player-height);
  /* Guarantee player is above everything (canvas, nav, content) so buttons are always clickable */
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem env(safe-area-inset-bottom, 0px);
  background: rgba(3, 9, 20, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(232, 234, 240, 0.06);
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.player.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.player-btn {
  background: transparent;
  border: 0;
  /* All transport buttons are full brightness — grey made them look disabled. */
  color: var(--text);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: color 200ms ease-out, background 200ms ease-out;
}

.player-btn:hover,
.player-btn:focus-visible {
  color: var(--text);
  background: rgba(232, 234, 240, 0.06);
  outline: none;
}

.player-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* === VOLUME GROUP ===
   Mute button + range slider sit side-by-side at the far right of the player bar.
   The slider uses a CSS custom property (--vol) for the filled-track gradient.
   Cross-browser range thumb styles are needed for WebKit and Firefox separately.
   Hidden on very small screens where the player bar is already at its tightest. */
.volume-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  /* Filled (left of thumb) = accent; unfilled (right) = muted white */
  background: linear-gradient(
    to right,
    var(--accent) var(--vol, 100%),
    rgba(232, 234, 240, 0.18) var(--vol, 100%)
  );
  /* Vertical padding enlarges the touch target without changing visual height */
  padding: 8px 0;
  box-sizing: content-box;
}

/* WebKit / Blink thumb */
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.volume-slider:hover::-webkit-slider-thumb,
.volume-slider:focus-visible::-webkit-slider-thumb {
  background: var(--accent);
  transform: scale(1.25);
}

/* Firefox thumb */
.volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  cursor: pointer;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.volume-slider:hover::-moz-range-thumb,
.volume-slider:focus-visible::-moz-range-thumb {
  background: var(--accent);
  transform: scale(1.25);
}

/* Firefox track — strip Firefox's default track fill */
.volume-slider::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: transparent;
}

.player-info {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;                                /* allow shrinking for ellipsis */
  flex: 1 1 auto;
}

.player-track {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

.player-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;          /* steady width as numbers tick */
  white-space: nowrap;
}

.progress {
  flex: 0 1 280px;
  /* 6px visible track; invisible 8px padding above+below enlarges the click area
     so a click anywhere near the bar registers correctly. Negative margin cancels
     the layout effect of the padding so neighbouring elements don't shift. */
  height: 6px;
  padding: 8px 0;
  margin: -8px 0;
  box-sizing: content-box;
  background: rgba(232, 234, 240, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.progress:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--nebula-violet), var(--accent));
  border-radius: 2px;
}


/* === RESPONSIVE ===
   Tablet (≤720px): single-column releases, tighter nav and player.
   Mobile (≤600px): player splits into two rows, larger touch targets.
   Small phone (≤420px): tightest margins, nav text scales down.
   ============================================================ */

/* --- Tablet --- */
@media (max-width: 720px) {
  .releases-grid { grid-template-columns: 1fr; }

  .top-nav a          { padding: 0.5rem 0.9rem; font-size: 0.65rem; }
  .top-nav.centered a { padding: 0.7rem 1.2rem; font-size: 0.8rem; }

  /* Hide time display on tablet to save room */
  .player-time { display: none; }
  .progress    { flex: 1 1 auto; }
}


/* --- Mobile: two-row player + larger touch targets --- */
@media (max-width: 600px) {
  /* Increase player height to fit two rows comfortably */
  :root { --player-height: 84px; }

  /* Player: wrap into two rows.
     Row 1: playlist tabs (full width, ~40px).
     Row 2: controls, track name, progress bar, mute (~44px).
     align-content:stretch splits the 84px evenly between the two rows.
     padding-bottom carries the iOS safe-area inset (home indicator). */
  .player {
    flex-wrap: wrap;
    align-content: stretch;
    padding: 0 0.75rem env(safe-area-inset-bottom, 0px);
    gap: 0;
    min-height: var(--player-height);
  }

  /* Tabs take the full first row, centred */
  .player-tabs {
    order: -1;
    flex: 0 0 100%;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(232, 234, 240, 0.07);
  }

  .player-tab {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    padding: 0.3rem 0.8rem;
  }

  /* Second row: all remaining items share the lower half naturally */
  .player-controls { order: 0; flex: 0 0 auto; gap: 0.1rem; }
  .player-info     { order: 1; flex: 1 1 0;    min-width: 0; gap: 0.3rem; }
  .progress        { order: 2; flex: 1 1 80px; align-self: center;
                     height: 14px; border-radius: 7px; margin: 0 0.4rem; }
  .progress-fill   { border-radius: 7px; }
  .volume-group    { order: 3; flex: 0 0 auto; }
  .volume-slider   { display: none; }            /* no room — mute icon alone is enough */
  #mute-btn        { width: 36px; }

  .player-btn     { width: 34px; height: 34px; }
  .player-btn svg { width: 18px; height: 18px; }

  /* Track name: allow more of the narrow screen */
  .player-track { max-width: 38vw; font-size: 0.68rem; }
  .player-time  { display: none; }   /* no room for time on second row */

  /* Nav: tighten spacing so four items don't overflow */
  .top-nav a {
    padding: 0.5rem 0.6rem;
    font-size: 0.6rem;
    letter-spacing: 0.22em;
  }
  .top-nav.centered a {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
  }
  /* Thinner separators to save space */
  .nav-sep { font-size: 0.55rem; }

  /* Tighter content padding — use more of the narrow viewport */
  .main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Bio: slightly smaller text for comfortable line lengths on 375px */
  .bio-body p { font-size: 0.95rem; line-height: 1.75; }

  /* Contact links: adjust for mobile with labels */
  .contact-icons { gap: 2rem; }
  .contact-link svg { width: 28px; height: 28px; }
  .contact-link-label { font-size: 0.6rem; }
}


/* --- Small phone (≤420px) --- */
@media (max-width: 420px) {
  .main { padding-left: 0.85rem; padding-right: 0.85rem; }

  /* Tap targets: pad vertically so each link clears the WCAG 44px minimum
     touch area, even though the visual text remains tiny. */
  .top-nav a {
    padding: 1rem 0.55rem;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .top-nav.centered a {
    padding: 1.05rem 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
  }
  .nav-sep { display: none; }   /* drop separators — items are close enough */

  .player-track { max-width: 34vw; }
}


/* === WIDESCREEN POLISH ===
   On ≥1280px monitors the content gets a touch more dramatic — bigger lead
   paragraph, larger featured release, three-column releases grid. This makes
   the page feel composed for a cinema screen, not stretched. */
@media (min-width: 1280px) {
  /* Slightly larger bio measure + bigger lead paragraph for editorial weight. */
  .bio { max-width: 70ch; }
  .bio-body p              { font-size: 1.08rem; line-height: 1.9;  }
  .bio-body p:first-of-type { font-size: 1.22rem; line-height: 1.7; }

  /* More breathing room around section heading on big screens. */
  .section-heading { margin-bottom: 2rem; font-size: 0.75rem; }

  /* Featured release scales up — it's the hero of the page. */
  .featured-release         { max-width: 1040px; margin-bottom: 4rem; }
  .featured-release .video-frame { max-width: 1040px; }
  .featured-release-label   { font-size: 0.8rem; margin-top: 0.9rem; }

  /* Three-column releases grid uses the wider canvas without feeling cramped. */
  .releases-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }

}

/* Ultra-wide (≥1600px) — give the canvas even more room. */
@media (min-width: 1600px) {
  .main { max-width: 1280px; }
}


/* === REDUCED MOTION ===
   When the user has asked for reduced motion, kill all animations + transitions.
   The canvas itself also checks this flag (see main.js) and skips parallax + twinkle. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html             { scroll-behavior: auto; }
  .release-frame   { animation: none; }
  /* backdrop-filter is not a transition/animation so the rule above won't catch it.
     Remove blur compositing layers for users who prefer reduced motion — a meaningful
     accessibility + GPU win on low-power devices. */
  .demos-modal,
  .track-list,
  .top-nav.pinned.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
