:root {
  --ink: #f8fbff;
  --muted: #9eb0cb;
  --navy: #050b1b;
  --panel: rgba(7, 17, 40, 0.88);
  --cyan: #35e8ff;
  --magenta: #ff55d6;
  --amber: #ffbd57;
  --green: #38f09a;
  --line: rgba(117, 219, 255, 0.28);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--navy);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(35, 93, 154, 0.28), transparent 40%),
    linear-gradient(180deg, #071028 0%, #030817 100%);
  overflow-x: hidden;
}
button, dialog { font: inherit; }
button { color: inherit; }
a { color: var(--cyan); }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: #001016;
  background: var(--cyan);
  border-radius: 8px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: relative;
  z-index: 20;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: .8rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 24, .82);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}
.brand img { filter: drop-shadow(0 0 12px rgba(53, 232, 255, .32)); }
.brand span { display: grid; line-height: 1; }
.brand strong { font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: -.03em; }
.brand small { margin-top: .35rem; color: var(--cyan); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.topbar__status { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .78rem; }
.topbar__status > span:not(.live-pill) { padding-left: .8rem; border-left: 1px solid var(--line); }
.live-pill { display: inline-flex; align-items: center; gap: .4rem; color: var(--green); letter-spacing: .1em; }
.live-pill i, .status-dot::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); content: ""; }

.icon-button {
  justify-self: end;
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  min-height: 38px;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 35, 66, .62);
  cursor: pointer;
}
.icon-button:hover, .icon-button:focus-visible { border-color: var(--cyan); }

main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(.6rem, 2vw, 1.6rem); }
.office-shell { position: relative; }
.scene {
  position: relative;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(129, 225, 255, .6);
  border-radius: var(--radius);
  background: #081028;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .5), 0 0 0 5px rgba(69, 182, 255, .04);
}
.scene:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
.scene__background, .scene__tint, .scene__window-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene__background { z-index: 0; object-fit: cover; image-rendering: pixelated; }
.scene__tint { z-index: 1; pointer-events: none; mix-blend-mode: multiply; transition: background 1.2s ease; }
.scene--day .scene__tint { background: rgba(255, 224, 142, .03); }
.scene--evening .scene__tint { background: rgba(45, 16, 82, .08); }
.scene--night .scene__tint { background: rgba(4, 9, 43, .35); }
.scene__weather {
  position: absolute;
  z-index: 4;
  left: 18.1%;
  top: 6.4%;
  width: 42.1%;
  height: 44.5%;
  pointer-events: none;
  opacity: .96;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 2px rgba(114, 206, 255, .3));
}
.scene__window-glow { z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 42% 38%, rgba(66, 175, 255, .1), transparent 42%); animation: breathe 7s ease-in-out infinite; }

.actor {
  position: absolute;
  z-index: 6;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .4));
  transform-origin: 50% 100%;
  transition: left var(--move-ms, 0ms) linear, top var(--move-ms, 0ms) linear, transform var(--move-ms, 0ms) linear, opacity .4s ease;
  pointer-events: none;
}
.actor--hansen {
  --face: 1;
  --move-ms: 0ms;
  left: 39%;
  top: 59%;
  width: auto;
  height: 34%;
  aspect-ratio: 1 / 1;
  filter: none;
  transform: translate(-50%, -100%) scale(.82);
}
.actor--hansen .actor__sprite {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("assets/hansen-idle-v2.png") 0 0 / 200% 100% no-repeat;
  image-rendering: pixelated;
  transform: scaleX(var(--face));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 5px rgba(0, 0, 0, .42));
}
.actor--hansen .actor__shadow {
  position: absolute;
  z-index: 1;
  left: 24%;
  right: 24%;
  bottom: 1%;
  height: 7%;
  border-radius: 50%;
  background: rgba(1, 5, 15, .42);
  filter: blur(3px);
}
.actor--hansen.is-walking { aspect-ratio: 543 / 724; }
.actor--hansen.is-walking .actor__sprite {
  background-image: url("assets/hansen-walk-v2.png");
  background-size: 400% 100%;
  animation: hansen-walk .62s steps(4) infinite;
}
.actor--hansen.is-coffee .actor__sprite { background-position: 100% 0; }
.actor--base { width: auto; height: 16%; left: 80%; top: 84%; transform: translate(-50%, -100%); }
.actor--drone { width: auto; height: 10%; left: 84%; top: 62%; transform: translate(-50%, -100%); animation: hover 2.4s ease-in-out infinite; }
.actor--base.is-happy { animation: happy .35s ease-in-out 5; }
.actor--drone.is-flying { animation: flight 4.8s cubic-bezier(.42, 0, .32, 1); }

.hotspot {
  position: absolute;
  z-index: 8;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.hotspot::after { content: ""; position: absolute; inset: 0; border: 1px solid transparent; border-radius: inherit; }
.hotspot:hover::after, .hotspot:focus-visible::after { border-color: rgba(53, 232, 255, .75); box-shadow: 0 0 0 5px rgba(53, 232, 255, .13); }
.hotspot:focus-visible { outline: none; }
.hotspot--h { left: 5%; top: 14%; width: 8%; height: 18%; }
.hotspot--coffee { left: 60%; top: 29%; width: 9%; height: 22%; }
.hotspot--tv { left: 70%; top: 22%; width: 15%; height: 22%; }
.hotspot--lamp { left: 18%; top: 21%; width: 9%; height: 24%; }
.hotspot--toy { left: 76%; top: 75%; width: 12%; height: 13%; }

.speech {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 10%;
  max-width: 280px;
  padding: .6rem .8rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 12px;
  background: rgba(4, 12, 29, .9);
  color: #fff;
  font-size: clamp(.65rem, 1.2vw, .9rem);
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.speech.is-visible { opacity: 1; transform: translate(-50%, 0); }
.scene__caption {
  position: absolute;
  z-index: 11;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .8rem;
  border: 1px solid rgba(123, 218, 255, .25);
  border-radius: 10px;
  background: rgba(2, 9, 23, .68);
  backdrop-filter: blur(12px);
  color: #dce9ff;
  font-size: clamp(.68rem, 1.2vw, .85rem);
}
.scene__caption span:last-child { color: var(--muted); }

.action-dock {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
  width: min(900px, calc(100% - 2rem));
  margin: -1.05rem auto 0;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 14, 34, .94);
  box-shadow: 0 16px 45px rgba(0, 0, 0, .35);
  backdrop-filter: blur(16px);
}
.action-dock button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  padding: .6rem .7rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(19, 39, 72, .65);
  cursor: pointer;
  font-size: .78rem;
}
.action-dock button span:first-child { color: var(--cyan); font-size: 1rem; }
.action-dock button:hover, .action-dock button:focus-visible { border-color: var(--cyan); background: rgba(25, 67, 99, .8); }
.action-dock button:disabled { opacity: .5; cursor: wait; }

.below-scene {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding: clamp(3.5rem, 7vw, 6.5rem) clamp(.5rem, 3vw, 3rem) 3rem;
}
.eyebrow { margin: 0 0 .8rem; color: var(--cyan); font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
.below-scene h1 { max-width: 760px; margin: 0; font-size: clamp(2rem, 5vw, 4.5rem); line-height: .98; letter-spacing: -.055em; }
.below-scene article > p:last-child { max-width: 650px; margin: 1.5rem 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.7; }
.activity-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.activity-card__head { display: flex; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.status-dot { display: inline-flex; align-items: center; gap: .4rem; color: var(--green); font-size: .65rem; }
.activity-card ol { display: grid; gap: .6rem; max-height: 210px; margin: 0; padding: 1rem; overflow: hidden; list-style: none; }
.activity-card li { display: grid; grid-template-columns: 45px 1fr; gap: .6rem; color: #dce9ff; font-size: .78rem; }
.activity-card time { color: var(--muted); font-variant-numeric: tabular-nums; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; }

dialog { width: min(520px, calc(100% - 2rem)); padding: 0; border: 1px solid rgba(107, 221, 255, .45); border-radius: 18px; color: var(--ink); background: #071026; box-shadow: 0 30px 100px rgba(0, 0, 0, .72); }
dialog::backdrop { background: rgba(1, 5, 14, .78); backdrop-filter: blur(10px); }
.dialog-card { position: relative; margin: 0; padding: clamp(1.5rem, 5vw, 3rem); }
.dialog-card h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.05; }
.dialog-card p:not(.eyebrow):not(.terminal-line) { color: var(--muted); line-height: 1.65; }
.dialog-card--terminal { box-shadow: inset 0 0 60px rgba(29, 255, 159, .05); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-line { color: var(--green); }
.dialog-close { position: absolute; right: 1rem; top: 1rem; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.primary-button { margin-top: 1rem; padding: .75rem 1rem; border: 0; border-radius: 10px; color: #001017; background: var(--cyan); font-weight: 800; cursor: pointer; }
.noscript { position: fixed; inset: auto 1rem 1rem; z-index: 50; padding: 1rem; border-radius: 10px; color: #241300; background: var(--amber); }

body.zen .topbar__status, body.zen .brand span, body.zen .action-dock, body.zen .scene__caption, body.zen .below-scene, body.zen footer { display: none; }
body.zen main { width: 100%; padding: 0; }
body.zen .scene { min-height: calc(100vh - 65px); border: 0; border-radius: 0; }
body.zen .topbar { position: fixed; right: .5rem; top: .5rem; min-height: auto; display: block; width: auto; padding: .35rem; border: 0; border-radius: 12px; background: rgba(3, 9, 24, .65); }
body.zen .brand { display: none; }

@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }
@keyframes hansen-walk {
  0%, 24.99% { background-position: 0 0; }
  25%, 49.99% { background-position: 33.333% 0; }
  50%, 74.99% { background-position: 66.666% 0; }
  75%, 100% { background-position: 100% 0; }
}
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes happy { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg) translateY(-2%); } }
@keyframes flight {
  0% { left: 82%; top: 56%; transform: rotate(0); }
  25% { left: 66%; top: 22%; transform: rotate(-4deg); }
  50% { left: 43%; top: 13%; transform: rotate(3deg); }
  75% { left: 22%; top: 31%; transform: rotate(-2deg); }
  100% { left: 82%; top: 56%; transform: rotate(0); }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 62px; padding: .6rem .8rem; }
  .topbar__status { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; width: 100%; }
  .button-label { display: none; }
  main { padding: .5rem; }
  .scene { border-radius: 12px; }
  .scene__caption { left: .45rem; right: .45rem; bottom: .45rem; }
  .scene__caption span:last-child { display: none; }
  .action-dock { grid-template-columns: repeat(5, 1fr); width: calc(100% - .5rem); gap: .25rem; padding: .3rem; margin-top: -.4rem; }
  .action-dock button { min-height: 42px; padding: .35rem; }
  .action-dock button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .below-scene { grid-template-columns: 1fr; padding: 3.5rem .6rem 2rem; }
  footer { flex-direction: column; }
}

@media (orientation: portrait) and (max-width: 600px) {
  .scene { aspect-ratio: 4 / 3; }
  .scene__background { object-position: 48% 50%; }
}

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

