/* ============================================================
   os.css — md.academy text-mode desktop OS
   One rule per component, themed through tokens. The render is a
   dark warm-black shell (desktop · dock · icons · boot) wrapping
   sand "paper" window interiors with pixel-stepped corners.
   See DESIGN.md for the canonical system.
   ============================================================ */

/* RittswoodRedStar — pixel buttons + big figures + the hero word "Академія". */
@font-face {
  font-family: 'RittswoodRedStar';
  src: url('../assets/fonts/RittswoodRedStar_8.ttf') format('truetype');
  font-display: swap;
}

/* ---- window / sand-paper system tokens (single source) ---- */
:root {
  --w98-face:    #E2D7BE;   /* dock · start-menu · raised face */
  --w98-facelt:  #EFE6D3;   /* hover face */
  --w98-hilite:  #FFFBF1;
  --w98-shadow:  #AD9E80;
  --w98-frame:   #5C4D38;
  --w98-client:  #F2ECDE;   /* active window surface */
  --w98-ink:     #2B2117;   /* warm dark-brown ink on sand */
  --w98-ta1:     #B85335;   /* start-menu accent (banner / hover) */
  --w98-tia:     #FFF6EC;   /* ink on that accent */
  --sand-dim:    #E6DBC3;   /* inactive window surface (a touch darker) */
  --bar-ink:     #6A5B46;   /* window title-bar ink, in every state */
  --line-w:      rgba(74,56,36,0.34);   /* warm 1px frame line */
  --w98-raised:  inset 0 0 0 1px var(--line-w);          /* flat 1px outset */
  --w98-sunken:  inset 0 0 0 1px rgba(74,56,36,0.18);    /* flat 1px inset (cards) */
  --w98-pressed: inset 0 0 0 1px rgba(74,56,36,0.5);
  --pixel-corner: polygon(
    0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
  --pixel-corner-sm: polygon(
    0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
}

/* ---------- analog texture ---------- */
.fx-scanlines { display: none; }
.fx-grain {
  position: fixed; inset: 0; z-index: 9001; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- cursors ---------- */
a, button, [role="button"], [data-open],
.btn, .btn--primary, .struct__cta, .dock__start, .dock__btn,
.widget__cta, .win__btn { cursor: pointer; }
/* drag uses the default arrow cursor everywhere */
.widget, .win__bar,
.icon.is-grab, .icon.is-grab *, .widget.is-grab, .win__bar.is-drag { cursor: default !important; }

/* ---------- inline Lucide icons — stroke = currentColor, size = 1em ---------- */
.lucide { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.125em; }

/* ---------- tooltip — classic pale-yellow hint box ---------- */
.tooltip {
  position: fixed; z-index: 9500; pointer-events: none;
  background: #ffffe1; color: #000; border: 1px solid #000;
  font-family: var(--sans); font-size: 11px; line-height: 1.3;
  padding: 2px 6px; max-width: 260px; white-space: nowrap;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.45);
}
.tooltip[hidden] { display: none; }

/* =========================================================
   BOOT SCREEN — POST log + progress bar (currently skipped by JS)
   ========================================================= */
.boot {
  position: fixed; inset: 0; z-index: 8000;
  background: var(--desktop);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(20px, 8vw, 120px);
  font-family: var(--mono); font-size: var(--t-mono); color: var(--fg-dim);
}
.boot.is-off { opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease); }
.boot__log { white-space: pre-wrap; line-height: 1.7; margin: 0; min-height: 11em; }
.boot__log .k { color: var(--clay); }
.boot__log .ok { color: var(--live); }
.boot__log .hi { color: var(--amber); }
.boot__bar {
  margin-top: 18px; width: min(420px, 80vw);
  border: 1px solid var(--line); height: 16px; padding: 2px;
  display: flex; align-items: center;
}
.boot__fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--clay) 0 7px, transparent 7px 9px);
  transition: width 90ms linear;
}
.boot__hint { margin-top: 12px; color: var(--muted); font-size: var(--t-xs); }
.boot__cursor { display: inline-block; width: 0.6ch; background: var(--clay);
  animation: blink 0.5s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   OS SHELL + DESKTOP
   ========================================================= */
.os { position: fixed; inset: 0; display: flex; flex-direction: column; }
.os[hidden] { display: none; }
.os.is-on { animation: os-in 360ms var(--ease) both; }
@keyframes os-in { from { opacity: 0; } to { opacity: 1; } }

.desktop {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background-color: var(--desktop);
  background-image:
    radial-gradient(ellipse 80% 80% at 50% 46%,
      rgba(10,9,8,0.42) 0%, rgba(10,9,8,0.16) 55%, rgba(10,9,8,0) 100%),
    linear-gradient(rgba(10,9,8,0.30), rgba(10,9,8,0.30)),
    url("../assets/wallpaper.png");
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.desktop::after {  /* corner vignette so windows lift off the wallpaper */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 130% at 50% 40%, transparent 62%, rgba(0,0,0,0.32) 100%);
}

/* =========================================================
   DESKTOP WIDGETS — paper sticky-note course cards
   pixel-cornered, no pin, no cast shadow; straighten + lift on hover
   ========================================================= */
.widgets { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.widget {
  position: absolute; width: 264px; pointer-events: auto; touch-action: none;
  padding-top: 10px;
  background: var(--paper); color: var(--paper-ink);
  filter: saturate(1.02);
  clip-path: var(--pixel-corner);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.widget--1 { --paper: var(--paper-1); transform: rotate(-2.4deg); }
.widget--2 { --paper: var(--w98-client); transform: rotate(1.8deg); }
.widget.is-grab { cursor: grabbing; }
/* soft paper sheen */
.widget::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(158deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0) 44%, rgba(0,0,0,0.06) 100%);
}
.widget__pin { display: none; }
.widget__body { position: relative; z-index: 1; padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 11px; }
.widget__kicker { display: none; }
.widget__title { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.04; letter-spacing: 0.01em; color: var(--paper-ink); }
.widget__meta { font-family: var(--mono); font-size: var(--t-sm); color: #5c4632; }
.widget__foot { display: contents; }   /* transparent on desktop; a flex row on mobile */

/* desktop hover — straighten, lift, slight zoom */
@media (min-width: 721px) {
  .widget--1:hover, .widget--2:hover {
    transform: rotate(0deg) translateY(-8px) scale(1.05);
    box-shadow: 0 24px 44px -12px rgba(0,0,0,0.62), 0 6px 14px rgba(0,0,0,0.4);
    z-index: 20;
  }
}

/* =========================================================
   DESKTOP ICONS — free-positioned, draggable, white labels
   ========================================================= */
.icons { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.icon {
  position: absolute; width: 96px; padding: 9px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; border: 1px solid transparent; border-radius: 3px;
  color: #f3efe7; user-select: none; pointer-events: auto; touch-action: none;
  opacity: 0;   /* revealed by the staggered item-in animation */
}
.icon.is-grab { cursor: grabbing; }
.icon__glyph {
  font-family: var(--mono); font-size: 26px; line-height: 1;
  width: 46px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: #f3efe7;
  border: 1px solid var(--hair); border-radius: 3px;
  background: linear-gradient(180deg, var(--win-raised), var(--win));
  box-shadow: 2px 2px 0 var(--shadow);
}
.icon--folder .icon__glyph { color: #f3efe7; }
.icon.is-sel, .icon.is-sel .icon__glyph { color: #ffffff; }
/* image-backed icons (Win98 PNGs): no tile frame, crisp upscale */
.icon__glyph--img, .icon.is-sel .icon__glyph--img { border: 0; background: none; box-shadow: none; padding: 0; }
.icon__img {
  width: 44px; height: 44px; object-fit: contain; display: block; image-rendering: auto;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}
.icon__label {
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0; text-transform: none;
  white-space: nowrap; max-width: none; overflow: visible;
}

/* =========================================================
   WINDOWS — transparent host, pixel surface + sharp drop drawn as
   two pseudo layers so window text stays perfectly crisp.
   The single focus cue is the surface tone (active = sand, idle = darker sand).
   ========================================================= */
.windows { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.win {
  position: absolute; display: flex; flex-direction: column;
  min-width: 280px; max-width: 94vw;
  background: transparent; border: 0; overflow: visible;
  pointer-events: auto;
  animation: win-open 180ms var(--ease) both;
}
@keyframes win-open { from { opacity: 0; transform: translateY(6px) scale(0.99); } }
.win.is-min { display: none; }
.win.is-max {            /* maximise must beat the JS inline geometry */
  inset: 6px 6px calc(var(--dock-h) + 6px) 6px !important;
  width: auto !important; height: auto !important;
}
/* pixel-stepped surface */
.win::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--sand-dim);
  clip-path: var(--pixel-corner);
}
.win.is-active::before { background: var(--w98-client); }
/* sharp, no-blur drop: same shape, offset 8px down-right */
.win::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: rgba(0,0,0,0.10); transform: translate(8px, 8px);
  clip-path: var(--pixel-corner);
}

/* title bar — flat, one ink, no rule, identical whether focused or not */
.win__bar {
  height: 32px; min-height: 32px;
  display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px;
  background: transparent; color: var(--bar-ink);
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  cursor: grab; user-select: none;
}
.win__bar.is-drag { cursor: grabbing; }
.win__title { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 400; color: var(--bar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__glyph { display: inline-flex; align-items: center; opacity: 0.7; }
.win__glyph img { width: 16px; height: 16px; object-fit: contain; display: block; image-rendering: auto; }
.win__glyph .lucide { width: 16px; height: 16px; }
.win__glyph:has(img), .win__glyph:has(.lucide) { opacity: 1; }
.win__rule { display: none; }
.win__controls { display: flex; gap: 1px; flex: 0 0 auto; margin-left: 6px; }
/* only the close button shows — bare glyph, ember on hover */
.win__btn { width: 30px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 13px; font-weight: 700; line-height: 1; color: var(--bar-ink); background: none; border: 0; }
.win__btn[data-act="min"], .win__btn[data-act="max"] { display: none; }
.win__btn .lucide { width: 15px; height: 15px; }
.win__btn--close { margin-left: 3px; }
.win__btn--close:hover { color: var(--ember); }
/* windows are not resizable — no grip */
.win__grip { display: none; }

/* body — transparent so the pixel surface shows through; sand content tokens */
.win__body, .browser__view {
  --fg: #2B2117; --fg-dim: #5A4C3B; --muted: #8C7C66; --amber: #9a5a2a;
  --win: #EFE7D6; --win-raised: #E6DDC8;
  --hair: rgba(70,52,33,0.16); --line: rgba(70,52,33,0.30);
}
.win__body {
  flex: 1 1 auto; min-height: 0; overflow: visible;
  padding: 22px 24px 26px; background: transparent; color: var(--w98-ink);
}
.win--browser .win__body { padding: 0; }
.win--app .win__body { padding: 0; overflow: hidden; background: #0e0c0a; }
/* in-window buttons run a touch tighter than the desktop (widget) ones;
   vertical padding stays asymmetric so the pixel label sits optically centred */
.win__body .btn, .browser__view .btn { padding: 10px 14px 6px; }
.win__iframe { width: 100%; height: 100%; border: 0; display: block; background: #0e0c0a; }
.win-loading {
  display: flex; align-items: center; justify-content: center; height: 100%;
  min-height: 80px; padding: 24px; color: var(--w98-shadow);
  font-family: var(--mono); font-size: var(--t-sm);
}

/* =========================================================
   FAUX BROWSER chrome (dormant — wired in wm.js for kind:'browser')
   ========================================================= */
.browser { display: flex; flex-direction: column; height: 100%; }
.browser__bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--w98-face); box-shadow: inset 0 -1px 0 var(--w98-shadow);
  font-family: var(--mono); font-size: var(--t-sm);
  --fg: var(--w98-ink); --fg-dim: #5A4C3B; --muted: #8A7B63;
}
.browser__nav { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.browser__nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.browser__nav img { width: 15px; height: 15px; object-fit: contain; vertical-align: -2px; }
.browser__url {
  flex: 1; display: flex; align-items: center; gap: 7px; padding: 4px 10px; color: var(--fg-dim);
  background: var(--w98-client); border: 1px solid var(--line-w);
}
.browser__url .lock { color: var(--live); }
.browser__url .host { color: var(--fg); }
.browser__url .path { color: var(--muted); }
.browser__fav { width: 16px; height: 16px; flex: 0 0 auto; object-fit: contain; }
.browser__view { flex: 1 1 auto; overflow: auto; padding: 30px 30px 34px; }

/* =========================================================
   WINDOW CONTENT — shared section typography (sand interior)
   ========================================================= */
.sec { display: flex; flex-direction: column; gap: 16px; max-width: 60ch; }
.sec--wide { max-width: 78ch; }
.eyebrow {
  font-family: var(--mono); font-weight: 700; font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--clay); margin: 0 0 4px;
}
/* window/section titles — one pixel style across every window.
   RittswoodRedStar is an 8px-grid bitmap face: it only lands exactly on the
   device pixels at integer sizes that are multiples of 8, with integer tracking
   and line-height. Fixed 32px (24 on mobile) keeps it razor-crisp, not the
   fractional sizes a clamp() would produce. */
.h-disp, .proj-win__name, .rev-win__name {
  font-family: 'RittswoodRedStar', 'Press Start 2P', monospace; font-weight: 700;
  text-transform: uppercase; color: var(--w98-ink);
  font-size: 32px; line-height: 1.25; letter-spacing: 2px; margin: 0 0 8px;
}
/* content sub-headings (course name · principle title) — one Handjet size */
.struct__name, .principle__h {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--w98-ink);
  font-size: 34px; line-height: 1.08; margin: 0 0 8px;
}
.h1 { font-size: 64px; line-height: 1.0; }
.h2 { font-size: var(--t-h2); }
.h3 { font-size: var(--t-h3); }
.lead { font-family: var(--sans); color: var(--fg-dim); font-size: 16px; line-height: 1.58; max-width: 62ch; }
.body, .principle__body, .struct__desc, .rev-win__text, .review__text, .project__desc {
  font-family: var(--sans); color: var(--fg-dim); font-size: 14.5px; line-height: 1.62;
}
.body, .principle__body { max-width: 56ch; }
.hr { height: 1px; background: var(--hair); border: 0; margin: 4px 0; }
.num { color: var(--amber); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* drop the leading eyebrow at the very top of a window (КУРСИ, ВІДГУКИ…). */
.win__body > .sec:first-child > .eyebrow:first-child,
.win__body > .prin-head:first-child > .eyebrow:first-child,
.win__body > .proj-win:first-child .proj-win__head > .eyebrow:first-child { display: none; }

/* terminal block */
.term {
  font-family: var(--mono); font-size: var(--t-mono); line-height: 1.7; color: var(--fg-dim);
  padding: 12px 15px; align-self: flex-start; border: 1px solid var(--hair);
  background: var(--win-raised); max-width: 46ch; white-space: pre-wrap;
}
.term .p { color: var(--clay); }
.term .o { color: var(--muted); }
.term .live { color: var(--live); }

/* tag chips */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: var(--t-xs); color: var(--fg-dim);
  padding: 5px 10px; border: 1px solid var(--hair); background: var(--win-raised);
}

/* button row */
.btnrow { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 2px; }

/* label:value spec rows — installment terms, legal characteristics */
.specs { display: flex; flex-direction: column; gap: 8px; max-width: 60ch; }
.specs__h {
  font-family: var(--mono); font-weight: 700; font-size: var(--t-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.specs__list { display: flex; flex-direction: column; }
.specs__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 9px 0; border-top: 1px solid var(--hair);
}
.specs__row dt { font-family: var(--sans); font-size: var(--t-sm); color: var(--fg-dim); margin: 0; }
.specs__row dd { font-family: var(--mono); font-size: var(--t-sm); color: var(--w98-ink); margin: 0; text-align: right; }

/* =========================================================
   ABOUT window (md.academy.url) — what it is / why / what you get.
   Scoped to .about-intro so no other window is affected.
   ========================================================= */
.about-intro { display: flex; flex-direction: column; align-items: stretch; gap: 18px; width: 100%; max-width: none; }
.about-intro .eyebrow { margin: 0; }
/* headline set in the pixel button face (RittswoodRedStar), full width, no forced break */
.about-intro .h1 { font-family: 'RittswoodRedStar', 'Press Start 2P', monospace; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: clamp(17px, 2.6vw, 23px); line-height: 1.35; color: var(--w98-ink); margin: 0; }
.about-intro .lead { margin: 0; max-width: none; }
.about-points { list-style: none; display: flex; flex-direction: column; gap: 28px; width: 100%; margin: 4px 0 0; padding: 0; }
.about-points--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; }
.about-point { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.about-point__ico { width: 40px; height: 40px; object-fit: contain; image-rendering: auto; margin-top: 2px; }
.about-point__tx { min-width: 0; }
.about-point__h { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; font-size: 21px; line-height: 1.1; color: var(--w98-ink); margin: 0 0 3px; }
.about-point__b { font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--fg-dim); margin: 0; max-width: none; }
.about-intro .btnrow { margin-top: 4px; }
.about-meta { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.04em; color: var(--muted); margin: 0; }

/* =========================================================
   PRINCIPLES — icon + big heading rows, no divider lines
   ========================================================= */
.prin-head { margin-bottom: 6px; }
.prin-title {
  font-family: 'RittswoodRedStar', monospace; text-transform: uppercase;
  font-size: 24px; letter-spacing: 2px; line-height: 1.25;
  margin: 0 0 8px; text-wrap: balance;
}
.principles { display: flex; flex-direction: column; }
.principle { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start; padding: 20px 2px; }
.principle__ico { width: 44px; height: 44px; object-fit: contain; image-rendering: auto; margin-top: 2px; }
.principle__tx { min-width: 0; }
.principle__body--lead { color: var(--fg); }
.principle__tx .talks { margin-top: 13px; }
.principle__tx .btn { margin-top: 16px; }

/* =========================================================
   COURSES — two course specs stacked, divided by a hairline.
   No surface, no frame: just the rule between them. CTA is the
   standard site button component; meta line reads all in clay.
   ========================================================= */
.structs { display: flex; flex-direction: column; }
.struct {
  position: relative; padding: 22px 0; display: flex; flex-direction: column; gap: 11px;
  background: none; box-shadow: none; border: 0;
}
.struct:first-child { padding-top: 4px; }
.struct + .struct { border-top: 1px solid var(--hair); }
.struct__id, .struct__phases { display: none; }
/* sessions · duration · price — one orange line */
.struct__meta, .struct__meta .num { font-family: var(--mono); font-size: var(--t-sm); color: var(--clay); }

/* =========================================================
   REVIEWS — Windows Explorer "Details" view
   ========================================================= */
.explorer { font-family: var(--mono); font-size: var(--t-xs); }
.explorer__rows { display: flex; flex-direction: column; }
.explorer__row {
  display: grid; grid-template-columns: 50px 1fr 1.25fr; align-items: center;
  width: 100%; padding: 0; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--hair);
  color: var(--fg-dim);
}
.explorer__rows li:last-child .explorer__row { border-bottom: 0; }
.explorer__cell { padding: 13px 10px 13px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.explorer__cell--ico { padding: 11px 0; display: flex; }
.explorer__cell--ico img {
  width: 38px; height: 38px; object-fit: cover; display: block;
  border: 0;
}
.explorer__cell--name { color: var(--fg); font-size: var(--t-sm); }
.explorer__cell--role { color: var(--muted); }

/* review card (list variant) */
.reviews { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.review { padding: 16px; background: var(--w98-client); box-shadow: var(--w98-sunken); display: flex; flex-direction: column; gap: 9px; }
.review__who { font-family: var(--mono); font-size: var(--t-sm); color: var(--clay-soft); }
.review__role { color: var(--muted); }

/* single review window */
.rev-win { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.rev-win__ph { width: 128px; height: 128px; flex: 0 0 auto; object-fit: cover; border: 0; }
.rev-win__name { margin: 0; }
.rev-win__role { font-family: var(--mono); font-size: var(--t-xs); color: var(--clay); margin-top: 4px; }
.rev-win__role a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rev-win__role a:hover { color: var(--clay-soft); }
.rev-win__text { margin-top: 18px; }

/* =========================================================
   AUTHOR — 2-column ID card (left) + content (right)
   ========================================================= */
.profile { display: grid; gap: 18px; grid-template-columns: minmax(0,1fr); }
.profile--2col { grid-template-columns: minmax(0, 264px) minmax(0, 1fr); gap: 32px; align-items: start; }
.profile__id { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.profile__id .eyebrow { margin: 0; }
.profile__id .prin-title { margin: 0 0 4px; font-size: 32px; line-height: 1.25; letter-spacing: 2px; }
.profile__photo {
  order: -1; flex: 0 0 auto;
  width: 100%; max-width: 264px; aspect-ratio: 1 / 1; height: auto;
  object-fit: cover; margin: 0 0 6px; border: 0; box-shadow: none;
}
.profile__sub { font-family: var(--mono); font-size: var(--t-sm); color: var(--clay); letter-spacing: 0.02em; margin: 0; }
.profile__main { display: flex; flex-direction: column; gap: 0; min-width: 0; }

/* press / talks — a divided index, not cards */
.talks { display: flex; flex-direction: column; }
.talks .eyebrow { margin-bottom: 6px; }
.talk { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hair); text-decoration: none; }
.talk:last-child { border-bottom: 1px solid var(--hair); }
.talk__t { font-family: var(--sans); font-size: var(--t-sm); color: var(--fg-dim); line-height: 1.4; transition: color .25s ease; }
.talk__go { font-family: var(--mono); font-size: 14px; color: var(--muted); transition: color .25s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
.talk:hover .talk__t { color: var(--fg); }
.talk:hover .talk__go { color: var(--clay); transform: translate(3px, -3px); }

/* =========================================================
   PROJECTS — folder icon grid + single-project window (name only)
   ========================================================= */
.projects { display: flex; flex-direction: column; }
.project { padding: 15px 0; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
.project:last-child { border-bottom: 1px solid var(--hair); }
.project__h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.project__name { font-family: var(--mono); font-size: var(--t-body); color: var(--fg); letter-spacing: 0.02em; }
.project__year { font-family: var(--mono); font-size: var(--t-xs); color: var(--clay); }
.project__meta { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); }
.folder { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 4px; padding: 2px; justify-content: start; }
.folder__item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: 96px; padding: 11px 4px 9px; text-align: center;
  border: 1px solid transparent; background: none; color: var(--fg-dim); text-decoration: none;
}
.folder__item:active { background: rgba(var(--clay-rgb),0.18); }
.folder__item img { width: 32px; height: 32px; object-fit: contain; image-rendering: auto; }
.folder__item span { font-family: var(--mono); font-size: var(--t-xs); line-height: 1.25; word-break: break-word; color: var(--fg-dim); text-decoration: none; }
.proj-win { display: flex; align-items: center; gap: 14px; }
.proj-win__ico { display: none; }
.proj-win + .body, .proj-win + .project__meta { margin-top: 14px; }

/* =========================================================
   CONTACTS / footer columns
   ========================================================= */
.cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); }
.col__h { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }
.col a, .col__item { display: block; font-family: var(--mono); font-size: var(--t-sm); color: var(--fg-dim); padding: 3px 0; text-decoration: none; text-align: left; }
.col a:hover { color: var(--clay-soft); }
.col__item.is-soon { color: var(--muted); }

/* content rhythm between a header and the block that follows it */
.body + .btnrow, .project__meta + .btnrow, .rev-win__text + .btnrow { margin-top: 18px; }
.sec + .structs, .sec + .principles, .sec + .reviews, .sec + .projects,
.sec--wide + .cols, .sec + .cols, .sec + .explorer, .sec + .folder,
.sec--wide + .explorer, .sec--wide + .folder, .sec + .specs { margin-top: 14px; }
.specs + .body { margin-top: 14px; }

/* =========================================================
   BUTTON — one clay pill, reused in every window
   ========================================================= */
.btn, .btn--primary, .struct__cta, .widget__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  align-self: flex-start; width: auto; flex: 0 0 auto;
  font-family: 'RittswoodRedStar', 'Press Start 2P', monospace; font-size: var(--t-sm); font-weight: 700;
  letter-spacing: 0.09em; line-height: 1.4; text-transform: uppercase; text-decoration: none;
  padding: 12px 18px 8px; min-height: 0; white-space: nowrap; cursor: pointer;
  color: #fff; background: var(--clay); border: 0; border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.30); clip-path: var(--pixel-corner-sm);
  transition: background .16s var(--ease), color .16s, transform .12s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover, .btn--primary:hover, .struct__cta:hover, .widget__cta:hover {
  background: var(--clay-soft); color: #fff; transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(var(--clay-rgb),0.55), 0 2px 4px rgba(0,0,0,0.30);
}
.btn:active, .btn--primary:active, .struct__cta:active, .widget__cta:active {
  transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* black variant — monobank "buy in installments" CTA */
.btn--mono { background: var(--desktop); color: #fff; }
.btn--mono:hover { background: #2E2E2E; color: #fff; }
.btn--mono:active { background: #000; }
.btn--mono .mono-badge { height: 13px; width: auto; display: block; filter: brightness(0) invert(1); }

/* =========================================================
   CHAST CHECKOUT — phone-number form inside the installment window
   ========================================================= */
.chast-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 52ch; margin-top: 4px; }
.chast-form__input {
  width: 100%; font-family: var(--sans); font-size: 14.5px; color: var(--w98-ink);
  background: var(--w98-client); border: 1px solid var(--line-w);
  padding: 10px 12px; clip-path: var(--pixel-corner-sm);
}
.chast-form__input:focus-visible { outline: 1px dotted var(--w98-ink); outline-offset: -3px; }
.chast-form__status { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--fg-dim); min-height: 1.4em; margin: 0; }
.chast-form__status.is-ok { color: var(--live); }
.chast-form__status.is-err { color: var(--ember); }

/* =========================================================
   DOCK — authentic Windows-98 taskbar (flat sand skin)
   ========================================================= */
.dock {
  height: var(--dock-h); min-height: var(--dock-h);
  display: flex; align-items: center; gap: 0; padding: 2px;
  background: #e6dccb; border-top: 1px solid var(--line-w);
}
/* Start button + md monogram tile */
.dock__start {
  display: inline-flex; align-items: center; gap: 6px;
  height: calc(var(--dock-h) - 6px); padding: 0 9px 0 4px; margin-right: 3px; flex: 0 0 auto;
  font-family: 'Press Start 2P', monospace; font-size: 8px; font-weight: 700; line-height: 1.4;
  text-transform: uppercase; color: var(--w98-ink);
  background: transparent; border: 1px solid var(--line-w); clip-path: var(--pixel-corner-sm);
}
.dock__start:hover { background: rgba(74,56,36,0.10); }
.dock__start:active, .dock__start.is-pressed { background: #d8c9af; }
.dock__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 16px; flex: 0 0 auto;
  background: linear-gradient(180deg, var(--clay-soft), var(--clay-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.40), 0 0 0 1px rgba(0,0,0,0.32);
  clip-path: var(--pixel-corner-sm);
  transition: filter .14s var(--ease), transform .1s var(--ease);
}
.dock__logo b {
  font-family: 'Press Start 2P', monospace; font-size: 7px; line-height: 1; font-weight: 400;
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.28);
  /* Press Start 2P ink sits high-left in the em — nudge to optical centre */
  transform: translate(0.4px, 0.5px);
}
.dock__start:hover .dock__logo { filter: brightness(1.07); }
.dock__start:active .dock__logo, .dock__start.is-pressed .dock__logo { transform: translateY(1px); }
.dock__sep { width: 3px; align-self: stretch; margin: 3px 4px 4px; flex: 0 0 auto;
  background: var(--hair); border-left: 1px solid var(--w98-shadow); border-right: 1px solid var(--w98-hilite); }
/* task buttons */
.dock__items { display: flex; gap: 3px; flex: 1 1 auto; align-items: center; min-width: 0; overflow: hidden; padding-right: 4px; }
.dock__btn {
  display: flex; align-items: center; gap: 6px;
  height: calc(var(--dock-h) - 6px); flex: 0 1 162px; min-width: 42px; max-width: 162px;
  padding: 0 8px; font-family: 'Press Start 2P', monospace; font-size: 8px; line-height: 1.4;
  text-transform: uppercase; color: var(--w98-ink);
  background: transparent; border: 1px solid var(--line-w); clip-path: var(--pixel-corner-sm);
  text-align: left; white-space: nowrap; overflow: hidden;
}
.dock__btn:hover { background: rgba(74,56,36,0.10); }
.dock__btn:active { background: #d8c9af; }
.dock__ico { width: 16px; height: 16px; flex: 0 0 auto; object-fit: contain; image-rendering: auto; }
.dock__btn .g { flex: 0 0 auto; color: var(--clay); }
.dock__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dock__btn.is-min { opacity: 0.85; }
/* active task button — white, no border */
.dock__btn.is-active { background: #fff; color: var(--on-clay); border: 0; font-weight: 700; }
.dock__btn.is-active .g { color: var(--on-clay); }
.dock__btn.is-active .dock__label { position: relative; left: 1px; top: 1px; }
/* system tray + clock */
.dock__tray {
  flex: 0 0 auto; margin-left: 2px; display: flex; align-items: center; gap: 8px;
  height: calc(var(--dock-h) - 6px); padding: 0 9px; border: 1px solid var(--line-w);
  background: var(--w98-face); font-family: var(--sans); font-size: 12px; color: var(--w98-ink);
}
.dock__clock { font-family: 'Press Start 2P', monospace; font-size: 9px; line-height: 1; color: var(--w98-ink); letter-spacing: .02em; }
.dock .led { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 4px var(--live); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 6px var(--live); animation: blink 1.6s steps(2,jump-none) infinite; }

/* focus ring on chrome buttons — like 98's dotted focus */
.win__btn:focus-visible, .dock__btn:focus-visible, .dock__start:focus-visible,
.btn:focus-visible, .struct__cta:focus-visible { outline: 1px dotted var(--w98-ink); outline-offset: -4px; }

/* =========================================================
   START MENU
   ========================================================= */
.startmenu {
  position: fixed; left: 2px; bottom: calc(var(--dock-h) + 2px); z-index: 40;
  display: flex; min-width: 216px;
  background: var(--w98-face); border: 1px solid var(--line-w); box-shadow: 0 8px 22px rgba(0,0,0,0.30);
  font-family: var(--sans); color: var(--w98-ink);
}
.startmenu[hidden] { display: none; }
.startmenu.is-open { animation: startmenu-in 0.12s var(--ease) both; }
@keyframes startmenu-in { from { opacity: 0; transform: translateY(10px); } }
.startmenu__banner {
  flex: 0 0 30px; align-self: stretch; margin: 3px 0 3px 3px;
  background: linear-gradient(to top, var(--w98-ta1), #6e2f18);
  display: flex; align-items: flex-end; justify-content: center; padding: 10px 0;
}
.startmenu__banner span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.04em;
  color: var(--w98-tia); white-space: nowrap; text-transform: uppercase;
}
.startmenu__banner b { color: #f5c79a; }
.startmenu__list { flex: 1; list-style: none; margin: 0; padding: 3px; }
.startmenu__item {
  position: relative;
  display: flex; align-items: center; gap: 11px; padding: 6px 18px 6px 8px;
  cursor: pointer; white-space: nowrap; color: var(--w98-ink); font-size: 13px;
}
.startmenu__item:hover, .startmenu__item:focus-visible { background: var(--w98-ta1); color: var(--w98-tia); outline: none; }
.startmenu__ico { width: 24px; height: 24px; flex: 0 0 24px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.startmenu__ico img { width: 24px; height: 24px; object-fit: contain; image-rendering: auto; }
.startmenu__ico .lucide { width: 20px; height: 20px; }
.startmenu__sep { height: 0; margin: 4px 6px 4px 38px; border-top: 1px solid var(--w98-shadow); border-bottom: 1px solid var(--w98-hilite); }

/* cascading flyout (Projects / Reviews) */
.startmenu__arrow { margin-left: auto; padding-left: 14px; line-height: 1; opacity: 0.8; display: inline-flex; align-items: center; }
.startmenu__arrow .lucide { width: 14px; height: 14px; }
.startmenu__sub {
  position: absolute; left: 100%; bottom: -4px; z-index: 50;
  display: none; min-width: 184px; list-style: none; margin: 0; padding: 3px;
  background: var(--w98-face); border: 1px solid var(--line-w);
  box-shadow: 0 8px 22px rgba(0,0,0,0.30);
}
.startmenu__item--has:hover > .startmenu__sub,
.startmenu__item--has:focus-within > .startmenu__sub { display: block; }
.startmenu__subitem {
  display: flex; align-items: center; gap: 11px; padding: 6px 18px 6px 8px;
  cursor: pointer; white-space: nowrap; color: var(--w98-ink); font-size: 13px;
}
.startmenu__subitem:hover, .startmenu__subitem:focus-visible { background: var(--w98-ta1); color: var(--w98-tia); outline: none; }
.startmenu__subitem .startmenu__ico, .startmenu__subitem .startmenu__ico img { width: 20px; height: 20px; flex-basis: 20px; }

/* =========================================================
   CLAUDE MASCOT
   ========================================================= */
.claude-mascot {
  position: absolute; left: -6px; bottom: 100%; margin: 0 0 10px;
  height: 60px; width: auto; display: block; pointer-events: none;
  image-rendering: pixelated; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
  animation: mascot-bob 3.2s var(--ease) infinite;
}
.mascot-sticky {
  position: fixed; right: 14px; bottom: 0; width: 92px; height: auto;
  z-index: 500; pointer-events: none; image-rendering: pixelated;
  animation: mascot-bob 3.2s var(--ease) infinite;
}
@keyframes mascot-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (min-width: 721px) { .mascot-sticky { display: none; } }   /* desktop uses the hero mascot */

/* =========================================================
   WALLPAPER HERO — ported 1:1 from md-academy.design.
   Markup, CSS and animations lifted verbatim; the real-site palette
   is scoped to .stage so the original colours resolve.
   ========================================================= */
.stage {
  position: absolute; inset: 0; z-index: 1;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  --bg:#1a1411; --fg:#F5F1E8;
  --accent:#D97757; --accent-2:#B85A3E; --accent-3:#E89B7F; --accent-4:#CC785C;
  --ink:#1a0f0a; --muted:#A89E8F; --dim:#5C5048;
  --border:rgba(245,241,232,0.16); --border-s:rgba(245,241,232,0.16);
}
.hero{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,max-content);justify-content:center;gap:clamp(12px,1.4vw,26px);align-items:center;position:relative;min-height:100%;padding:30px 44px calc(var(--dock-h) + 28px) 44px}
@media (max-width:1040px){ .hero{grid-template-columns:1fr;justify-content:start} }

.kicker{font-size:11px;font-weight:700;letter-spacing:.22em;text-transform:uppercase;color:var(--accent);margin-bottom:28px;display:flex;align-items:center;gap:12px}
.kicker .bar{width:40px;height:2px;background:var(--accent)}
h1.hero-h{font-family:var(--display);font-weight:700;font-size:clamp(46px,6.4vw,124px);line-height:.9;letter-spacing:.01em;text-transform:uppercase;margin-bottom:32px;max-width:12ch;overflow-wrap:break-word;hyphens:none}
h1.hero-h .yl{color:var(--accent)}
.hero-lead{font-family:var(--sans);font-size:20px;line-height:1.65;color:var(--fg-dim);max-width:320px;margin-bottom:40px;letter-spacing:.01em}
.hero-lead b{color:var(--fg);font-weight:700}
.hero-side{display:flex;flex-direction:column;gap:18px;position:relative;width:100%;max-width:540px;justify-self:start}

/* hero headline — three words, chaotic offsets, staggered entrance */
.hero-h { display: flex; flex-direction: column; align-items: flex-start; max-width: none; }
.hw { position: relative; display: block; opacity: 0; transform: translateY(22px); animation: word-in .6s var(--ease) forwards; }
.hw1 { left: -48px; font-family: 'RittswoodRedStar', monospace; font-size: 0.31em; animation-delay: .14s; }   /* Академія */
.hw2 { left: -64px; font-size: 1.30em; animation-delay: .32s; }   /* дизайн */
.hw3 { left: 12px;  font-size: 1em; animation-delay: .52s; }      /* інженерів */
@keyframes word-in { to { opacity: 1; transform: none; } }

/* glitch back-plane (JS-populated) */
.hero-glitch{position:absolute;inset:0;z-index:0;pointer-events:none;user-select:none;overflow:hidden;font-family:monospace;font-weight:700;line-height:1.2;font-size:11px;opacity:0;animation:hg-in .5s ease-out .1s forwards}
@keyframes hg-in{to{opacity:1}}
.hero-glitch pre{position:absolute;margin:0;white-space:pre;color:rgba(var(--clay-rgb),.18)}

/* floating pills overlaid on the iMac (JS-positioned) */
.hero-pills{position:absolute;inset:0;pointer-events:none;z-index:5;font-family:monospace;font-weight:700;font-size:9px;letter-spacing:.04em;line-height:1}
.hero-pills .p{position:absolute;background:var(--bg);border:1px solid rgba(var(--clay-rgb),.5);color:#E89B7F;padding:4px 8px;white-space:nowrap;text-transform:uppercase;box-shadow:0 3px 10px rgba(0,0,0,.35);opacity:0;transform:scale(.6) rotate(var(--rot,0deg));animation:p-enter .55s cubic-bezier(.34,1.56,.64,1) forwards;animation-delay:var(--ed,0s)}
.hero-pills .p .acc{color:var(--accent)}
.hero-pills .p .ok{color:var(--live)}
.hero-pills .p .dim{color:var(--muted)}
@keyframes p-enter{0%{opacity:0;transform:scale(.6) rotate(var(--rot,0deg))}100%{opacity:1;transform:scale(1) rotate(var(--rot,0deg))}}
@keyframes p-bob{0%,100%{transform:translate(0,0) rotate(var(--rot,0deg));opacity:.92}50%{transform:translate(0,-3px) rotate(var(--rot,0deg));opacity:1}}

/* iMac monitor + terminal (typewriter + shimmer driven by hero.js) */
.hero-laptop{position:relative;z-index:1;font-family:monospace;font-weight:700;font-size:10px;line-height:1.1;color:rgba(var(--clay-rgb),.65);white-space:pre;letter-spacing:0;text-align:left;margin:0 auto 6px;display:block;font-variant-ligatures:none;font-feature-settings:"calt" 0,"liga" 0;opacity:0;animation:hl-in .6s ease-out .55s forwards}
@keyframes hl-in{to{opacity:1}}
.hero-laptop .rch{color:rgba(var(--clay-rgb),.75)}
.hero-laptop .acc{color:var(--accent)}
.hero-laptop .dim{color:rgba(245,241,232,.4)}
.hero-laptop .t-line{color:#E89B7F}
.hero-laptop .t-line .cc-prompt{color:#D97757;font-weight:700}
.hero-laptop .t-line .cc-ok{color:var(--live)}
.hero-laptop .t-line .cc-tool{color:#E89B7F;font-weight:800}
.hero-laptop .t-line .cc-cmd{color:var(--clay-soft)}
.hero-laptop .t-line .cc-flag{color:#A89E8F}
.hero-laptop .t-line .cc-num{color:var(--amber)}
.hero-laptop .t-line.l1{animation-delay:0s}
.hero-laptop .t-line.l2{animation-delay:.35s}
.hero-laptop .t-line.l3{animation-delay:.7s}
.hero-laptop .t-line.l4{animation-delay:1.05s}
.hero-laptop .t-line.l5{animation-delay:1.4s}
.hero-laptop .t-line.l6{animation-delay:1.75s}
.hero-laptop .t-line.l7{animation-delay:2.1s}
.hero-laptop .t-cursor{color:var(--accent);animation:t-blink 1.1s steps(1) infinite}
@keyframes t-pulse{0%,100%{opacity:.85}50%{opacity:1}}
@keyframes t-blink{0%,49%{opacity:1}50%,100%{opacity:0}}

/* hero text column — headline + lead side by side; iMac raised */
@media (min-width: 1041px) {
  .hero { justify-content: flex-start; padding-left: clamp(150px, 12vw, 270px); }
  .hero > div:first-child {
    transform: translateY(clamp(160px, 30vh, 400px));
    display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center;
    gap: 44px; max-width: none;
  }
  .hero > div:first-child .hero-lead { margin-bottom: 0; flex: 0 0 auto; }
  .hero-side { transform: translateY(-120px); }
}
/* wide desks (>=1680): ease the hero off hard-left (never centered) and let the
   text+iMac row breathe, so 1920+ reads composed instead of left-hugging. */
@media (min-width: 1680px) {
  .hero { padding-left: clamp(150px, 18vw, 520px); }
  .hero > div:first-child { gap: clamp(44px, 4.5vw, 104px); }
}
/* hero lead resting + reveal (no !important so the animation can drive transform) */
.hero-lead { transform: translate(-64px, -82px); animation: lead-in 0.7s var(--ease) 0.85s both; }
@keyframes lead-in {
  from { opacity: 0; transform: translate(-64px, -64px); }
  to   { opacity: 1; transform: translate(-64px, -82px); }
}

@media (max-width: 900px){ .hero-laptop{font-size:8.5px} }
@media (max-width: 420px){ .hero-laptop{font-size:6.5px;line-height:1.05} }

/* =========================================================
   STAGGERED REVEAL keyframes (icons / widgets / dock)
   ========================================================= */
@keyframes item-in   { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes sticky-in { from { opacity: 0; } to { opacity: 1; } }   /* opacity only — keep the paper's rotate */
@keyframes dock-up   { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* =========================================================
   MOBILE — desktop metaphor becomes a scrollable column
   hero → icon launcher grid → stacked widgets; windows open as
   bottom sheets; dock hidden. (!important here beats JS inline geometry.)
   ========================================================= */
@media (max-width: 720px) {
  .desktop {
    display: flex !important; flex-direction: column !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; padding-bottom: 8px !important;
  }
  .desktop::after { display: none !important; }

  /* hero */
  .stage { order: 0; position: static !important; }
  .hero-side { display: flex !important; }
  .hero-laptop { font-size: 6px !important; line-height: 1.05 !important; align-self: center; margin-top: -14px !important; }
  .claude-mascot { display: none !important; }
  .hero { padding: 20px 16px 16px !important; gap: 18px !important; }
  h1.hero-h { max-width: none; margin-bottom: 20px; }
  .hero-side { max-width: none; }
  .hero-pills { font-size: 8px; } .hero-pills .p { padding: 3px 6px; }
  .hero-h { display: block !important; text-align: center !important; white-space: nowrap !important; }
  .hero-h .hw { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hw1 { display: block !important; left: 0 !important; }
  .hw2, .hw3 { display: inline !important; left: 0 !important; font-size: clamp(24px, 8.4vw, 40px) !important; }
  .hero-lead { opacity: 1 !important; transform: none !important; animation: none !important; max-width: 100% !important; text-align: center !important; font-size: 12px !important; margin-top: -12px !important; margin-bottom: 24px !important; }
  .lead-br { display: inline !important; }

  /* icons → launcher grid */
  .icons {
    display: grid !important; position: static !important; inset: auto !important;
    order: 1; margin-top: auto !important; grid-template-columns: repeat(4, 1fr); gap: 4px;
    padding: 4px 10px 8px; pointer-events: auto; z-index: auto;
  }
  .icon {
    position: static !important; left: auto !important; top: auto !important;
    width: auto !important; opacity: 1 !important; animation: none !important;
    touch-action: auto !important; gap: 4px !important; padding: 6px 4px !important;
  }
  .icon:hover { background: none; border-color: transparent; }
  .icon__img { width: 34px !important; height: 34px !important; }
  .icon__label { font-size: 10px !important; }

  /* no taskbar on mobile */
  .dock { display: none !important; }

  /* widgets → bottom accordion deck */
  .widgets {
    position: static !important; order: 2; inset: auto !important;
    margin: 0 !important; padding: 0 8px 14px !important;
    height: auto !important; min-height: 0 !important;
    display: flex !important; flex-direction: column !important; justify-content: flex-end !important; gap: 0 !important;
    z-index: auto !important; pointer-events: auto !important;
    perspective: 1100px !important; perspective-origin: 50% 120% !important;
  }
  .widget__body {
    position: static !important;
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    gap: 12px !important; padding: 10px 18px 16px !important;
  }
  .widget__foot {
    display: flex !important; flex-wrap: nowrap !important; align-items: center !important;
    justify-content: flex-start !important; gap: 12px !important; width: 100% !important;
  }
  .widget__foot .btn { order: 1 !important; flex: 0 0 auto !important; font-size: 11px !important; padding: 9px 14px !important; letter-spacing: 0.05em !important; }
  .widget__meta {
    order: 2 !important; flex: 0 1 auto !important; min-width: 0 !important; position: static !important; margin: 0 !important;
    font-size: 13.5px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; text-align: left !important;
  }
  .m-full { display: none !important; }
  .m-short { display: inline !important; }
  .widget, .widget--1, .widget--2 {
    position: relative !important; left: auto !important; right: auto !important;
    top: auto !important; bottom: auto !important; width: auto !important;
    height: 150px !important; max-height: 150px !important;
    transform: none;
    opacity: 1 !important; animation: none !important; pointer-events: auto !important;
    touch-action: auto !important; cursor: pointer !important; overflow: hidden !important;
  }
  .widget:not(.is-up) {
    order: 1; z-index: 1 !important;
    margin: 0 0 -62px 0 !important;
    transform-style: preserve-3d !important; transform-origin: 50% 100% !important; backface-visibility: hidden !important;
    animation: card-to-back 640ms cubic-bezier(.33,.86,.34,1) 70ms both !important;
  }
  .widget.is-up {
    order: 2; z-index: 2 !important; margin: 0 !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
    transform-style: preserve-3d !important; transform-origin: 50% 100% !important; backface-visibility: hidden !important;
    animation: card-to-front 680ms cubic-bezier(.2,.74,.26,1) both !important;
  }
  .widget__title {
    white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
    font-size: clamp(20px, 6vw, 26px) !important; line-height: 1.12 !important; letter-spacing: 0 !important;
  }

  /* windows → bottom sheet */
  .windows { position: fixed !important; inset: 0 !important; z-index: 1000 !important; pointer-events: none; }
  .win {
    position: fixed !important; display: flex !important; flex-direction: column !important;
    top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: auto !important; max-width: none !important;
    max-height: 90vh !important; max-height: 90dvh !important; pointer-events: auto;
  }
  .win:not(.is-active) { display: none !important; }
  .win__grip { display: none !important; }
  .win__bar { flex: 0 0 auto !important; position: sticky !important; top: 0 !important; z-index: 2 !important; }
  .win__body {
    flex: 1 1 auto !important; min-height: 0 !important;
    overflow-y: auto !important; overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch; padding-left: 16px !important; padding-right: 16px !important;
  }
  .browser__view { padding-left: 16px; padding-right: 16px; }

  /* app / iframe windows (e.g. Таро) go full-bleed on mobile: full width + full height, no body gutters */
  .win--app {
    top: 0 !important; bottom: auto !important; height: 100dvh !important; max-height: 100dvh !important;
  }
  .win--app .win__body { padding: 0 !important; }

  /* reviews list → photo + (name over role) */
  .explorer__row {
    grid-template-columns: 40px 1fr !important; grid-template-rows: auto auto !important;
    align-items: center !important; padding: 6px 4px !important;
  }
  .explorer__cell--ico { grid-row: 1 / 3 !important; }
  .explorer__cell--name { grid-column: 2 !important; padding-bottom: 0 !important; }
  .explorer__cell--role { grid-column: 2 !important; padding-top: 0 !important; white-space: normal !important; font-size: var(--t-xs) !important; }

  /* projects / social folder grids */
  .folder { grid-template-columns: repeat(3, 1fr) !important; }

  /* author 2-column → single column */
  .profile--2col { grid-template-columns: 1fr !important; gap: 22px !important; }
  .profile__id .profile__photo { width: 110px; height: 110px; }

  /* pixel titles stay on the 8px grid at the smaller mobile step (24px) */
  .h-disp, .proj-win__name, .rev-win__name, .profile__id .prin-title { font-size: 24px !important; }
}
.m-short { display: none; }   /* desktop hides the short meta; mobile shows it */

/* mobile card-shuffle keyframes (deck cut) */
@keyframes card-to-front {
  0%   { transform: translateY(-30px) translateZ(0)    rotateX(0)     rotateZ(-2deg)  scale(1);    box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  26%  { transform: translateY(-50px) translateZ(120px) rotateX(15deg) rotateZ(4deg)   scale(1.05); box-shadow: 0 26px 50px rgba(0,0,0,.5); }
  52%  { transform: translateY(-40px) translateZ(140px) rotateX(13deg) rotateZ(2.4deg) scale(1.06); box-shadow: 0 30px 56px rgba(0,0,0,.52); }
  78%  { transform: translateY(6px)   translateZ(38px)  rotateX(3deg)  rotateZ(-1deg)  scale(1.012); box-shadow: 0 12px 30px rgba(0,0,0,.42); }
  100% { transform: translateY(0)     translateZ(0)     rotateX(0)     rotateZ(0)      scale(1);    box-shadow: 0 -10px 30px rgba(0,0,0,.4); }
}
@keyframes card-to-back {
  0%   { transform: translateY(24px) translateZ(0)    rotateX(0)     rotateZ(2deg)    scale(1);    filter: brightness(1); }
  34%  { transform: translateY(14px) translateZ(-95px) rotateX(-9deg) rotateZ(-3.2deg) scale(.94);  filter: brightness(.86); }
  62%  { transform: translateY(6px)  translateZ(-56px) rotateX(-5deg) rotateZ(-1.6deg) scale(.968); filter: brightness(.92); }
  100% { transform: translateY(0)    translateZ(0)    rotateX(0)     rotateZ(0)       scale(1);    filter: brightness(1); }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .led, .boot__cursor { animation: none; }
  .win, .os.is-on { animation: none; }
  .boot.is-off { transition: none; }
  .hw { opacity: 1; transform: none; animation: none; }
  .icon, .widget { opacity: 1 !important; animation: none !important; }
  .dock { animation: none !important; }
  .claude-mascot, .mascot-sticky { animation: none; }
  .hero-pills .p { animation: none !important; opacity: 1; transform: rotate(var(--rot,0deg)); }
  .hero-laptop, .hero-glitch { animation: none !important; opacity: 1; }
  .hero-laptop .t-line, .hero-laptop .t-cursor { animation: none !important; }
  .hero-lead { animation: none !important; opacity: 1; transform: translate(-64px, -82px); }
  .widget.is-up, .widget:not(.is-up) { animation: none !important; }
}
