/* Portfolio: a 1990s gaming PC. VGA ink on a dithered SVGA desktop, Win9x chrome with 2px bevels, a CRT layer behind a toggle.
   Colour, bevel and focus are tokens, so the high-contrast theme is a token swap. */

@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/pixelify-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/pixelify-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/vt323-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/vt323-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --chrome: "Pixelify Sans", "Courier New", monospace;
  --dos: "VT323", "Courier New", monospace;
  --text: "Atkinson Hyperlegible", "Segoe UI", Verdana, sans-serif;

  /* surfaces */
  --desk1: #0000aa; --desk2: #00009a; --sky1: #000058; --sky2: #3f0090;
  --silver: #c0c0c0; --ink: #000000; --ink2: #404040;
  --paper: #ffffff; --paper-ink: #000000;
  /* bevels */
  --hi: #ffffff; --hi2: #dfdfdf; --mid: #808080; --lo: #404040;
  /* title bars (white text on every state) */
  --tb-a1: #0000aa; --tb-a2: #0055aa; --tb-i1: #404040; --tb-i2: #707070; --tb-ink: #ffffff; --tb-i-ink: #ffffff;
  /* accents */
  --link: #0000ee; --focus: #0000aa; --sel-bg: #0000aa; --sel-ink: #ffffff; --route: #aa0000;
  --dos-bg: #000000; --dos-ink: #aaaaaa; --dos-hi: #55ff55;
  --label-ink: #ffffff;
  --taskbar: 44px;
}

/* high contrast (Win9x "High Contrast Black"): the same tokens, swapped */
html.hc {
  --desk1: #000000; --desk2: #000000; --sky1: #000000; --sky2: #000000;
  --silver: #000000; --ink: #ffffff; --ink2: #ffffff;
  --paper: #000000; --paper-ink: #ffffff;
  --hi: #ffffff; --hi2: #ffffff; --mid: #ffffff; --lo: #ffffff;
  --tb-a1: #ffff00; --tb-a2: #ffff00; --tb-i1: #000000; --tb-i2: #000000; --tb-ink: #000000; --tb-i-ink: #ffffff;
  --link: #ffff00; --focus: #ffff00; --sel-bg: #ffff00; --sel-ink: #000000; --route: #ffff00;
  --dos-bg: #000000; --dos-ink: #ffffff; --dos-hi: #ffff00;
}
html.hc .window:not(.active) .titlebar { border-bottom: 2px solid #ffffff; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--desk1); color-scheme: light; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 16px/1.55 var(--text);
  background-color: var(--desk1);
  background-image: repeating-conic-gradient(rgba(0,0,0,.3) 0% 25%, rgba(0,0,0,0) 0% 50%), linear-gradient(180deg, var(--sky1) 0%, var(--desk1) 58%, var(--sky2) 100%);
  background-size: 2px 2px, 100% 100%; background-attachment: fixed;
  -webkit-font-smoothing: auto;
}
::selection { background: var(--sel-bg); color: var(--sel-ink); }
html { scrollbar-color: var(--mid) var(--silver); }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--text); line-height: 1.3; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.1em; }
p { margin: 0 0 .9em; max-width: 68ch; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; max-width: 68ch; }
li { margin-bottom: .45em; }
button { font: inherit; color: inherit; }

/* language: one language visible at a time */
html[data-lang="en"] [lang="pt"]:not(.keep), html[data-lang="pt"] [lang="en"]:not(.keep) { display: none !important; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 5000; padding: 8px 12px; background: var(--paper); color: var(--paper-ink); border: 2px solid var(--ink); font: 700 14px var(--chrome); }
.skip:focus { top: 8px; }

/* ---------- shared bevel pieces ---------- */
.raised { border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid), inset 1px 1px 0 var(--hi2); background: var(--silver); }
.sunken { border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); box-shadow: inset 1px 1px 0 var(--lo), inset -1px -1px 0 var(--hi2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 16px;
  font: 700 14px/1.1 var(--chrome); letter-spacing: .02em; color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--silver); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid), inset 1px 1px 0 var(--hi2);
}
.btn:active, .btn[aria-pressed="true"] { border-color: var(--lo) var(--hi) var(--hi) var(--lo); box-shadow: inset 1px 1px 0 var(--mid); padding: 7px 15px 5px 17px; }
.btn.primary { outline: 2px solid var(--ink); outline-offset: -6px; }
.btn.primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1em 0; max-width: none; }
.note { color: var(--ink2); max-width: 68ch; }
.role { font: 400 1.25rem/1.3 var(--dos); letter-spacing: .02em; color: var(--ink2); margin-bottom: .8em; }
.lead { font-size: 1.05rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#h-setup { font: 700 40px/1.2 var(--chrome); letter-spacing: 0; margin-bottom: .3em; }
.program > h2:first-child { font: 700 24px/1.3 var(--chrome); }
.profiles { margin-top: 0; }

/* DOS pane */
.dos { margin: 1em 0 0; padding: 10px 12px; background: var(--dos-bg); color: var(--dos-ink); font: 400 20px/1.3 var(--dos); white-space: pre-wrap; overflow-wrap: anywhere;
  border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); }
.dos .dim { color: var(--dos-hi); }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- document mode (no JavaScript): the sections read as stacked windows ---------- */
#programs { max-width: 820px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: 18px; }
.program { padding: 18px 20px; background: var(--silver); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid), inset 1px 1px 0 var(--hi2); }
.nojs { max-width: 820px; margin: 0 auto; padding: 12px 16px; color: var(--label-ink); }
html:not(.js) [role="tablist"], html:not(.js) .jsonly { display: none; }
html:not(.js) [role="tabpanel"][hidden] { display: block; }
html:not(.js) .disc { cursor: default; }
html:not(.js) [data-detail][hidden] { display: block; }
html:not(.js) .actions button { display: none; }

/* tabs (diagnostic tool) */
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 6px; margin: 14px 0 -2px; position: relative; z-index: 1; }
[role="tab"] {
  min-height: 36px; padding: 6px 16px; font: 700 14px var(--chrome); color: var(--ink); cursor: pointer; background: var(--silver);
  border: 2px solid; border-color: var(--hi) var(--lo) transparent var(--hi); box-shadow: inset 1px 0 0 var(--hi2); margin-top: 4px;
}
[role="tab"][aria-selected="true"] { margin-top: 0; padding-top: 10px; padding-bottom: 8px; background: var(--paper); color: var(--paper-ink); border-bottom: 2px solid var(--paper); }
.panel { background: var(--paper); color: var(--paper-ink); padding: 16px 18px; position: relative;
  border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); box-shadow: inset 1px 1px 0 var(--lo), inset -1px -1px 0 var(--hi2); }
.panel a { color: var(--link); }
html:not(.hc) .panel { --link: #0000aa; }
.panel h3:first-child { margin-top: 0; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 1em 0 0; }
.fields dt { font-weight: 700; }
.fields dd { margin: 0; max-width: 68ch; }
.fields.wide { grid-template-columns: 8.5rem 1fr; }
.job { margin: 0 0 1.4em; }
.job h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin: 0 0 .1em; }
.job .when { font: 400 1.2rem var(--dos); color: var(--ink2); white-space: nowrap; }
.where { color: var(--ink2); margin: 0 0 .5em; }
.plain { list-style: square; }
.num { list-style: decimal; }

/* disc shelf */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin: 14px 0; }
.disc { --hue: #005a5a; position: relative; display: grid; grid-template-columns: 24px 1fr; min-height: 112px; padding: 0; text-align: left; cursor: pointer; background: #e4e4e4; color: #000;
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid); }
.disc[data-hue="c"] { --hue: #005a5a; } .disc[data-hue="p"] { --hue: #7a007a; } .disc[data-hue="y"] { --hue: #7a5200; }
.disc[data-hue="e"] { --hue: #006a00; } .disc[data-hue="r"] { --hue: #8a0000; } .disc[data-hue="b"] { --hue: #0000aa; }
.disc .spine { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; padding: 6px 0; background: var(--hue); color: #fff; font: 700 12px var(--chrome); letter-spacing: .14em; }
.disc .label { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 8px; font: 700 14px/1.3 var(--text); }
.disc .pix { width: 32px; height: 32px; }
.disc[aria-pressed="true"] { background: var(--paper); color: var(--paper-ink); border-color: var(--lo) var(--hi) var(--hi) var(--lo); box-shadow: inset 1px 1px 0 var(--mid); }
html.hc .disc { background: #000; color: #fff; }
html.hc .disc .spine { background: #ffffff; color: #000; }
.label-card { background: var(--paper); color: var(--paper-ink); padding: 16px 18px; min-height: 10rem;
  border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); box-shadow: inset 1px 1px 0 var(--lo), inset -1px -1px 0 var(--hi2); }
.label-card h3 { margin-top: 0; }
.label-card a { color: var(--link); }
html:not(.hc) .label-card { --link: #0000aa; }
.tags { font: 400 1.15rem var(--dos); color: var(--ink2); margin: .4em 0 0; }
.label-card .tags { color: var(--paper-ink); }

/* links */
.links { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: 8px; max-width: 520px; }
.links li { margin: 0; }
.links a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; min-height: 44px; padding: 10px 14px; text-decoration: none; font-weight: 700; color: var(--ink);
  background: var(--silver); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid), inset 1px 1px 0 var(--hi2); }
.links a:hover { background: var(--sel-bg); color: var(--sel-ink); }
.links .url { font: 400 1.1rem var(--dos); }
.mail-out { font: 400 1.2rem var(--dos); }
.mail-out a { color: var(--link); }

/* notepad */
.paper { background: var(--paper); color: var(--paper-ink); padding: 14px 18px; border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); box-shadow: inset 1px 1px 0 var(--lo), inset -1px -1px 0 var(--hi2); }
.paper h3:first-child { margin-top: 0; }

/* settings */
.settings fieldset { margin: 0 0 14px; padding: 8px 14px 6px; border: 2px solid; border-color: var(--mid) var(--hi) var(--hi) var(--mid); box-shadow: 1px 1px 0 var(--hi2), inset 1px 1px 0 var(--hi2); }
.settings legend { padding: 0 6px; font: 700 14px var(--chrome); }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: #0000aa; flex: none; margin: 0; }
html.hc .check input { accent-color: #ffff00; }

/* ================= DESKTOP SHELL (JavaScript) ================= */
html.js body { overflow: hidden; height: 100vh; height: 100dvh; }
html.js #programs { display: none; }
html.js .nojs { display: none; }
#desktop { position: fixed; inset: 0 0 var(--taskbar) 0; z-index: 1; overflow: hidden; }
#desktop[hidden], #taskbar[hidden] { display: none; }
.wm { position: absolute; right: 22px; bottom: 16px; text-align: right; font: 400 2rem/1 var(--dos); color: #55ffff; opacity: .55; pointer-events: none; user-select: none; }
.wm small { display: block; font-size: 1.1rem; color: #ffffff; }
html.hc .wm { display: none; }

.icons { position: absolute; top: 10px; left: 10px; bottom: 10px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 98px); grid-auto-columns: 96px; gap: 4px 6px; align-content: start; pointer-events: none; }
.icon { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; height: 94px; padding: 4px 2px; background: transparent; border: 1px solid transparent; color: var(--label-ink); cursor: pointer;
  font: 400 14px/1.3 var(--chrome); text-align: center; }
.icon .pix { width: 48px; height: 48px; flex: none; }
.icon .txt { padding: 1px 4px; overflow-wrap: anywhere; }
.icon.sel .txt, .icon:focus-visible .txt { background: var(--sel-bg); color: var(--sel-ink); }
.icon:focus-visible { outline: 2px dotted var(--label-ink); outline-offset: 0; border-color: transparent; }
html.hc .icon { color: #fff; }

/* windows */
.window { position: absolute; display: flex; flex-direction: column; min-width: 300px; max-width: calc(100vw - 8px); max-height: calc(100% - 4px); background: var(--silver);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid), inset 1px 1px 0 var(--hi2), 0 10px 22px rgba(0,0,0,.4); }
html.hc .window { box-shadow: none; border-color: #fff; }
.window[hidden] { display: none; }
.window.max { inset: 0 !important; width: auto !important; height: auto !important; max-width: none; max-height: none; }
.titlebar { display: flex; align-items: center; gap: 8px; padding: 3px 3px 3px 6px; background: linear-gradient(90deg, var(--tb-i1), var(--tb-i2)); color: var(--tb-i-ink); font: 700 14px/1 var(--chrome);
  user-select: none; touch-action: none; cursor: default; flex: none; }
.window.active .titlebar { background: linear-gradient(90deg, var(--tb-a1), var(--tb-a2)); color: var(--tb-ink); }
.titlebar .pix { width: 16px; height: 16px; flex: none; }
.tb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btn { position: relative; width: 28px; height: 26px; padding: 0; flex: none; cursor: pointer; color: #000; background: var(--silver);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: inset -1px -1px 0 var(--mid); }
html.hc .tb-btn { color: #fff; border-color: #fff; }
.tb-btn:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
.tb-btn::before, .tb-btn::after { content: ""; position: absolute; background: currentColor; }
.tb-min::before { left: 6px; right: 8px; bottom: 6px; height: 3px; }
.tb-max::before { left: 5px; right: 5px; top: 5px; bottom: 5px; background: none; border: 2px solid currentColor; border-top-width: 3px; }
.tb-close::before, .tb-close::after { left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; transform: rotate(45deg); }
.tb-close::after { transform: rotate(-45deg); }
.tb-btn:focus-visible { outline: 2px solid #ffff55; outline-offset: 1px; }
.win-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 18px; overscroll-behavior: contain; }
.window .program { padding: 0; border: 0; box-shadow: none; background: none; }
.window .dos { margin: 0; }
.window .program > h1:first-child, .window .program > h2:first-child { margin-top: 0; }

/* taskbar */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--taskbar); z-index: 900; display: flex; align-items: center; gap: 6px; padding: 4px;
  background: var(--silver); border-top: 2px solid var(--hi); box-shadow: 0 -1px 0 var(--hi2); }
.start { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 14px 0 10px; font: 700 15px var(--chrome); }
.start .pix { width: 16px; height: 16px; }
.tasks { flex: 1; min-width: 0; display: flex; gap: 4px; height: 100%; overflow: hidden; }
.task { flex: 0 1 170px; min-width: 0; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 8px; text-align: left; font: 700 13px var(--chrome); white-space: nowrap; overflow: hidden; }
.task .pix { width: 16px; height: 16px; flex: none; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.tray { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px; }
.tray .btn { min-height: 0; height: 100%; padding: 0 10px; font-family: var(--dos); font-size: 19px; font-weight: 400; letter-spacing: .04em; }
.tray .btn:active, .tray .btn[aria-pressed="true"] { padding: 1px 9px 0 11px; }
.clock { font: 400 1.3rem var(--dos); min-width: 3.4em; text-align: center; }
.langs { display: flex; height: 100%; gap: 2px; }

/* start menu */
.startmenu { position: fixed; left: 2px; bottom: var(--taskbar); z-index: 950; display: flex; width: 300px; max-width: calc(100vw - 4px); }
.startmenu[hidden] { display: none; }
.startmenu .banner { flex: none; width: 34px; background: linear-gradient(0deg, var(--tb-a1), var(--tb-a2)); color: var(--tb-ink); writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 0; text-align: left; font: 700 18px var(--chrome); letter-spacing: .06em; }
html.hc .startmenu .banner { background: #ffff00; color: #000; }
.startmenu ul { list-style: none; margin: 0; padding: 2px; flex: 1; max-width: none; }
.startmenu li { margin: 0; }
.startmenu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 4px 10px; text-align: left; background: transparent; border: 0; cursor: pointer; font: 700 14px var(--chrome); }
.startmenu button:hover, .startmenu button:focus-visible { background: var(--sel-bg); color: var(--sel-ink); outline: none; }
.startmenu .pix { width: 32px; height: 32px; flex: none; }
.startmenu hr { margin: 2px 4px; border: 0; border-top: 1px solid var(--mid); border-bottom: 1px solid var(--hi); }

/* boot and shutdown screens */
#boot, #shutdown { position: fixed; inset: 0; z-index: 2000; background: #000; color: var(--dos-ink); font: 400 clamp(18px, 3.2vw, 26px)/1.3 var(--dos); padding: clamp(14px, 4vw, 40px); white-space: pre-wrap; overflow: hidden; }
#boot[hidden], #shutdown[hidden] { display: none; }
#boot .hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #ffff55; }
#boot .ok { color: #55ff55; }
#shutdown { display: grid; place-items: center; text-align: center; color: #ff8800; font-size: clamp(22px, 4vw, 34px); }
#shutdown p { max-width: 24em; }

/* CRT layer: scanlines, vignette, glow. It is a toggle. */
#crt { position: fixed; inset: 0; z-index: 3000; pointer-events: none; display: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, rgba(0,0,0,0) 1px 3px), radial-gradient(ellipse at center, rgba(0,0,0,0) 58%, rgba(0,0,0,.5) 100%); }
html.crt #crt { display: block; }
html.crt #desktop, html.crt #boot { text-shadow: 0 0 2px rgba(120, 170, 255, .45); }
html.crt:not(.reduce) #desktop { animation: flicker 7s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 48% { opacity: .965; } 49% { opacity: 1; } 91% { opacity: .98; } 92% { opacity: 1; } }

/* reduced motion: a system setting, or the switch in Settings */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
html.reduce *, html.reduce *::before, html.reduce *::after { animation: none !important; transition: none !important; }

/* ================= small screens: one window at a time ================= */
@media (max-width: 760px) {
  :root { --taskbar: 52px; }
  h1 { font-size: 1.7rem; }
  #h-setup { font-size: 32px; }
  .icons { right: 10px; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); grid-template-rows: none; grid-auto-columns: auto; grid-auto-rows: 96px; }
  .icon { width: 100%; }
  .window { inset: 0 0 0 0 !important; width: auto !important; height: auto !important; max-width: none; max-height: none; border-width: 0 0 2px; box-shadow: none; }
  .window:not(.active) { display: none; }
  .tb-max { display: none; }
  .tb-btn { width: 44px; height: 40px; }
  .task { flex-basis: 44px; }
  .task span { display: none; }
  .wm { display: none; }
  .fields, .fields.wide { grid-template-columns: 1fr; gap: 2px; }
  .fields dd { margin-bottom: 10px; }
  .btn { min-height: 44px; }
  [role="tablist"] { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 0; margin-bottom: 8px; }
  #p-setup .actions .btn { flex: 1 1 calc(50% - 10px); }
  [role="tab"], [role="tab"][aria-selected="true"] { min-height: 44px; margin-top: 0; padding: 6px 8px; border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); }
  [role="tab"][aria-selected="true"] { background: var(--paper); color: var(--paper-ink); border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
  .startmenu { width: calc(100vw - 4px); }
  .panel, .label-card { padding: 14px; }
  .clock { display: none; }
  .tray .btn { padding: 0 8px; min-width: 44px; }
}
@media (max-width: 420px) { .win-body { padding: 12px; } .shelf { grid-template-columns: repeat(2, 1fr); } }
