@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

:root { color-scheme: dark; font-family: Manrope, system-ui, sans-serif; color: #fff; background: #0a1210; }
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }
.room { min-height: 100svh; position: relative; overflow: hidden; background: #0a1210; }
.viewer, .viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer canvas { filter: brightness(1.03) saturate(.96); transition: filter .8s ease; cursor: grab; touch-action: none; }
.viewer canvas:active { cursor: grabbing; }
.viewer-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4,12,10,.42), transparent 22%, transparent 68%, rgba(3,10,8,.58)); transition: background .8s ease; }
.tv-screen-image { position: absolute; z-index: 2; display: block; opacity: 0; pointer-events: none; object-fit: cover; transition: opacity .2s ease; }
.tv-screen-image.active { opacity: 1; }
.room[data-scene="watch"] .viewer canvas { filter: brightness(.96) saturate(1.04) contrast(1.02); }
.room[data-scene="watch"] .viewer-shade { background: radial-gradient(circle at 50% 45%, rgba(50,105,145,.15), transparent 25%), linear-gradient(180deg, rgba(3,8,12,.5), transparent 38%, rgba(2,5,8,.65)); }
.room[data-scene="relax"] .viewer canvas { filter: brightness(.98) sepia(.08) saturate(1.1); }
.room[data-scene="off"] .viewer canvas { filter: brightness(.88) saturate(.82); }

.topbar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 84px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.16); background: linear-gradient(180deg, rgba(6,16,13,.68), transparent); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; text-decoration: none; }
.brand-mark { width: 31px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #c8f05a; color: #132521; font: 500 .9rem DM Mono, monospace; }
.topbar > p { margin: 0; font: 500 .72rem DM Mono, monospace; letter-spacing: .08em; text-transform: uppercase; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #c8f05a; box-shadow: 0 0 0 5px rgba(200,240,90,.12); }
.icon-button { width: 38px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(9,20,17,.45); cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.14); }

.intro-card { position: absolute; z-index: 8; left: 50%; top: 50%; width: min(460px, calc(100% - 32px)); padding: 38px; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.2); background: rgba(11,30,25,.88); box-shadow: 0 30px 90px rgba(0,0,0,.4); backdrop-filter: blur(18px); transition: opacity .35s, transform .35s, visibility .35s; }
.intro-card.hidden { opacity: 0; visibility: hidden; transform: translate(-50%, -46%); }
.kicker { margin: 0 0 12px; color: #c8f05a; font: 500 .7rem DM Mono, monospace; text-transform: uppercase; letter-spacing: .12em; }
.intro-card h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 500; line-height: .98; letter-spacing: -.06em; }
.intro-card > p:not(.kicker) { margin: 22px 0; color: #c6d2ce; line-height: 1.65; }
.primary-button { min-height: 50px; padding: 0 22px; border: 0; border-radius: 3px; background: #c8f05a; color: #132521; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: #fff; }

.device-rail { position: absolute; z-index: 5; left: 28px; top: 50%; width: 190px; transform: translateY(-50%); display: grid; gap: 6px; }
.device-rail > p, .scene-bar > p { margin: 0 0 6px; color: rgba(255,255,255,.68); font: 500 .68rem DM Mono, monospace; letter-spacing: .12em; text-transform: uppercase; }
.device-rail button { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 3px; background: rgba(8,20,17,.56); text-align: left; cursor: pointer; backdrop-filter: blur(9px); }
.device-rail button:hover, .device-rail button.active { border-color: #c8f05a; background: rgba(20,57,48,.82); }
.device-rail button span { width: 20px; color: #c8f05a; text-align: center; }

.control-panel { position: absolute; z-index: 7; top: 104px; right: 28px; bottom: 100px; width: min(380px, calc(100% - 32px)); padding: 28px; transform: translateX(calc(100% + 40px)); opacity: 0; border: 1px solid rgba(255,255,255,.18); background: rgba(10,27,23,.93); box-shadow: 0 24px 80px rgba(0,0,0,.38); backdrop-filter: blur(20px); transition: transform .4s cubic-bezier(.2,.8,.2,1), opacity .3s; overflow: auto; }
.control-panel.open { transform: none; opacity: 1; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.13); }
.panel-heading h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.04em; }
.control-group { padding: 24px 0 0; }
.control-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; font-size: .88rem; font-weight: 600; }
.control-label output { color: #c8f05a; font: 500 .8rem DM Mono, monospace; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented button, .power-button { min-height: 42px; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; background: rgba(255,255,255,.06); cursor: pointer; }
.segmented button:hover, .segmented button.active, .power-button.active { border-color: #c8f05a; background: #c8f05a; color: #132521; }
input[type="range"] { width: 100%; accent-color: #c8f05a; }
.temperature { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 20px 0; }
.temperature strong { min-width: 90px; font: 500 2.4rem DM Mono, monospace; text-align: center; }
.temperature button { width: 44px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.06); cursor: pointer; }

.scene-bar { position: absolute; z-index: 5; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 8px; border: 1px solid rgba(255,255,255,.17); border-radius: 4px; background: rgba(8,20,17,.66); backdrop-filter: blur(12px); }
.scene-bar > p { margin: 0 10px; }
.scene-bar button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.scene-bar button:hover, .scene-bar button.active { background: #c8f05a; color: #132521; }
.view-tools { position: absolute; z-index: 5; right: 28px; bottom: 28px; display: flex; gap: 5px; }
.view-tools button { min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid rgba(255,255,255,.17); border-radius: 3px; background: rgba(8,20,17,.66); cursor: pointer; backdrop-filter: blur(12px); }
.view-tools button:hover { border-color: #c8f05a; }
.demo-note { position: absolute; z-index: 5; left: 28px; bottom: 20px; margin: 0; color: rgba(255,255,255,.62); font: 400 .65rem DM Mono, monospace; }
.loading { position: absolute; z-index: 10; inset: 0; display: grid; place-content: center; justify-items: center; background: #0a1210; transition: opacity .45s, visibility .45s; }
.loading.hidden { opacity: 0; visibility: hidden; }
.loading span { width: 34px; aspect-ratio: 1; border: 2px solid rgba(255,255,255,.15); border-top-color: #c8f05a; border-radius: 50%; animation: spin .8s linear infinite; }
.loading p { font: 500 .68rem DM Mono, monospace; text-transform: uppercase; letter-spacing: .12em; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 16px; }
  .topbar > p { display: none; }
  .device-rail { left: 12px; top: auto; bottom: 82px; width: auto; max-width: calc(100% - 24px); transform: none; grid-template-columns: repeat(4, 44px); }
  .device-rail > p { display: none; }
  .device-rail button { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .device-rail button span { font-size: 1rem; }
  .control-panel { top: auto; left: 12px; right: 12px; bottom: 138px; width: auto; max-height: 58vh; transform: translateY(calc(100% + 180px)); }
  .control-panel.open { transform: none; }
  .scene-bar { left: 12px; right: 12px; bottom: 16px; transform: none; overflow-x: auto; }
  .scene-bar > p { display: none; }
  .scene-bar button { flex: 1 0 auto; }
  .view-tools, .demo-note { display: none; }
  .intro-card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
