/* =========================================================
   Moodboard — Six Senses Rome
   ---------------------------------------------------------
   Navigable card-board of six sonic moodboards.
   Each card opens inline to reveal its track list. A
   Spotify-style fixed player sits at the bottom; a hidden
   YouTube IFrame Player drives audio.

   Coherent with landing.css + deck.css: same tokens, same
   typography (Inter Tight 800 uppercase headlines, Newsreader
   italic accent), left rail, custom cursor.
   ========================================================= */

.mb {
  position: relative;
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
  padding-bottom: 14vh; /* reserve room for fixed player */
}
.mb a, .mb button, .mb .clickable { cursor: none; }

/* =========================================================
   Hero
   ========================================================= */
.mb-hero {
  position: relative;
  padding: 18vh 8vw 8vh 11vw;
}
.mb-hero .eyebrow {
  font-size: 1.3vh;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 3vh;
}
.mb-hero h1 {
  margin: 0 0 4vh;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 11vh, 200px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.mb-hero h1 .line       { display: block; overflow: hidden; }
.mb-hero h1 .line > span{ display: inline-block; will-change: transform; }
.mb-hero .lead {
  margin: 0;
  font-size: clamp(16px, 2vh, 26px);
  line-height: 1.45;
  max-width: 60ch;
  color: var(--ink-soft);
}
.mb-hero .lead em {
  font-family: "Newsreader", "Tiempos", Georgia, serif;
  font-style: italic;
  color: var(--ink);
  font-weight: 500;
}

/* =========================================================
   Board — grid of 6 cards
   ========================================================= */
.mb-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2vh 2vw;
  padding: 0 6vw 12vh;
  transition: padding 320ms ease;
}
.mb-board[data-open="true"] {
  /* Once a card is open the grid relaxes — open card consumes most of the space */
}
@media (max-width: 980px) {
  .mb-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .mb-board { grid-template-columns: 1fr; }
}

/* Each card */
.mb-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  transition:
    transform 360ms cubic-bezier(.2,.8,.2,1),
    box-shadow 360ms cubic-bezier(.2,.8,.2,1),
    border-color 320ms ease,
    opacity 320ms ease;
}
.mb-card:hover { transform: translateY(-0.6vh); box-shadow: 0 18px 50px rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.18); }

/* When some card is open, keep the others fully visible — only block clicks */
.mb-board[data-open="true"] .mb-card             { pointer-events: none; }
.mb-board[data-open="true"] .mb-card.open        { pointer-events: auto; }

/* Open card — fullbleed inline, replaces the grid visually */
.mb-card.open {
  position: fixed;
  top: 6vh;
  left: 6vw; right: 6vw; bottom: 16vh;
  width: auto; height: auto;
  aspect-ratio: auto;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(280px, 36vw) 1fr;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  box-shadow: 0 40px 140px rgba(0,0,0,0.20);
  transform: none;
}

/* Card cover — solid black by default, falls back to an image when
   the moodboard has `image: "<url>"` set in world.js. */
.mb-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.4vh 1.6vw;
  color: #fff;
  background-color: #0F0F12;
  background-size: cover;
  background-position: center;
  isolation: isolate;
  flex: 0 0 auto;
  overflow: hidden;
}
.mb-card.open .mb-cover {
  aspect-ratio: auto;
  height: 100%;
}
/* Audio-/cursor-reactive aura blob sits behind the gradient. */
.mb-cover .mb-aura {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Gradient overlay — dark only at top/bottom so the blob shows through */
.mb-cover::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0)   30%,
    rgba(0,0,0,0)   70%,
    rgba(0,0,0,0.60) 100%);
  z-index: 1;
  pointer-events: none;
}
/* Subtle grain on top */
.mb-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.35;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}
/* Cover content sits above everything. AuraField is excluded by the more
   specific `.mb-cover .mb-aura` rule above which sets z-index: 0. */
.mb-cover > * { position: relative; z-index: 3; }
.mb-cover .num {
  font-family: var(--font-display);
  font-size: 1.2vh;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.78;
}
.mb-cover h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vh, 80px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.mb-cover .submood {
  font-family: "Newsreader", "Tiempos", Georgia, serif;
  font-style: italic;
  font-size: clamp(13px, 1.7vh, 20px);
  line-height: 1.35;
  opacity: 0.92;
}
.mb-cover .cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  transition: gap 240ms ease;
}
.mb-card:hover .mb-cover .cta { gap: 16px; }
.mb-card.open .mb-cover .cta { display: none; }

/* Card meta (under cover, in closed state) */
.mb-meta {
  display: none; /* meta lives in cover for the closed state; tracks panel for open */
}

/* Tracks panel — only shows on .open */
.mb-tracks {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 2.4vh 2vw 2vh;
}
.mb-card:not(.open) .mb-tracks { display: none; }

.mb-tracks-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.6vh;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.4vh;
}
.mb-tracks-head .h-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
}
.mb-tracks-head .h-feeling {
  font-family: "Newsreader", "Tiempos", Georgia, serif;
  font-style: italic;
  font-size: clamp(13px, 1.55vh, 18px);
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

.mb-tracklist {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.25) transparent;
}
.mb-tracklist::-webkit-scrollbar { width: 4px; }
.mb-tracklist::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.20); border-radius: 2px; }

.mb-track {
  display: grid;
  grid-template-columns: 30px 22px 1fr 28px;
  align-items: center;
  gap: 14px;
  padding: 1.2vh 1vw;
  border-radius: 4px;
  cursor: pointer;
  transition: background 200ms ease, padding 200ms ease, color 200ms ease;
}
.mb-track .t-ext {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  transition: color 200ms ease, background 200ms ease;
  text-decoration: none;
}
.mb-track .t-ext:hover { color: var(--orange); background: rgba(230, 76, 31, 0.10); }
.mb-track .t-ext svg { width: 12px; height: 12px; display: block; }
.mb-track[data-playing="true"] .t-ext { color: var(--orange); }
.mb-track:hover { background: rgba(230, 76, 31, 0.06); padding-left: 1.4vw; }
.mb-track[data-playing="true"] { background: rgba(230, 76, 31, 0.12); color: var(--orange); }

.mb-track .n {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-feature-settings: "tnum";
}
.mb-track[data-playing="true"] .n { color: var(--orange); }

.mb-track .play-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: color 200ms ease, transform 200ms ease;
}
.mb-track:hover .play-icon { color: var(--orange); transform: scale(1.15); }
.mb-track[data-playing="true"] .play-icon { color: var(--orange); }
.mb-track .play-icon svg { width: 12px; height: 12px; display: block; }

.mb-track .meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
}
.mb-track .t-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(15px, 1.95vh, 22px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-track .t-artist {
  display: block;
  font-size: clamp(12px, 1.4vh, 16px);
  font-weight: 400;
  color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-track[data-playing="true"] .t-artist { color: rgba(230, 76, 31, 0.85); }

/* Backdrop when open (subtle dim) */
.mb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(248, 247, 244, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.mb-backdrop.show { opacity: 1; pointer-events: auto; }

/* =========================================================
   Closing direction notes — after the board
   ========================================================= */
.mb-notes {
  position: relative;
  padding: 12vh 11vw 8vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5vw;
  background: var(--bg-light);
}
.mb-notes h2 {
  grid-column: 1 / -1;
  margin: 0 0 6vh;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 7vh, 100px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.mb-notes h2 .line       { display: block; overflow: hidden; }
.mb-notes h2 .line > span{ display: inline-block; will-change: transform; }
.mb-notes .col-label {
  font-size: 1.3vh;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2.4vh;
}
.mb-notes .col.avoid .col-label    { color: var(--ink-soft); }
.mb-notes .col.aim   .col-label    { color: var(--orange); }
.mb-notes ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: clamp(15px, 1.95vh, 24px);
  line-height: 1.6;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.mb-notes ul li {
  position: relative;
  padding: 0.6vh 0 0.6vh 2.4vw;
}
.mb-notes ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.6vh;
  width: 1.4vw; height: 1px;
  background: var(--orange);
}
.mb-notes .col.avoid ul li { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.2); }
@media (max-width: 720px) {
  .mb-notes { grid-template-columns: 1fr; }
}

/* =========================================================
   Thank you — final closing footer
   Dark tone closing moment with confidential notice + brand
   line. Extra bottom padding so the fixed player never
   overlaps the brand line.
   ========================================================= */
.mb-thanks {
  position: relative;
  padding: 18vh 11vw 22vh;
  background: var(--bg-dark);
  color: #fff;
}
.mb-thanks h2 {
  margin: 0 0 8vh;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 14vh, 200px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.mb-thanks h2 .line       { display: block; overflow: hidden; }
.mb-thanks h2 .line > span{ display: inline-block; will-change: transform; }
.mb-thanks .confidential {
  margin: 0 0 3vh;
  max-width: 72ch;
  font-family: var(--font-body);
  font-size: clamp(12px, 1.45vh, 14px);
  line-height: 1.55;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}
.mb-thanks .sign {
  margin: 0;
  font-family: "Newsreader", "Tiempos", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(16px, 2vh, 26px);
  color: rgba(255, 255, 255, 0.75);
}

/* =========================================================
   Spotify-style fixed player
   ========================================================= */
.mb-player {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(100%);
  width: min(820px, calc(100vw - 200px));
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 18px;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease;
}
.mb-player.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Now playing — left */
.mb-pl-now {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.mb-pl-cover {
  width: 44px; height: 44px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: rgba(0,0,0,0.85);
  text-transform: uppercase;
}
.mb-pl-meta { min-width: 0; }
.mb-pl-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-pl-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-pl-tag {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Transport + scrub — center */
.mb-pl-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 320px;
}
.mb-pl-transport {
  display: flex;
  align-items: center;
  gap: 18px;
}
.mb-pl-tbtn {
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  padding: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: color 200ms ease;
}
.mb-pl-tbtn:hover { color: #fff; }
.mb-pl-tbtn svg { width: 14px; height: 14px; display: block; }
.mb-pl-play {
  width: 36px; height: 36px;
  background: #fff;
  color: #0F0F12;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 200ms ease, transform 200ms ease;
}
.mb-pl-play:hover { background: var(--orange); color: #fff; transform: scale(1.06); }
.mb-pl-play svg { width: 12px; height: 12px; display: block; }
.mb-pl-play .pause { display: none; }
.mb-player[data-playing="true"] .mb-pl-play .play  { display: none; }
.mb-player[data-playing="true"] .mb-pl-play .pause { display: block; }

.mb-pl-scrub {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.mb-pl-time {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  font-feature-settings: "tnum";
}
.mb-pl-time.right { text-align: right; }
.mb-pl-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}
.mb-pl-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #fff;
  width: 0%;
  border-radius: 2px;
  transition: background 200ms ease;
}
.mb-pl-bar:hover .mb-pl-bar-fill { background: var(--orange); }

/* Extras — right (volume + close) */
.mb-pl-extras {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}
/* "Open on YouTube" escape hatch for the current track */
.mb-pl-yt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.mb-pl-yt:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.mb-pl-yt svg { width: 11px; height: 11px; display: block; }

.mb-pl-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 4px;
  transition: color 200ms ease;
}
.mb-pl-close:hover { color: #fff; }
.mb-pl-close svg { width: 14px; height: 14px; }

@media (max-width: 980px) {
  .mb-player { width: calc(100vw - 32px); padding: 10px 14px; grid-template-columns: 1fr auto; gap: 14px; }
  .mb-pl-mid { min-width: 0; }
}

/* (YouTube iframe host removed — audio is now a local HTMLAudioElement) */

/* =========================================================
   Custom cursor (same mechanic as landing / deck)
   ========================================================= */
.mb .dv-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 12px; height: 12px;
  border: 1px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: difference;
  background: transparent;
  transition: width 280ms cubic-bezier(.2,.8,.2,1),
              height 280ms cubic-bezier(.2,.8,.2,1),
              background 200ms ease,
              border-color 200ms ease;
}
.mb .dv-cursor.hover {
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.90);
}
@media (hover: none) {
  .mb .dv-cursor { display: none; }
  .mb, .mb a, .mb button, .mb .clickable { cursor: auto !important; }
}

/* Body scroll when moodboard is mounted */
body[data-mode="world"] { overflow-y: auto; overflow-x: hidden; }
