/* Always on: a night scene. The laptop closes, the box on the shelf keeps working, jobs finish overnight and the
   phone gets the report and an approval. always.js steps the phases (classes on .ao-world); without JS, and under
   reduced motion, the scene shows its final state. */

.always { overflow: hidden; }
.always::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 360px at 20% 30%, var(--k-glow), transparent 70%),
              radial-gradient(500px 300px at 90% 80%, rgba(47, 227, 160, .10), transparent 70%); }
.ao { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 960px) { .ao { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* ---------- the scene box (fixed aspect: no layout shift) ---------- */
.ao-scene { margin: 0; container-type: inline-size; border-radius: 20px; padding: 1px;
  background: linear-gradient(140deg, rgba(111, 139, 255, .7), rgba(245, 165, 36, .35) 45%, rgba(47, 227, 160, .45));
  box-shadow: 0 30px 80px -30px var(--k-glow), 0 0 0 1px var(--k-line); }
.ao-world { position: relative; aspect-ratio: 16 / 11; overflow: hidden; border-radius: 19px; color: #E6EBFF;
  font: 400 clamp(9px, 1.75cqw, 13px)/1.3 var(--k-mono); background: #0A1440; isolation: isolate; }
.ao-world * { box-sizing: border-box; }

/* sky: day layer under a night layer whose opacity changes */
.ao-sky { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #7FA6F5 0%, #BFD3FF 55%, #E9D9B8 100%); }
.ao-sun { position: absolute; left: 40%; top: 10%; width: 9cqw; height: 9cqw; border-radius: 50%;
  background: radial-gradient(circle, #FFE7A8 0 45%, rgba(255, 210, 120, .5) 46%, transparent 70%); transition: transform 1.6s var(--k-ease-out), opacity 1.2s; }
.ao-night { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease;
  background: linear-gradient(180deg, #030616 0%, #0A1440 60%, #17205A 100%); }
.ao-stars { position: absolute; inset: 0 0 40% 0;
  background-image: radial-gradient(1.4px 1.4px at 12% 20%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 30% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 48% 26%, #C9D4FF 50%, transparent 51%), radial-gradient(1px 1px at 22% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 40% 14%, #FFE7A8 50%, transparent 51%), radial-gradient(1px 1px at 8% 52%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 55% 44%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 66% 6%, #C9D4FF 50%, transparent 51%);
  animation: ao-twinkle 4s ease-in-out infinite alternate; }
@keyframes ao-twinkle { to { opacity: .45; } }
.ao-moon { position: absolute; left: 44%; top: 9%; width: 6cqw; height: 6cqw; border-radius: 50%;
  box-shadow: inset -1.6cqw .4cqw 0 0 #F3EBD0; filter: drop-shadow(0 0 10px rgba(243, 235, 208, .5)); transform: translateY(20%); transition: transform 1.8s var(--k-ease-out); }

/* clock */
.ao-clock { position: absolute; left: 4%; top: 5%; display: grid; gap: 2px; padding: .5em .8em; border-radius: 8px;
  background: rgba(3, 6, 22, .55); border: 1px solid rgba(136, 157, 231, .3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ao-clock span { font-size: 1.9em; font-weight: 500; letter-spacing: .02em; color: #FFC15C; font-variant-numeric: tabular-nums; }
.ao-clock small { font-size: .85em; color: #B9C4E8; }

/* the always-on box on a shelf */
.ao-shelf { position: absolute; left: 9%; top: 29%; width: 25%; }
.ao-box { position: relative; height: 5.6cqw; margin: 0 8%; border-radius: 1.1cqw; background: linear-gradient(180deg, #1C2550, #0B1236);
  border: 1px solid rgba(136, 157, 231, .45); display: flex; align-items: center; gap: 6%; padding: 0 8%; }
.ao-halo { position: absolute; inset: -60%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(47, 227, 160, .35), transparent); opacity: .5; transition: opacity 1.2s; }
.ao-led { position: absolute; right: 8%; top: 50%; width: .8cqw; height: .8cqw; margin-top: -.4cqw; border-radius: 50%;
  background: #2FE3A0; box-shadow: 0 0 8px #2FE3A0, 0 0 16px rgba(47, 227, 160, .7); animation: ao-breathe 2.4s ease-in-out infinite; }
@keyframes ao-breathe { 50% { opacity: .45; } }
.ao-leds { display: flex; gap: .5cqw; }
.ao-leds i { width: .9cqw; height: .45cqw; border-radius: 2px; background: rgba(136, 157, 231, .35); }
.ao-box-t { position: absolute; left: 50%; top: calc(100% + 1.9cqw); transform: translateX(-50%); padding: .15em .6em; border-radius: 1cqw; background: rgba(3, 6, 22, .7); font-size: .8em; color: #C9D4FF; white-space: nowrap; }
.ao-board { height: 1cqw; margin-top: .5cqw; border-radius: 3px; background: linear-gradient(180deg, #6B5A45, #3E3327);
  box-shadow: 0 1.2cqw 1.2cqw -1cqw rgba(0, 0, 0, .5); }

/* desk + laptop */
.ao-desk { position: absolute; left: 0; width: 64%; bottom: 31%; height: 30%; }
.ao-table { position: absolute; left: 4%; right: -2%; bottom: 0; height: 1.4cqw; border-radius: 4px; background: linear-gradient(180deg, #8A7156, #4D3E2E); }
.ao-laptop { position: absolute; left: 14%; bottom: 1.4cqw; width: 40%; perspective: 60cqw; }
.ao-lid { position: relative; height: 14cqw; margin: 0 7%; border-radius: 1cqw 1cqw .2cqw .2cqw; background: #222B4F; padding: .8cqw;
  transform-origin: 50% 100%; transition: transform 1.4s cubic-bezier(.6, 0, .2, 1); border: 1px solid rgba(136, 157, 231, .35); }
.ao-lid-in { height: 100%; border-radius: .5cqw; background: linear-gradient(160deg, #1C3EBA, #0B1236); display: grid; align-content: start; gap: .7cqw; padding: 1cqw;
  box-shadow: 0 0 3cqw rgba(91, 123, 255, .5); transition: opacity .8s .4s, box-shadow .8s; }
.ao-lid-in i { display: block; height: .7cqw; border-radius: 2px; background: rgba(255, 255, 255, .55); }
.ao-lid-in i:nth-child(2) { width: 70%; background: #F5A524; }
.ao-lid-in i:nth-child(3) { width: 45%; }
.ao-base { height: 1cqw; border-radius: 0 0 1cqw 1cqw; background: linear-gradient(180deg, #A9B3CE, #5B6272); }
.ao-mug { position: absolute; left: 62%; bottom: 1.4cqw; width: 3.2cqw; height: 3.6cqw; border-radius: 0 0 .9cqw .9cqw; background: #F5A524; }
.ao-mug::after { content: ""; position: absolute; right: -1.3cqw; top: .7cqw; width: 1.5cqw; height: 1.7cqw; border: .45cqw solid #F5A524; border-left: 0; border-radius: 0 1cqw 1cqw 0; }

/* phone */
.ao-lock { display: grid; justify-items: center; gap: .2em; margin: .6cqw 0 .4cqw; }
.ao-lock span { font: 300 3.1em/1 var(--ts-font-sans); color: #fff; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ao-lock small { font-size: .78em; color: #8C9BD0; }
.ao-lock small::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .4em; border-radius: 50%; background: #2FE3A0; box-shadow: 0 0 6px #2FE3A0; }
.ao-phone { position: absolute; right: 5%; top: 6%; width: 25%; height: 60%; border-radius: 3cqw; padding: 1.6cqw 1.2cqw;
  background: linear-gradient(180deg, #0D1640, #060B24); border: 2px solid #34416B;
  box-shadow: 0 2cqw 4cqw -1cqw rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset; display: flex; flex-direction: column; gap: 1.2cqw; }
.ao-ph-top { display: flex; justify-content: space-between; align-items: center; font-size: .85em; color: #C9D4FF; padding: 0 .6cqw; }
.ao-ph-dots { width: 3.5cqw; height: .9cqw; border-radius: 1cqw; background: #000; }
.ao-note { position: relative; display: grid; gap: .3em; padding: 1cqw 1.1cqw; border-radius: 1.4cqw; background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(136, 157, 231, .3); font-size: .82em; line-height: 1.3;
  opacity: 0; transform: translateY(-1.4cqw) scale(.96); transition: opacity .45s, transform .55s var(--k-ease-spring); }
.ao-note b { font-weight: 500; color: #FFC15C; font-size: .9em; }
.ao-note > span { color: #fff; font-family: var(--ts-font-sans); }
.ao-n2 { border-color: rgba(245, 165, 36, .55); box-shadow: 0 0 2cqw -.5cqw rgba(245, 165, 36, .55); }
.ao-btns { display: flex; gap: .7cqw; margin-top: .3em; }
.ao-btns span { flex: 1; text-align: center; padding: .35em 0; border-radius: .8cqw; font-size: .9em; }
.ao-yes { background: #F5A524; color: #0B1433; transition: transform .15s, box-shadow .3s; }
.ao-no { background: rgba(255, 255, 255, .1); color: #C9D4FF; }
.ao-ok { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: inherit;
  background: #0C3A2A; color: #2FE3A0; font-weight: 500; opacity: 0; transform: scale(.8); transition: opacity .3s, transform .45s var(--k-ease-spring); }

/* overnight jobs */
.ao-jobs { position: absolute; left: 3%; right: 3%; bottom: 3.5%; height: 25%; margin: 0; padding: 1.2cqw; list-style: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2cqw; border-radius: 1.6cqw;
  background: rgba(3, 6, 22, .72); border: 1px solid rgba(136, 157, 231, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ao-jobs li { position: relative; display: grid; align-content: start; gap: .25em; min-width: 0; padding: .4cqw .6cqw; border-left: 2px solid rgba(136, 157, 231, .3); transition: border-color .4s; }
.ao-jobs time { color: #FFC15C; font-size: .9em; }
.ao-jobs span:not(.ao-bar) { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-jobs em { font-style: normal; color: #8C9BD0; font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-bar { display: block; height: .55cqw; margin-top: .3em; border-radius: 1cqw; background: rgba(136, 157, 231, .18); overflow: hidden; }
.ao-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #4868DA, #2FE3A0);
  transform: scaleX(0); transform-origin: left; transition: transform 1.6s cubic-bezier(.4, 0, .2, 1); }
.ao-jobs b { position: absolute; right: .4cqw; top: .3cqw; width: 2.2cqw; height: 2.2cqw; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .9em; color: #04060E; background: #2FE3A0;
  box-shadow: 0 0 1.2cqw rgba(47, 227, 160, .7); opacity: 0; transform: scale(.3); transition: opacity .25s, transform .45s var(--k-ease-spring); }
.ao-jobs b::before { content: "✓"; }

/* ---------- phases (set by always.js on .ao-world) ---------- */
.ao-world.is-night .ao-night { opacity: 1; }
.ao-world.is-done .ao-night { opacity: .25; }
.ao-world.is-night .ao-sun { transform: translateY(160%); opacity: 0; }
.ao-world.is-night .ao-moon { transform: none; }
.ao-world.is-closed .ao-lid { transform: rotateX(86deg); }
.ao-world.is-closed .ao-lid-in { opacity: 0; box-shadow: none; }
.ao-world.is-night .ao-halo, .ao-world.is-done .ao-halo { opacity: 1; }
.ao-world.is-night .ao-leds i { animation: ao-blink 1.1s steps(2, jump-none) infinite; }
.ao-world.is-night .ao-leds i:nth-child(2) { animation-delay: .27s; }
.ao-world.is-night .ao-leds i:nth-child(3) { animation-delay: .55s; }
.ao-world.is-night .ao-leds i:nth-child(4) { animation-delay: .8s; }
@keyframes ao-blink { 0% { background: rgba(136, 157, 231, .35); } 100% { background: #FFC15C; box-shadow: 0 0 6px #FFC15C; } }
.ao-jobs li.run { border-left-color: #6F8BFF; }
.ao-jobs li.run .ao-bar i, .ao-jobs li.ok .ao-bar i { transform: none; }
.ao-jobs li.ok { border-left-color: #2FE3A0; }
.ao-jobs li.ok b { opacity: 1; transform: none; }
.ao-world.n1 .ao-n1, .ao-world.n2 .ao-n2 { opacity: 1; transform: none; }
.ao-world.tap .ao-yes { transform: scale(.9); box-shadow: 0 0 0 .6cqw rgba(245, 165, 36, .35); }
.ao-world.approved .ao-ok { opacity: 1; transform: none; }

/* final state: no JS, or reduced motion */
.ao-world.is-final .ao-night { opacity: 1; }
.ao-world.is-final .ao-sun { opacity: 0; }
.ao-world.is-final .ao-moon { transform: none; }
.ao-world.is-final .ao-lid { transform: rotateX(86deg); }
.ao-world.is-final .ao-lid-in { opacity: 0; }
.ao-world.is-final .ao-halo { opacity: 1; }
.ao-world.is-final .ao-jobs li { border-left-color: #2FE3A0; }
.ao-world.is-final .ao-bar i { transform: none; }
.ao-world.is-final .ao-jobs b, .ao-world.is-final .ao-note, .ao-world.is-final .ao-ok { opacity: 1; transform: none; }
html:not(.js) .ao-world .ao-night, html:not(.js) .ao-world .ao-note, html:not(.js) .ao-world .ao-jobs b, html:not(.js) .ao-world .ao-ok { opacity: 1; transform: none; }
html:not(.js) .ao-world .ao-bar i { transform: none; }
html:not(.js) .ao-world .ao-lid { transform: rotateX(86deg); }
.ao-world.paused *, .ao-world.paused { animation-play-state: paused !important; }

/* ---------- phone layout of the scene ---------- */
@media (max-width: 640px) {
  .ao-world { aspect-ratio: 4 / 5; font-size: clamp(9px, 3cqw, 12px); }
  .ao-clock { left: 4%; top: 4%; }
  .ao-sun { left: 34%; top: 6%; width: 14cqw; height: 14cqw; }
  .ao-moon { left: 46%; top: 3%; width: 10cqw; height: 10cqw; box-shadow: inset -2.6cqw .6cqw 0 0 #F3EBD0; }
  .ao-shelf { left: 5%; top: 25%; width: 44%; }
  .ao-box { height: 9cqw; border-radius: 1.8cqw; }
  .ao-led { width: 1.4cqw; height: 1.4cqw; margin-top: -.7cqw; }
  .ao-leds i { width: 1.6cqw; height: .8cqw; }
  .ao-box-t { top: calc(100% + 2.8cqw); }
  .ao-board { height: 1.6cqw; }
  .ao-desk { width: 58%; bottom: 41%; height: 18%; }
  .ao-laptop { left: 8%; width: 66%; }
  .ao-lid { height: 20cqw; }
  .ao-mug { left: 78%; width: 5cqw; height: 5.6cqw; }
  .ao-mug::after { right: -2cqw; width: 2.2cqw; height: 2.6cqw; border-width: .7cqw; }
  .ao-table { height: 2cqw; }
  .ao-phone { right: 4%; top: 4%; width: 40%; height: 54%; border-radius: 5cqw; padding: 2.6cqw 2cqw; gap: 2cqw; }
  .ao-ph-dots { width: 6cqw; height: 1.6cqw; }
  .ao-note { border-radius: 2.4cqw; padding: 1.8cqw; font-size: .78em; }
  .ao-btns span { border-radius: 1.4cqw; }
  .ao-lock span { font-size: 2.4em; }
  .ao-jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); height: 36%; bottom: 3%; padding: 2.4cqw; gap: 2cqw; border-radius: 3cqw; }
  .ao-bar { height: 1cqw; }
  .ao-jobs b { width: 4cqw; height: 4cqw; }
}

/* ---------- the side column ---------- */
.ao-points { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: ao; }
.ao-points li { counter-increment: ao; position: relative; padding: 14px 16px 14px 56px; border-radius: 12px; line-height: 1.55;
  border: 1px solid var(--ts-border); background: color-mix(in srgb, var(--ts-surface) 85%, transparent);
  transition: border-color .25s, transform .3s var(--k-ease-out), box-shadow .3s; }
.ao-points li::before { content: counter(ao, decimal-leading-zero); position: absolute; left: 16px; top: 15px;
  font: 500 .8125rem/1.5 var(--k-mono); color: var(--k-kicker); }
.ao-points li:hover { border-color: color-mix(in srgb, var(--ts-primary) 55%, var(--ts-border)); transform: translateX(4px); box-shadow: 0 0 24px -10px var(--k-glow); }
.ao-points strong { color: var(--ts-text); }
.ao-points li { color: var(--ts-text-muted); }
.ao-plat { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 .75rem/1.4 var(--k-mono); color: var(--ts-text-muted); }
.ao-plat > span { letter-spacing: .04em; text-transform: uppercase; color: var(--k-kicker); }
.ao-plat ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.ao-plat li { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--ts-surface-sunken); color: var(--ts-text); }
.ao-side .fine { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .ao-points li:hover { transform: none; }
}
