:root {
  color-scheme: light;
  color: #343b3c;
  background: #f7f5ee;
  font: 16px/1.5 Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 48% 38%, #fcfaf5, #eae5d8 100%);
}
.masthead {
  max-width: 80rem;
  margin-inline: auto;
  padding: 1.3rem 0 .9rem;
  width: calc(100% - clamp(2rem, 10vw, 9rem));
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #aaa99b;
}
.masthead a { color: inherit; text-decoration: none; }
.brand { font-size: 1.75rem; letter-spacing: .16em; }
.brand span { color: #66796e; }
.return-link { font: .82rem/1.5 "Segoe UI", sans-serif; }
.return-link:hover { text-decoration: underline; text-underline-offset: .25em; }
main { padding: clamp(1.4rem, 4vh, 3.4rem) .75rem 2.4rem; }
h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(2.2rem, 5.5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.035em;
}
figure { width: min(100%, clamp(28rem, calc((100svh - 15rem) * 1.195), 55rem)); margin: 0 auto; }
.computer { position: relative; aspect-ratio: 920 / 770; }
.computer > svg { display: block; width: 100%; height: 100%; }
#capsule-screen {
  position: absolute;
  left: 28.696%;
  top: 11.429%;
  width: 38.261%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3% / 4%;
  background:
    radial-gradient(ellipse at 21% 4%, #e8e0be22, transparent 60%),
    linear-gradient(144deg, #343937, #232826 67%, #1c201f);
  box-shadow: inset 0 0 1.1rem #11141080, inset 0 1px #d7ccb82e;
}
#capsule-screen-content { position: absolute; inset: 0; }
#capsule-power {
  position: absolute;
  left: 60.217%;
  top: 47.792%;
  width: 3.478%;
  height: 3.247%;
  appearance: none;
  display: grid;
  place-items: center;
  color: #605c4b;
  background: linear-gradient(#e2dac7, #bdb198);
  border: 1px solid #8a806c;
  border-radius: 14%;
  box-shadow: inset 0 1px #f6eedb;
  padding: 0;
  cursor: pointer;
}
figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .2rem 1rem;
  font: .76rem/1.5 "Segoe UI", sans-serif;
  color: #57574f;
  letter-spacing: .06em;
}

.capsule-desktop { display: none; }
.capsule-notice {
  max-width: 34rem;
  margin: clamp(2.5rem, 10vh, 6rem) auto 0;
  padding: 0 .75rem;
  text-align: center;
}
.capsule-notice h2 {
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: 400;
  line-height: 1.25;
}
.capsule-notice p { line-height: 1.7; }
.capsule-notice a { color: #465d53; text-underline-offset: .25em; }

@media (any-pointer: fine) and (any-hover: hover) {
  .capsule-desktop { display: block; }
  .capsule-notice { display: none; }
}

html { overflow-x: clip; scrollbar-gutter: stable; }
html.capsule-on { overflow: hidden; }
.computer {
  transform-origin: var(--crt-origin, 47.826% 28.571%);
  transform: var(--crt-transform, none);
  transition: transform 1.8s cubic-bezier(.22, .7, .2, 1),
              --crt-zoom 1.8s cubic-bezier(.22, .7, .2, 1);
}
.capsule-desktop:has(.capsule-foreground)::before {
  content: "";
  display: block;
  aspect-ratio: 920 / 770;
}
.computer.capsule-foreground {
  position: fixed;
  z-index: 2;
  left: var(--scene-left);
  top: var(--scene-top);
  width: var(--scene-width);
}
#capsule-power svg { width: 61%; height: 75%; }
#capsule-power:hover { background: #eee6d1; color: #384c3c; }
#capsule-power:focus-visible, #capsule-return:focus-visible {
  outline: 2px solid #3e5e50;
  outline-offset: 3px;
}
#capsule-power:disabled { cursor: default; }
.computer:is([data-power="starting"], [data-power="on"]) #capsule-power { color: #355a3b; }
.computer:is([data-power="starting"], [data-power="on"]) #capsule-monitor-light {
  fill: #93b96f;
  filter: drop-shadow(0 0 3px #94b974);
}
#capsule-screen::before, #capsule-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#capsule-screen::before {
  background: radial-gradient(ellipse, #617666, #343e38 82%, #292e2b);
  opacity: 0;
  transition: opacity .55s ease;
}
.computer:is([data-power="starting"], [data-power="on"]) #capsule-screen::before { opacity: 1; }
.computer[data-power="starting"] #capsule-screen::after {
  background: radial-gradient(ellipse, #e4f0d8, #bdceab 50%, transparent 85%);
  animation: crt-flash .75s ease-out both;
}
@keyframes crt-flash {
  0%, 100% { opacity: 0; }
  24% { opacity: .67; }
}
#capsule-screen-content {
  width: 1024px;
  height: 768px;
  inset: 0 auto auto 0;
  transform: scale(var(--desktop-scale, 1));
  transform-origin: top left;
}
.capsule-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #eee9de;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s ease;
}
.capsule-on .capsule-backdrop { opacity: 1; }
#capsule-return {
  position: fixed;
  z-index: 3;
  top: 12px;
  right: 16px;
  max-width: calc(100% - 32px);
  padding: .46rem .75rem;
  border: 1px solid #a29b88;
  border-radius: 3px;
  color: #343b3c;
  background: #f7f3e9;
  font: .8rem/1.35 "Segoe UI", sans-serif;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .computer, .capsule-backdrop, #capsule-screen::before { transition: none; }
  .computer[data-power="starting"] #capsule-screen::after { animation: none; opacity: 0; }
}

.computer[data-power="stopping"] #capsule-screen::before {
  transition: opacity .21s ease-out;
}
.computer[data-power="stopping"] #capsule-screen::after {
  background: radial-gradient(ellipse, #e3e9c9, #a9b396 42%, transparent 76%);
  animation: crt-fade-out .22s ease-out both;
}
@keyframes crt-fade-out {
  0% { opacity: .32; transform: scale(1); }
  70% { opacity: .23; transform: scale(.8, .025); }
  100% { opacity: 0; transform: scale(.03, .01); }
}
@media (prefers-reduced-motion: reduce) {
  .computer[data-power="stopping"] #capsule-screen::before { transition: none; }
  .computer[data-power="stopping"] #capsule-screen::after { animation: none; opacity: 0; }
}

/* Glass shading is soft; the narrow glint is a separate optical edge. */
#capsule-screen {
  box-shadow: inset 0 0 .75rem #11141066, inset 0 1px #d7ccb824;
}

/* non-scaling-stroke handles SVG transforms. The HTML camera scales its
   whole layer, so counter its animated scale on the marked strokes only. */
@property --crt-zoom {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
.capsule-outline {
  stroke-width: calc(var(--outline-width, 1px) / var(--crt-zoom, 1));
}
