/* Dimitris Pournatzis · the cyberdeck
   Deck mode (html.deck-on): the CV runs on an Arch Linux (Hyprland) desktop inside a rugged case.
   Plain mode (no .deck-on: no JavaScript, "Plain view", print): every deck wrapper collapses with
   display: contents, so the same sections read as the normal page in site.css. */

/* ── Plain mode: wrappers vanish, deck chrome hides ───────────────── */
.scene, .deck, .deck__lid, .screen, .os, .wm, .win--app { display: contents; }
.intro, .case, .deck__hinge, .deck__base, .wall, .bar, .win--term, .launcher, .boot, .hero__deckhint { display: none; }

@media screen {

.deck-on {
  --room: #08090b;
  --arch: #1793d1;
  --arch-hi: #5fb4e3;
  --shell: #1f2328;
  --shell-edge: #30353c;
  --win-line: rgba(89, 89, 89, .67);
  --hypr: linear-gradient(45deg, rgba(51, 204, 255, .93), rgba(0, 255, 153, .93));
  color-scheme: dark;
}
.deck-on body { overflow: hidden; background: var(--room); }
.deck-on .nav, .deck-on .menu { display: none !important; }
.deck-on .skip { z-index: 200; }

/* ── The room ──────────────────────────────────────────────────────── */
.deck-on .scene {
  display: block; position: fixed; inset: 0; overflow: hidden;
  background: var(--room);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
.deck-on .scene::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: #101216; border-top: 1px solid #191c21; pointer-events: none;
}
.deck-on .scene::after {
  content: ""; position: absolute; left: 50%; top: 42%; width: 80vmax; height: 60vmax; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(23, 147, 209, .09), transparent 70%); pointer-events: none;
}
.deck-on .scene[data-state="open"]::after, .deck-on .scene[data-state="booting"]::after { opacity: 0; }

/* ── Intro (closed state) ──────────────────────────────────────────── */
.deck-on .intro {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: absolute; z-index: 6; left: 16px; right: 16px; bottom: max(28px, 5.5vh);
  text-align: center; color: #eef0f3;
}
.intro__name { font-size: clamp(30px, 2.4vw + 12px, 46px); letter-spacing: -0.035em; line-height: 1.05; }
.intro__line { font-size: clamp(15px, .4vw + 13px, 18px); color: #a9abb0; max-width: 34em; }
.intro__actions { display: flex; gap: 12px; margin-top: 8px; }
.intro__hint { font: 400 12px/1.4 var(--mono); color: #6c7380; }
.intro__plain { background: none; border: 0; padding: 12px 4px; margin: -12px 0; font: inherit; color: #a9abb0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.intro__plain:hover { color: #eef0f3; }
.btn--arch { --b-bg: var(--arch); --b-bg-h: #2ba3de; --b-fg: #0b0c0e; }
.btn--ghost-inv { --b-bg: transparent; --b-bg-h: rgba(255, 255, 255, .06); --b-fg: #eef0f3; --b-bd: #3a3f46; --b-bd-h: #8e8f92; }

/* ── The deck (open layout; closed = this, scaled by deck.js) ─────── */
.deck-on .deck {
  display: flex; flex-direction: column;
  position: absolute; z-index: 4; inset: 12px;
  transform-origin: 50% 50%;
}
.deck-on .scene:not(.is-fit) .deck { opacity: 0; }
.deck-on .deck__lid {
  display: block; flex: 1; min-height: 0; box-sizing: border-box; padding: 12px;
  border-radius: 20px 20px 10px 10px;
  background: var(--shell); border: 1px solid var(--shell-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 40px 90px rgba(0, 0, 0, .5);
}
.deck-on .screen { display: block; position: relative; height: 100%; border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px #0d0f12; }
.deck-on .os { display: block; position: absolute; inset: 0; }
.deck-on .scene[data-state="closed"] .os,
.deck-on .scene[data-state="opening"] .os { visibility: hidden; }
.deck-on .deck__hinge { display: flex; justify-content: space-between; flex: none; height: 10px; margin: 0 40px; padding: 0 12%; background: #121418; }
.deck-on .deck__hinge span { width: 110px; max-width: 30%; height: 10px; border-radius: 3px; background: #2a2f36; }
.deck-on .deck__base {
  display: flex; align-items: center; gap: 18px; flex: none;
  height: 118px; box-sizing: border-box; padding: 14px 18px;
  border-radius: 10px 10px 24px 24px; background: #22262b; border: 1px solid var(--shell-edge);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}

/* keys */
.keys { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.key {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  height: 84px; padding: 10px 14px; box-sizing: border-box;
  border-radius: 10px; border: 1px solid #3a4048; background: #2c3138; color: #e3e6eb;
  box-shadow: 0 5px 0 #0b0c0e;
  font: 500 15px/1.1 var(--font); text-align: left; cursor: pointer;
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease), background-color 150ms var(--ease);
}
.key__n { font: 500 11px var(--mono); opacity: .75; }
.key[aria-pressed="true"] {
  background: var(--arch); color: #0b0c0e; border-color: #4fb0e4;
  box-shadow: 0 1px 0 #0b4f73, 0 0 26px rgba(23, 147, 209, .4); transform: translateY(4px);
}
@media (hover: hover) and (pointer: fine) {
  .key:hover { background: #353b43; }
  .key[aria-pressed="true"]:hover { background: #2aa0dc; }
}
.key:active { transform: translateY(5px); box-shadow: 0 0 0 #0b0c0e; transition-duration: 60ms; }
.key:focus-visible { outline: 2px solid var(--arch-hi); outline-offset: 3px; }


/* ── The case exterior (closed) ───────────────────────────────────── */
.deck-on .case { display: block; position: absolute; inset: 0; z-index: 8; container-type: size; cursor: pointer; }
.case__shell {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: clamp(26px, 4.5cqmin, 60px);
  background-color: #1f2328;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 6px);
  border: 1px solid #30353c;
  box-shadow: 0 60px 120px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 255, 255, .06), inset 0 -3px 0 rgba(0, 0, 0, .4);
}
.case__rim { position: absolute; inset: 2.6cqmin; border-radius: clamp(18px, 3cqmin, 44px); border: 1px solid #2c3137; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.case__bump { position: absolute; width: 8cqmin; height: 8cqmin; background: #16191d; }
.case__bump--tl { left: 0; top: 0; border-bottom-right-radius: 3cqmin; }
.case__bump--tr { right: 0; top: 0; border-bottom-left-radius: 3cqmin; }
.case__bump--bl { left: 0; bottom: 0; border-top-right-radius: 3cqmin; }
.case__bump--br { right: 0; bottom: 0; border-top-left-radius: 3cqmin; }
.case__handle {
  position: absolute; left: 50%; top: -6.5cqmin; width: 22cqw; min-width: 80px; height: 8cqmin; transform: translateX(-50%);
  box-sizing: border-box; border: 2cqmin solid #2a2f36; border-bottom: 0; border-radius: 5cqmin 5cqmin 0 0;
}
.case__latch {
  position: absolute; bottom: -4.6cqmin; width: 11cqw; min-width: 40px; height: 5.4cqmin;
  border-radius: 1cqmin 1cqmin 1.6cqmin 1.6cqmin; background: #2c3138; border: 1px solid #3c424a; box-shadow: 0 1cqmin 0 #0d0f12;
}
.case__latch--l { left: 21%; }
.case__latch--r { right: 21%; }
.case__plate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8cqmin;
  width: max(26cqw, 20cqmin); height: 12cqmin; border-radius: 1cqmin; background: #2b3036; border: 1px solid #3a4048;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.case__plate b { font: 500 2.8cqmin var(--mono); letter-spacing: .14em; color: #c9ccd2; }
.case__plate i { font: 400 1.9cqmin var(--mono); font-style: normal; color: #8e8f92; white-space: nowrap; }
.sticker { position: absolute; box-shadow: 0 .4cqmin 0 rgba(0, 0, 0, .35); }
.sticker--arch { left: 11cqw; top: 13cqh; width: 18cqmin; height: 18cqmin; border-radius: 50%; background: #f4f5f7; transform: rotate(-8deg); display: grid; place-items: center; }
.sticker--arch img { width: 58%; height: 58%; }
.sticker--home { right: 9cqw; top: 17cqh; width: max(26cqw, 30cqmin); box-sizing: border-box; padding: 2cqmin 2.4cqmin; background: #f2d34a; color: #111; transform: rotate(3deg); font: 500 2.6cqmin/1.3 var(--mono); }
.sticker--ok { right: 13cqw; bottom: 16cqh; padding: 1.2cqmin 1.8cqmin; background: #0b0c0e; border: 1px solid #3a4048; color: #3ddc97; transform: rotate(-2deg); font: 400 2.2cqmin var(--mono); white-space: nowrap; }
.case__note { position: absolute; left: 12cqw; bottom: 16cqh; max-width: 40cqw; font: 400 1.9cqmin/1.4 var(--mono); color: #5f6672; }
@media (hover: hover) and (pointer: fine) {
  .deck-on .scene[data-state="closed"] .case:hover .case__latch { transform: translateY(.8cqmin); }
  .case__latch { transition: transform 200ms var(--ease); }
}

/* ── Wallpaper ─────────────────────────────────────────────────────── */
.deck-on .wall { display: block; position: absolute; inset: 0; background: #0b0d12; }
.wall__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; }
.wall__gl { position: absolute; inset: 0; }
.wall__gl .vanta-canvas { opacity: 0; transition: opacity 900ms var(--ease); }
.wall-live .wall__gl .vanta-canvas { opacity: 1; }
.wall-live .wall__img { opacity: 0; transition: opacity 900ms var(--ease); }

/* ── Waybar ────────────────────────────────────────────────────────── */
.deck-on .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: absolute; z-index: 3; left: 10px; right: 10px; top: 8px; height: 38px;
  padding: 0 6px; box-sizing: border-box;
  border-radius: 8px; background: rgba(13, 15, 19, .9); border: 1px solid rgba(255, 255, 255, .06);
  font: 400 12px var(--mono); color: #c9ccd2;
}
.bar__l, .bar__r { display: flex; align-items: center; flex: none; }
.bar__l { gap: 4px; }
.bar__r { gap: 12px; }
.bar__arch { display: grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.bar__arch img { width: 16px; height: 16px; }
.bar__arch:hover, .bar__arch[aria-expanded="true"] { background: rgba(23, 147, 209, .18); }
.bar__ws { display: flex; gap: 2px; }
.bar__ws button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px;
  border: 0; border-radius: 6px; background: transparent; color: #c9ccd2; font: inherit; cursor: pointer;
}
.bar__ws button:hover { background: rgba(255, 255, 255, .07); }
.bar__ws button[aria-pressed="true"] { background: var(--arch); color: #0b0c0e; }
.ws__n { opacity: .7; }
.bar__title { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px;
  border: 1px solid #2c3036; border-radius: 5px; background: transparent; color: #c9ccd2; font: inherit; cursor: pointer;
}
.bar__btn:hover { border-color: #5f6672; color: #eef0f3; }
.bar__btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bar__btn[aria-pressed="true"].bar__term { background: var(--arch); border-color: var(--arch); color: #0b0c0e; }
.bar__wall[aria-pressed="false"] svg { opacity: .45; }
.bar__btn[hidden] { display: none; }
.bar__ts { display: inline-flex; align-items: center; gap: 6px; }
.bar__ts .dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; }
.deck-on :focus-visible { outline-color: var(--arch-hi); }

/* ── Tiling (Hyprland: gaps, rounding, the default active border) ─── */
.deck-on .wm { display: flex; gap: 10px; position: absolute; z-index: 2; top: 56px; left: 10px; right: 10px; bottom: 10px; }
.deck-on .win { position: relative; min-width: 0; box-sizing: border-box; border-radius: 10px; border: 2px solid var(--win-line); }
.deck-on .win.is-focused { border-color: transparent; }
.deck-on .win.is-focused::before {
  content: ""; position: absolute; inset: -2px; z-index: 3; border-radius: 10px; padding: 2px; pointer-events: none;
  background: var(--hypr);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.deck-on .win--app { display: block; flex: 0 0 60%; background: #0f1115; }
.deck-on .win__body {
  display: block; height: 100%; overflow-y: auto; border-radius: 8px;
  container: win / inline-size; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #33373e transparent;
}
.deck-on .win__body:focus { outline: none; }
.deck-on .win--term { display: flex; flex-direction: column; flex: 1; background: rgba(11, 13, 18, .8); }

/* terminal (foot) */
.term { display: flex; flex-direction: column; height: 100%; min-height: 0; font: 400 13px/1.55 var(--mono); color: #d5dbe7; }
.term__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 8px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #33373e transparent; }
.term__out > div { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.55em; }
.t-cmd { color: #eef0f3; }
.t-dim { color: #7a818c; }
.t-err { color: #ff6b6b; }
.t-ok { color: #3ddc97; }
.t-blue { color: var(--arch-hi); }
.t-user { color: #3ddc97; }
.t-path { color: var(--arch-hi); }
.term__line { display: flex; align-items: baseline; gap: 8px; }
.term__ps1 { white-space: nowrap; }
.term__in { flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: #eef0f3; font: inherit; caret-color: #eef0f3; }
.term__hints { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.term__hints button {
  height: 30px; padding: 0 9px; border: 1px solid #2c3036; border-radius: 4px;
  background: rgba(0, 0, 0, .25); color: #a9abb0; font: 400 12px var(--mono); cursor: pointer;
}
.term__hints button:hover { border-color: #5f6672; color: #eef0f3; }
.fetch { display: flex; gap: 22px; margin: 6px 0 10px; }
.fetch__logo { margin: 0; color: var(--arch); font: 500 13px/1.3 var(--mono); white-space: pre; }
.fetch__info { display: flex; flex-direction: column; min-width: 0; }
.fetch__k { color: var(--arch-hi); }
.fetch__sw { display: flex; margin-top: 8px; }
.fetch__sw span { width: 20px; height: 13px; }
.fetch__sw span:nth-child(1) { background: #1d2025; }
.fetch__sw span:nth-child(2) { background: #ff6b6b; }
.fetch__sw span:nth-child(3) { background: #3ddc97; }
.fetch__sw span:nth-child(4) { background: #f2d34a; }
.fetch__sw span:nth-child(5) { background: #1793d1; }
.fetch__sw span:nth-child(6) { background: #c678dd; }
.fetch__sw span:nth-child(7) { background: #56b6c2; }
.fetch__sw span:nth-child(8) { background: #d5dbe7; }
.boot__log > div { min-height: 1.6em; }
.sl-train { margin: 4px 0; font: 400 12px/1.2 var(--mono); white-space: pre; color: #d5dbe7; animation: sl-run 3.6s linear both; }
@keyframes sl-run { from { transform: translateX(110%); } to { transform: translateX(-120%); } }

/* launcher (wofi) */
.deck-on .launcher { display: block; position: absolute; inset: 0; z-index: 6; }
.deck-on .launcher[hidden] { display: none; }
.launcher__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.launcher__box {
  position: absolute; left: 50%; top: 14%; width: min(460px, calc(100% - 24px)); transform: translateX(-50%);
  border-radius: 10px; background: #111317; border: 2px solid var(--arch); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden;
}
.launcher__in { width: 100%; box-sizing: border-box; height: 50px; padding: 0 16px; border: 0; border-bottom: 1px solid #22262c; background: transparent; color: #eef0f3; font: 400 15px var(--mono); outline: none; }
.launcher__list { list-style: none; margin: 0; padding: 6px 0; max-height: 60vh; overflow-y: auto; }
.launcher__list li[hidden] { display: none; }
.launcher__list button {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 46px; padding: 0 16px;
  border: 0; background: transparent; color: #eef0f3; font: 400 15px var(--font); text-align: left; cursor: pointer;
}
.launcher__list button:hover, .launcher__list button:focus-visible { background: rgba(23, 147, 209, .2); outline: none; }
.l__k { width: 28px; font: 400 12px var(--mono); color: #8e8f92; }

/* boot */
.deck-on .boot { display: none; position: absolute; inset: 0; z-index: 10; background: #000; padding: 26px 30px; overflow: hidden; }
.deck-on .scene[data-state="booting"] .boot { display: block; }
.boot__log { margin: 0; font: 400 15px/1.6 var(--mono); color: #c9ccd2; white-space: pre-wrap; }
.b-ok { color: #3ddc97; }
.b-blue { color: var(--arch); }
.b-caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.15em; background: #c9ccd2; }
.boot__skip {
  position: absolute; right: 22px; bottom: 20px; height: 40px; padding: 0 14px;
  border: 1px solid #33373e; border-radius: 4px; background: transparent; color: #a9abb0; font: 400 13px var(--mono); cursor: pointer;
}

/* ── The CV sections as apps (dark, compact) ───────────────────────── */
.deck-on .win--app {
  --bg: #0f1115; --surface: #1c1f25; --paper: #15181d;
  --ink: #eef0f3; --muted: #9a9ca3; --text-2: #b9bbc1;
  --line: rgba(238, 240, 243, .12); --line-strong: rgba(238, 240, 243, .3);
  --accent: #1793d1; --accent-ink: #0b0c0e;
  color: var(--ink);
}
.deck-on .app { display: none; min-height: 0; padding: 30px 34px 40px; background: transparent; color: var(--ink); }
.deck-on .app.is-active { display: block; }
.deck-on .app .wrap { width: auto; margin: 0; }
.deck-on .app .grid { display: block; }
.deck-on .app .grid > * + * { margin-top: 30px; }
.deck-on .app h2 { font-size: clamp(28px, 3.6cqw + 8px, 40px); }
.deck-on .app .sec__sub { font-size: 16px; max-width: 44em; }
.deck-on .sec__head--row { display: block; }
.deck-on .sec__head--row .sec__sub { margin-top: 12px; }
.deck-on .sec--dark { background: transparent; color: var(--ink); }
.deck-on .btn--ghost { --b-bd: rgba(238, 240, 243, .3); --b-bd-h: rgba(238, 240, 243, .6); --b-bg-h: rgba(255, 255, 255, .06); --b-fg: var(--ink); }
.deck-on .btn--inv { --b-bg: var(--arch); --b-bg-h: #2ba3de; --b-fg: #0b0c0e; }
.deck-on .tile__mark { background: #eef0f3; color: #0b0c0e; }

/* README (the hero in plain view) */
.deck-on .hero { display: none; position: static; min-height: 0; overflow: visible; align-items: initial; padding: 30px 34px 40px; background: transparent; }
.deck-on .hero.is-active { display: block; }
.deck-on .hero::before, .deck-on .hero__art { display: none; }
.deck-on .hero__notice::before { background: var(--arch); }
.deck-on .hero__name { font-size: clamp(44px, 8cqw + 10px, 80px); margin-bottom: 22px; }
.deck-on .hero__role { font-size: clamp(18px, 1.6cqw + 12px, 24px); }
.deck-on .hero__lead { color: var(--text-2); }
.deck-on .hero__deckhint {
  display: block; margin-top: 28px; max-width: 36em; padding: 14px 16px;
  border-radius: 6px; background: rgba(23, 147, 209, .08); border: 1px solid rgba(23, 147, 209, .28);
  font-size: 14px; line-height: 1.55; color: #c9ccd2;
}
.hero__deckhint kbd { font-family: var(--mono); color: #fff; }

/* Experience */
.deck-on .job--lead { display: block; margin-top: 24px; padding: 24px 0; }
.deck-on .job--lead .job__list { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.deck-on .jobs-pair { grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
/* Skills */
.deck-on .skills { grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
.deck-on .skill { min-height: 0; padding: 20px 22px 22px; }
/* Education */
.deck-on .degree { margin-top: 24px; }
.deck-on .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
/* HomeLab */
.deck-on .app .lab { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.deck-on .lab__text { display: contents; }
.deck-on .lab__text > h2 { order: 1; }
.deck-on .lab__text > .sec__sub { order: 2; }
.deck-on .app .lab .lab__fig { order: 3; align-self: stretch; margin-top: 26px; }
.deck-on .lab__points { order: 4; margin: 24px 0 24px; }
.deck-on .lab__text > .btn { order: 5; align-self: flex-start; }
.deck-on .dg--wide { display: block; }
.deck-on .dg--tall { display: none; }
.deck-on .lab__pause { position: static; display: flex; margin: 0 0 12px auto; }
.deck-on .lab__pause[hidden] { display: none; }
/* Contact */
.deck-on .close.is-active { display: flex; flex-direction: column; min-height: 100%; box-sizing: border-box; }
.deck-on .close__addr { font-size: clamp(24px, 5.6cqw + 4px, 58px); }
.deck-on .close__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deck-on .foot { margin-top: 40px; }
.deck-on .foot__in { display: block; }
.deck-on .foot__in p + p { margin-top: 6px; }

@container win (min-width: 640px) {
  .deck-on .job--lead .job__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
  .deck-on .jobs-pair, .deck-on .skills, .deck-on .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-on .pair { gap: 28px; }
}
@container win (max-width: 599.98px) {
  .deck-on .dg--wide { display: none; }
  .deck-on .dg--tall { display: block; max-width: 420px; margin: 0 auto; }
  .deck-on .app, .deck-on .hero { padding: 22px 18px 32px; }
  .deck-on .close__links { grid-template-columns: minmax(0, 1fr); }
  .deck-on .hero__actions .btn { flex: 1 1 auto; }
  .deck-on .lab__pt { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .deck-on .rows li { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
}

/* ── Medium screens: one window at a time, terminal on >_ ─────────── */
@media (max-width: 1099.98px) {
  .keys { gap: 8px; }
  .key { padding: 8px 10px; font-size: 13px; }
  .ws__l { display: none; }
  .bar__ws button { min-width: 30px; justify-content: center; padding: 0 6px; }
  .ws__n { opacity: 1; }
}
@media (max-width: 999.98px) {
  .deck-on .win--app { flex: 1 1 auto; }
  .deck-on .win--term { display: none; }
  .deck-on .wm.show-term .win--app { display: none; }
  .deck-on .wm.show-term .win--term { display: flex; }
  .bar__title { display: none; }
  .bar__l { flex: 1; }
}
@media (max-height: 720px) and (min-width: 700px) {
  .deck-on .deck__base { height: 96px; padding: 10px 14px; }
  .key { height: 68px; }
  .key { padding: 8px 12px; }
}

/* ── Phone: a full-screen deck, 3 × 2 keypad, one window ──────────── */
@media (max-width: 699.98px) {
  .deck-on .deck { inset: 6px; }
  .deck-on .deck__lid { padding: 6px; border-radius: 16px 16px 8px 8px; }
  .deck-on .screen { border-radius: 10px; }
  .deck-on .deck__hinge { height: 6px; margin: 0 24px; }
  .deck-on .deck__hinge span { height: 6px; }
  .deck-on .deck__base { height: auto; padding: 10px; border-radius: 8px 8px 18px 18px; }
  .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .key { flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; height: 46px; padding: 0 10px; font-size: 14px; box-shadow: 0 4px 0 #0b0c0e; border-radius: 8px; }
  .key[aria-pressed="true"] { transform: translateY(3px); box-shadow: 0 1px 0 #0b4f73; }
  .key__n { font-size: 10px; }

  .deck-on .bar { left: 6px; right: 6px; top: 6px; height: 44px; gap: 8px; padding: 0 4px; }
  .bar__ws, .bar__ts, .bar__plain, .bar__lid, .bar__wall { display: none; }
  .bar__arch { width: 44px; height: 38px; }
  .bar__title { display: block; text-align: left; font-size: 12px; }
  .bar__btn { height: 38px; min-width: 44px; justify-content: center; }
  .bar__r { gap: 10px; padding-right: 4px; }
  .deck-on .wm { top: 56px; left: 6px; right: 6px; bottom: 6px; }

  .term { font-size: 12px; }
  .term__scroll { padding: 12px; }
  .term__in { font-size: 16px; }
  .term__hints { padding: 8px; }
  .term__hints button { height: 36px; padding: 0 10px; }
  .fetch { flex-direction: column; gap: 6px; }
  .fetch__logo { font-size: 11px; }

  .deck-on .boot { padding: 14px 14px; }
  .boot__log { font-size: 11.5px; line-height: 1.5; }
  .boot__skip { left: 14px; right: 14px; bottom: 14px; height: 44px; }

  .intro__actions { flex-direction: column; align-self: stretch; }
  .intro__actions .btn { width: 100%; }
}

@media (max-width: 379.98px) {
  .keys { gap: 6px; }
  .key { gap: 6px; padding: 0 8px; font-size: 12.5px; }
}

} /* @media screen */

/* ── Reduced motion: no travel ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sl-train { animation: none; }
}
