@property --accent { syntax: "<color>"; inherits: true; initial-value: #8de9df; }
@property --accent-secondary { syntax: "<color>"; inherits: true; initial-value: #ff8a9b; }
@property --accent-tertiary { syntax: "<color>"; inherits: true; initial-value: #a998ff; }
@property --ambient-base { syntax: "<color>"; inherits: true; initial-value: #101019; }
@property --ambient-primary { syntax: "<color>"; inherits: true; initial-value: #16bbaa; }
@property --ambient-secondary { syntax: "<color>"; inherits: true; initial-value: #ff4475; }
@property --ambient-tertiary { syntax: "<color>"; inherits: true; initial-value: #8855ff; }
/* Artwork colours move across the canvas; text accents stay light and readable. */
:root {
  color-scheme: dark;
  transition: --accent 2.4s ease, --accent-secondary 2.4s ease, --accent-tertiary 2.4s ease, --ambient-base 3.4s ease, --ambient-primary 3.4s ease, --ambient-secondary 3.4s ease, --ambient-tertiary 3.4s ease;
  --ink: #faf9fc;
  --muted: #d0d5e5;
  --line: rgba(255,255,255,.12);
  --accent: #8de9df;
  --accent-secondary: #ff8a9b;
  --accent-tertiary: #a998ff;
  --accent-rgb: 141,233,223;
  --accent-secondary-rgb: 255,138,155;
  --accent-tertiary-rgb: 169,152,255;
  --ambient-base: #101019;
  --ambient-primary: #16bbaa;
  --ambient-secondary: #ff4475;
  --ambient-tertiary: #8855ff;
  --green: #51d79b;
  --cyan: #8de9df;
  --gutter: clamp(20px, 3.2vw, 62px);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; }
body { color: var(--ink); background: #101019; font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
.bg { position: fixed; inset: 0; overflow: hidden; background: var(--ambient-base); pointer-events: none; }
.ambient-orb { position: absolute; width: 90vw; height: 90vw; border-radius: 50%; opacity: 1; will-change: transform; transition: opacity 1.2s; }
.orb-one { left: -29%; top: -65%; background: radial-gradient(ellipse, color-mix(in srgb, var(--ambient-primary) 92%, transparent), color-mix(in srgb, var(--ambient-primary) 58%, transparent) 38%, transparent 72%); animation: drift-one 22s ease-in-out -8s infinite alternate; }
.orb-two { right: -21%; bottom: -55%; background: radial-gradient(ellipse, color-mix(in srgb, var(--ambient-secondary) 92%, transparent), color-mix(in srgb, var(--ambient-secondary) 55%, transparent) 40%, transparent 72%); animation: drift-two 27s ease-in-out -14s infinite alternate; }
.orb-three { width: 78vw; height: 78vw; right: -6%; top: -52%; background: radial-gradient(ellipse, color-mix(in srgb, var(--ambient-tertiary) 72%, transparent), color-mix(in srgb, var(--ambient-tertiary) 34%, transparent) 42%, transparent 72%); animation: drift-three 32s ease-in-out -20s infinite alternate; }
.overlay { position: fixed; inset: 0; background: linear-gradient(180deg, rgba(5,8,18,.38), rgba(5,8,18,.30) 18%, transparent 32%, transparent 74%, rgba(5,8,18,.12)); pointer-events: none; }
html[data-ambience-mode="intercom"] .ambient-orb { opacity: .4; }
.sheen { position: fixed; inset: 0; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.4' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
.screen { position: relative; height: 100vh; height: 100dvh; padding: 25px var(--gutter) 26px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: clamp(16px,2.2vh,28px); }
.topline { min-width: 0; }
.masthead { display: flex; align-items: center; justify-content: flex-end; padding-bottom: 23px; }
.clock { display: flex; align-items: center; gap: 15px; }
.time { font-size: clamp(28px,2.2vw,42px); line-height: 1; font-weight: 450; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.date { color: var(--muted); font-size: 12px; max-width: 65px; line-height: 1.4; }
.top-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(225px,.7fr) minmax(0,1fr); align-items: center; gap: clamp(15px,2vw,36px); border-block: 1px solid var(--line); padding: 14px 0; }
.top-left { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
#statusPill { font-size: 14px; font-weight: 650; white-space: nowrap; }
.spotify-mark { width: 22px; height: 22px; flex: 0 0 22px; }
.spotify-mark.small { width: 18px; height: 18px; flex-basis: 18px; }
.sensor-strip { display: flex; gap: clamp(12px,1.3vw,25px); }
.sensor-pill { display: flex; flex-direction: column; align-items: start; gap: 3px; }
.sensor-label, .occupancy-label { font-size: 9px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sensor-value { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.occupancy-pill { padding-left: 22px; border-left: 1px solid var(--line); gap: 12px; }
.occupancy-icon { display: flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 50%; }
.occupancy-icon:before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.occupancy-label { display: block; }
.occupancy-total { font-size: 25px; font-weight: 600; line-height: 1.15; }
.occupancy-stat { display: flex; flex-direction: column; gap: 2px; margin-left: 8px; }
.occupancy-stat strong { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500; }
.occupancy-stat span { font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.alta-pill { min-width: 0; gap: 9px; border-left: 1px solid var(--line); padding-left: 22px; }
.alta-dot, .ev-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); flex: 0 0 6px; }
.alta-dot.denied { background: #ff8a9b; }
.alta-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.3); }
.alta-brand-mark { width: 17px; height: 17px; object-fit: contain; flex: 0 0 17px; }
.alta-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.alta-main { font-size: clamp(12px,1vw,17px); font-weight: 650; overflow-wrap: anywhere; }
.alta-sub { font-size: clamp(10px,.68vw,12px); color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.playing-view { min-height: 0; display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: clamp(35px,6vw,115px); align-items: center; padding: 10px clamp(0px,2vw,36px); }
.album-wrap { position: relative; width: min(100%,54vh,580px); aspect-ratio: 1; justify-self: center; border-radius: 12px; isolation: isolate; }
.album-wrap:before { content: ''; position: absolute; z-index: -1; inset: 9% -7% -10%; background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%); filter: blur(24px); }
.album-art { display: block; position: relative; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; box-shadow: 0 26px 70px rgba(0,0,0,.42); transition: opacity .55s; animation: art-float 9s ease-in-out infinite alternate; }
.missing-art .album-art { opacity: 0; }
.art-fallback { opacity: 0; }
.missing-art .art-fallback { opacity: 1; }
.art-fallback { position: absolute; inset: 0; border-radius: 10px; background: radial-gradient(circle, #151622 0 10%, var(--accent) 10.4% 11.4%, #151622 12% 22%, transparent 23%), repeating-radial-gradient(circle, #1c2030 0 2px, #24283a 3px 4px); display: grid; place-items: center; overflow: hidden; }
.art-fallback span { font-size: 32px; color: var(--accent); }
.glass-card { position: relative; isolation: isolate; min-width: 0; min-height: 0; width: 100%; max-height: 100%; display: flex; flex-direction: column; padding-block: 10px; }
.glass-card:before { content: ''; position: absolute; z-index: -1; inset: -24% -26px -24% -20%; background: radial-gradient(ellipse 50% 50%, rgba(5,8,20,.60) 10%, rgba(5,8,20,.38) 50%, transparent 100%); pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin-bottom: clamp(18px,3vh,38px); color: var(--accent); transition: color 2s; }
.equalizer { display: flex; align-items: center; gap: 3px; height: 19px; margin-left: 10px; }
.equalizer i { width: 3px; height: 17px; border-radius: 3px; background: var(--accent); transform-origin: center; animation: equalize .95s ease-in-out infinite alternate; }
.equalizer i:nth-child(2) { animation-duration: .65s; animation-delay: -.2s; }
.equalizer i:nth-child(3) { animation-duration: 1.15s; animation-delay: -.7s; }
.equalizer i:nth-child(4) { animation-duration: .8s; animation-delay: -.4s; }
.equalizer i:nth-child(5) { animation-duration: 1.3s; animation-delay: -.9s; }
.track { margin: 0 0 16px; font-size: clamp(36px,5vw,100px); font-weight: 650; letter-spacing: -.055em; line-height: 1.04; overflow-wrap: anywhere; text-wrap: balance; }
.artist { font-size: clamp(21px,2.1vw,39px); line-height: 1.2; font-weight: 400; color: var(--accent); overflow-wrap: anywhere; transition: color 2s; }
.album { margin-top: 9px; font-size: clamp(12px,1.05vw,19px); color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.device { font-size: clamp(10px,.85vw,14px); margin-top: clamp(17px,3vh,32px); color: #c7c7d6; gap: 8px; max-width: 100%; }
.device-logo { display: flex; width: 18px; height: 18px; flex: 0 0 18px; }
.device-logo img, .device-logo svg { width: 100%; height: 100%; object-fit: contain; }
.device-text { min-width: 0; overflow-wrap: anywhere; }
.progress-shell { margin-top: clamp(18px,3vh,34px); }
.progress-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .03em; margin-bottom: 11px; }
.progress-container { height: 3px; border-radius: 6px; background: rgba(255,255,255,.14); }
.progress { position: relative; width: 0; max-width: 100%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s linear, background-color 2s; }
.progress:after { content: ''; position: absolute; right: -4px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent); }
.playing-brand { margin-top: clamp(18px,3vh,35px); opacity: .42; }
.playing-brand img { width: 115px; height: 43px; object-fit: contain; object-position: left center; }
.idle-view { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
#idleStage { position: absolute; inset: 16px 0; }
.idle-card { position: absolute; left: 0; top: 0; width: clamp(210px,25vw,480px); display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 16px; will-change: transform; }
.idle-logo { width: 100%; height: auto; max-height: 180px; object-fit: contain; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 36%, transparent)); animation: logo-breathe 6s ease-in-out infinite alternate; }
.idle-halo { position: absolute; inset: -35% -25%; z-index: -1; background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 16%, transparent), transparent 63%); }
.idle-orbit { position: absolute; pointer-events: none; width: min(65vw,900px); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-25deg); border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 50%; }
.idle-orbit:before, .idle-orbit:after { content: ''; position: absolute; inset: 11%; border: 1px solid color-mix(in srgb, var(--accent-secondary) 8%, transparent); border-radius: 50%; }
.idle-orbit:after { inset: -11%; border-color: color-mix(in srgb, var(--accent-tertiary) 7%, transparent); }
.activity-strip { min-width: 0; border-top: 1px solid var(--line); padding-top: 15px; }
.ev-strip { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.ev-pill { padding: 13px 15px; min-width: 0; gap: 10px; background: rgba(9,12,24,.45); border: 1px solid rgba(255,255,255,.11); border-radius: 10px; }
.ev-dot { background: #9b9eab; }
.ev-pill.available .ev-dot { background: #51d79b; }
.ev-pill.charging .ev-dot { background: #85ceff; box-shadow: 0 0 12px #85ceff66; animation: charge-pulse 2.5s ease-in-out infinite; }
.ev-pill.offline .ev-dot, .ev-pill.fault .ev-dot { background: #ff8a9b; }
.ev-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ev-name { display: block; font-size: 17px; font-weight: 650; }
.ev-detail { display: block; font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.ev-starter { display: flex; align-items: center; gap: 4px; color: #d6d5df; font-size: 10px; line-height: 1.3; }
.ev-starter-mark { width: 10px; height: 10px; object-fit: contain; }
.ev-starter-name { overflow-wrap: anywhere; }
.intercom-view { display: grid; min-height: 0; place-items: center; }
.intercom-card { min-height: 0; max-height: 100%; width: min(100%,1050px, calc((100dvh - 280px) * 1.777)); display: flex; flex-direction: column; gap: 18px; }
.intercom-media-wrap { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 16px; background: #05070e; border: 1px solid var(--line); }
.intercom-media, .intercom-livekit video { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; background: #05070e; }
.intercom-livekit { position: relative; }
.intercom-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.intercom-meta { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.intercom-title { font-size: clamp(24px,2.5vw,42px); font-weight: 600; }
.intercom-subtitle { color: var(--muted); margin-top: 5px; font-size: 14px; }
.intercom-countdown { font-size: 28px; font-variant-numeric: tabular-nums; }
.intercom-countdown-mark { width: 22px; height: 22px; }
.hidden { display: none !important; }
@keyframes drift-one { 0% { transform: translate3d(-3vw,-5vh,0) scale(.96); } 48% { transform: translate3d(13vw,17vh,0) scale(1.08); } 100% { transform: translate3d(24vw,2vh,0) scale(1.04); } }
@keyframes drift-two { 0% { transform: translate3d(4vw,8vh,0) scale(1.04); } 52% { transform: translate3d(-16vw,-17vh,0) scale(1.10); } 100% { transform: translate3d(-27vw,4vh,0) scale(.98); } }
@keyframes drift-three { 0% { transform: translate3d(7vw,0,0) scale(.98); } 55% { transform: translate3d(-15vw,24vh,0) scale(1.12); } 100% { transform: translate3d(-25vw,7vh,0) scale(1.02); } }
@keyframes art-float { to { transform: translateY(-7px) rotate(-.45deg); } }
@keyframes logo-breathe { to { opacity: .82; } }
@keyframes equalize { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes charge-pulse { 50% { opacity: .45; } }
html[data-motion="paused"] *, html[data-ambience-mode="intercom"] * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; } }
@media (min-width: 901px) and (max-height: 790px) {
  .screen { padding-top: 16px; padding-bottom: 16px; gap: 14px; }
  .masthead { padding-bottom: 14px; }
  .top-row { padding-block: 10px; }
  .playing-view { gap: 5vw; }
  .album-wrap { width: min(100%,51vh); }
  .track { font-size: clamp(34px,4.5vw,68px); }
  .eyebrow { margin-bottom: 15px; }
  .artist { font-size: 27px; }
  .device, .progress-shell { margin-top: 18px; }
  .playing-brand { margin-top: 18px; }
  .playing-brand img { width: 90px; height: 33px; }
  .ev-pill { padding: 9px 12px; }
  .idle-card { width: clamp(210px,24vw,390px); }
}
@media (max-width: 1100px) {
  .top-row { grid-template-columns: minmax(0,1.1fr) minmax(200px,.8fr) minmax(0,1fr); gap: 16px; }
  .top-left { gap: 8px; }
  #statusPill { width: 100%; }
  .sensor-strip { gap: 16px; }
  .occupancy-pill, .alta-pill { padding-left: 15px; }
  .occupancy-pill { gap: 7px; }
  .occupancy-stat { margin-left: 4px; }
}
@media (max-width: 900px), (orientation: portrait) {
  .orb-one { width: 160vw; height: 160vw; top: -16%; left: -72%; }
  .orb-two { width: 170vw; height: 170vw; bottom: -8%; right: -78%; }
  .orb-three { width: 150vw; height: 150vw; top: 20%; right: -68%; }
  body { overflow: auto; }
  .screen { height: auto; min-height: 100dvh; grid-template-rows: auto minmax(380px,1fr) auto; padding: 20px; gap: 24px; }
  .masthead { padding-bottom: 18px; }
  .clock { gap: 8px; }
  .time { font-size: 29px; }
  .date { font-size: 10px; max-width: 53px; }
  .top-row { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; padding-block: 13px; }
  .top-left { gap: 10px; }
  #statusPill { font-size: 11px; }
  .sensor-value { font-size: 12px; }
  .sensor-label { font-size: 8px; }
  .sensor-strip { gap: 15px; }
  .occupancy-pill { justify-content: end; border-left: 0; padding-left: 0; gap: 7px; }
  .occupancy-icon { display: none; }
  .occupancy-total { font-size: 23px; }
  .occupancy-label { font-size: 8px; }
  .occupancy-stat strong { font-size: 12px; }
  .alta-pill { grid-column: 1/-1; border: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
  .alta-main { font-size: 13px; }
  .alta-sub { font-size: 10px; }
  .alta-photo { width: 32px; height: 32px; }
  .playing-view { display: flex; flex-direction: column; align-items: stretch; gap: 25px; padding: 0; }
  .album-wrap { width: min(72vw,430px); align-self: center; }
  .glass-card { padding: 0 8px; max-height: none; }
  .glass-card:before { inset: -10% -10px; }
  .eyebrow { margin-bottom: 16px; font-size: 10px; }
  .track { font-size: clamp(32px,7vw,58px); letter-spacing: -.045em; }
  .artist { font-size: 25px; }
  .album { font-size: 13px; }
  .device { font-size: 11px; margin-top: 17px; }
  .progress-shell { margin-top: 22px; }
  .playing-brand { margin-top: 22px; }
  .playing-brand img { width: 100px; height: 35px; }
  .idle-view { min-height: 440px; }
  .idle-card { width: clamp(190px,49vw,340px); padding: 10px; gap: 16px; }
  #idleStage { inset: 16px 0; }
  .idle-orbit { width: 110vw; }
  .ev-strip { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
  .ev-pill { padding: 12px 9px; gap: 7px; align-items: start; }
  .ev-dot { margin-top: 4px; width: 5px; height: 5px; flex-basis: 5px; }
  .ev-name { font-size: 12px; }
  .ev-detail, .ev-starter { font-size: 10px; }
  .intercom-card { width: 100%; max-height: none; }
  .intercom-view { min-height: 360px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  body { overflow: auto; }
  .screen { height: auto; min-height: 100dvh; padding: 16px 24px; grid-template-rows: auto minmax(250px,1fr) auto; gap: 18px; }
  .top-row { grid-template-columns: 1fr .75fr 1fr; gap: 12px; }
  .alta-pill { grid-column: auto; border: 0; padding: 0; }
  .playing-view { display: grid; grid-template-columns: .8fr 1.2fr; gap: 30px; }
  .album-wrap { width: min(100%,260px); }
  .glass-card { padding: 0; }
  .track { font-size: 36px; }
  .artist { font-size: 22px; }
  .playing-brand { display: none; }
  .idle-view { min-height: 290px; }
  #idleStage { inset: 16px 0; }
  .idle-card { width: 220px; gap: 10px; }
  .ev-strip { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .ev-pill { padding: 10px 7px; }
  .intercom-card { width: min(100%,600px); }
}
@media (max-width: 370px) {
  .screen { padding-inline: 14px; }
  .sensor-strip { gap: 10px; }
  .occupancy-pill { gap: 5px; }
  .occupancy-stat { margin-left: 2px; }
  .ev-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
