/* =========================================================
   CLAUDINA // NOW — styles.css
   Zune / early Metro inspired. Dark, typographic, asymmetric.
   ========================================================= */

:root{
  --bg: #050505;
  --bg-2: #0a0a0a;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --muted-2: #4d4d4d;
  --accent: #f5a100; /* orange default */
  --accent-dim: rgba(245,161,0,0.35);

  --font: 'Manrope', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --display-size: clamp(64px, 10vw, 180px);
  --display-line: 0.86;
  --meta-size: clamp(16px, 1.6vw, 26px);

  --ease: cubic-bezier(.22,.68,0,1);
  --t-fast: 240ms;
  --t-med: 560ms;
  --t-slow: 900ms;
}

*{ box-sizing: border-box; }
html, body{
  margin:0; padding:0;
  width:100%; height:100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button{
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img{ -webkit-user-drag: none; user-drag: none; }

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

/* =========================================================
   INTRO
   ========================================================= */
.intro{
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
.intro-word{
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0;
  padding-left: 6vw;
}
.intro-word--a{
  font-size: clamp(40px, 9vw, 140px);
  transform: translateY(14px);
  animation: introIn 700ms var(--ease) forwards;
}
.intro-word--b{
  font-size: clamp(28px, 6vw, 90px);
  font-weight: 300;
  color: var(--accent);
  transform: translateY(14px);
  animation: introIn 700ms var(--ease) 260ms forwards;
}
@keyframes introIn{
  to{ opacity: 1; transform: translateY(0); }
}
.intro.hide{
  animation: introOut 480ms var(--ease) forwards;
}
@keyframes introOut{
  to{ opacity: 0; }
}
.intro.gone{ display: none; }

/* =========================================================
   STAGE + VISUAL SECTIONS
   ========================================================= */
.stage{
  position: fixed; inset: 0;
  overflow: hidden;
}

.visual{
  position: absolute; inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  will-change: opacity, transform;
}
.visual.active{
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.visual.leaving{
  opacity: 0;
  transform: scale(0.97);
}

/* ---------------------------------------------------------
   VISUAL 01 — TYPE
   --------------------------------------------------------- */
.visual--type{ background: var(--bg); }

.type-field{
  position: absolute; inset: 0;
}

.type-line{
  position: absolute;
  font-weight: 800;
  line-height: var(--display-line);
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--text);
  will-change: transform, opacity;
}
.type-line.is-accent{ color: var(--accent); }
.type-line.is-muted{
  color: transparent;
  -webkit-text-stroke: 1px var(--muted-2);
  font-weight: 700;
}
.type-line.is-light{ font-weight: 300; }

/* ---------------------------------------------------------
   VISUAL 02 — WAVE
   --------------------------------------------------------- */
.visual--wave{ background: var(--bg); }
#waveCanvas{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.wave-label{
  position: absolute;
  right: 6vw;
  bottom: 32vh;
  text-align: right;
  pointer-events: none;
}
.wave-label__title{
  font-size: clamp(28px, 4.4vw, 64px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 0.95;
}
.wave-label__artist{
  font-size: var(--meta-size);
  font-weight: 300;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------------------------------------------------------
   VISUAL 03 — EQUALIZER
   ZUNE / Hi-Fi / automotive — never RGB gamer. Thick bars,
   one accent color, gentle peak-hold.
   --------------------------------------------------------- */
.visual--equalizer{ background: var(--bg); }
#equalizerCanvas{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.eq-label{
  position: absolute;
  right: 6vw;
  bottom: 32vh;
  text-align: right;
  pointer-events: none;
}
.eq-label__title{
  font-size: clamp(28px, 4.4vw, 64px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 0.95;
}
.eq-label__artist{
  font-size: var(--meta-size);
  font-weight: 300;
  color: var(--accent);
  margin-top: 6px;
}

/* ---------------------------------------------------------
   VISUAL 04 — ALBUM
   --------------------------------------------------------- */
.visual--album{ background: var(--bg); }

.album-bg{
  position: absolute;
  top: -20%; right: -25%;
  width: 90%; height: 140%;
  background-image: url('assets/album-placeholder.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.3) brightness(0.5);
  opacity: 0.55;
  transform: scale(1.2);
  will-change: transform;
}
.album-bg2{
  position: absolute;
  left: -10%; bottom: -30%;
  width: 60%; height: 90%;
  background-image: url('assets/album-placeholder.jpg');
  background-size: 300% 300%;
  background-position: 80% 20%;
  filter: blur(2px) contrast(1.1);
  opacity: 0.18;
  mix-blend-mode: screen;
}

.album-art-wrap{
  position: absolute;
  top: 8vh;
  right: -4vw;
  width: min(64vh, 62vw);
  height: min(64vh, 62vw);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
  will-change: transform;
}
.album-art{
  width: 112%;
  height: 112%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

.album-meta{
  position: absolute;
  left: 6vw;
  bottom: 34vh;
  max-width: 46vw;
}
.album-meta__title{
  font-size: clamp(40px, 6vw, 104px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.88;
}
.album-meta__artist{
  margin-top: 14px;
  font-size: var(--meta-size);
  font-weight: 300;
  color: var(--accent);
}

/* =========================================================
   GESTURE LAYER
   ========================================================= */
.gesture-layer{
  position: fixed; inset: 0;
  z-index: 40;
  background: transparent;
}

/* =========================================================
   OVERLAY UI
   ========================================================= */
.overlay{
  position: fixed; inset: 0;
  z-index: 60;
  pointer-events: none;
  padding: 5vh 6vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.overlay.visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.overlay.visible *{ pointer-events: auto; }

.overlay-scrim{
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
}
.overlay-scrim--top{
  top: 0; height: 24vh;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
}
.overlay-scrim--bottom{
  bottom: 0; height: 40vh;
  background: linear-gradient(to top, rgba(0,0,0,0.88), rgba(0,0,0,0));
}

.overlay__top{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.overlay__eyebrow{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.overlay__track{
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 500;
  color: var(--text);
}
.overlay__sep{
  color: var(--muted-2);
  margin: 0 10px;
  font-weight: 300;
}

.overlay__progress{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  max-width: 640px;
}
.progress-track{
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--muted-2);
}
.progress-fill{
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--accent);
  transition: width 120ms linear;
}

.overlay__bottom{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 5vw;
  flex-wrap: wrap;
}

.control-group{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-label{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.control-row{
  display: flex;
  gap: 18px;
  align-items: center;
}

.control-primary{
  width: 56px; height: 56px;
  border: 1px solid var(--muted-2);
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.control-primary:hover, .control-primary:focus-visible{
  border-color: var(--accent);
  color: var(--accent);
}

.opt{
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.opt.active{
  color: var(--text);
  border-color: var(--accent);
}

.swatch{
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.swatch.active{
  border-color: var(--text);
  transform: scale(1.25);
}

.control-toggle, .control-text{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--muted-2);
  padding: 10px 16px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.control-toggle.on{
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.control-text:hover, .control-toggle:hover{
  color: var(--text);
  border-color: var(--text);
}

/* focus visibility for keyboard use */
button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* =========================================================
   SIDE PANELS — MUSIC (search + recent) & SETTINGS
   Shared shell, same treatment the old CONNECT panel used.
   ========================================================= */
.side-panel{
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5,5,5,0.97);
  display: flex;
  flex-direction: column;
  padding: 6vh 8vw;
  transform: translateY(100%);
  transition: transform var(--t-slow) var(--ease);
  pointer-events: none;
}
.side-panel.open{
  transform: translateY(0);
  pointer-events: auto;
}
.side-panel__header{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--muted-2);
  padding-bottom: 20px;
  flex-shrink: 0;
}
.side-panel__close{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.side-panel__close:hover{ color: var(--text); }
.side-panel__body{
  margin-top: 24px;
  max-width: 640px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Tabs (MUSIC: SEARCH / RECENT) */
.tabs{
  display: flex;
  gap: 28px;
  flex-shrink: 0;
  margin-top: 22px;
}
.tab{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}
.tab.active{
  color: var(--text);
  border-color: var(--accent);
}

.panel-view{
  margin-top: 22px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-view.is-hidden{ display: none; }

/* Search */
.search-form{ flex-shrink: 0; }
.search-input{
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--muted-2);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(24px, 3.6vw, 44px);
  font-weight: 300;
  padding: 10px 0;
  outline: none;
}
.search-input::placeholder{ color: var(--muted-2); }
.search-input:focus{ border-color: var(--accent); }

.results-list{
  margin-top: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-row{
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 4px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  width: 100%;
}
.result-row:hover .result-row__title{ color: var(--accent); }
.result-row__thumb{
  width: 56px; height: 56px;
  flex-shrink: 0;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center;
}
.result-row__meta{ min-width: 0; }
.result-row__title{
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-fast) var(--ease);
}
.result-row__artist{
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-message{
  padding: 30px 4px;
}
.panel-message__title{
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.panel-message__subtitle{
  margin-top: 10px;
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  max-width: 480px;
}

/* Settings */
.settings-block__label{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.settings-block__hint{
  margin-top: 12px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
  font-size: 15px;
  max-width: 520px;
}
.settings-input{
  display: block;
  width: 100%;
  max-width: 480px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--muted-2);
  color: var(--text);
  font-family: monospace;
  font-size: 16px;
  padding: 10px 0;
  margin-top: 10px;
  outline: none;
}
.settings-input:focus{ border-color: var(--accent); }
.settings-block__status{
  margin-top: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* =========================================================
   MESSAGE TOAST — replaces alert()
   ========================================================= */
.message-toast{
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translate(-50%, 12px);
  z-index: 90;
  background: rgba(10,10,10,0.92);
  border: 1px solid var(--muted-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  white-space: nowrap;
}
.message-toast.visible{
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   YOUTUBE SOURCE TILE
   Minimal, policy-compliant persistent player. Kept small and
   discreet by design — never hidden through non-compliant
   hacks (zero-size, off-screen, etc).
   ========================================================= */
.youtube-source-tile{
  position: fixed;
  right: 6vw;
  bottom: 5vh;
  z-index: 55;
  width: 128px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.youtube-source-tile.visible{
  opacity: 0.9;
  transform: translateY(0);
}
.overlay.visible ~ .youtube-source-tile.visible{
  pointer-events: auto;
}
.youtube-source-tile__label{
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}
.youtube-source-tile__player{
  width: 128px;
  height: 72px;
  background: #000;
  overflow: hidden;
}
.youtube-source-tile__player iframe{
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}
body.drive .youtube-source-tile{
  width: 84px;
  opacity: 0.5;
}
body.drive .youtube-source-tile__player{
  width: 84px;
  height: 47px;
}
body.drive .youtube-source-tile__label{
  display: none;
}

/* =========================================================
   DRIVE DISPLAY MODE
   ========================================================= */
body.drive .overlay__progress,
body.drive .hide-in-drive,
body.drive .overlay__eyebrow{
  display: none;
}
body.drive .overlay__track{
  font-size: clamp(28px, 3.4vw, 44px);
}
body.drive .control-primary{
  width: 72px; height: 72px;
  font-size: 24px;
}
body.drive .display-size-boost{
  --display-size: clamp(80px, 12vw, 220px);
}
body.drive .album-meta__title{
  font-size: clamp(60px, 9vw, 160px);
}
body.drive .wave-label__title,
body.drive .eq-label__title{
  font-size: clamp(36px, 5.6vw, 84px);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Portrait fallback: still usable, just re-flow a bit */
@media (orientation: portrait){
  .album-art-wrap{
    width: min(70vw, 70vh);
    height: min(70vw, 70vh);
    right: -6vw;
  }
  .album-meta{ max-width: 80vw; }
  .overlay__bottom{ gap: 6vw; }
}

/* Small landscape (phones / narrow head units) */
@media (max-height: 500px){
  .overlay{ padding: 3vh 5vw; }
  .control-primary{ width: 44px; height: 44px; font-size: 15px; }
  .album-meta{ bottom: 30vh; max-width: 50vw; }
  .album-meta__title{ font-size: clamp(28px, 5.5vw, 72px); }
  .wave-label{ bottom: 30vh; }
  .wave-label__title{ font-size: clamp(20px, 4vw, 40px); }
  .eq-label__title{ font-size: clamp(20px, 4vw, 40px); }
  .overlay__bottom{ gap: 4vw; }
  .control-row{ gap: 12px; }
  .youtube-source-tile{ width: 92px; right: 4vw; bottom: 3vh; }
  .youtube-source-tile__player{ width: 92px; height: 52px; }
}

/* Large displays */
@media (min-width: 1600px){
  :root{
    --meta-size: 22px;
  }
}

/* Fullscreen affordance hides once entered */
:fullscreen #fullscreenBtn,
:-webkit-full-screen #fullscreenBtn{
  display: none;
}
