/* ==========================================================================
   Mogahid Sabeel — site v3 "Desktop, Reissued"
   Static, dependency-free. Self-hosted fonts. No third-party requests.
   Tokens live in tokens.css. All artwork and chrome are original.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 clamp(16px, 0.5vw + 14.5px, 18px)/1.6 var(--f-body);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; padding-bottom: var(--taskbar-h);
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; }
p { margin: 0 0 1em; }
em { font-style: italic; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--sel-bg); color: var(--sel-ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; text-decoration: none; font-family: var(--f-mono); transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Pixel icons ---------- */
.icon { width: 16px; height: 16px; flex: none; shape-rendering: crispEdges; color: currentColor; }
.icon .ic2 { fill: var(--icon-2); }
.icon .ic3 { fill: var(--icon-3); }
.icon .ic4 { fill: var(--icon-4); }
.icon--xl { width: 64px; height: 64px; }

/* ---------- Bevels ---------- */
.bevel, .btn, .tbtn, .window, .window__btn, .window__min, .taskbar, .tb__menu, .tb__item, .lang__btn, .theme-toggle, .start-menu {
  border: 2px solid; border-color: var(--bevel-l) var(--bevel-d) var(--bevel-d) var(--bevel-l);
}
.bevel--in, .addressbar__path, .pbar, .fader, .meter, .file__art, .file__media, .wizard__side, .statusbar, .tb__clock {
  border: 2px solid; border-color: var(--bevel-d) var(--bevel-l) var(--bevel-l) var(--bevel-d);
}

/* ---------- Desktop layout ---------- */
.desktop { position: relative; }
.desktop__area { max-width: var(--maxw); margin: 0 auto; padding: clamp(16px, 3vw, 40px) var(--gutter) 24px; display: grid; gap: clamp(20px, 3vw, 36px); }

/* ---------- Window chrome ---------- */
.window { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.window__bar {
  display: flex; align-items: center; gap: 8px; min-height: var(--bar-h); padding: 0 4px 0 10px;
  background: var(--bar-off); color: var(--bar-off-ink);
}
.window.is-active .window__bar, .window__bar--on { background: linear-gradient(90deg, var(--bar-a), var(--bar-b)); color: var(--bar-ink); }
.window__title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 400 1.25rem/1 var(--f-term); letter-spacing: .01em; min-width: 0; }
.window__title .icon { color: currentColor; }
.window__file { white-space: nowrap; }
.window__sep { opacity: .7; }
.window__btns { margin-left: auto; display: flex; gap: 3px; }
.window__btn, .window__min { position: relative; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; background: var(--surface); color: var(--ink); cursor: default; }
.window__min, .window__close { cursor: pointer; }
.window__min::before, .window__close::before { content: ""; position: absolute; inset: -12px; } /* 48 px hit area */
.window__min:active, .window__close:active { border-color: var(--bevel-d) var(--bevel-l) var(--bevel-l) var(--bevel-d); }
.window__body { padding: clamp(16px, 2.5vw, 28px); }
.window.is-min .window__body { display: none; }
.doc-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.12; letter-spacing: -.01em; margin-bottom: 16px; max-width: 24ch; }
.doc-title em, .hero__title em { color: var(--amber); font-style: italic; }
.doc-title--mono { font-family: var(--f-mono); font-weight: 500; letter-spacing: -.02em; max-width: 30ch; }
.doc, .doc__intro, .explorer__intro { max-width: 72ch; }
.doc__intro, .explorer__intro { color: var(--ink-2); margin-bottom: 20px; }

/* boot sequence: hide the desktop until the terminal line has typed (JS only; reduced motion skips) */
.js.is-booting .window:not(.window--term), .js.is-booting .footer, .js.is-booting .term__out { visibility: hidden; }
.js.is-booted:not(.is-instant) .window:not(.window--term) { animation: win-in var(--t-win) var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.js.is-booted:not(.is-instant) .term__out { animation: fade-in .35s var(--ease) both; }
.js.is-booted:not(.is-instant) .window--term { animation: power-on .5s var(--ease) both; }
@keyframes win-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes power-on { from { filter: brightness(1.7) contrast(1.2); } to { filter: none; } }

/* ---------- Buttons ---------- */
.btn, .tbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.2; cursor: pointer;
}
.btn:active, .tbtn:active, .tbtn.is-active, .tb__item.is-active, .lang__btn[aria-pressed="true"], .tb__menu[aria-expanded="true"] {
  border-color: var(--bevel-d) var(--bevel-l) var(--bevel-l) var(--bevel-d); transform: translate(1px, 1px);
}
.btn--primary { background: var(--bar-a); color: #FFFFFF; }
.btn--primary .icon { color: #FFFFFF; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[disabled]:active { transform: none; border-color: var(--bevel-l) var(--bevel-d) var(--bevel-d) var(--bevel-l); }
.tbtn { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.tbtn b { font: 500 .75rem/1 var(--f-mono); padding: 3px 6px; background: var(--surface); border: 1px solid var(--line); }
.tbtn.is-active b, .tbtn[aria-pressed="true"] b { background: var(--bar-a); color: #FFF; }

/* ---------- Toolbars, menubars, status bars ---------- */
.menubar { display: flex; gap: 18px; padding: 4px 10px; margin: -4px 0 12px; font: 400 .95rem/1.4 var(--f-body); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.menubar span::first-letter { text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.addressbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: .9rem; color: var(--ink-2); }
.addressbar__path { flex: 1; padding: 6px 10px; background: var(--surface-2); font-family: var(--f-mono); font-size: .85rem; color: var(--ink); }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 20px; padding: 6px 10px; background: var(--surface-2); font: 400 .8rem/1.4 var(--f-mono); color: var(--ink-2); }

/* ---------- Terminal window (Start) ---------- */
.window--term .window__body { background: var(--term-bg); color: var(--term-text); font-family: var(--f-mono); }
.term__boot { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 1.25rem/1.3 var(--f-term); color: var(--term-ink); }
.term__cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--term-ink); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
.is-booted .term__cursor { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }
.term__skip { display: none; margin-top: 8px; border: 1px dashed var(--term-dim); background: none; color: var(--term-dim); padding: 6px 10px; font: 400 .85rem/1 var(--f-mono); cursor: pointer; min-height: 44px; }
.is-booting .term__skip { display: inline-block; }
.term__out { margin-top: 20px; }
.eyebrow { font: 400 .8rem/1.4 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--term-dim); margin-bottom: 14px; }
.hero__title { font-family: var(--f-mono); font-weight: 500; font-size: clamp(1.7rem, 3.6vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; color: var(--term-ink); max-width: 24ch; margin-bottom: 18px; }
.hero__lead { font-family: var(--f-body); max-width: 62ch; color: var(--term-text); margin-bottom: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0 0 26px; padding-top: 14px; border-top: 1px dashed var(--term-dim); max-width: 620px; }
.stat dt { font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1; color: var(--term-ink); margin-bottom: 6px; }
.stat__unit { font-size: .5em; margin-left: 4px; color: var(--term-dim); }
.stat dd { margin: 0; font-family: var(--f-body); font-size: .82rem; line-height: 1.4; color: var(--term-dim); }
.term__fig { margin: 0; }
.pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font: 400 .85rem/1.4 var(--f-mono); letter-spacing: .06em; color: var(--term-dim); }
.pipe__raw { color: var(--term-dim); }
.pipe__arrow { color: var(--term-dim); }
.pipe__st { padding: 3px 8px; border: 1px solid var(--term-dim); color: var(--term-text); white-space: nowrap; }
.pipe__st b { font-weight: 400; color: inherit; opacity: .8; margin-right: 4px; } /* inherits so the amber "hit" state keeps contrast */
.pipe__st--end { border-color: var(--term-ink); color: var(--term-ink); }
.js .pipe__st { animation: hit 4.8s steps(1) infinite; animation-delay: calc(var(--s) * 1s); }
@keyframes hit { 0%, 20% { background: var(--term-ink); color: var(--term-bg); } 21%, 100% { background: transparent; } }
.js .pipe__st b { animation: none; }
.term__cap { margin-top: 12px; font: 400 .8rem/1.5 var(--f-body); color: var(--term-dim); }

/* ---------- readme.txt (Now) ---------- */
.now__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.lede { font-size: 1.05em; margin-bottom: 20px; }
.focus-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.focus-list li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.focus-list .icon { color: var(--teal-ink); position: relative; top: 2px; }
.note { font-size: .85rem; color: var(--ink-2); }
.quote { margin: 0; padding: 20px 22px; background: var(--surface-2); border-left: 4px solid var(--amber); }
.quote p { font-family: var(--f-mono); font-size: 1.05rem; line-height: 1.45; }
.quote footer { font: .8rem/1.4 var(--f-mono); color: var(--ink-2); }

/* ---------- Portfolio (explorer) ---------- */
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.file { position: relative; display: flex; flex-direction: column; padding: 14px; background: var(--surface); border: 1px dotted transparent; isolation: isolate; transition: background-color var(--t-fast), border-color var(--t-fast); }
.file:hover, .file:focus-within { background: var(--surface-2); border-color: var(--teal); }
.file.is-hidden { display: none; }
.file__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; margin-bottom: 12px; } /* wraps when a long Italian tag meets the meta line */
.file__meta { font: .72rem/1.2 var(--f-mono); color: var(--ink-2); text-align: right; }
.file__art, .file__media { position: relative; height: 150px; display: grid; place-items: center; background: var(--surface-2); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 8px 8px; overflow: hidden; }
.file__art .icon { color: var(--ink); }
.file__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.file__media--dark { background: #070C12; }
.play { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface); color: var(--ink); border: 2px solid; border-color: var(--bevel-l) var(--bevel-d) var(--bevel-d) var(--bevel-l); }
.file h4 { font-size: 1.15rem; margin: 14px 0 8px; }
.file p { color: var(--ink-2); font-size: .94rem; line-height: 1.5; flex: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 14px; }
.tags li { font: .72rem/1 var(--f-mono); padding: 5px 7px; background: var(--surface-2); border: 1px solid var(--line); }
.file__open { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; border: 0; background: none; padding: 8px 0; min-height: 44px; cursor: pointer; font-weight: 500; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.file__open::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.file__open .icon { color: currentColor; }

/* cassette-label evidence tags: text always present; colour is never the only signal */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; margin: 0; background: var(--tag-learning); color: var(--tag-ink); border: 1px solid var(--line); border-radius: 3px; font: 500 .7rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); }
.tag .icon { width: 14px; height: 14px; color: var(--tag-ink); }
.tag--delivered { background: var(--tag-delivered); }
.tag--strategy { background: var(--tag-strategy); }
.tag--practice { background: var(--tag-practice); }
.tag--learning { background: var(--tag-learning); border-style: dashed; }

/* ---------- Case dialog (a window) ---------- */
.case { width: min(760px, calc(100vw - 24px)); max-height: calc(100svh - 32px); padding: 0; background: var(--surface); color: var(--ink); overflow: hidden; }
.case::backdrop { background: rgba(6, 43, 42, .55); }
.case[open] { animation: win-in var(--t-win) var(--ease); }
.case.is-closing { animation: win-out var(--t-win) var(--ease) forwards; }
@keyframes win-out { to { opacity: 0; transform: scale(.97); } }
.case .window__bar { padding-right: 4px; }
.case__inner { max-height: calc(100svh - 32px - var(--bar-h)); overflow-y: auto; padding: clamp(18px, 3vw, 32px); overscroll-behavior: contain; }
.case__body .tag { margin-bottom: 12px; }
.case h3 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); line-height: 1.15; margin-bottom: 18px; }
.case__video { position: relative; display: block; width: 100%; max-width: 320px; margin: 0 auto 22px; padding: 0; background: var(--surface-2); cursor: pointer; aspect-ratio: 4 / 5; border: 2px solid; border-color: var(--bevel-d) var(--bevel-l) var(--bevel-l) var(--bevel-d); }
.case__video--dark { background: #070C12; }
.case__video img, .case__video video { width: 100%; height: 100%; object-fit: cover; }
.case__video.is-playing { cursor: default; background: #000; }
.play--lg { width: 56px; height: 56px; right: 50%; bottom: 50%; transform: translate(50%, 50%); }
.play--lg .icon { width: 24px; height: 24px; }
.case__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
.case__grid > div { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.case__grid dt { font: 500 .7rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 8px; }
.case__grid dd { margin: 0; font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.case__grid > div:last-child { border-style: dashed; }

/* ---------- Method wizard ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(16px, 3vw, 32px); align-items: stretch; }
.wizard__side { position: relative; min-height: 300px; background: var(--surface-2); overflow: hidden; font-family: var(--f-mono); font-size: .8rem; }
.screen { position: absolute; inset: 0; padding: 22px; opacity: 0; transition: opacity .3s var(--ease); pointer-events: none; }
.screen.is-active { opacity: 1; }
.screen__caption { position: absolute; right: 10px; bottom: 6px; margin: 0; font: .62rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.screen--map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen--map path { fill: none; stroke: var(--teal-ink); stroke-width: 1.5; stroke-dasharray: 4 5; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -18; } }
.map-node { position: absolute; left: var(--x); top: var(--y); padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1; }
.map-node--decision { border-color: var(--amber); color: var(--amber); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line); }
.check i { font-style: normal; width: 18px; height: 18px; display: grid; place-items: center; font-size: .72rem; font-weight: 600; }
.check .ok { background: var(--ok); color: var(--surface); } .check .warn { background: var(--warn); color: var(--surface); }
.check--sum { justify-content: center; background: transparent; border-style: dashed; color: var(--ink-2); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.chain span { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); }
.chain em { font-style: normal; color: var(--teal-ink); }
.chain--meta span { font-size: .72rem; color: var(--ink-2); border-style: dashed; }
.hash { margin-top: 14px; color: var(--ink-2); font-size: .72rem; letter-spacing: .06em; }
.screen--handover { display: grid; place-items: center; }
.doc-card { grid-area: 1 / 1; width: 170px; padding: 14px 12px 50px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(var(--r)) translateX(calc(var(--r) * 5)); }
.doc-card::after { content: ""; display: block; margin-top: 10px; height: 34px; background: repeating-linear-gradient(var(--line) 0 1px, transparent 1px 8px); }
.wizard__main { display: flex; flex-direction: column; }
.wizard__count { font: 500 .8rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.steps { list-style: none; margin: 0; padding: 0; flex: 1; }
.step { position: relative; padding: 8px 0 8px 56px; }
.js .wizard .step:not(.is-active) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.step__num { position: absolute; left: 0; top: 4px; font: 400 2rem/1 var(--f-term); color: var(--amber); }
.step h4 { font-size: 1.35rem; margin-bottom: 8px; }
.step p { color: var(--ink-2); margin: 0; max-width: 46ch; }
.wizard__nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.principle { padding: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.principle h4 { font-size: 1.05rem; margin-bottom: 6px; }
.principle h4::before { content: "§ "; color: var(--amber); font-family: var(--f-mono); }
.principle p { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.5; }

/* ---------- Journey (progress dialog) ---------- */
.progress-dlg__msg { font: .85rem/1.4 var(--f-mono); color: var(--ink-2); margin-bottom: 8px; }
.pbar { height: 22px; background: var(--surface-2); overflow: hidden; margin-bottom: 24px; }
.pbar__fill { display: block; height: 100%; width: calc(var(--t, 0) * 100%); background: repeating-linear-gradient(90deg, var(--bar-a) 0 12px, transparent 12px 16px); transition: width .25s linear; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 8px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.tl { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; padding-left: 18px; }
.tl::before { content: ""; position: absolute; left: -15px; top: 10px; width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--line); transition: background-color .3s, border-color .3s; }
.tl.is-in::before { background: var(--bar-a); border-color: var(--bar-a); }
.tl__year { font: 500 .85rem/1.6 var(--f-mono); letter-spacing: .04em; color: var(--ink-2); padding-top: 6px; }
.tl__card { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); }
.tl__card--now { border-color: var(--bar-a); box-shadow: inset 3px 0 0 var(--bar-a); }
.tl__card h4 { font-size: 1.1rem; margin-bottom: 4px; }
.tl__org { font: .78rem/1.4 var(--f-mono); color: var(--teal-ink); margin-bottom: 6px; }
.tl__card p:last-child { margin-bottom: 0; }
.tl__card > p:not(.tl__org) { color: var(--ink-2); font-size: .93rem; }

/* ---------- Toolkit (mixer) ---------- */
.mixer__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.lv { display: inline-block; width: 10px; height: 10px; flex: none; }
.lv--deep { background: var(--bar-a); }
.lv--working { background: linear-gradient(90deg, var(--bar-a) 50%, transparent 50%); border: 1.5px solid var(--bar-a); }
.lv--learning { border: 1.5px dashed var(--ink-2); }
.mixer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bank { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.bank h4 { font: 400 1.1rem/1.2 var(--f-term); margin-bottom: 12px; }
.channels { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ch { position: relative; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px; background: var(--surface); border: 1px solid var(--line); text-align: center; transition: border-color var(--t-fast), opacity .3s; }
.ch:hover, .ch:focus-visible { border-color: var(--teal); z-index: 3; }
.fader { position: relative; width: 14px; height: 64px; background: var(--surface-2); }
.fader i { position: absolute; left: -7px; width: 24px; height: 10px; background: var(--surface); border: 2px solid; border-color: var(--bevel-l) var(--bevel-d) var(--bevel-d) var(--bevel-l); bottom: calc(var(--lvl, .33) * 52px); }
.fader::before { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: calc(var(--lvl, .33) * 100%); background: var(--bar-a); }
.ch[data-level="deep"] { --lvl: 1; }
.ch[data-level="working"] { --lvl: .66; }
.ch[data-level="learning"] { --lvl: .33; }
.ch[data-level="learning"] .fader::before { background: repeating-linear-gradient(0deg, var(--ink-2) 0 2px, transparent 2px 5px); }
.ch__name { font-size: .78rem; line-height: 1.3; }
.ch__tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 220px; padding: 7px 9px; background: var(--ink); color: var(--bg); font-size: .76rem; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 4; }
.ch:hover .ch__tip, .ch:focus-visible .ch__tip { opacity: 1; }
.mixer.is-filtering .ch { opacity: .3; }
.mixer.is-filtering .ch.is-match { opacity: 1; border-color: var(--teal); }
.meters { margin-top: 16px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.meters h4 { font: 400 1.1rem/1.2 var(--f-term); margin-bottom: 12px; }
.meters ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; }
.meters li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; font-size: .92rem; }
.meters em { font: .75rem/1 var(--f-mono); color: var(--ink-2); font-style: normal; }
.meter { grid-column: 1 / -1; display: block; height: 12px; background: var(--surface); overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--v) * 100%); background: repeating-linear-gradient(90deg, var(--bar-a) 0 6px, transparent 6px 8px); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .1s; }
.meters.is-in .meter i, html:not(.js) .meter i { transform: scaleX(1); }

/* ---------- Message box (Contact) ---------- */
.msg { display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; align-items: start; }
.msg__icon { color: var(--bar-a); }
.msg__text p { color: var(--ink-2); max-width: 60ch; margin: 0; }
.msg__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- about.txt ---------- */
.window--about { max-width: 520px; }
.about__line { margin: 0; font-family: var(--f-mono); }

/* ---------- Footer ---------- */
.footer { font-size: .85rem; color: var(--ink-2); padding: 4px 4px 0; }
.footer p { margin: 0 0 6px; }
.privacy summary { cursor: pointer; font: 500 .75rem/1.6 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; width: fit-content; min-height: 44px; display: flex; align-items: center; }
.privacy p { max-width: 72ch; margin: 4px 0 0; font-size: .82rem; }

/* ---------- Taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: var(--taskbar-h);
  display: flex; align-items: center; gap: 6px; padding: 0 6px;
  background: var(--surface-2); border-left: 0; border-right: 0; border-bottom: 0;
}
.tb__menu, .tb__item, .lang__btn, .theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; min-width: 44px; padding: 4px 10px;
  background: var(--surface-2); color: var(--ink); text-decoration: none; font: 500 .9rem/1 var(--f-body); cursor: pointer;
}
.tb__menu { font-family: var(--f-term); font-size: 1.15rem; font-weight: 400; }
.tb__menu::before { content: ""; position: absolute; inset: -6px 0; }
.tb__menu { position: relative; }
.tb__items { display: flex; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.tb__item { position: relative; flex: 0 1 150px; min-width: 0; }
.tb__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb__item.is-min { opacity: .6; }
.tb__item::before { content: ""; position: absolute; inset: -6px 0; }
.tb__tray { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang { display: inline-flex; gap: 2px; }
.lang__btn { min-width: 44px; justify-content: center; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .06em; padding: 4px 8px; }
.theme-toggle { justify-content: center; padding: 4px; }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle__moon { display: none; }
.is-dark .theme-toggle__sun { display: none; }
.is-dark .theme-toggle__moon { display: block; }
.tb__clock { min-height: 36px; display: inline-flex; align-items: center; padding: 4px 10px; font: 400 .85rem/1 var(--f-mono); color: var(--ink); background: var(--surface); }

/* ---------- Start menu ---------- */
.start-menu { position: fixed; left: 6px; bottom: calc(var(--taskbar-h) + 4px); z-index: 101; min-width: 220px; background: var(--surface-2); box-shadow: var(--shadow); }
.start-menu[hidden] { display: none; }
.start-menu__list { list-style: none; margin: 0; padding: 4px; }
.start-menu__list a, .start-menu__list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
.start-menu__list a:hover, .start-menu__list button:hover, .start-menu__list a:focus-visible, .start-menu__list button:focus-visible { background: var(--bar-a); color: #FFF; outline-offset: -3px; }
.start-menu__list a:hover .icon, .start-menu__list button:hover .icon { color: #FFF; }
.start-menu__sep { height: 2px; margin: 4px 8px; border-top: 1px solid var(--bevel-d); border-bottom: 1px solid var(--bevel-l); }

/* ---------- 404 "blue error screen" ---------- */
.bsod { min-height: 100svh; margin: 0; padding: clamp(24px, 6vw, 72px) var(--gutter); background: #0B2E7A; color: #ECE7D9; font-family: var(--f-mono); display: grid; align-content: center; }
.bsod__box { max-width: 72ch; }
.bsod h1 { display: inline-block; background: #ECE7D9; color: #0B2E7A; padding: 2px 10px; font: 400 1.4rem/1.3 var(--f-term); margin-bottom: 20px; }
.bsod p { margin-bottom: 14px; }
.bsod a { color: #FFB000; }
.bsod__hint { color: #B8C4E0; font-size: .9rem; }

/* ---------- Language crossfade ---------- */
.is-switching [data-i18n] { opacity: .2; }
[data-i18n] { transition: opacity .2s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tb__items { display: none; }
  .now__grid, .wizard, .mixer { grid-template-columns: 1fr; }
  .wizard__side { min-height: 240px; }
  .screen { padding: 14px; font-size: .72rem; }
  .meters ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 640px) {
  .desktop__area { padding-left: 16px; padding-right: 16px; }
  .window__body { padding: 16px 14px; }
  .files, .principles, .case__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .tl { grid-template-columns: 1fr; gap: 4px; }
  .tl__year { padding-top: 0; }
  .meters ul { grid-template-columns: 1fr; }
  .msg { grid-template-columns: 1fr; }
  .msg__icon { width: 40px; height: 40px; }
  .msg__actions { justify-content: stretch; }
  .msg__actions .btn { flex: 1; justify-content: center; }
  .ch { width: calc(50% - 5px); }
  .ch__tip { left: 0; right: 0; transform: none; width: auto; max-width: none; overflow-wrap: anywhere; }
  .tbtn { min-height: 44px; }
  .lang__btn, .theme-toggle { min-height: 44px; min-width: 44px; }
  .window__sep, .window__title > span:last-child:not(.window__file) { display: none; }
  .tb__clock { display: none; }
  .menubar { gap: 12px; }
}
@media (max-width: 400px) {
  .lang__btn { padding: 4px 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .term__cursor { animation: none; }
  .js .pipe__st { animation: none; }
  .pbar__fill { transition: none; }
  .meter i { transform: scaleX(1); }
}

/* ---------- Print: plain, readable, every wizard step visible ---------- */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .taskbar, .start-menu, .window__btns, .term__skip, .term__cursor, .toolbar, .addressbar, .statusbar, .menubar, .wizard__side, .wizard__nav, .wizard__count, .pbar, .progress-dlg__msg, .file__open, .ch__tip { display: none !important; }
  .window { box-shadow: none; border: 1px solid #000; break-inside: avoid; }
  .window__bar { background: #eee !important; color: #000 !important; }
  .window--term .window__body { background: #fff; color: #000; }
  .hero__title, .term__boot, .stat dt { color: #000; }
  .js .wizard .step:not(.is-active) { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .window.is-min .window__body { display: block; }
  .window--about[hidden] { display: none; }
}
