/* Office Radio — ऑफिस रेडियो */

/* Registering the palette lets the scene cross-fade between times of day
   instead of snapping. Browsers without @property just switch instantly. */
@property --sky-1   { syntax: '<color>'; inherits: true; initial-value: #79b6e8; }
@property --sky-2   { syntax: '<color>'; inherits: true; initial-value: #b9dcf3; }
@property --sky-3   { syntax: '<color>'; inherits: true; initial-value: #f6e3c4; }
@property --sun     { syntax: '<color>'; inherits: true; initial-value: #fff3cf; }
@property --city-far  { syntax: '<color>'; inherits: true; initial-value: #9fbcd8; }
@property --city-near { syntax: '<color>'; inherits: true; initial-value: #7d9cbe; }
@property --tree     { syntax: '<color>'; inherits: true; initial-value: #4c7f50; }
@property --wall     { syntax: '<color>'; inherits: true; initial-value: #8a7358; }
@property --wall-lit { syntax: '<color>'; inherits: true; initial-value: #d7b184; }
@property --warm     { syntax: '<color>'; inherits: true; initial-value: #ffc472; }
@property --fg-sil   { syntax: '<color>'; inherits: true; initial-value: #4a3a2c; }
@property --haze     { syntax: '<color>'; inherits: true; initial-value: #ffd9a0; }
@property --accent   { syntax: '<color>'; inherits: true; initial-value: #e9a13b; }

:root {
  --sun-y: 325px;
  --star-op: 0;
  --win-lit: 0.08;
  --warm-op: 0.3;
  --lamp-op: 0.45;
  --screen-op: 0.55;
  --haze-op: 0.16;

  /* Fixed interior tones — these read the same at every hour. */
  --leaf: #58a85b;
  --leaf-dk: #2f6136;
  --desk: #cb9159;
  --desk-dk: #8f6136;
  --mug: #efe6d6;
  --screen: #cfe6ff;

  --ink: #fdf8f0;
  --ink-dim: rgba(253, 248, 240, 0.62);
  --ink-faint: rgba(253, 248, 240, 0.34);
  --glass: rgba(22, 17, 14, 0.46);
  --glass-line: rgba(255, 255, 255, 0.16);
  --radius: 18px;

  --sans: 'Anek Devanagari', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

  color-scheme: dark;
  transition: --sky-1 2.5s, --sky-2 2.5s, --sky-3 2.5s, --sun 2.5s,
              --city-far 2.5s, --city-near 2.5s, --tree 2.5s, --wall 2.5s, --wall-lit 2.5s,
              --warm 2.5s, --fg-sil 2.5s, --haze 2.5s, --accent 0.6s;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0d0b12;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ scene */

/* overflow:hidden keeps the sliced SVG from extending the page box on mobile. */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* The photograph, and a very slow push-in so a still image still breathes. */
.photo { position: absolute; inset: 0; animation: kenburns 78s ease-in-out infinite alternate; }
.photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  display: block;
  filter: brightness(var(--ph-b, 1)) saturate(var(--ph-s, 1))
          hue-rotate(var(--ph-h, 0deg)) contrast(var(--ph-c, 1));
  transition: filter 2.5s ease;
}
@keyframes kenburns {
  from { transform: scale(1.05) translate3d(-0.6%, 0.4%, 0); }
  to   { transform: scale(1.12) translate3d(0.8%, -0.9%, 0); }
}

/* Time of day, painted over the photograph. */
.daylight {
  position: absolute; inset: 0;
  pointer-events: none;
  background: var(--grade, transparent);
  opacity: var(--grade-op, 0);
  mix-blend-mode: var(--grade-mode, multiply);
  transition: opacity 2.5s ease, background-color 2.5s ease;
}

/* Sunlight through the glass: a bloom that breathes and a slow diagonal sweep. */
.godray { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.godray::before {
  content: '';
  position: absolute; inset: -10%;
  background: radial-gradient(38% 42% at 52% 34%, var(--warm), transparent 68%);
  opacity: calc(var(--warm-op, 0.3) * 0.26);
  mix-blend-mode: screen;
  animation: bloom 13s ease-in-out infinite alternate;
}
.godray::after {
  content: '';
  position: absolute; top: -60%; left: -40%;
  width: 55%; height: 220%;
  background: linear-gradient(100deg, transparent, var(--warm), transparent);
  opacity: 0.05;
  mix-blend-mode: screen;
  filter: blur(28px);
  transform: rotate(14deg);
  animation: sweep 34s linear infinite;
}
@keyframes bloom { from { opacity: calc(var(--warm-op, 0.3) * 0.16); } to { opacity: calc(var(--warm-op, 0.3) * 0.34); } }
@keyframes sweep { from { transform: rotate(14deg) translateX(-30%); } to { transform: rotate(14deg) translateX(360%); } }

/* Dust in the light. Generated in app.js so it works over either backdrop. */
.motes { position: absolute; inset: 0; pointer-events: none; }
.motes i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: var(--warm);
  animation: mote-float var(--dur, 16s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
@keyframes mote-float {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--dx, 24px), var(--dy, -90px), 0); }
}

/* Only one backdrop is live at a time. */
body[data-backdrop='photo'] #scene { display: none; }
body[data-backdrop='svg'] .photo,
body[data-backdrop='svg'] .godray { display: none; }

.sun, .sun-glow { cy: var(--sun-y); transition: cy 2.5s ease; }

/* A film of grain keeps the flat vectors from looking sterile. */
.grain {
  position: absolute; inset: -50%;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 42%, transparent 48%, rgba(8, 6, 12, 0.38) 100%),
    linear-gradient(to bottom, rgba(8, 6, 12, 0.34), transparent 22%, transparent 62%, rgba(8, 6, 12, 0.55));
}

/* scene motion */
.cloud { animation: drift var(--dur, 200s) linear infinite; animation-delay: var(--delay, 0s); transform: translate(-300px, var(--y)); }
@keyframes drift { from { transform: translate(-320px, var(--y)); } to { transform: translate(1700px, var(--y)); } }

.twinkle { animation: tw var(--tw, 4s) ease-in-out infinite alternate; animation-delay: var(--td, 0s); }
@keyframes tw { from { opacity: 0.15; } to { opacity: 1; } }

.bird { animation: fly var(--dur, 20s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes fly { from { transform: translate(-120px, 40px); } to { transform: translate(1500px, -80px); } }

.fan-blades { animation: spin 1.6s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.leaf { transform-box: fill-box; transform-origin: 50% 100%; animation: sway var(--dur, 7s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }

.vine { transform-box: fill-box; transform-origin: 50% 0; animation: sway var(--dur, 9s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }

.mote { animation: float var(--dur, 14s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(var(--dx, 20px), -70px); } }

.steam { animation: rise 3.2s ease-out infinite; animation-delay: var(--delay, 0s); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes rise {
  0%   { opacity: 0; transform: translateY(6px) scaleY(0.7); }
  30%  { opacity: 0.55; }
  100% { opacity: 0; transform: translateY(-22px) scaleY(1.25); }
}

.screen { animation: flicker 7s ease-in-out infinite; }
@keyframes flicker { 0%, 92%, 100% { filter: none; } 94% { filter: brightness(1.35); } 96% { filter: brightness(0.85); } }

/* ---------------------------------------------------------------- chrome */

.shell {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(16px, 2.2vw, 30px);
  gap: 12px;
  overflow: clip;
}

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.clock-wrap { display: flex; flex-direction: column; gap: 2px; }
.clock {
  font-family: var(--mono);
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}
.clock .suffix { font-size: 0.55em; opacity: 0.7; margin-left: 4px; }
.session {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 2px 16px rgba(0, 0, 0, 0.7);
}
.session b { color: #fff; font-weight: 600; }
.clock { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 2px 20px rgba(0, 0, 0, 0.75); }

.top-actions { display: flex; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  font-size: 14px; font-weight: 500;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.chip:hover { background: rgba(40, 32, 26, 0.6); border-color: rgba(255, 255, 255, 0.3); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ------------------------------------------------------------- wordmark */

.masthead {
  position: relative;
  align-self: center;
  justify-self: center;
  text-align: center;
  display: grid;
  gap: 4px;
  pointer-events: none;
  transform: translateY(-6vh);
}
/* A soft scrim so the wordmark holds up against a bright midday sky. */
.masthead::before {
  content: '';
  position: absolute;
  inset: -30% -22%;
  z-index: -1;
  background: radial-gradient(58% 52% at 50% 50%, rgba(10, 7, 14, 0.52), transparent 72%);
}
/* The wave sits across the wordmark, behind the letters so they stay legible
   while the glow bleeds over them. */
.masthead-wave {
  position: absolute;
  left: 50%;
  top: 0;                 /* app.js centres this on the wordmark line itself */
  transform: translate(-50%, -50%);
  width: min(170%, 98vw);
  height: 120px;
  z-index: -1;
  pointer-events: none;
}

.masthead .hi {
  font-size: clamp(54px, 9.5vw, 138px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: #fff;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 0 90px color-mix(in srgb, var(--accent) 60%, transparent);
}
.masthead .en {
  font-family: var(--mono);
  font-size: clamp(10px, 1.15vw, 14px);
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.masthead .sub {
  margin-top: 8px;
  font-size: clamp(15px, 1.5vw, 21px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

/* ----------------------------------------------------------------- dial */

.bottom { display: grid; gap: 14px; justify-items: center; }

.dial {
  display: flex; gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 22px), transparent);
}
.dial::-webkit-scrollbar { display: none; }

.station {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  padding: 9px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(18, 14, 12, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.station:hover { background: rgba(38, 30, 24, 0.62); transform: translateY(-2px); }
.station .s-en { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.station .s-hi { font-size: 11.5px; line-height: 1.2; color: rgba(255, 255, 255, 0.55); }
.station[aria-current='true'] {
  border-color: color-mix(in srgb, var(--tint) 80%, transparent);
  background: color-mix(in srgb, var(--tint) 22%, rgba(18, 14, 12, 0.55));
  box-shadow: 0 6px 26px color-mix(in srgb, var(--tint) 35%, transparent);
}
.station[aria-current='true'] .s-hi { color: var(--tint); }

/* --------------------------------------------------------------- player */

.player {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.art {
  width: 62px; height: 62px;
  border-radius: 11px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.track { min-width: 0; display: grid; gap: 3px; }
.track .t-title {
  font-size: 15.5px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track .t-artist {
  font-size: 13px; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.scrub { display: flex; align-items: center; gap: 9px; margin-top: 4px; }
.bar {
  position: relative; flex: 1;
  height: 32px;
  cursor: pointer;
  touch-action: none;
}
.bar canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bar[data-live='true'] { cursor: default; }
.time { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: #ff6b5e; display: inline-flex; align-items: center; gap: 5px;
}
.live-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ff6b5e; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.controls { display: flex; align-items: center; gap: 6px; }
.ctl {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.18s, transform 0.12s;
}
.ctl:hover { background: rgba(255, 255, 255, 0.12); }
.ctl:active { transform: scale(0.92); }
.ctl.primary {
  width: 50px; height: 50px;
  background: var(--accent);
  color: #1a1208;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 55%, transparent);
}
.ctl.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.ctl svg { width: 19px; height: 19px; fill: currentColor; }
.ctl.small { width: 30px; height: 30px; opacity: 0.66; }
.ctl.small:hover { opacity: 1; }
.ctl.small svg { width: 16px; height: 16px; }
.links { display: flex; flex-direction: column; gap: 2px; margin-left: 4px; }
.ctl.primary svg { width: 22px; height: 22px; }
.ctl.is-busy svg { animation: pulse 1s ease-in-out infinite; }

/* ---------------------------------------------------------------- panels */

.panel {
  position: fixed;
  top: 50%; right: clamp(16px, 2.2vw, 30px);
  transform: translate(0, -50%) translateX(calc(100% + 40px));
  width: min(330px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  overflow-y: auto;
  z-index: 5;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--glass-line);
  background: rgba(20, 15, 13, 0.72);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  opacity: 0;
}
.panel[data-open='true'] { transform: translate(0, -50%); opacity: 1; }

.panel h2 {
  margin: 0 0 2px;
  font-size: 19px; font-weight: 700;
}
.panel .lede { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }

.layer { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.layer .ico { font-size: 15px; text-align: center; opacity: 0.85; }
.layer .lname { font-size: 14px; font-weight: 500; }
.layer .lname small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-faint); }
.layer .val { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.layer input { grid-column: 1 / -1; }

input[type='range'] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; margin: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 0 12px var(--accent);
}
input[type='range']::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.panel-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.mini {
  padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--glass-line); background: transparent;
  font-size: 12px; transition: background 0.18s;
}
.mini:hover { background: rgba(255, 255, 255, 0.1); }

.keys-list { display: grid; gap: 9px; }
.keys-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 13px; }
.keys-list span { color: var(--ink-dim); }
kbd {
  font-family: var(--mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  white-space: nowrap;
}

/* ------------------------------------------------------------ boss mode */

.boss {
  position: fixed; inset: 0; z-index: 50;
  display: none;
  background: #f6f7f9;
  color: #1e2430;
  font-family: 'Segoe UI', system-ui, sans-serif;
  padding: 28px 34px;
  overflow: auto;
}
.boss[data-open='true'] { display: block; }
.boss h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.boss p.sub { margin: 0 0 22px; font-size: 12.5px; color: #6b7383; }
.boss table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.boss th, .boss td { padding: 7px 10px; border-bottom: 1px solid #e4e7ec; text-align: right; }
.boss th:first-child, .boss td:first-child { text-align: left; }
.boss th { font-weight: 600; color: #55607a; background: #eef1f5; }
.boss tr:nth-child(even) td { background: #fbfcfd; }
.boss .exit { position: fixed; right: 22px; bottom: 18px; font-size: 11px; color: #9aa3b2; }

/* ----------------------------------------------------------------- misc */

.yt-mount { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -9999px; top: 0; }

.toast {
  position: fixed; left: 50%; bottom: 118px;
  transform: translateX(-50%) translateY(14px);
  z-index: 20;
  padding: 9px 16px; border-radius: 11px;
  background: rgba(20, 15, 13, 0.86);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast[data-show='true'] { opacity: 1; transform: translateX(-50%) translateY(0); }

.veil {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(10, 8, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.5s;
}
.veil[hidden] { display: none; }
.veil {
  background: radial-gradient(70% 60% at 50% 45%, rgba(10, 8, 14, 0.3), rgba(8, 6, 12, 0.72));
}
.veil button {
  display: grid; place-items: center; gap: 0;
  padding: 0; border: 0; background: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  color: var(--ink);
  animation: veil-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes veil-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }

.veil .ring {
  position: relative;
  display: grid; place-items: center;
  width: 108px; height: 108px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--accent) 92%, #fff) 0%,
    var(--accent) 55%,
    color-mix(in srgb, var(--accent) 60%, #000) 100%);
  box-shadow:
    0 18px 60px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s;
}
/* Two halos breathing outward — it should read as a signal, not a dialog. */
.veil .ring::before,
.veil .ring::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  animation: halo 3.2s ease-out infinite;
}
.veil .ring::after { animation-delay: 1.6s; }
@keyframes halo {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(1.85); opacity: 0; }
}
.veil .ring svg { width: 38px; height: 38px; fill: #17110a; margin-left: 5px; position: relative; }

.veil button:hover .ring {
  transform: scale(1.06);
  box-shadow:
    0 22px 76px color-mix(in srgb, var(--accent) 60%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.32) inset;
}
.veil button:active .ring { transform: scale(0.97); }

.veil .big {
  font-size: 30px; font-weight: 700; letter-spacing: -0.015em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.75);
}
.veil .small {
  margin-top: 4px;
  font-size: 15px; font-weight: 400;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}
.veil .hintline {
  margin-top: 22px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

/* --------------------------------------------------------- small screens */

@media (max-width: 760px) {
  .masthead { transform: translateY(-3vh); }
  .masthead .sub { font-size: 14px; }
  .player { grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; }
  .player .controls { grid-column: 1 / -1; justify-content: center; }
  .art { width: 50px; height: 50px; }
  .panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%;
           max-height: 72vh; border-radius: 20px 20px 0 0;
           transform: translateY(100%); }
  .panel[data-open='true'] { transform: translateY(0); }
  .session { display: none; }
}

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

/* ---------------------------------------------------------------- search */

.chip.icon { width: 38px; padding: 0; justify-content: center; }
.chip.icon svg { width: 17px; height: 17px; fill: currentColor; }
.chip.coffee { font-size: 16px; text-decoration: none; }
.chip.coffee:hover { border-color: #ffdd00; box-shadow: 0 0 0 1px #ffdd00 inset; }

.online { margin-left: 7px; }
.online::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2.4s ease-in-out infinite;
  vertical-align: 1px;
}
.online b { color: var(--ink); font-weight: 600; }

.search-modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(20px, 9vh, 110px) 16px 24px;
  background: rgba(8, 6, 12, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade 0.2s ease;
}
.search-modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.search-box {
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--glass-line);
  background: rgba(20, 15, 13, 0.9);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: rise-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rise-in { from { transform: translateY(14px) scale(0.98); opacity: 0; } }

.search-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.search-head .mag { width: 19px; height: 19px; fill: var(--ink-faint); flex: 0 0 auto; }
.search-head input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  color: var(--ink);
  font: 500 17px/1.3 var(--sans);
}
.search-head input::placeholder { color: var(--ink-faint); }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-head .esc { flex: 0 0 auto; }

.search-sources { display: flex; gap: 6px; padding: 12px 18px 4px; flex-wrap: wrap; }
.src {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: transparent;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.src[aria-pressed='true'] { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.src .state { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.src[data-state='loading'] .state { animation: pulse 0.9s ease-in-out infinite; opacity: 1; }
.src[data-state='ok'] .state { background: #4ade80; opacity: 1; }
.src[data-state='fail'] .state { background: #ff6b5e; opacity: 1; }

.search-results { overflow-y: auto; overflow-x: hidden; padding: 8px; flex: 1; min-height: 0; }

.result {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 12px;
  width: 100%; min-width: 0;
  padding: 8px 10px;
  border: 0; border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: background 0.15s;
}
.result:hover, .result:focus-visible { background: rgba(255, 255, 255, 0.09); }
.result img {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; background: rgba(255, 255, 255, 0.07);
}
.result .r-main { min-width: 0; display: grid; }
.result .r-title {
  font-size: 14px; font-weight: 500; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result .r-sub {
  font-size: 12px; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result .r-meta { display: flex; align-items: center; gap: 9px; }
.result .r-dur { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.badge {
  font-family: var(--mono); font-size: 8.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink-dim);
}
.badge[data-src='youtube'] { color: #ff6b5e; border-color: rgba(255, 107, 94, 0.42); }
.badge[data-src='audius'] { color: #c86bff; border-color: rgba(200, 107, 255, 0.42); }
.badge[data-src='archive'] { color: #6bd3ff; border-color: rgba(107, 211, 255, 0.42); }

.search-hint {
  margin: 0;
  padding: 11px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px; color: var(--ink-faint); line-height: 1.5;
}

@media (max-width: 760px) {
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search-modal { padding: 12px 10px; }
  .result { grid-template-columns: 38px 1fr auto; }
  .result img { width: 38px; height: 38px; }
}
