/* ─────────────────────────────────────────────────────────────
   Laptop posture — the phone becomes a tiny computer
   Lid on top, hinge, keyboard deck below.
   All colours come from --m-* vars set per machine in JS.
   ───────────────────────────────────────────────────────────── */

.view--computer {
  display: grid;
  grid-template-rows: calc(50% - 4px) 8px calc(50% - 4px);
  background: var(--m-body);
  z-index: 1;
  overflow: hidden;
}

/* ── lid ─────────────────────────────────────────────────────── */
.lid {
  grid-row: 1;
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--m-body) 88%, #fff) 0%, var(--m-body) 42%, color-mix(in srgb, var(--m-body) 92%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -14px 24px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.lid-bezel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  padding: 2.6cqh 3.2cqw 1.7cqh;
  gap: 0 2cqw;
}

.lid-side {
  display: flex;
  flex-direction: column;
  gap: 1.2cqh;
  font-family: var(--font-mono);
  font-size: clamp(6px, 0.68cqw, 9px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--m-plate-ink);
  opacity: 0.75;
  align-self: stretch;
  justify-content: center;
}
.lid-side--l { align-items: flex-start; }
.lid-side--r { align-items: flex-end; text-align: right; }

.lid-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.75em 0.5em 0.55em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  color: var(--m-plate-ink);
  opacity: 0.85;
  transition: background 0.2s, opacity 0.2s;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: inherit;
  font-family: var(--font-mono);
  margin-bottom: 1cqh;
}
.lid-back:hover { background: rgba(255, 255, 255, 0.42); opacity: 1; }
.lid-back span { font-size: 1.5em; line-height: 0.6; }

.lid-grille {
  width: 46%;
  height: 4.4cqh;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.22) 0.6px, transparent 0.8px);
  background-size: 4px 4px;
  opacity: 0.6;
  border-radius: 2px;
}

.lid-sticker, .sticker-round {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px dashed currentColor;
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 0.8;
  transform: rotate(-7deg);
}
.lid-sticker {
  width: 8.2cqw;
  height: 8.2cqw;
  font-size: clamp(6px, 0.78cqw, 10px);
  line-height: 1;
  padding: 0.4em;
  text-align: center;
}
.lid-plate {
  font-family: var(--font-mono);
  font-size: clamp(6px, 0.66cqw, 9px);
  letter-spacing: 0.24em;
  opacity: 0.6;
}

.screen-frame {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  height: 97%;
  max-height: 97%;
  aspect-ratio: 16 / 10;
  align-self: center;
  padding: 0.9cqh 0.9cqw;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--m-bezel) 0%, color-mix(in srgb, var(--m-bezel) 82%, #000) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 3px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.18);
  display: flex;
  min-height: 0;
}

.screen {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
  container-type: size;
  container-name: screen;
  background: var(--m-screen);
  color: var(--m-screen-ink);
  font-family: var(--font-pixel);
  font-size: clamp(10px, 2.35cqw, 15px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 22px rgba(0, 0, 0, 0.35);
}
.screen > * { position: relative; z-index: 1; }

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.09) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 30%, transparent 55%, rgba(0, 0, 0, 0.28) 100%);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.screen-glare {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 26%, transparent 42%);
  border-radius: 4px;
}
.screen-off {
  position: absolute;
  inset: 0;
  background: #0c0c0b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 8;
}
.screen-off.is-on { opacity: 1; }

.lid-chin { display: none; }

.lid-tag {
  grid-column: 2;
  grid-row: 2;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(5.5px, 0.62cqw, 8px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--m-plate-ink);
  opacity: 0.55;
  padding-top: 0.8cqh;
  white-space: nowrap;
}

/* ── hinge ───────────────────────────────────────────────────── */
.hinge {
  grid-row: 2;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.06) 42%, rgba(0, 0, 0, 0.2));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(255, 255, 255, 0.1);
}
.hinge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14) 18%, rgba(255, 255, 255, 0.14) 82%, transparent);
  opacity: 0.5;
}
.hinge i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.7);
}

/* ── deck ────────────────────────────────────────────────────── */
.deck {
  grid-row: 3;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 70% 1fr;
  align-items: center;
  gap: 0 2cqw;
  padding: 1.8cqh 3.2cqw 2.2cqh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--m-body) 94%, #000) 0%, var(--m-body) 26%, color-mix(in srgb, var(--m-body) 90%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.deck-side {
  display: flex;
  flex-direction: column;
  gap: 1.4cqh;
  font-family: var(--font-mono);
  font-size: clamp(5.5px, 0.62cqw, 8px);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--m-plate-ink);
  opacity: 0.8;
  line-height: 1.6;
}
.deck-side--l { align-items: flex-start; }
.deck-side--r { align-items: flex-end; }

.model-chip {
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  font-size: 1.02em;
  white-space: nowrap;
}
.sticker-round {
  width: 7cqw;
  height: 7cqw;
  font-size: clamp(5.5px, 0.72cqw, 9px);
  line-height: 1.1;
  text-align: center;
  margin-top: 0.6cqh;
}

.kb-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5cqh;
  min-width: 0;
}

/* keyboard */
.keyboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.05cqh;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.18));
}

.kb-row {
  display: flex;
  gap: 0.42cqw;
  justify-content: center;
  align-items: stretch;
}

.key {
  flex: var(--w, 1) 1 0;
  min-width: 0;
  height: clamp(20px, 4.3cqh, 42px);
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--m-key) 100%, #fff) 0%, var(--m-key) 58%, color-mix(in srgb, var(--m-key) 88%, #000) 100%);
  color: var(--m-key-ink);
  font-family: var(--font-sans);
  font-size: clamp(6px, 0.66cqw, 10px);
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1.5px 0 color-mix(in srgb, var(--m-key-2) 80%, #000),
    0 1.5px 0 color-mix(in srgb, var(--m-key-2) 60%, #000),
    0 2px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.06s linear, box-shadow 0.06s linear, filter 0.1s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  padding: 0 0.1em;
  white-space: nowrap;
}
.key--mod { font-size: 0.82em; letter-spacing: 0.04em; opacity: 0.92; }
.key--fn { font-size: 0.72em; opacity: 0.78; }
.key-ico { display: grid; place-items: center; width: 1.15em; height: 1.15em; opacity: 0.62; }
.key-ico svg { width: 100%; height: 100%; }
.key--power { color: var(--m-plate-ink); }
.key.is-lock { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--m-key-ink) 34%, transparent), inset 0 1px 0 rgba(255,255,255,.7), 0 1.5px 0 color-mix(in srgb, var(--m-key-2) 60%, #000); }
.key--glyph { font-size: 0.9em; letter-spacing: 0; }
.key--space .key-face { opacity: 0; }
.key.is-down {
  transform: translateY(1.5px);
  box-shadow:
    inset 0 1px 0 rgba(0, 0, 0, 0.15),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.2),
    0 0.5px 0 color-mix(in srgb, var(--m-key-2) 60%, #000),
    0 1px 1px rgba(0, 0, 0, 0.12);
  filter: brightness(0.96);
}

.kb-grille {
  flex: 0 0 auto;
  width: 8cqw;
  border-radius: 3px;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.3) 0.5px, transparent 0.7px);
  background-size: 3px 3px;
  opacity: 0.45;
}

/* trackpad */
.trackpad {
  width: 27%;
  min-width: 120px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  background: color-mix(in srgb, var(--m-body) 88%, #000);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.18);
}
.tp-pad {
  position: relative;
  flex: 1;
  min-height: 5.6cqh;
  border-radius: 3px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--m-key) 92%, #fff), var(--m-key));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  touch-action: none;
  overflow: hidden;
}
.tp-pad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.25), transparent 45%);
  pointer-events: none;
}
.tp-cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.tp-cursor.is-on { opacity: 0.8; }

.tp-buttons { display: flex; gap: 2px; }
.tp-btn {
  flex: 1;
  height: 2.2cqh;
  min-height: 9px;
  border-radius: 2.5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--m-key) 100%, #fff), var(--m-key));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 0 color-mix(in srgb, var(--m-key-2) 70%, #000);
}
.tp-btn:active { filter: brightness(0.94); transform: translateY(1px); }

/* simulated depth, only inside the demo rig */
[data-sim="1"] .app[data-posture="laptop"] .lid { transform-origin: 50% 100%; transform: perspective(2200px) rotateX(-1.6deg); }
[data-sim="1"] .app[data-posture="laptop"] .deck { transform-origin: 50% 0%; transform: perspective(2200px) rotateX(2.2deg); }

/* ══════════════════════════════════════════════════════════════
   THE RETRO OS  (inside .screen)
   ══════════════════════════════════════════════════════════════ */

.os {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(10px, 2.35cqw, 15px);
  line-height: 1.2;
  overflow: hidden;
}

/* boot */
.boot {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: var(--boot-bg, #000);
  color: var(--boot-ink, #e8e8e0);
  overflow: hidden;
}
.boot[data-boot="mac"] { background: #e9e5da; color: #1b1a17; font-family: var(--font-pixel); }
.boot[data-boot="win"] { background: #05070c; color: #dfe6ee; }
.boot[data-boot="aqua"] { background: #f2f6f8; color: #1c3d4c; }
.boot[data-boot="bios"] { background: #0a0a0a; color: #dcdcd2; font-family: var(--font-term); font-size: 1.5em; }
.boot[data-boot="basic"] { background: #4b52a8; color: #cfd4ff; font-family: var(--font-term); font-size: 1.55em; }

.boot-mac { display: grid; place-items: center; gap: 1.8cqh; text-align: center; }
.boot-mac svg { width: 24cqw; max-width: 120px; }
.boot-mac .boot-note {
  font-family: var(--font-pixel);
  font-size: 0.62em;
  letter-spacing: 0.1em;
  opacity: 0.55;
}

.boot-win {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  background:
    radial-gradient(30% 26% at 20% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0) 70%),
    radial-gradient(22% 18% at 28% 37%, rgba(255,255,255,0.7), rgba(255,255,255,0) 72%),
    radial-gradient(18% 14% at 14% 40%, rgba(255,255,255,0.6), rgba(255,255,255,0) 72%),
    radial-gradient(26% 22% at 76% 24%, rgba(255,255,255,0.75), rgba(255,255,255,0) 70%),
    radial-gradient(18% 15% at 86% 32%, rgba(255,255,255,0.6), rgba(255,255,255,0) 72%),
    radial-gradient(20% 16% at 64% 19%, rgba(255,255,255,0.55), rgba(255,255,255,0) 72%),
    radial-gradient(36% 24% at 46% 92%, rgba(255,255,255,0.55), rgba(255,255,255,0) 72%),
    radial-gradient(22% 18% at 62% 82%, rgba(255,255,255,0.35), rgba(255,255,255,0) 72%),
    linear-gradient(170deg, #2b6cc0 0%, #4a93d4 34%, #8ec7ea 64%, #d9eef9 100%);
  padding: 6cqh 4cqw;
  text-align: center;
}
.boot-win .bw-inner { display: grid; place-items: center; gap: 2.4cqh; }
.boot-win .bw-logo { display: flex; gap: 0.9cqw; transform: skewX(-6deg); }
.boot-win .bw-logo i { width: 7.4cqw; height: 7.4cqw; border-radius: 1px; box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
.boot-win .bw-logo i:nth-child(1) { background: #f0553a; }
.boot-win .bw-logo i:nth-child(2) { background: #f5c542; }
.boot-win .bw-logo i:nth-child(3) { background: #4caf6d; }
.boot-win .bw-logo i:nth-child(4) { background: #3a7fd5; }
.boot-win .bw-brand {
  font-family: var(--font-sans);
  color: #fff;
  font-size: 1.1em;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.boot-win .bw-name {
  font-family: var(--font-display);
  color: #14263d;
  font-size: 2.6em;
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.boot-win .bw-name b { color: #d1452e; font-weight: 400; }
.boot-win .bw-sub {
  font-family: var(--font-sans);
  font-size: 0.68em;
  color: #17334f;
  opacity: 0.75;
  letter-spacing: 0.04em;
}
.boot-win .bw-bar {
  width: 46cqw;
  max-width: 260px;
  height: 8px;
  background: rgba(10, 30, 50, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1cqh;
}
.boot-win .bw-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d8e9fb, #ffffff);
  box-shadow: 2px 0 0 rgba(0,0,0,0.15);
  transition: width 0.2s linear;
}
.boot-win .bw-corner {
  position: absolute;
  top: 4cqh;
  right: 4cqw;
  font-family: var(--font-sans);
  font-size: 0.68em;
  color: #e9f4ff;
  letter-spacing: 0.08em;
  opacity: 0.9;
}
.boot-win .bw-foot {
  align-self: end;
  font-family: var(--font-sans);
  font-size: 0.6em;
  color: #0f2a44;
  opacity: 0.7;
}

.boot-aqua { display: grid; place-items: center; gap: 2.4cqh; text-align: center; }
.boot-aqua .bq-mark { width: 12cqw; max-width: 58px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.boot-aqua .bq-name {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.15em;
  color: #1b3a48;
}
.boot-aqua .bq-bar {
  width: 26cqw;
  height: 6px;
  border-radius: 4px;
  background: rgba(28, 61, 76, 0.12);
  overflow: hidden;
}
.boot-aqua .bq-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #63d2e8, #2e9fc4);
  transition: width 0.3s var(--ease);
}

.boot-term {
  width: 100%;
  height: 100%;
  padding: 5cqh 5cqw;
  box-sizing: border-box;
  font-family: var(--font-term);
  font-size: 1em;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow: hidden;
}
.boot-term .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: currentColor;
  vertical-align: -0.16em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.boot-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 9;
  pointer-events: none;
  animation: crt-on 0.5s ease-out forwards;
}
@keyframes crt-on {
  0% { opacity: 0.9; transform: scaleY(0.004); }
  35% { opacity: 0.55; transform: scaleY(0.02); }
  100% { opacity: 0; transform: scaleY(1); }
}

/* ── desktop shells ──────────────────────────────────────────── */
.desktop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  animation: os-in 0.45s var(--ease) both;
}
@keyframes os-in { from { opacity: 0; transform: scale(0.99); } to { opacity: 1; transform: none; } }

.os-menubar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.1em;
  padding: 0.22em 0.7em;
  font-size: 0.8em;
  z-index: 4;
  user-select: none;
}

.os-desk {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.os-icons {
  position: absolute;
  top: 1.2em;
  left: 1em;
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  z-index: 1;
}
.os-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  width: 4.6em;
  background: none;
  color: inherit;
  font-size: 0.72em;
  text-align: center;
  line-height: 1.15;
  padding: 0;
  cursor: pointer;
}
.os-icon svg { width: 2.1em; height: 2.1em; display: block; }
.os-icon span {
  padding: 0 0.25em;
  border-radius: 2px;
}
.os-icon:hover span { background: rgba(255, 255, 255, 0.55); color: #111; }
.os-icon:focus-visible { outline: 1px dashed currentColor; outline-offset: 2px; }

.os-taskbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.16em 0.3em;
  font-size: 0.78em;
  z-index: 5;
}
.os-dock {
  position: absolute;
  left: 50%;
  bottom: 0.55em;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 0.5em;
  padding: 0.35em 0.55em;
  border-radius: 0.8em;
  z-index: 5;
}
.os-dock button { width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 0.35em; }
.os-dock svg { width: 1.6em; height: 1.6em; }

/* classic Mac-ish shell */
.os[data-shell="classic"] { font-family: var(--font-pixel); }
.os[data-shell="classic"] .os-menubar {
  background: #f1ede2;
  border-bottom: 1px solid #1b1a17;
  color: #1b1a17;
  font-size: 0.72em;
  padding: 0.1em 0.6em;
}
.os[data-shell="classic"] .os-menubar b { font-weight: 400; }
.os[data-shell="classic"] .os-desk {
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.09) 1px, transparent 0) 0 0 / 4px 4px,
    #e9e5da;
  image-rendering: pixelated;
}
.os[data-shell="classic"] .os-icons { color: #1b1a17; }
.os[data-shell="classic"] .os-menubar .mb-right { margin-left: auto; display: flex; gap: 1em; }
.os[data-shell="classic"] .os-icon span { background: #e9e5da; }

/* Win95-ish shell */
.os[data-shell="win"] { font-family: var(--font-sans); }
.os[data-shell="win"] .os-desk { background: #2f7d74; }
.os[data-shell="win"] .os-icons { color: #fff; }
.os[data-shell="win"] .os-icon span { text-shadow: 0 1px 1px rgba(0,0,0,0.6); background: transparent; }
.os[data-shell="win"] .os-icon:hover span { background: #1a3f8f; color: #fff; text-shadow: none; }
.os[data-shell="win"] .os-taskbar {
  background: #c3c3bd;
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #deded8;
  color: #111;
  font-size: 0.74em;
}
.os[data-shell="win"] .os-taskbar .start {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.12em 0.55em;
  font-weight: 700;
  background: #c3c3bd;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6b6b66;
}
.os[data-shell="win"] .os-taskbar .start svg { width: 1.1em; height: 1.1em; }
.os[data-shell="win"] .os-taskbar .tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.05em 0.5em;
  box-shadow: inset 1px 1px 0 #6b6b66, inset -1px -1px 0 #fff;
  font-size: 0.95em;
}
.os[data-shell="win"] .os-taskbar .tray svg { width: 1em; height: 1em; }

/* aqua-ish shell */
.os[data-shell="aqua"] { font-family: var(--font-sans); }
.os[data-shell="aqua"] .os-menubar {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(228,240,245,0.72));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(30, 70, 90, 0.2);
  color: #14313e;
  font-size: 0.74em;
  font-weight: 600;
}
.os[data-shell="aqua"] .os-menubar .mb-right { margin-left: auto; display: flex; gap: 0.9em; font-weight: 400; }
.os[data-shell="aqua"] .os-desk {
  background:
    radial-gradient(90% 70% at 20% 0%, #bfeaf7 0%, transparent 60%),
    radial-gradient(80% 60% at 90% 20%, #a8dff0 0%, transparent 55%),
    linear-gradient(170deg, #e8f7fc 0%, #c9ecf6 45%, #9fd4e8 100%);
}
.os[data-shell="aqua"] .os-icons { color: #123947; }
.os[data-shell="aqua"] .os-icon span { background: transparent; }
.os[data-shell="aqua"] .os-dock {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 10px rgba(10, 50, 70, 0.18), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}
.os[data-shell="aqua"] .os-dock button { background: rgba(255,255,255,0.75); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }

/* basic / terminal shell */
.os[data-shell="basic"] { font-family: var(--font-term); }
.os[data-shell="basic"] .os-desk { background: #4b52a8; color: #dfe2ff; }
.os[data-shell="basic"] .os-icons, .os[data-shell="basic"] .os-menubar, .os[data-shell="basic"] .os-taskbar { display: none; }

/* ── windows ─────────────────────────────────────────────────── */
.os-win {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 12em;
  box-shadow: 0 0.5em 1.4em rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.os-win.is-dragging { box-shadow: 0 1em 2em rgba(0, 0, 0, 0.35); }

.os-winbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.22em 0.45em;
  font-size: 0.74em;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.os-winbar .wb-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-winbar .wb-ctl { margin-left: auto; display: flex; gap: 0.3em; }
.os-winbar .wb-ctl button {
  width: 1.15em; height: 1em;
  display: grid; place-items: center;
  font-size: 0.85em;
  line-height: 1;
}
.os-wbody { flex: 1; min-height: 0; overflow: auto; position: relative; }

.os[data-shell="classic"] .os-win {
  background: #f2eee3;
  border: 1px solid #1b1a17;
  box-shadow: 2px 2px 0 rgba(27, 26, 23, 0.35);
}
.os[data-shell="classic"] .os-winbar {
  background: repeating-linear-gradient(180deg, #dcd7c9 0 2px, #efebdf 2px 4px);
  border-bottom: 1px solid #1b1a17;
  font-family: var(--font-pixel);
  font-size: 0.68em;
  color: #1b1a17;
  justify-content: center;
}
.os[data-shell="classic"] .os-winbar .wb-title { flex: 1; text-align: center; }
.os[data-shell="classic"] .os-winbar .wb-ctl button {
  background: #e6e1d4; border: 1px solid #1b1a17; border-radius: 1px;
}
.os[data-shell="classic"] .os-wbody { background: #fff; }

.os[data-shell="win"] .os-win {
  background: #c3c3bd;
  padding: 2px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6b6b66, 2px 2px 0 rgba(0,0,0,0.35);
}
.os[data-shell="win"] .os-winbar {
  background: linear-gradient(90deg, #0a246a, #4f7bd4);
  color: #fff;
  font-size: 0.72em;
  font-family: var(--font-sans);
}
.os[data-shell="win"] .os-winbar .wb-ctl button {
  background: #c3c3bd;
  color: #111;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6b6b66;
  border-radius: 1px;
}
.os[data-shell="win"] .os-wbody { background: #fff; box-shadow: inset 1px 1px 0 #6b6b66, inset -1px -1px 0 #fff; }

.os[data-shell="aqua"] .os-win {
  background: rgba(252, 254, 255, 0.96);
  border-radius: 0.45em;
  border: 1px solid rgba(20, 60, 80, 0.28);
  box-shadow: 0 0.8em 2em rgba(10, 45, 65, 0.3), inset 0 1px 0 rgba(255,255,255,0.9);
}
.os[data-shell="aqua"] .os-winbar {
  background: linear-gradient(180deg, rgba(240,246,250,0.98), rgba(211,226,236,0.98));
  border-bottom: 1px solid rgba(20, 60, 80, 0.2);
  font-size: 0.7em;
  color: #17394a;
  padding-left: 0.6em;
  position: relative;
}
.os[data-shell="aqua"] .os-winbar .wb-ctl--left {
  display: flex;
  gap: 0.34em;
  margin-left: 0;
  margin-right: 0.55em;
  order: -1;
  align-items: center;
}
.os[data-shell="aqua"] .os-winbar .wb-ctl--left button {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  font-size: 0;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.os[data-shell="aqua"] .os-winbar .wb-ctl--left button:nth-child(2) { background: #febc2e; }
.os[data-shell="aqua"] .os-winbar .wb-ctl--left button:nth-child(3) { background: #28c840; }
.os[data-shell="aqua"] .os-winbar .wb-ctl--left button:active { filter: brightness(0.85); }
.os[data-shell="aqua"] .os-winbar .wb-title { text-align: center; flex: 1; font-weight: 600; }
.os[data-shell="aqua"] .os-wbody { background: #fff; }

/* terminal body */
.os-term {
  position: absolute;
  inset: 0;
  padding: 2.4cqw 3cqw;
  font-family: var(--font-term);
  font-size: 1.5em;
  line-height: 1.22;
  background: #4b52a8;
  color: #dfe2ff;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}
.os-term .t-cursor { display: inline-block; width: 0.55em; height: 1em; background: currentColor; vertical-align: -0.16em; animation: blink 1.05s steps(1) infinite; }
.os-term .t-out, .os-term .t-line { white-space: pre-wrap; min-height: 0.2em; }

/* tiny software cursor driven by the trackpad */
.os-cursor {
  position: absolute;
  z-index: 40;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}
.os-cursor.is-on { opacity: 1; }
.os-cursor::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0.62em;
  height: 0.95em;
  background: #1b1a17;
  clip-path: polygon(0 0, 0 76%, 22% 62%, 36% 100%, 52% 94%, 38% 58%, 64% 58%);
}
.os-cursor::after {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.12em;
  width: 0.34em;
  height: 0.5em;
  background: #fff;
  clip-path: polygon(0 0, 0 76%, 22% 62%, 36% 100%, 52% 94%, 38% 58%, 64% 58%);
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════
   TinyNet — the fake retro web
   ══════════════════════════════════════════════════════════════ */

.tn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fffdf7;
  color: #1b1a17;
  font-family: var(--font-sans);
  font-size: 0.86em;
  overflow: hidden;
}
.tn-chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.5em;
  font-size: 0.72em;
  border-bottom: 1px solid #cfc7bb;
  background: #efebe0;
}
.os[data-shell="win"] .tn-chrome { background: #d6d3ca; }
.os[data-shell="aqua"] .tn-chrome { background: #eef4f7; }
.os[data-shell="classic"] .tn-chrome { font-family: var(--font-pixel); font-size: 0.62em; }
.tn-chrome button {
  width: 1.6em; height: 1.5em;
  display: grid; place-items: center;
  border: 1px solid #a9a294;
  border-radius: 2px;
  background: #fbf8f0;
  font-size: 0.95em;
  line-height: 1;
  color: #3c382f;
}
.tn-chrome button:disabled { opacity: 0.35; }
.tn-url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.16em 0.45em;
  border: 1px solid #a9a294;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: #4a453b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tn-url b { color: #2f6b4f; }
.tn-page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fffdf7;
  padding: 0.9em 1.1em 1.4em;
  line-height: 1.45;
  scrollbar-width: thin;
}
.tn-page a { color: #1c4fb8; text-decoration: underline; cursor: pointer; }
.tn-page a:visited { color: #6a3f9a; }
.tn-page h1 {
  font-family: var(--font-display);
  font-size: 1.5em;
  line-height: 1.05;
  margin: 0.1em 0 0.35em;
  font-weight: 400;
}
.tn-page h2 {
  font-family: var(--font-sans);
  font-size: 0.85em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8377;
  margin: 1.3em 0 0.5em;
  border-bottom: 1px solid #ded6c8;
  padding-bottom: 0.25em;
}
.tn-page p { margin: 0.5em 0; max-width: 46em; }
.tn-page .lead { font-family: var(--font-display); font-style: italic; font-size: 1.05em; color: #4a4438; }
.tn-page ul { margin: 0.4em 0 0.8em; padding-left: 1.1em; }
.tn-page li { margin: 0.3em 0; }
.tn-page hr { border: 0; border-top: 1px solid #ded6c8; margin: 1em 0; }
.tn-kicker { font-family: var(--font-mono); font-size: 0.68em; letter-spacing: 0.16em; text-transform: uppercase; color: #9a9285; }
.tn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.66em;
  padding: 0.18em 0.45em;
  border: 1px solid #bfb6a6;
  background: #f7f1e4;
  color: #5a5346;
  letter-spacing: 0.06em;
}
.tn-split { display: grid; grid-template-columns: 1fr 9em; gap: 1.2em; align-items: start; }
.tn-side { border-left: 1px solid #ded6c8; padding-left: 0.9em; font-size: 0.82em; color: #5b554a; }
.tn-side h2 { margin-top: 0; font-size: 0.78em; }
.tn-img {
  border: 1px solid #c9c0b0;
  background: repeating-linear-gradient(45deg, #f3ede0 0 6px, #eee7d8 6px 12px);
  display: grid;
  place-items: center;
  padding: 1.1em 0.5em;
  font-family: var(--font-mono);
  font-size: 0.66em;
  color: #a0988a;
  text-align: center;
  margin: 0.7em 0;
}
.tn-weather-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.4em 0;
  border-bottom: 1px dotted #ded6c8;
  font-size: 0.85em;
}
.tn-weather-row b { font-family: var(--font-mono); font-weight: 400; width: 3.2em; color: #7a7365; }
.tn-weather-row .wx { font-family: var(--font-mono); color: #2f6b4f; }
.tn-weather-row em { margin-left: auto; font-family: var(--font-mono); font-style: normal; color: #4a453b; }
.tn-guest { list-style: none; padding: 0; margin: 0.4em 0; font-family: var(--font-mono); font-size: 0.76em; }
.tn-guest li { border-bottom: 1px dotted #ded6c8; padding: 0.5em 0; color: #4a453b; }
.tn-guest li b { color: #1c4fb8; font-weight: 500; }
.tn-form { display: flex; gap: 0.4em; margin-top: 0.8em; }
.tn-form--col { flex-direction: column; align-items: stretch; }
.tn-form--col button { align-self: flex-start; }
.tn-form input {
  flex: 1; min-width: 0;
  border: 1px solid #a9a294;
  background: #fff;
  padding: 0.4em 0.5em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: #1b1a17;
  outline: none;
}
.tn-form input:focus { border-color: #2f6b4f; box-shadow: 0 0 0 2px rgba(47, 107, 79, 0.15); }
.tn-form button {
  border: 1px solid #7f8f7f;
  background: linear-gradient(#f6f2e6, #e2dccb);
  padding: 0.4em 0.8em;
  font-size: 0.78em;
  color: #33301f;
  border-radius: 2px;
}
.tn-form button:active { transform: translateY(1px); }
.tn-counter {
  display: inline-flex;
  gap: 0.12em;
  margin-top: 0.3em;
}
.tn-counter i {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.9em;
  background: #1b1a17;
  color: #c8f5b8;
  padding: 0.08em 0.22em;
}
.tn-cols { columns: 2; column-gap: 1.4em; font-size: 0.85em; }
@media (max-width: 520px) { .tn-cols { columns: 1; } }
.tn-404 { text-align: center; padding: 1.5em 1em; }
.tn-404 h1 { font-size: 2.4em; }
.tn-marquee { overflow: hidden; white-space: nowrap; font-family: var(--font-mono); font-size: 0.7em; color: #8a8377; border-top: 1px solid #ded6c8; padding-top: 0.35em; margin-top: 1em; }
.tn-marquee span { display: inline-block; animation: marquee 22s linear infinite; padding-left: 100%; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* classic 1-bit tint for the browser in the oldest machine */
.os[data-shell="classic"] .tn { filter: grayscale(1) contrast(1.06); }
.os[data-shell="classic"] .tn-page { background: #f4f1e7; }

/* about / readme windows */
.rd {
  padding: 1em 1.15em 1.4em;
  font-family: var(--font-mono);
  font-size: 0.78em;
  line-height: 1.6;
  color: #2b2820;
  background: #fffdf7;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
}
.rd h2 { font-family: var(--font-display); font-size: 1.7em; font-weight: 400; margin: 0.4em 0 0.5em; color: #1b1a17; }
.rd p { margin: 0.5em 0; }
.rd .rd-meta { font-size: 0.86em; color: #8a8377; }
.rd .rd-note { border-left: 2px solid #c9a24b; padding-left: 0.7em; color: #6b6458; }
.rd .rd-write { margin-top: 0.9em; }
.rd textarea {
  width: 100%;
  min-height: 5.5em;
  border: 1px solid #c0b8a8;
  background: #fffdf7;
  padding: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: #1b1a17;
  resize: none;
  outline: none;
  box-sizing: border-box;
}
.rd textarea:focus { border-color: #2f6b4f; }

/* ══════════════════════════════════════════════════════════════
   per-machine personality hooks set from JS
   ══════════════════════════════════════════════════════════════ */

.app { --m-body: #d6c9b3; --m-bezel: #b8a78c; --m-key: #cbbba1; --m-key-2: #9d8d75; --m-key-ink: #3b3327; --m-plate-ink: #665b49; --m-screen: #e9e4d6; --m-screen-ink: #2b2a26; }

/* CRT-ish phosphor variants */
.app[data-machine="tiny64"] .screen { filter: saturate(1.05) contrast(1.04); }
.app[data-machine="jelly"] .screen { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), inset 0 0 18px rgba(255,255,255,0.35); }


/* ═══════════════════════════════════════════════════════════════
   Portrait laptop — a pocket computer for narrow screens
   ═══════════════════════════════════════════════════════════════ */
@container app (max-aspect-ratio: 0.98) {
  .view--computer { grid-template-rows: 39% 8px minmax(0, 1fr); }
  .lid-bezel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 2.2cqh 5cqw 1.2cqh; }
  .lid-side { display: none; }
  .lid-side--l {
    display: flex;
    position: absolute;
    top: 1.4cqh;
    left: 3cqw;
    z-index: 3;
    align-self: auto;
    justify-content: flex-start;
  }
  .lid-back { margin-bottom: 0; }
  .screen-frame { grid-column: 1; grid-row: 1; width: 96%; height: auto; aspect-ratio: 16 / 10; justify-self: center; align-self: center; }
  .lid-tag { grid-column: 1; grid-row: 2; font-size: clamp(5.5px, 1.5cqw, 8px); padding-top: 0.5cqh; }
  .deck { grid-template-columns: minmax(0, 1fr); padding: 1.6cqh 5cqw 2.2cqh; }
  .deck-side { display: none; }
  .kb-wrap { width: 100%; gap: 1.2cqh; }
  .key { height: clamp(20px, 4.1cqh, 44px); font-size: clamp(7px, 2.1cqw, 11px); }
  .kb-row { gap: 0.7cqw; }
  .keyboard { gap: 0.8cqh; }
  .trackpad { width: 42%; min-width: 130px; }
  .tp-pad { min-height: 4.4cqh; }
  .os { font-size: clamp(9px, 2.6cqw, 13px); }
  .tn-page { padding: 0.8em 0.9em 1.2em; }
}

/* ═══════════════════════════════════════════════════════════════
   1968 typewriter · 1977 terminal · 1981 pocket calculator
   ═══════════════════════════════════════════════════════════════ */

/* ── boot screens ─────────────────────────────────────────────── */
.boot[data-boot="writer"] { background: #e9e3d2; color: #2a2620; }
.boot-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  padding: 1.5em 2.4em;
  background: #f8f4e6;
  border: 1px solid #ded7c3;
  box-shadow: 0 0.4em 1.2em rgba(60, 45, 25, 0.18);
  animation: sheet-in 0.7s var(--ease) both;
}
.boot-sheet span {
  font-family: var(--font-pixel);
  font-size: 0.95em;
  letter-spacing: 0.22em;
}
.boot-sheet i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.55em;
  letter-spacing: 0.16em;
  opacity: 0.5;
}
@keyframes sheet-in {
  from { transform: translateY(40%) rotate(-1deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.boot[data-boot="terminal"] { background: #07110a; color: #8dffa8; }
.boot[data-boot="terminal"] .boot-term { text-shadow: 0 0 8px rgba(141, 255, 168, 0.5); animation: phosphor-on 0.6s ease-out both; }
@keyframes phosphor-on {
  0% { opacity: 0; filter: brightness(2.4); }
  40% { opacity: 0.6; }
  60% { opacity: 0.25; }
  100% { opacity: 1; filter: none; }
}

.boot[data-boot="pocket"] { background: #a8b78e; color: #20281a; font-family: var(--font-pixel); }
.boot-pocket { display: flex; flex-direction: column; align-items: center; gap: 0.9em; }
.boot-pocket span { font-size: 1em; letter-spacing: 0.14em; }
.boot-pocket i { font-style: normal; font-size: 0.6em; opacity: 0.55; letter-spacing: 0.24em; }

/* ── typewriter paper inside the lid ─────────────────────────── */
.app[data-machine="tinywriter"] .screen {
  background: #f4f0e2;
  box-shadow: inset 0 0 0 1px rgba(70, 60, 40, 0.35), inset 0 0 20px rgba(80, 60, 30, 0.1);
}
.app[data-machine="tinywriter"] .screen::after {
  background: radial-gradient(120% 100% at 50% 25%, transparent 55%, rgba(70, 55, 30, 0.16) 100%);
  mix-blend-mode: multiply;
  opacity: 0.7;
}
.app[data-machine="tinywriter"] .screen-frame {
  background: linear-gradient(180deg, #8d9882, #6f7a67);
  padding: 1.1cqh 0.6cqw;
  border-radius: 5px;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.3);
}
.app[data-machine="tinywriter"] .key { border-radius: 999px; }
.app[data-machine="tinywriter"] .trackpad { display: none; }
.app[data-machine="tinywriter"] .kb-wrap { gap: 0; }

.os[data-shell="writer"] { background: #efe9d8; font-family: var(--font-pixel); }
.os[data-shell="writer"] .os-desk { background: #efe9d8; }
.tw {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #e7e1cf, #f7f3e6);
  overflow: hidden;
}
.tw-roll {
  flex: 0 0 auto;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.7em;
  background: linear-gradient(180deg, #8d9882, #6f7a67);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);
}
.tw-roll i { width: 0.32em; height: 0.32em; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.tw-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.1em 1.6em 1.4em 2.8em;
  scrollbar-width: none;
}
.tw-scroll::-webkit-scrollbar { display: none; }
.tw-paper {
  position: relative;
  min-height: 100%;
  background: repeating-linear-gradient(180deg, transparent 0 1.55em, rgba(90, 70, 40, 0.05) 1.55em 1.58em);
}
.tw-paper::before {
  content: "";
  position: absolute;
  left: 1.1em;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(180, 80, 60, 0.35);
}
.tw-head {
  font-family: var(--font-pixel);
  font-size: 0.52em;
  letter-spacing: 0.2em;
  color: rgba(60, 54, 40, 0.4);
  padding-bottom: 1.1em;
}
.tw-lines {
  font-family: "Courier New", var(--font-mono);
  font-size: 1.32em;
  line-height: 1.55em;
  color: #2a2620;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.01em;
  text-shadow: 0 0.02em 0 rgba(90, 75, 45, 0.18);
}
.tw-caret {
  display: inline-block;
  width: 0.48em;
  height: 1.05em;
  background: #2a2620;
  vertical-align: -0.18em;
  margin-left: 0.04em;
  animation: blink 1s steps(1) infinite;
}
.tw.is-return .tw-lines { animation: carriage-return 0.36s var(--ease); }
@keyframes carriage-return {
  0% { transform: translateX(-0.7em); }
  55% { transform: translateX(0.16em); }
  100% { transform: none; }
}
.tw-note {
  flex: 0 0 auto;
  font-family: var(--font-pixel);
  font-size: 0.38em;
  letter-spacing: 0.16em;
  color: rgba(60, 54, 40, 0.35);
  text-align: center;
  padding: 0.5em 0 0.8em;
}

/* ── green terminal ──────────────────────────────────────────── */
.os[data-shell="terminal"] { background: #07110a; font-family: var(--font-term); }
.os[data-shell="terminal"] .os-desk { background: #07110a; }
.os[data-shell="terminal"] .os-term {
  background: #07110a;
  color: #8dffa8;
  text-shadow: 0 0 5px rgba(141, 255, 168, 0.4);
  font-size: 1.55em;
  padding: 3cqw 3.4cqw;
}
.os[data-shell="terminal"] .os-term .t-cursor {
  background: #8dffa8;
  box-shadow: 0 0 10px rgba(141, 255, 168, 0.9);
}
.os[data-shell="terminal"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}
.app[data-machine="tinyterm"] .screen { box-shadow: inset 0 0 0 1px #000, inset 0 0 26px rgba(0, 0, 0, 0.65); }
.app[data-machine="tinyterm"] .screen::after { opacity: 0.7; }

/* ── pocket LCD ──────────────────────────────────────────────── */
.app[data-machine="tinypocket"] .screen { background: #d7d3c4; }
.app[data-machine="tinypocket"] .screen::after {
  background: radial-gradient(120% 100% at 50% 30%, transparent 60%, rgba(60, 60, 40, 0.16) 100%);
  mix-blend-mode: multiply;
  opacity: 0.5;
}
.app[data-machine="tinypocket"] .screen-frame {
  background: linear-gradient(180deg, #33332f, #1b1b18);
  padding: 1.9cqh 1cqw;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.22);
}
.os[data-shell="pocket"] { background: #d7d3c4; font-family: var(--font-pixel); }
.os[data-shell="pocket"] .os-desk { background: #d7d3c4; }
.pocket-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1em;
  background:
    linear-gradient(180deg, #e3dfd1 0%, #d7d3c4 45%, #cbc6b5 100%);
}
.pocket-label {
  font-family: var(--font-pixel);
  font-size: 0.55em;
  letter-spacing: 0.18em;
  color: #5f5a4e;
  opacity: 0.85;
}
.pocket-label--dim { opacity: 0.45; font-size: 0.46em; }
.pocket-screen {
  position: relative;
  width: 84%;
  height: 52%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75em 1.05em;
  border-radius: 5px;
  background: #a8b78e;
  box-shadow:
    inset 0 0 0 3px #2b2b28,
    inset 0 0 26px rgba(30, 40, 20, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.5);
}
.pocket-screen::after {
  content: "";
  position: absolute;
  inset: 3px;
  pointer-events: none;
  border-radius: 4px;
  background: repeating-linear-gradient(0deg, rgba(30, 40, 20, 0.07) 0 1px, transparent 1px 3px);
}
.pl-meta, .pl-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.5em;
  letter-spacing: 0.12em;
  color: #20281a;
  opacity: 0.62;
  position: relative;
  z-index: 1;
}
.pl-line {
  display: flex;
  align-items: baseline;
  font-size: 2.9em;
  line-height: 1;
  color: #20281a;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
}
.pl-caret {
  display: inline-block;
  width: 0.4em;
  height: 0.8em;
  background: #20281a;
  opacity: 0.6;
  margin-left: 0.1em;
  animation: blink 1s steps(1) infinite;
}

/* ═══════════════════════════════════════════════════════════════
   Wide displays — a wide desk computer instead of a tiny laptop
   ═══════════════════════════════════════════════════════════════ */
@container app (min-aspect-ratio: 1.3) {
  .lid-bezel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 54%) minmax(0, 1fr);
    padding: 2.2cqh 3.4cqw 1.5cqh;
  }
  .screen-frame { width: 100%; height: 91%; aspect-ratio: auto; }
  .lid-side { font-size: clamp(8px, 0.7cqw, 12px); gap: 1.4cqh; }
  .lid-back { font-size: clamp(8px, 0.72cqw, 11px); padding: 0.55em 0.9em; }
  .lid-sticker { width: 6cqw; height: 6cqw; font-size: clamp(8px, 0.8cqw, 13px); }
  .lid-plate { font-size: clamp(8px, 0.65cqw, 11px); }
  .lid-tag { font-size: clamp(6px, 0.55cqw, 9px); }

  .deck { grid-template-columns: 1fr 72% 1fr; padding: 1.5cqh 3.4cqw 2cqh; }
  .key { height: clamp(24px, 5cqh, 56px); font-size: clamp(8px, 0.62cqw, 12px); }
  .trackpad { width: 20%; min-width: 140px; }
  .deck-side { font-size: clamp(7px, 0.55cqw, 10px); }
  .sticker-round { width: 4.6cqw; height: 4.6cqw; font-size: clamp(7px, 0.6cqw, 11px); }
}

/* keep retro pages readable on a wide screen */
@container screen (min-aspect-ratio: 1.75) {
  .tn-page {
    padding-left: max(1.1em, calc((100% - 640px) / 2));
    padding-right: max(1.1em, calc((100% - 640px) / 2));
  }
  .tn-page > * { max-width: 640px; }
}

/* ═══════════════════════════════════════════════════════════════
   Full-screen laptop: screen fills the lid, chin carries the brand
   ═══════════════════════════════════════════════════════════════ */
@container app (min-aspect-ratio: 1.3) {
  .lid-bezel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 2.4cqh 2.6cqw 1.1cqh;
    gap: 0;
  }
  .screen-frame {
    grid-column: 1;
    grid-row: 1;
    width: 72%;
    height: 100%;
    aspect-ratio: auto;
    justify-self: center;
    align-self: stretch;
  }
  .lid-tag { display: none; }
  .lid-chin {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 72%;
    justify-self: center;
    padding-top: 1.1cqh;
    color: var(--m-plate-ink);
  }
  .chin-plate {
    font-family: var(--font-mono);
    font-size: clamp(7px, 0.62cqw, 11px);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
  }
  .chin-tag {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(12px, 1.15cqw, 24px);
    opacity: 0.85;
    letter-spacing: 0.01em;
  }
  .lid-side {
    position: absolute;
    top: 2.2cqh;
    z-index: 3;
    align-self: auto;
    justify-content: flex-start;
    gap: 0.8cqh;
  }
  .lid-side--l { left: 2.4cqw; }
  .lid-side--r { right: 2.4cqw; flex-direction: row; align-items: center; gap: 1cqw; }
  .lid-side--r .lid-plate { display: none; }
  .lid-back { margin-bottom: 0; }
  .lid-sticker { width: 4.4cqw; height: 4.4cqw; font-size: clamp(7px, 0.72cqw, 12px); }

  .screen { font-size: clamp(12px, 1.55cqw, 22px); }
  .os { font-size: clamp(12px, 1.6cqw, 23px); }
}

/* icons step back while a window is open */
.os-desk:has(.os-win) .os-icons {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.os-icons { transition: opacity 0.25s var(--ease); }
