/* Brim — the interactive Mac on the home page.
   The stage is laid out at a fixed logical size (set by demo.js) and scaled as a whole, like
   the app scales the island, so proportions stay exact at every width. */

.screen { aspect-ratio: 16 / 10; }
.screen.compact-ratio { aspect-ratio: 4 / 3; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; font-family: var(--font); color: #fff; }
.screen.no-js .stage { display: none; }
.screen .fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen.ready .fallback { display: none; }

/* Wallpaper: an original warm-dusk landscape, drawn in CSS + SVG (no image to load). */
.wall { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #1b1340 0%, #34205f 26%, #6a2d7e 50%, #c24f73 74%, #f39a5d 100%); }
.wall::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60% 45% at 78% 22%, rgba(255, 160, 120, .38), transparent 70%),
  radial-gradient(50% 40% at 18% 30%, rgba(123, 108, 255, .45), transparent 70%),
  radial-gradient(70% 50% at 50% 110%, rgba(255, 196, 120, .55), transparent 70%); }
.wall svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 72%; }

/* Menu bar */
.menubar {
  position: absolute; left: 0; right: 0; top: 0; height: 32px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 18px;
  font-size: 13.5px; font-weight: 500; letter-spacing: -.005em; color: rgba(255, 255, 255, .95);
  background: rgba(24, 12, 48, .22);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.menubar .side { display: flex; align-items: center; gap: 19px; }
.menubar .app { font-weight: 700; }
.menubar .logo-mark { width: 17px; height: 11px; border-radius: 6px; background: #fff; position: relative; }
.menubar .logo-mark::after { content: ""; position: absolute; left: 3px; top: 3px; width: 5px; height: 5px; border-radius: 2px; background: #1b1340; }
.menubar svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menubar .batt { display: flex; align-items: center; gap: 6px; }
.menubar .batt svg { width: 25px; }
.menubar .clock { font-variant-numeric: tabular-nums; min-width: 128px; text-align: right; }
.stage.small .menubar .hide-small { display: none; }

/* Dock (macOS Tahoe): real app icons, which carry their own shape, padding and shadow. */
.dock {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 1;
  display: flex; align-items: flex-end; gap: 2px; padding: 5px 7px;
  border-radius: 26px; background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 32px rgba(20, 8, 40, .28);
  -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7);
}
.dock .app-i { position: relative; display: block; width: 62px; height: 62px; transition: transform .25s var(--spring); }
.dock .app-i:hover { transform: translateY(-8px) scale(1.12); }
.dock .app-i img { width: 62px; height: 62px; -webkit-user-drag: none; }
.dock .app-i.run::after { content: ""; position: absolute; bottom: -3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.dock .app-i::before {
  content: attr(data-name); position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translate(-50%, 4px); padding: 4px 10px; border-radius: 8px;
  background: rgba(36, 30, 44, .72); color: #fff; font: 600 13px/1.3 var(--font); white-space: nowrap;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s var(--ease);
}
.dock .app-i:hover::before { opacity: 1; transform: translate(-50%, 0); }
.dock .sep { width: 1px; align-self: stretch; margin: 8px 6px; background: rgba(255, 255, 255, .32); }
.stage.small .dock .hide-small { display: none; }

/* Hint bubble */
.hint {
  position: absolute; left: 50%; top: 86px; transform: translateX(-50%); z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap;
  transition: opacity .4s, transform .5s var(--spring);
}
.hint svg { width: 15px; height: 15px; fill: #fff; }
.hint.gone, .stage.island-big .hint { opacity: 0; transform: translate(-50%, -6px); pointer-events: none; }

/* ───────────── The island ───────────── */
.island {
  --iw: 180px; --ih: 32px; --ir: 11px;
  position: absolute; top: 0; left: 50%; z-index: 5;
  width: var(--iw); height: var(--ih);
  transform: translateX(-50%);
  background: #000; color: #fff;
  border-radius: 0 0 var(--ir) var(--ir);
  transition: width .5s var(--spring), height .5s var(--spring), border-radius .5s var(--spring), box-shadow .4s;
  cursor: default;
}
.island.closing { transition-duration: .36s, .36s, .36s, .3s; transition-timing-function: cubic-bezier(.3, .7, .2, 1); }
.island.big { box-shadow: 0 22px 44px -10px rgba(0, 0, 0, .55); }
.island::before, .island::after { content: ""; position: absolute; top: 0; width: 12px; height: 12px; pointer-events: none; }
.island::before { left: -12px; background: radial-gradient(circle at 0 100%, transparent 11.5px, #000 12px); }
.island::after { right: -12px; background: radial-gradient(circle at 100% 100%, transparent 11.5px, #000 12px); }
.island .hit { position: absolute; inset: 0 -16px -12px; }

.layer {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; filter: blur(5px); transform: scale(.94);
  transition: opacity .18s, filter .22s, transform .3s var(--ease);
  pointer-events: none; overflow: hidden; border-radius: inherit;
}
.layer.on { opacity: 1; filter: none; transform: none; transition: opacity .28s .12s, filter .32s .1s, transform .45s .08s var(--spring); pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .island, .layer, .layer.on { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* Compact wings: content left and right of the camera. */
.wings { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 11px; }
.wing { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wing svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wing .f { fill: currentColor; stroke: none; }
.tint-green { color: #32d74b; }
.tint-orange { color: #ff9f0a; }
.tint-blue { color: #0a84ff; }
.tint-sky { color: #5ac8f5; }
.eq.push { margin-left: auto; }

/* Lock / unlock: the shackle lifts when the Mac unlocks. */
.padlock .shackle { fill: none; stroke: currentColor; stroke-width: 2.4; transform-origin: 8px 10.5px; transition: transform .5s var(--spring); }
.island.unlocked .padlock .shackle { transform: translateY(-2.6px); }
.island.unlocked .padlock { color: #32d74b; }
.padlock { transition: color .3s; }

/* Album art: generated gradients (no real artwork). */
.art { position: relative; flex: none; overflow: hidden; background: linear-gradient(135deg, var(--c1, #ff5f6d), var(--c2, #ffc371)); transition: background .5s; }
.art::before { content: ""; position: absolute; width: 62%; height: 62%; right: -8%; bottom: -10%; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.art::after { content: ""; position: absolute; width: 30%; height: 30%; left: 14%; top: 14%; border-radius: 50%; background: rgba(0, 0, 0, .14); }
.art.sm { width: 21px; height: 21px; border-radius: 6px; }
.art.md { width: 58px; height: 58px; border-radius: 14px; box-shadow: 0 8px 20px -6px var(--c1, #ff5f6d); }
.art.lg { width: 94px; height: 94px; border-radius: 20px; box-shadow: 0 12px 28px -8px var(--c1, #ff5f6d); }

.eq { display: flex; align-items: center; gap: 2.5px; height: 18px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent, #ff5f6d); transform-origin: center; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(1) { animation-duration: .9s; }
.eq i:nth-child(2) { animation-duration: 1.2s; animation-delay: -.3s; }
.eq i:nth-child(3) { animation-duration: .8s; animation-delay: -.5s; }
.eq i:nth-child(4) { animation-duration: 1.05s; animation-delay: -.2s; }
.paused .eq i { animation-play-state: paused; transform: scaleY(.25); transition: transform .3s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* Peek (track change) */
.peek { display: flex; align-items: center; gap: 14px; height: 100%; padding: 30px 18px 12px; }
.peek .t { flex: 1; min-width: 0; }
.t b, .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.t span { font-size: 14px; color: rgba(235, 235, 245, .6); margin-top: 1px; }

/* Open island */
.open { position: relative; height: 100%; padding: 0 22px; }
.open .bar { display: flex; justify-content: space-between; align-items: center; height: 34px; padding-top: 2px; }
.open .tabs { display: flex; gap: 4px; }
.open .tab { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 9px; color: rgba(255, 255, 255, .55); }
.open .tab.on { background: rgba(255, 255, 255, .14); color: #fff; }
.open .tab svg, .open .status svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.open .status { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .72); }
.open .status .batt-i { width: 24px; }
.open .body { display: flex; gap: 22px; margin-top: 12px; }
.player { flex: 1; display: flex; gap: 18px; min-width: 0; }
.player .meta { flex: 1; min-width: 0; padding-top: 2px; }
.player .top { display: flex; align-items: flex-start; gap: 10px; }
.player .t b { font-size: 18px; }
.player .t span { font-size: 15px; }
.progress { margin-top: 13px; }
.progress .track { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); cursor: pointer; }
.progress .track::before { content: ""; position: absolute; inset: -8px 0; }
.progress .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: rgba(255, 255, 255, .92); }
.progress .times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: rgba(235, 235, 245, .45); font-variant-numeric: tabular-nums; }
.controls { display: flex; justify-content: center; align-items: center; gap: 30px; margin-top: 8px; }
.ctl { display: grid; place-items: center; width: 40px; height: 36px; border: 0; border-radius: 10px; background: none; color: #fff; transition: background .2s, transform .15s; }
.ctl:hover { background: rgba(255, 255, 255, .1); }
.ctl:active { transform: scale(.88); }
.ctl svg { width: 26px; height: 26px; fill: #fff; }
.ctl.play svg { width: 30px; height: 30px; }
.side-col { width: 212px; flex: none; padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, .12); }
.side-col .day { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #ff453a; }
.side-col .ev { margin-top: 6px; padding-left: 10px; border-left: 3px solid #ff453a; }
.side-col .ev b { display: block; font-size: 15px; letter-spacing: -.02em; }
.side-col .ev span { display: block; font-size: 13px; color: rgba(235, 235, 245, .6); }
.join { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; padding: 7px 13px; border-radius: 12px; border: 0; background: #32d74b; color: #04230d; font-size: 14px; font-weight: 700; }
.join svg { width: 16px; height: 16px; fill: currentColor; }
.quick { display: flex; align-items: center; gap: 5px; margin-top: 16px; }
.quick svg { width: 18px; height: 18px; fill: none; stroke: #ff9f0a; stroke-width: 2.2; stroke-linecap: round; }
.quick button { padding: 5px 7px; border: 0; border-radius: 10px; background: rgba(255, 159, 10, .16); color: #ff9f0a; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quick button:hover { background: rgba(255, 159, 10, .26); }

/* HUD level bar */
.level { position: relative; width: 92px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.level i { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: 3px; background: #fff; transition: width .18s var(--ease); }

/* Banners (AirPods, meeting, notification, download done) */
.banner { display: flex; align-items: center; gap: 14px; height: 100%; padding: 30px 18px 12px 16px; }
.banner .vis { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .1); }
.banner .vis svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.banner .vis.device { width: 58px; height: 58px; background: none; border-radius: 0; margin-left: -4px; }
.banner .vis.device img { width: 58px; height: 58px; }
.vis-red { background: rgba(255, 69, 58, .18) !important; }
.vis-red svg { stroke: #ff453a !important; }
.vis-blue { background: rgba(10, 132, 255, .2) !important; }
.vis-blue svg { stroke: #4fb6ff !important; }
.vis-violet { background: rgba(123, 108, 255, .25) !important; }
.vis-violet svg { stroke: #b3a8ff !important; }
.banner .t { flex: 1; min-width: 0; }
.ring { position: relative; width: 40px; height: 40px; flex: none; }
.ring svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: rgba(255, 255, 255, .15); }
.ring .fg { stroke: #32d74b; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.pill-btn { padding: 8px 14px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 700; flex: none; }
.pill-btn.green { background: #32d74b; color: #04230d; }
.pill-btn.gray { background: rgba(255, 255, 255, .14); color: #fff; }

/* Drop zone (AirDrop & Shelf) */
.drop { display: flex; gap: 12px; height: 100%; padding: 42px 16px 16px; }
.zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 20px; font-size: 14px; font-weight: 700; }
.zone.air { background: rgba(90, 200, 245, .14); box-shadow: inset 0 0 0 1.5px rgba(90, 200, 245, .55); color: #5ac8f5; }
.zone.shelf { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .8); }
.zone svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zone .rings circle { animation: ping 1.8s ease-out infinite; transform-origin: 20px 26px; }
.zone .rings circle:nth-child(2) { animation-delay: .4s; }
.zone .rings circle:nth-child(3) { animation-delay: .8s; }
@keyframes ping { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: .15; } }
.zone small { font-size: 12px; font-weight: 600; opacity: .7; }
.flying { position: absolute; z-index: 6; width: 46px; height: 56px; border-radius: 6px; background: linear-gradient(160deg, #fff, #dfe6ff); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; }
.flying::after { content: "PDF"; position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 800 10px var(--font); color: #e0443a; }
.flying.go { animation: fly 1.4s var(--ease) forwards; }
@keyframes fly {
  0% { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(-8deg) scale(1); }
  15% { opacity: 1; }
  80% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.7); }
  100% { opacity: 0; transform: translate(0, 0) scale(.4); }
}

/* ───────────── Lock Screen (demo moment + the section's picture) ─────────────
   Sizes are in em: 1em = 16px on the 1280-wide stage, and 1.25cqw in the section's frame. */
.ls-clock { position: absolute; left: 0; right: 0; top: 5.6em; text-align: center; }
.ls-date { font-size: 1.45em; font-weight: 600; letter-spacing: -.01em; color: rgba(255, 255, 255, .88); }
.ls-time { margin-top: .02em; font-family: ui-rounded, "SF Pro Rounded", var(--font); font-size: 7.6em; font-weight: 700; line-height: 1; letter-spacing: -.025em; color: rgba(255, 255, 255, .94); font-variant-numeric: tabular-nums; text-shadow: 0 .04em .3em rgba(30, 10, 60, .25); }
.ls-batt { display: inline-flex; align-items: center; gap: .45em; margin-top: .9em; padding: .38em .85em .38em .7em; border-radius: 999px; font-size: 1.2em; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ls-batt svg { width: 1.45em; height: 1.45em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ls-player {
  position: absolute; left: 50%; bottom: 7.2em; transform: translateX(-50%);
  display: flex; align-items: center; gap: .9em; width: 25em; padding: .85em 1em .85em .85em; border-radius: 1.5em;
  background: rgba(30, 14, 52, .34); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); color: #fff;
}
.ls-player .art.md { width: 3.5em; height: 3.5em; border-radius: .8em; box-shadow: none; }
.ls-player .t { flex: 1; min-width: 0; }
.ls-player .t b { font-size: 1.05em; }
.ls-player .t span { font-size: .9em; }
.ls-ctl { display: flex; gap: .7em; }
.ls-ctl svg { width: 1.45em; height: 1.45em; fill: #fff; }
.ls-user { position: absolute; left: 0; right: 0; bottom: 1.4em; display: flex; flex-direction: column; align-items: center; gap: .45em; font-size: .95em; font-weight: 500; color: rgba(255, 255, 255, .75); }
.ls-avatar { width: 2.6em; height: 2.6em; border-radius: 50%; background: linear-gradient(135deg, #ffc371, #ff5f6d 60%, #7b6cff); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }

/* In the demo: a blurred Lock Screen over the desktop, under the island. */
.lockscreen {
  position: absolute; inset: 0; z-index: 4; font-size: 16px;
  background: rgba(20, 8, 44, .22);
  -webkit-backdrop-filter: blur(28px) saturate(1.4); backdrop-filter: blur(28px) saturate(1.4);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility 0s .45s;
}
.stage.locked .lockscreen { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }
.stage.small .lockscreen { font-size: 13px; }
.stage.small .ls-clock { top: 6em; }
.stage.locked .hint { opacity: 0; }

/* In the Lock Screen section: a standalone picture that scales with its width. */
.ls-frame {
  position: relative; aspect-ratio: 16 / 10; container-type: inline-size;
  border-radius: clamp(18px, 2.6vw, 34px); overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(60% 45% at 78% 22%, rgba(255, 160, 120, .38), transparent 70%),
    radial-gradient(50% 40% at 18% 30%, rgba(123, 108, 255, .45), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(255, 196, 120, .55), transparent 70%),
    linear-gradient(180deg, #1b1340 0%, #34205f 26%, #6a2d7e 52%, #c24f73 76%, #f39a5d 100%);
  box-shadow: 0 50px 90px -40px rgba(92, 44, 20, .55), 0 0 0 1px rgba(0, 0, 0, .06);
}
.ls-frame > * { font-size: 1.55cqw; }
.ls-frame .art-a { --c1: #ff5f6d; --c2: #ffc371; }
.ls-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 14.5em; height: 2em; padding: 0 .75em; display: flex; align-items: center; border-radius: 0 0 .8em .8em; background: #000; }
.ls-notch svg { width: 1.2em; height: 1.2em; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { :root:not(.theme-light) .ls-frame { box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); } }
