/* Perfect World Liquid Glass Controls v1.0
   Framework-free build. No external fonts, assets, or dependencies. */

:root {
  --ink: #edf7f8;
  --muted: #8aa2aa;
  --line: rgba(150, 230, 238, 0.13);
  --panel: #020b0f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--panel); }
body { margin: 0; background: #02090d; color: var(--ink); font-family: var(--mono); }
button { font: inherit; }

.demo-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(24px, 5vw, 72px);
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 14%, rgba(24, 102, 112, .16), transparent 24%),
    radial-gradient(circle at 83% 9%, rgba(146, 88, 166, .12), transparent 22%),
    radial-gradient(circle at 50% 78%, rgba(211, 141, 55, .08), transparent 34%),
    #02090d;
}

.map-field { position: absolute; inset: 0; z-index: -1; overflow: hidden; opacity: .94; }
.map-field::before,
.map-field::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(25deg, transparent 48.9%, rgba(114, 207, 219, .12) 49.2%, rgba(114, 207, 219, .12) 49.55%, transparent 49.85%),
    linear-gradient(153deg, transparent 48.9%, rgba(230, 162, 80, .09) 49.15%, rgba(230, 162, 80, .09) 49.45%, transparent 49.75%);
  background-size: 87px 73px, 121px 101px;
  transform: rotate(-4deg) scale(1.2);
}
.map-field::after { transform: rotate(19deg) scale(1.3); opacity: .45; }
.map-field i {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 9px currentColor, 0 0 24px currentColor;
}
.map-orbit { position: absolute; border: 1px solid rgba(122, 215, 225, .09); border-radius: 50%; transform: rotate(28deg); }
.orbit-a { width: 680px; height: 280px; left: -120px; top: 14%; }
.orbit-b { width: 540px; height: 210px; right: -80px; bottom: 10%; border-color: rgba(214, 145, 77, .09); }

.demo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  max-width: 1480px;
  margin: 0 auto clamp(48px, 8vw, 108px);
}
.eyebrow, .section-index, .state-label, .demo-footer { letter-spacing: .16em; }
.eyebrow { margin: 0 0 16px; color: #e6ad58; font-size: 12px; font-weight: 700; }
.demo-header h1 { margin: 0; font-size: clamp(38px, 6vw, 82px); letter-spacing: -.055em; line-height: .95; font-weight: 620; }
.intro { max-width: 780px; margin: 22px 0 0; color: #a9bec3; font-family: system-ui, sans-serif; font-size: clamp(16px, 2vw, 20px); line-height: 1.6; }
.header-mark { display: grid; place-items: center; flex: 0 0 auto; width: 78px; height: 78px; border: 1px solid rgba(183, 241, 247, .25); border-radius: 27px; background: rgba(228, 251, 255, .06); box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 25px 55px rgba(0,0,0,.35); backdrop-filter: blur(20px); }
.header-mark svg { width: 34px; }

.showcase, .state-strip { position: relative; max-width: 1480px; margin-inline: auto; }
.showcase-first { padding: clamp(24px, 4vw, 52px); border: 1px solid rgba(179, 230, 236, .14); border-radius: 36px; background: rgba(1, 12, 17, .34); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 40px 100px rgba(0,0,0,.28); backdrop-filter: blur(8px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 36px; }
.section-heading > div, .state-strip > div:first-child { display: flex; align-items: baseline; gap: 14px; }
.section-heading h2, .state-strip h2 { margin: 0; font-size: clamp(20px, 3vw, 34px); letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.section-index { color: #e4a64b; font-size: 11px; }
.room-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }

.liquid-glass {
  --glass-rgb: 210 225 233;
  --mx: 22%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #f3fbfc;
  border: 1px solid rgba(239, 254, 255, .58);
  background-color: rgba(147, 190, 199, .12);
  background:
    radial-gradient(150px circle at var(--mx) var(--my), rgba(255,255,255,.5), transparent 43%),
    radial-gradient(90% 130% at 82% 118%, rgba(var(--glass-rgb), .2), transparent 58%),
    linear-gradient(145deg, rgba(236,250,252,.24), rgba(145,185,193,.1) 38%, rgba(var(--glass-rgb), .1) 72%, rgba(225,247,249,.18));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 -2px 1px rgba(var(--glass-rgb), .44),
    inset 1px 0 0 rgba(255,255,255,.2),
    0 1px 1px rgba(255,255,255,.08),
    0 12px 30px rgba(0,0,0,.36),
    0 0 0 1px rgba(var(--glass-rgb), .13);
  backdrop-filter: blur(10px) saturate(185%) brightness(1.22) contrast(108%);
  -webkit-backdrop-filter: blur(10px) saturate(185%) brightness(1.22) contrast(108%);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s, box-shadow .22s, background .22s;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px;
  border-radius: inherit;
  background:
    linear-gradient(118deg, rgba(255,255,255,.18), transparent 29%, transparent 68%, rgba(var(--glass-rgb), .2)),
    repeating-linear-gradient(20deg, transparent 0 31px, rgba(var(--glass-rgb), .07) 32px, transparent 33px 58px);
  box-shadow: inset 0 0 18px rgba(255,255,255,.025);
  opacity: .82;
}
.liquid-glass::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 205deg, rgba(var(--glass-rgb), .48), rgba(255,255,255,.78) 22%, rgba(255,255,255,.08) 46%, rgba(var(--glass-rgb), .54) 78%, rgba(255,255,255,.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .8;
}
.glass-shine { pointer-events: none; position: absolute; inset: 1px 8% auto; height: 38%; border-radius: 999px 999px 42% 42%; background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.065) 48%, transparent); filter: blur(.35px); mix-blend-mode: screen; }

.room-button { min-height: 76px; width: 100%; display: grid; grid-template-columns: 52px 1fr 22px; align-items: center; gap: 14px; padding: 10px 16px 10px 11px; border-radius: 999px; cursor: pointer; text-align: left; }
.room-button:hover { transform: translateY(-3px) scale(1.012); border-color: rgba(255,255,255,.72); background: radial-gradient(150px circle at var(--mx) var(--my), rgba(255,255,255,.5), transparent 45%), linear-gradient(145deg, rgba(255,255,255,.2), rgba(var(--glass-rgb), .11) 60%, rgba(255,255,255,.15)); box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -2px 1px rgba(var(--glass-rgb), .48), 0 16px 34px rgba(0,0,0,.42), 0 0 26px rgba(var(--glass-rgb), .2), 0 0 0 1px rgba(var(--glass-rgb), .24); }
.room-button:active { transform: translateY(1px) scale(.985); box-shadow: inset 0 2px 8px rgba(0,0,0,.38), inset 0 -1px 1px rgba(255,255,255,.55), 0 5px 13px rgba(0,0,0,.3); }
.room-button:focus-visible, .icon-button:focus-visible { outline: 3px solid #f5c56e; outline-offset: 4px; }
.room-button:disabled { cursor: not-allowed; opacity: .42; filter: saturate(.4); transform: none; }
.icon-lens { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: white; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.42), rgba(var(--glass-rgb), .28) 38%, rgba(var(--glass-rgb), .12) 72%); box-shadow: inset 0 1px 2px rgba(255,255,255,.7), inset 0 -3px 7px rgba(var(--glass-rgb), .28), 0 0 20px rgba(var(--glass-rgb), .26); }
.icon-lens::after { content: ""; position: absolute; inset: 5px 11px auto; height: 10px; border-radius: 50%; background: rgba(255,255,255,.25); filter: blur(3px); }
.icon-lens svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.button-label { position: relative; z-index: 1; font-size: clamp(13px, 1.5vw, 17px); font-weight: 650; letter-spacing: .015em; white-space: nowrap; }
.selected-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; color: #071015; background: rgb(var(--glass-rgb)); box-shadow: 0 0 15px rgba(var(--glass-rgb), .72); opacity: 0; transform: scale(.4); transition: .22s ease; }
.room-button.is-selected { border-color: rgba(var(--glass-rgb), .76); box-shadow: inset 0 1px 1px rgba(255,255,255,.88), inset 0 -2px 1px rgba(var(--glass-rgb), .62), 0 15px 36px rgba(0,0,0,.42), 0 0 34px rgba(var(--glass-rgb), .22), 0 0 0 1px rgba(var(--glass-rgb), .26); }
.room-button.is-selected .selected-mark { opacity: 1; transform: scale(1); }

.state-strip { margin-top: 28px; padding: 34px 6px 18px; display: grid; grid-template-columns: minmax(160px, .55fr) 2.3fr; gap: 36px; }
.state-examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.state-examples > div { display: flex; flex-direction: column; gap: 12px; }
.state-label { color: #73929a; font-size: 10px; }
.icon-button { display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border-radius: 22px; cursor: pointer; }
.icon-button svg { width: 27px; height: 27px; }
.icon-button:hover { transform: translateY(-3px); border-color: white; box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -1px 1px rgba(var(--glass-rgb),.5), 0 16px 28px rgba(0,0,0,.4), 0 0 25px rgba(var(--glass-rgb),.16); }
.icon-button:active { transform: translateY(1px) scale(.94); }

.compact-showcase,
.component-showcase {
  margin-top: 58px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}
.icon-button-row { display: flex; flex-wrap: wrap; gap: 17px; }
.icon-button.is-active { color: #061012; background-color: rgba(82, 210, 232, .72); border-color: rgba(255,255,255,.8); box-shadow: inset 0 1px 2px rgba(255,255,255,.85), 0 0 30px rgba(82,210,232,.28), 0 12px 28px rgba(0,0,0,.34); }

.control-layout { display: grid; grid-template-columns: 1.15fr .95fr .9fr; gap: 26px; }
.control-sample { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.sample-wide { grid-column: span 2; }
.sample-radio { grid-column: 1 / -1; }

.segmented-control { min-height: 68px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border-radius: 999px; }
.segmented-control button { position: relative; z-index: 2; border: 0; border-radius: 999px; color: #b8c9cd; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: .07em; transition: color .2s, background .2s, box-shadow .2s, transform .2s; }
.segmented-control button:hover { color: white; }
.segmented-control button:focus-visible { outline: 3px solid #f5c56e; outline-offset: -1px; }
.segmented-control button.is-active { color: #201505; background: linear-gradient(145deg, rgba(255,245,220,.9), rgba(245,177,70,.68)); box-shadow: inset 0 1px 1px white, inset 0 -1px 0 rgba(129,72,5,.3), 0 4px 14px rgba(245,177,70,.28); }

.theme-picker,
.profile-capsule { min-height: 68px; width: 100%; display: flex; align-items: center; gap: 13px; padding: 8px 15px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: .045em; }
.theme-picker svg { width: 22px; height: 22px; margin-left: auto; }
.theme-dots { display: flex; gap: 5px; }
.theme-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.65); box-shadow: 0 0 10px currentColor; }
.theme-dots i:nth-child(1) { background: #d8e1df; color: #d8e1df; }
.theme-dots i:nth-child(2) { background: #52d2e8; color: #52d2e8; }
.theme-dots i:nth-child(3) { background: #f5b146; color: #f5b146; }
.theme-dots i:nth-child(4) { background: #91ca70; color: #91ca70; }

.profile-capsule .avatar { display: grid; place-items: center; flex: 0 0 auto; width: 47px; height: 47px; border-radius: 50%; color: #03100d; background: radial-gradient(circle at 35% 25%, #d2ffd0, #62d879 62%, #2e7f47); border: 1px solid rgba(255,255,255,.78); box-shadow: inset 0 1px 2px white, 0 0 18px rgba(98,216,121,.25); }
.presence-dot { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: #f5b146; box-shadow: 0 0 12px #f5b146; }

.radio-transport { min-height: 94px; display: grid; grid-template-columns: auto minmax(160px, 1fr) auto auto; align-items: center; gap: 18px; padding: 10px 18px 10px 10px; border-radius: 36px; }
.radio-actions { position: relative; z-index: 2; display: flex; gap: 8px; }
.radio-actions .icon-button { width: 60px; height: 60px; border-radius: 22px; background-color: rgba(190,218,222,.1); }
.equalizer { height: 56px; display: flex; align-items: end; justify-content: center; gap: 4px; padding: 8px 14px; border-inline: 1px solid rgba(220,249,251,.1); }
.equalizer i { width: 3px; height: calc(5px + (var(--bar) * 7px) / 22); max-height: 39px; border-radius: 3px; background: #59d7cc; opacity: .38; transform-origin: bottom; }
.equalizer.is-playing i { opacity: .95; animation: eq-bounce calc(.52s + (var(--bar) * .021s)) ease-in-out infinite alternate; }
@keyframes eq-bounce { to { transform: scaleY(.28); opacity: .48; } }
.station-display { display: flex; flex-direction: column; gap: 3px; min-width: 165px; }
.station-display strong { color: #70ddd2; font-size: 21px; letter-spacing: .035em; }
.station-display span { color: #799a9d; font-size: 10px; letter-spacing: .08em; }
.volume-meter { display: flex; align-items: center; gap: 11px; }
.volume-meter > svg { width: 24px; }
.volume-meter > span { display: flex; align-items: center; gap: 3px; }
.volume-meter i { width: 3px; height: 14px; border-radius: 2px; background: rgba(110,222,212,.16); }
.volume-meter i.on { background: #6eded4; box-shadow: 0 0 7px rgba(110,222,212,.65); }

.handoff-panel { max-width: 1480px; margin: 70px auto 0; padding: clamp(25px,4vw,46px); display: flex; align-items: center; justify-content: space-between; gap: 34px; border: 1px solid rgba(245,177,70,.2); border-radius: 32px; background: linear-gradient(125deg, rgba(245,177,70,.07), rgba(77,199,205,.045)); }
.handoff-panel > div { max-width: 790px; }
.handoff-panel h2 { margin: 8px 0 12px; font-size: clamp(24px,3.5vw,42px); letter-spacing: -.04em; }
.handoff-panel p { margin: 0; color: #a8bdc1; font-family: system-ui,sans-serif; font-size: 16px; line-height: 1.65; }
.download-button { flex: 0 0 auto; min-height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-radius: 999px; color: white; text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.download-button:hover { transform: translateY(-3px); box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -2px 1px rgba(245,177,70,.5), 0 18px 36px rgba(0,0,0,.4), 0 0 30px rgba(245,177,70,.14); }
.demo-footer { max-width: 1480px; margin: 70px auto 0; padding-top: 20px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #647f86; font-size: 10px; }

@media (max-width: 1040px) {
  .room-grid { grid-template-columns: repeat(2, 1fr); }
  .state-strip { grid-template-columns: 1fr; }
  .control-layout { grid-template-columns: 1fr 1fr; }
  .sample-wide, .sample-radio { grid-column: 1 / -1; }
  .radio-transport { grid-template-columns: auto 1fr auto; }
  .equalizer { display: none; }
}
@media (max-width: 640px) {
  .demo-shell { padding: 22px 16px 36px; }
  .demo-header { margin-bottom: 44px; }
  .header-mark { width: 58px; height: 58px; border-radius: 20px; }
  .showcase-first { padding: 18px 12px; border-radius: 26px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .room-grid, .state-examples { grid-template-columns: 1fr; }
  .room-button { min-height: 69px; }
  .state-strip { padding-inline: 0; }
  .control-layout { grid-template-columns: 1fr; }
  .sample-wide, .sample-radio { grid-column: auto; }
  .segmented-control { min-height: 58px; }
  .segmented-control button { font-size: 10px; }
  .radio-transport { grid-template-columns: 1fr; border-radius: 28px; padding: 14px; }
  .radio-actions { justify-content: center; }
  .station-display { align-items: center; text-align: center; }
  .volume-meter { justify-content: center; }
  .handoff-panel { align-items: flex-start; flex-direction: column; }
  .download-button { width: 100%; justify-content: center; }
  .demo-footer { gap: 18px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
