/* Ирина Борискина — портфолио. Концепция «90-е»: тетрис, пазлы, CD, Paint, окна, тамагочи, досье */

:root {
  --t-fast: 160ms; --t-base: 450ms; --t-slow: 650ms; --ease-out: cubic-bezier(.25, 1, .5, 1);
  --white: #FFFFFF;
  --black: #000000;
  --gray: #F5F5F5;
  --pink: #E30097;
  --glow: #FFCEFF; /* обводка кнопок тамагочи — цвет автора */

  --pixel: "Press Start 2P", "Courier New", monospace;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 3vw, 44px);
  --max: 1560px;
  --bar: 54px;
  --b: 2px solid var(--black);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--bar);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--pink); color: var(--white); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.pink { color: var(--pink); }
.only-mob { display: none; }
@media (hover: none) { .only-mob { display: inline; } .only-desk { display: none; } }

/* ——— Типографика ——— */

.path {
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  margin: 0 0 20px; display: inline-block;
  background: var(--gray); padding: 4px 8px; border: var(--b);
}
.path--light { background: var(--black); color: var(--white); border-color: var(--white); }

.h1, .h2 { font-family: var(--pixel); font-weight: 400; text-transform: uppercase; margin: 0; letter-spacing: .01em; }
.h1 { font-size: clamp(24px, 3.15vw, 50px); line-height: 1.35; }
.br-desk { display: none; }
@media (min-width: 901px) { .br-desk { display: inline; } }
.h2 { font-size: clamp(18px, 2.2vw, 34px); line-height: 1.45; max-width: 28ch; }
.h1, .h2, h3 { text-wrap: balance; }
p, dd, blockquote { text-wrap: pretty; }
.h2--big { font-size: clamp(20px, 2.6vw, 40px); }
.lead { font-size: clamp(16px, 1.2vw, 19px); max-width: 60ch; margin: 28px 0 0; }

.section { padding: clamp(72px, 9vw, 140px) 0; }
.section--gray { background: var(--gray); }
.shead { margin-bottom: clamp(36px, 4vw, 60px); }

.draft-note { display: inline-block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border: 1px dashed currentColor; padding: 3px 7px; }

/* ——— Пиксельная кнопка-тетромино (референс: 21st.dev pixel-button) ——— */

.tbtn {
  --c: var(--black); --t: var(--white); --o: 12px;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 var(--o);
  padding: 15px 24px;
  font-family: var(--pixel); font-size: 12px; line-height: 1.3; text-transform: uppercase; text-align: center;
  color: var(--t); background: none; border: 0;
}
.tbtn::before, .tbtn::after {
  content: ""; position: absolute; left: 0; right: 0; height: 50%; z-index: -1;
  background: var(--c);
  transition: transform .16s steps(2);
}
.tbtn::before { top: 0; transform: translateX(var(--o)); }
.tbtn::after { bottom: 0; transform: translateX(calc(var(--o) * -1)); }
.tbtn:hover::before { transform: translateX(calc(var(--o) * -1)); }
.tbtn:hover::after { transform: translateX(var(--o)); }
.tbtn:active { transform: translateY(2px); }
.tbtn svg { width: 16px; height: 16px; flex: none; }
.tbtn--pink { --c: var(--pink); } /* белый на маджента — решение автора */
.tbtn--light { --c: var(--white); --t: var(--black); }
.tbtn--big { padding: 20px 30px; font-size: 13px; }
.tbtn[disabled] { opacity: .35; pointer-events: none; }

/* ——— Окна ——— */

.win { border: var(--b); background: var(--white); display: flex; flex-direction: column; }
.win__bar {
  display: flex; align-items: center; gap: 4px;
  background: var(--black); color: var(--white);
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  padding: 5px 6px 5px 10px; min-height: 30px;
}
.win__bar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__bar i { width: 16px; height: 16px; border: 2px solid var(--white); flex: none; position: relative; }
.win__bar i:last-child::before, .win__bar i:last-child::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 2px; background: var(--white); transform: translate(-50%, -50%) rotate(45deg); }
.win__bar i:last-child::after { transform: translate(-50%, -50%) rotate(-45deg); }
.win__bar i:nth-last-child(2)::before { content: ""; position: absolute; inset: 2px; border-top: 2px solid var(--white); }
.win__bar i:nth-last-child(3)::before { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 2px; background: var(--white); }
.win--pink { border-color: var(--pink); }
.win--pink .win__bar { background: var(--pink); }
.win--dark { background: var(--black); border-color: var(--white); }
.win--dark .win__bar { background: var(--white); color: var(--black); }
.win--dark .win__bar i { border-color: var(--black); }
.win--dark .win__bar i::before, .win--dark .win__bar i::after { background: var(--black) !important; border-color: var(--black) !important; }

/* ——— Панель задач ——— */

.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  height: var(--bar);
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px;
  background: var(--gray); border-top: var(--b);
}
.start {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  font-family: var(--pixel); font-size: 11px;
  background: var(--white); border: var(--b); box-shadow: 3px 3px 0 var(--black);
}
.start[aria-expanded="true"] { background: var(--black); color: var(--white); box-shadow: none; transform: translate(3px, 3px); }
.start__logo { width: 18px; height: 18px; background: conic-gradient(var(--pink) 0 25%, var(--black) 0 50%, var(--pink) 0 75%, var(--black) 0); }
.taskbar__tabs { display: flex; gap: 6px; flex: 1; overflow: hidden; }
.taskbar__tabs a {
  font-family: var(--mono); font-size: 13px; white-space: nowrap;
  height: 38px; display: inline-flex; align-items: center; padding: 0 12px;
  border: var(--b); background: var(--white);
  transition: background-color .15s, color .15s;
}
.taskbar__tabs a:hover, .taskbar__tabs a.is-on { background: var(--black); color: var(--white); }
.taskbar__tg { --o: 6px; padding: 11px 14px; font-size: 10px; }
.taskbar__clock { font-family: var(--mono); font-size: 13px; border: var(--b); height: 38px; display: inline-flex; align-items: center; padding: 0 10px; background: var(--white); }

.startmenu {
  position: absolute; left: 8px; bottom: calc(var(--bar) - 2px);
  display: flex; width: min(340px, calc(100vw - 16px));
  background: var(--white); border: var(--b); box-shadow: 6px -6px 0 var(--pink);
}
.startmenu__side {
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--black); color: var(--white);
  font-family: var(--pixel); font-size: 16px; padding: 12px 8px;
}
.startmenu__side b { color: var(--pink); font-weight: 400; }
.startmenu ul { list-style: none; margin: 0; padding: 6px; flex: 1; }
.startmenu a { display: block; padding: 10px 12px; font-family: var(--mono); font-size: 14px; }
.startmenu a:hover { background: var(--pink); color: var(--white); }
.startmenu .sep { height: 2px; background: var(--black); margin: 6px 0; }

/* ——— Первый экран ——— */

.hero {
  min-height: calc(100vh - var(--bar)); min-height: calc(100svh - var(--bar));
  display: flex; align-items: center;
  background-color: var(--white);
  background-image: linear-gradient(var(--gray) 2px, transparent 2px), linear-gradient(90deg, var(--gray) 2px, transparent 2px);
  background-size: 32px 32px;
  padding: clamp(32px, 5vw, 64px) 0;
}
.hero__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 72px); align-items: center; width: 100%; }
.hero__name { font-size: 14px; margin: 0 0 26px; }
.hero__lead { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.45; max-width: 30em; margin: 28px 0 0; }
.hero__btns { display: flex; flex-wrap: wrap; gap: 16px 8px; margin: 36px 0 0; }

.hero__side { position: relative; padding-top: clamp(110px, 10vw, 150px); max-width: 560px; justify-self: end; width: 100%; }
.win--tetris { box-shadow: 8px 8px 0 var(--black); }
.tetris { display: flex; gap: 12px; padding: 12px; background: var(--black); }
.tetris__field { position: relative; flex: 1; max-width: 300px; }
#tetris { width: 100%; aspect-ratio: 10 / 16; display: block; background: var(--black); border: 2px solid var(--white); }
.tetris__overlay {
  position: absolute; inset: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center;
  background: rgba(0, 0, 0, .82); color: var(--white); padding: 16px;
}
.tetris__overlay p { margin: 0; font-size: 13px; line-height: 1.5; }
.tetris__title { font-family: var(--pixel); font-size: clamp(14px, 1.4vw, 20px) !important; line-height: 1.6 !important; color: var(--pink); }
.tetris__overlay .tbtn { --o: 8px; }
.tetris__overlay #tStart { --c: var(--white); --t: var(--black); }
.tetris__overlay #tClaim { --c: var(--pink); --t: var(--white); }
.tetris__info { color: var(--white); display: flex; flex-direction: column; gap: 8px; font-size: 12px; width: 92px; flex: none; }
.tetris__info b { font-family: var(--pixel); font-weight: 400; font-size: 22px; color: var(--pink); line-height: 1.2; }
#tetrisNext { width: 64px; height: 64px; border: 2px solid var(--white); }
.discount { height: 12px; border: 2px solid var(--white); padding: 1px; }
.discount i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--pink) 0 4px, transparent 4px 5px); transition: width .3s steps(5); }
.tetris__keys { margin-top: auto; opacity: .7; line-height: 1.5; font-size: 11px; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 12px 12px; background: var(--black); border-top: 2px solid var(--black); }
.pad__btn { padding: 0; background: none; border: 0; display: grid; place-items: center; transition: transform .08s steps(2); }
.pad__btn img { width: 100%; max-width: 72px; height: auto; display: block; }
.pad__btn:hover img { filter: brightness(1.05); }
.pad__btn:active { transform: translateY(3px); }

.mascot { position: absolute; right: 90px; top: -12px; z-index: 3; width: clamp(140px, 13vw, 200px); background: none; border: 0; padding: 0; }
.mascot img { width: 100%; height: auto; image-rendering: pixelated; }
.mascot__bubble {
  position: absolute; right: 88%; top: 18px;
  background: var(--white); border: var(--b); padding: 8px 12px; font-size: 13px; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--pink);
  opacity: 0; transform: translateY(6px) scale(.9); transform-origin: right bottom; pointer-events: none;
  transition: opacity var(--t-fast) steps(2), transform var(--t-fast) steps(3);
}
.mascot__bubble.is-on { opacity: 1; transform: none; }

/* ——— Кейсы: настоящие пазлы с выступами и выемками ——— */

#cases { overflow-x: clip; } /* детали разлетаются за край, пока собираются, — страница не должна прокручиваться вбок */
.puzzle { display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 50px; }
.piece {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--white); border: var(--b);
  margin: 0 -1px -2px -1px;
}
.piece:hover { z-index: 6; }
.piece:hover h3 { color: var(--pink); }

.reveal { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--gray); border-bottom: var(--b); }
.reveal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.reveal img + img { opacity: 0; object-position: top; }
.reveal--single img { object-position: top; }
.reveal.is-b img:first-child { opacity: 0; }
.reveal.is-b img + img { opacity: 1; }
.reveal canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.reveal--sky { background: url("../img/work/ecopoint-sky.jpg") center / cover; }
.reveal--sky img:first-child { object-fit: contain; padding: 4% 6% 0; object-position: center bottom; }

.cup {
  position: absolute; left: 16px; top: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--black); color: var(--white); border: 2px solid var(--white);
  font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding: 6px 12px 6px 8px;
}
.cup svg { width: 22px; height: 22px; color: var(--pink); }

.piece__body { padding: 24px 28px 30px; display: grid; gap: 14px; align-content: start; }
.tag { justify-self: start; font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; border: var(--b); padding: 4px 8px; background: var(--gray); }
.visit { justify-self: start; margin-top: 4px; font-family: var(--mono); font-size: 14px; font-weight: 500; border-bottom: 2px solid var(--pink); }
.piece:hover .visit { background: var(--pink); color: var(--white); }

/* флагманские кейсы: картинка крупно, рядом история «задача → решение → результат» */
.piece--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.55fr 1fr; }
.piece--wide .reveal { aspect-ratio: auto; min-height: clamp(360px, 36vw, 560px); border-bottom: 0; border-right: var(--b); }
.piece--flip { grid-template-columns: 1fr 1.55fr; }
.piece--flip .reveal { order: 2; border-right: 0; border-left: var(--b); }
.piece--flip .cup { left: auto; right: 16px; }
.piece--wide .piece__body { align-content: center; padding: clamp(24px, 3vw, 44px); }
.piece--wide h3 { font-size: clamp(20px, 2.2vw, 32px); }
.story { margin: 6px 0 0; display: grid; gap: 14px; }
.story div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; align-items: baseline; border-top: 1px solid var(--black); padding-top: 12px; }
.story dt { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.story dt::before { content: ""; width: 8px; height: 8px; background: var(--pink); flex: none; }
.story dd { margin: 0; max-width: 40ch; }
.piece h3 { font-family: var(--pixel); font-weight: 400; text-transform: uppercase; font-size: clamp(15px, 1.5vw, 22px); line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.piece p { margin: 0; max-width: 34em; }

/* ——— Globenty ——— */

.cd { background: var(--black); color: var(--white); padding: clamp(72px, 9vw, 140px) 0; }
.cd__head { display: flex; gap: clamp(16px, 3vw, 48px); align-items: center; justify-content: space-between; }
.cd__disc { width: clamp(150px, 19vw, 280px); height: auto; flex: none; animation: spin 6s linear infinite; }
.cd__head:hover .cd__disc { animation-duration: 1.6s; }
@keyframes spin { to { transform: rotate(360deg); } }
.cd .lead { color: rgba(255, 255, 255, .85); }
.cd__grid { display: grid; grid-template-columns: .85fr 1.4fr; gap: clamp(20px, 3vw, 48px); align-items: start; }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .3); }
.tracks button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: baseline; text-align: left;
  background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .3);
  padding: 12px 8px; color: var(--white);
}
.tracks b { font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .6); font-weight: 500; }
.tracks strong { font-family: var(--pixel); font-weight: 400; font-size: 12px; text-transform: uppercase; line-height: 1.4; }
.tracks small { grid-column: 2; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .65); }
.tracks button:hover, .tracks button.is-on { background: var(--pink); color: var(--white); }
.tracks button:hover b, .tracks button:hover small, .tracks button.is-on b, .tracks button.is-on small { color: var(--white); }
.screen { background: var(--black); padding: 10px; }
.reveal--cd { border: 0; aspect-ratio: 16 / 10; }
.reveal--cd { background: var(--black); }
.reveal--cd img { object-position: top !important; }
.reveal--cd.is-photo img { object-position: center !important; }
.cd__info { border: 2px solid var(--white); border-top: 0; padding: 20px 22px 24px; display: grid; gap: 12px; justify-items: start; }
.cd__region { margin: 0; font-size: 13px; color: var(--white); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.cd__region::before { content: ""; width: 10px; height: 10px; background: var(--pink); flex: none; }
.cd__desc { margin: 0; font-size: 17px; max-width: 42em; }
.cd__info .tbtn { margin-top: 6px; }
.cd__more { font-family: var(--mono); font-size: 14px; border-bottom: 2px solid var(--pink); }
.cd__more:hover { background: var(--pink); color: var(--white); }

/* ——— Paint ——— */

.paint { box-shadow: 8px 8px 0 var(--black); }
.paint__menu { display: flex; gap: 18px; padding: 6px 12px; font-size: 13px; border-bottom: var(--b); background: var(--white); overflow-x: auto; }
.paint__menu span:first-letter { text-decoration: underline; }
.paint__body { display: grid; grid-template-columns: 210px 1fr; background: var(--gray); }
.paint__tools { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: var(--b); background: var(--white); }
.tool {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 6px 10px 6px 6px; background: var(--white); border: var(--b); box-shadow: 3px 3px 0 var(--black);
  font-family: var(--mono); font-size: 14px; font-weight: 500;
}
.tool__ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 2px solid currentColor; background: var(--white); color: var(--black); }
.tool__ico svg { width: 18px; height: 18px; fill: currentColor; }
.tool__img { width: 44px; height: 44px; flex: none; }
.tool.is-on .tool__img { filter: drop-shadow(0 0 0 var(--white)); }
.tool:hover { background: var(--gray); }
.tool.is-on { background: var(--pink); color: var(--white); box-shadow: none; transform: translate(3px, 3px); }
.viewer { margin: 10px; border: var(--b); background: var(--white); padding: 12px; display: grid; gap: 12px; }
.art { margin: 0; display: none; }
.art.is-active { display: block; animation: show .25s steps(4); }
@keyframes show { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.art img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(70vh, 640px); margin: 0 auto; border: var(--b); }
.art { text-align: center; }
.art figcaption { font-family: var(--mono); font-size: 14px; font-weight: 500; padding: 10px 2px 0; }
.viewer__nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.viewer__nav .tbtn { --o: 8px; padding: 14px 18px; }
.viewer__nav .mono { font-size: 14px; min-width: 4.5em; text-align: center; }
.paint__status { font-size: 12px; padding: 5px 10px; border-top: var(--b); background: var(--gray); }

/* ——— Архив: окна браузера ——— */

.windows { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 24px); }
.bwin { box-shadow: 5px 5px 0 var(--black); transition: transform .2s steps(3), box-shadow .2s steps(3); }
.bwin:hover, .bwin:focus-visible { transform: translate(-4px, -4px); box-shadow: 9px 9px 0 var(--pink); }
.bwin:hover .win__bar, .bwin:focus-visible .win__bar { background: var(--pink); }
.bwin__addr { display: flex; gap: 8px; align-items: center; padding: 4px 8px; font-size: 12px; border-bottom: var(--b); background: var(--gray); }
.bwin__addr span { flex: 1; background: var(--white); border: 1px solid var(--black); padding: 1px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bwin img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.bwin__info { display: grid; gap: 6px; justify-items: start; padding: 10px 10px 12px; border-top: var(--b); }
.bwin__info p { margin: 0; font-size: 15px; line-height: 1.35; }

/* ——— Тамагочи (этапы и финал) ——— */

.tama { position: relative; width: min(100%, 560px); justify-self: center; aspect-ratio: 1; }
.tama__body { width: 100%; height: 100%; mix-blend-mode: multiply; filter: brightness(1.04); } /* почти-белый фон картинки сливается с белой секцией */
.tama__screen {
  position: absolute; left: 31.8%; top: 34.2%; width: 35.4%; height: 29.8%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5%;
  background: var(--gray); overflow: hidden;
  background-image: linear-gradient(rgba(0, 0, 0, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .06) 1px, transparent 1px);
  background-size: 4px 4px;
}
.tama__screen img { height: 64%; width: auto; image-rendering: pixelated; }
.tama__msg { font-family: var(--pixel); font-size: clamp(6px, .62vw, 9px); line-height: 1.5; text-align: center; padding: 0 6%; }
.tama__btn { position: absolute; width: 9.5%; aspect-ratio: 1; border-radius: 50%; background: transparent; border: 0; padding: 0; transform: translate(-50%, -50%); z-index: 3; }
.tama__btn:hover, .tama__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--glow), 0 0 18px 7px rgba(255, 206, 255, .9); }
.tama__btn--l { left: 33.5%; top: 76.2%; }
.tama__btn--c { left: 49.6%; top: 77%; }
.tama__btn--r { left: 66%; top: 76.2%; }
/* подписи поверх напечатанных SELECT / DECIDE / CANCEL */
.tama__label {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  background: var(--white); padding: .5% 1%; min-width: 15%;
  font-family: var(--mono); font-weight: 600; font-size: clamp(11px, 1vw, 14px); line-height: 1.25; text-align: center; white-space: nowrap;
  pointer-events: none;
}
.tama__label--l { left: 33.5%; top: 85.8%; min-width: 13%; }
.tama__label--c { left: 49.6%; top: 85.8%; background: var(--pink); color: var(--white); }
.tama__label--r { left: 66%; top: 85.8%; min-width: 13%; }

.steps__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 72px); align-items: center; }
.steps__card { margin-top: 32px; border: var(--b); background: var(--white); box-shadow: 8px 8px 0 var(--black); }
.steps__label { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.h2--steps { max-width: none; }
.steps__body { padding: clamp(20px, 2.6vw, 34px); }
.steps__body h3 { font-family: var(--pixel); font-weight: 400; text-transform: uppercase; font-size: clamp(16px, 1.6vw, 24px); line-height: 1.45; margin: 0 0 16px; color: var(--black); }
.steps__body > p:not(.mono) { font-size: 18px; margin: 0; min-height: 4.5em; }
.progress { height: 24px; border: var(--b); padding: 3px; margin: 22px 0 14px; }
.progress__fill { height: 100%; width: 20%; background: repeating-linear-gradient(90deg, var(--pink) 0 14px, transparent 14px 18px); transition: width .4s steps(5); }
.steps__note { font-size: 12px; margin: 0; }
.steps__hint { font-size: 13px; margin: 22px 0 0; }

/* ——— Отзывы-папки ——— */

.folders { position: relative; height: 470px; display: flex; justify-content: center; touch-action: pan-y; user-select: none; }
.folder {
  position: absolute; top: 34px; width: min(540px, 86vw); height: 390px; margin: 0;
  background: var(--white); border: var(--b);
  padding: 26px 26px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transition: transform .5s var(--ease), opacity .4s, background-color .3s, color .3s;
  cursor: grab;
}
.folder__tab {
  position: absolute; left: -2px; top: -34px; height: 34px; max-width: 80%;
  display: flex; align-items: center; padding: 0 14px;
  background: inherit; border: var(--b); border-bottom: 0; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder blockquote { margin: 0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.45; }
.folder figcaption { display: flex; align-items: center; gap: 14px; font-family: var(--pixel); font-size: 11px; line-height: 1.5; text-transform: uppercase; color: var(--pink); }
.folder figcaption img { width: 64px; height: 64px; object-fit: cover; border: var(--b); flex: none; }
.folder.is-active { background: var(--black); color: var(--white); box-shadow: 10px 10px 0 var(--pink); cursor: default; }
.folder.is-active figcaption img { border-color: var(--white); }
.folders__nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 24px; }
.folders__nav .tbtn { --o: 8px; padding: 14px 18px; }

/* ——— Досье ——— */

.dossier { background: var(--black); color: var(--white); padding: clamp(72px, 9vw, 140px) 0; }
.dossier__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(18px, 3vw, 40px); align-items: start; }
.file { background: var(--black); color: var(--white); }
.file__body { padding: 24px 26px 8px; font-size: 15px; line-height: 1.65; }
.file__body p { margin: 0 0 14px; }
.file__body b { color: var(--white); font-weight: 600; }
.file__body .pink { color: var(--white); background: var(--pink); padding: 8px 10px; margin-top: 4px; }
.file__body .pink b { color: var(--white); }
.file__cta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px 0 0; padding: 18px 26px; background: var(--pink); color: var(--white);
  font-family: var(--pixel); font-size: 13px; transition: background-color .15s, color .15s;
}
.file__cta svg { width: 24px; height: 24px; }
.file__cta:hover { background: var(--white); color: var(--black); }
.file .draft-note { margin: 14px 26px 18px; color: rgba(255, 255, 255, .7); }
.portrait { background: var(--black); }
.portrait__frame { position: relative; cursor: crosshair; }
.portrait__canvas { width: 100%; aspect-ratio: 4 / 5; display: block; }
.cam__rec { position: absolute; right: 12px; top: 10px; display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; text-shadow: 0 0 4px #000; }
.cam__rec i { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cam__time { position: absolute; left: 12px; top: 12px; font-size: 12px; text-shadow: 0 0 4px #000; }
.portrait__hint { position: absolute; left: 12px; bottom: 12px; background: var(--pink); color: var(--white); font-size: 12px; font-weight: 600; padding: 3px 8px; }

/* ——— Финал ——— */

.final { padding: clamp(72px, 9vw, 140px) 0; background: var(--white); border-top: var(--b); }
.final__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.final__sub { font-family: var(--pixel); font-size: clamp(12px, 1.2vw, 16px); line-height: 1.6; text-transform: uppercase; margin: 26px 0 0; display: inline-block; background: var(--black); color: var(--white); padding: 10px 14px; }
.final .tbtn { margin-top: 32px; }
.final__handle { font-size: 14px; margin: 16px 0 0; }
.stars { position: absolute; left: -25%; top: -30%; width: 150%; height: 130%; z-index: 4; pointer-events: none; }


.footer { background: var(--black); color: var(--white); padding: 20px 0 22px; font-size: 12px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; }
.footer a:hover { color: var(--pink); }

/* ——— Адаптив ——— */

@media (max-width: 1180px) {
  .taskbar__tabs { display: none; }
  .taskbar { justify-content: space-between; }
}

@media (max-width: 900px) {
  .hero__grid, .cd__grid, .final__grid, .steps__grid, .dossier__grid { grid-template-columns: 1fr; }
  .windows { grid-template-columns: repeat(2, 1fr); }
  .hero__side { justify-self: center; max-width: 440px; }
  .puzzle { grid-template-columns: 1fr; }
  .piece--wide, .piece--flip { grid-template-columns: 1fr; }
  .piece--wide .reveal, .piece--flip .reveal { order: 0; min-height: 0; aspect-ratio: 16 / 10; border: 0; border-bottom: var(--b); }
  .piece--flip .cup { right: auto; left: 16px; }
  .story div { grid-template-columns: 1fr; gap: 4px; }
  .dossier__grid .portrait { max-width: 480px; }
  /* Globenty на телефоне: экран и описание над треклистом, чтобы выбранный сайт было видно сразу */
  .cd__right { display: contents; }
  .cd__right .win { order: 1; }
  .tracks { order: 2; }
  .cd__info { order: 3; border-top: 2px solid var(--white); }
  .cd__grid { gap: 14px; }
  .tracks { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-top: 0; margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px 0; scrollbar-width: none; }
  .tracks::-webkit-scrollbar { display: none; }
  .tracks li { flex: 0 0 auto; scroll-snap-align: start; }
  .tracks button { width: 200px; height: 100%; border: 1px solid rgba(255, 255, 255, .35); grid-template-columns: 26px 1fr; padding: 12px 10px; }
  /* на телефоне тамагочи стоит сразу над карточкой шага, чтобы кнопки и текст были рядом */
  .steps__text { display: contents; }
  .steps__text .path { order: 1; justify-self: start; }
  .steps__text .h2 { order: 2; }
  .steps__card { order: 3; margin-top: 0; }
  .tama--steps { order: 4; width: min(88%, 330px); margin-top: -6px; }
  .steps__hint { order: 5; margin-top: 0; }
  .steps__grid { gap: 20px; }
}

@media (max-width: 600px) {
  .taskbar__clock { display: none; }
  .windows { grid-template-columns: repeat(6, 78vw); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 14px 16px 0; margin-right: calc(var(--gutter) * -1); scrollbar-width: none; }
  .windows::-webkit-scrollbar { display: none; }
  .bwin { scroll-snap-align: start; }
  .hero__btns .tbtn { flex: 1 1 100%; }
  .hero__side { padding-top: 120px; }
  .mascot { width: 130px; right: 0; }
  .mascot__bubble { right: 82%; top: 8px; font-size: 12px; }
  .tetris { padding: 8px; gap: 8px; }
  .tetris__info { width: 72px; }
  .tetris__keys { display: none; }
  .cd__head { position: relative; padding-right: 92px; }
  .cd__disc { position: absolute; right: 0; top: 0; width: 84px; }
  .paint { box-shadow: 4px 4px 0 var(--black); }
  .paint__body { grid-template-columns: 1fr; }
  .paint__tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; padding: 10px 8px; border-right: 0; border-bottom: var(--b); }
  .tool { gap: 6px; padding: 5px 6px 5px 5px; font-size: 13px; min-width: 0; }
  .tool__img { width: 36px; height: 36px; }
  .paint__menu span:nth-child(n+5) { display: none; } /* «Параметры» и «Справка» не помещаются на телефоне */
  .viewer { margin: 8px; padding: 8px; }
  .folders { height: 520px; }
  .folder { height: 440px; padding: 22px 18px; }
  .tama__label { font-size: 11px; padding: 1px 4px; }
  .tama__btn { width: 44px; height: 44px; }
  .tama__msg { font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.final__next { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 10px; max-width: 46ch; }
.final__next li { counter-increment: n; display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; }
.final__next li::before { content: counter(n) "."; font-family: var(--pixel); font-size: 12px; color: var(--pink); }

/* ═══════════ Анимации: единая система (см. js/fx.js) ═══════════ */

.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; image-rendering: pixelated; }

/* Появление: текст — из лёгкого размытия, окна — «открываются» с масштабом. Пиксельную графику не размываем. */
.rv-blur { opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out), filter var(--t-base) var(--ease-out); transition-delay: var(--rv-d, 0ms); }
.rv-pop { opacity: 0; transform: translateY(12px) scale(.94); transition: opacity var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-out), box-shadow var(--t-slow) var(--ease-out); transition-delay: var(--rv-d, 0ms); }
.rv-pop.win, .rv-pop.steps__card { box-shadow: 0 0 0 transparent; }
.rv-blur.is-in, .rv-pop.is-in { opacity: 1; transform: none; filter: none; }
.rv-pop.is-in.win--tetris, .rv-pop.is-in.steps__card { box-shadow: 8px 8px 0 var(--black); }

/* Активное окно: заголовок розовый, тень глубже */
.win { transition: box-shadow var(--t-fast) steps(2); }
.win.is-focus .win__bar { background: var(--pink); color: var(--white); }
.win.is-focus { box-shadow: 8px 8px 0 var(--black), 0 0 0 3px var(--glow); }

/* Печать текста: мигающий курсор */
.is-typing::after { content: "▌"; margin-left: 1px; color: var(--pink); animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* Живой маскот: еле заметно «дышит» ступеньками, прыгает пиксельно */
.mascot.is-alive img, img.is-alive { animation: breathe 2.8s steps(2) infinite; transform-origin: 50% 100%; }
.mascot.is-jump img, img.is-jump { animation: jump .52s steps(6); }
@keyframes breathe { 50% { transform: translateY(2px) scaleY(.985); } }
@keyframes jump { 0%, 100% { transform: none; } 15% { transform: translateY(2px) scaleY(.94); } 45% { transform: translateY(-22px); } 70% { transform: translateY(-6px); } }
.mascot { cursor: pointer; }

/* Кнопки: выпуклые, при наведении — мягкое розовое свечение, при нажатии проседают */
.tbtn { transition: transform var(--t-fast) steps(2), filter var(--t-fast) steps(2); filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .9)); }
.tbtn:hover { filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .9)) drop-shadow(0 0 8px rgba(255, 206, 255, .95)); }
.tbtn:active { transform: translate(3px, 3px); filter: none; }
.tbtn--light { filter: drop-shadow(3px 3px 0 var(--pink)); }
.taskbar .tbtn, .taskbar .tbtn:hover { filter: none; }
.pad__btn:active img { filter: brightness(.92); }
.tool__img { transition: transform var(--t-fast) steps(2); }
.tool:hover .tool__img { transform: translateY(-2px); }

/* Тетрис: скидка подпрыгивает, окно празднует максимум */
#tDiscount { display: inline-block; }
#tDiscount.is-bump { animation: bump .3s steps(3); }
@keyframes bump { 40% { transform: translateY(-5px) scale(1.25); color: var(--white); } }
.win--tetris.is-max { animation: maxglow 2.4s steps(8); }
@keyframes maxglow { 0%, 100% { box-shadow: 8px 8px 0 var(--black); } 20%, 60% { box-shadow: 8px 8px 0 var(--pink), 0 0 0 4px var(--glow), 0 0 30px 6px rgba(255, 206, 255, .8); } 40%, 80% { box-shadow: 8px 8px 0 var(--black), 0 0 0 4px var(--pink); } }

/* Тамагочи: центральная кнопка мягко пульсирует, кнопки физически нажимаются, экран мерцает при смене шага */
.tama__btn { transition: transform 80ms steps(2); }
.tama__btn--c::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--glow), 0 0 22px 8px rgba(255, 206, 255, .9); opacity: 0; animation: neon 2.6s var(--ease-out) infinite; pointer-events: none; }
@keyframes neon { 0%, 100% { opacity: 0; } 45% { opacity: .85; } }
.tama__btn:active, .tama__btn.is-pressed { transform: translate(-50%, calc(-50% + 3px)) scale(.94); box-shadow: inset 0 0 0 40px rgba(227, 0, 151, .18), 0 0 0 3px var(--glow); }
.tama__screen.is-flicker > * { animation: flicker .36s steps(4); }
@keyframes flicker { 0% { opacity: 0; } 25% { opacity: .6; } 50% { opacity: .2; } 100% { opacity: 1; } }
.tama__msg.is-typing::after { content: "_"; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .rv-blur, .rv-pop { opacity: 1 !important; transform: none !important; filter: none !important; }
  .mascot__bubble.is-on { transform: none; }
  .fx-canvas { display: none; }
}
/* Сцены Reels: имитация наведения программным курсором */
.tama__btn.is-hover { box-shadow: 0 0 0 3px var(--glow), 0 0 18px 7px rgba(255, 206, 255, .9); }
.tbtn.is-hover { filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .9)) drop-shadow(0 0 8px rgba(255, 206, 255, .95)); }
.tbtn.is-hover::before { transform: translateX(calc(var(--o) * -1)); }
.tbtn.is-hover::after { transform: translateX(var(--o)); }

/* ═══════════ Конверсия: готовые фразы, подбор сайта, «Читать кейс» ═══════════ */

.fx-toast { position: fixed; left: 50%; bottom: calc(var(--bar) + 14px); z-index: 90; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  background: var(--black); color: var(--white); border: 2px solid var(--pink); padding: 10px 14px; font-size: 13px; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity var(--t-fast) steps(2), transform var(--t-fast) steps(2); }
.fx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; max-width: 560px; }
.chips__title { flex-basis: 100%; margin: 0 0 4px; font-size: 13px; }
.chip { font-size: 13px; padding: 7px 11px; border: var(--b); background: var(--white); box-shadow: 3px 3px 0 var(--black); transition: transform var(--t-fast) steps(2), box-shadow var(--t-fast) steps(2), background-color var(--t-fast) steps(2); }
.chip:hover { background: var(--pink); color: var(--white); }
.chip:active { transform: translate(3px, 3px); box-shadow: none; }

.visits { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; margin-top: 4px; }
.visits .visit { margin-top: 0; }
.case-more { font-family: var(--mono); font-size: 14px; font-weight: 500; background: var(--black); color: var(--white); padding: 2px 8px; cursor: pointer; }
.case-more:hover, .case-more:focus-visible { background: var(--pink); }

.quiz__win { max-width: 1040px; box-shadow: 8px 8px 0 var(--black); }
.quiz__body { display: grid; grid-template-columns: 240px 1fr; min-height: 380px; }
.quiz__side { border-right: var(--b); padding: 22px; display: flex; flex-direction: column; gap: 14px; background: var(--white); }
.quiz__screen { aspect-ratio: 1; display: grid; place-items: center; border: var(--b); background: var(--gray);
  background-image: linear-gradient(rgba(0, 0, 0, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .06) 1px, transparent 1px); background-size: 4px 4px; }
.quiz__screen img { width: 66%; height: auto; image-rendering: pixelated; }
.quiz__step { margin: 0; font-size: 13px; }
.quiz__bar { height: 14px; border: var(--b); padding: 2px; }
.quiz__bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--pink) 0 6px, transparent 6px 8px); transition: width .3s steps(6); }
.quiz__main { padding: clamp(22px, 3vw, 36px); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.quiz__q { font-family: var(--pixel); font-size: clamp(13px, 1.2vw, 17px); line-height: 1.6; text-transform: uppercase; margin: 0; }
.quiz__opts { display: grid; gap: 10px; width: 100%; }
.quiz__opt { display: flex; gap: 14px; align-items: center; text-align: left; font-size: 16px; padding: 12px 14px; background: var(--white); border: var(--b); box-shadow: 3px 3px 0 var(--black);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2), background-color var(--t-fast) steps(2); }
.quiz__opt b { font-family: var(--pixel); font-weight: 400; font-size: 11px; width: 26px; height: 26px; display: grid; place-items: center; border: var(--b); flex: none; }
.quiz__opt:hover { background: var(--gray); }
.quiz__opt:hover b, .quiz__opt.is-on b { background: var(--pink); color: var(--white); border-color: var(--pink); }
.quiz__opt:active, .quiz__opt.is-on { transform: translate(3px, 3px); box-shadow: none; }
.quiz__back { background: none; border: 0; padding: 0; font-size: 13px; border-bottom: 1px solid currentColor; }
.quiz__back:hover { color: var(--pink); }
.quiz__kicker { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.quiz__result { font-family: var(--pixel); font-size: clamp(18px, 2vw, 28px); line-height: 1.4; text-transform: uppercase; color: var(--pink); margin: 0; }
.quiz__text { margin: 0; max-width: 52ch; font-size: 17px; }
.quiz__text a { border-bottom: 2px solid var(--pink); }
.quiz__main .tbtn { margin-top: 8px; }
.quiz__note { margin: 0; font-size: 12px; }

@media (max-width: 700px) {
  .quiz__body { grid-template-columns: 1fr; }
  .quiz__side { border-right: 0; border-bottom: var(--b); flex-direction: row; align-items: center; flex-wrap: wrap; padding: 14px 16px; }
  .quiz__screen { width: 76px; }
  .quiz__step { flex: 1; }
  .quiz__bar { flex-basis: 100%; }
  .quiz__opt { font-size: 15px; }
}

/* ——— Частые вопросы: окно «Справка» с раскрывающимися пунктами ——— */
.faq__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
.faq .shead .tbtn { margin-top: 28px; }
.faq__win { box-shadow: 8px 8px 0 var(--black); }
.faq__item + .faq__item { border-top: var(--b); }
.faq__item summary { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 22px; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__n { font-size: 13px; color: var(--pink); }
.faq__q { font-size: 18px; font-weight: 600; line-height: 1.35; }
.faq__x { width: 22px; height: 22px; border: var(--b); position: relative; flex: none; }
.faq__x::before, .faq__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: currentColor; transform: translate(-50%, -50%); }
.faq__x::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__item[open] .faq__x { background: var(--pink); border-color: var(--pink); color: var(--white); }
.faq__item[open] .faq__x::after { display: none; }
.faq__item summary:hover .faq__q { color: var(--pink); }
.faq__item p { margin: 0; padding: 0 22px 20px 55px; max-width: 64ch; }
.faq__item[open] p { animation: faqIn var(--t-base) var(--ease-out); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 900px) { .faq__grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .faq__item summary { padding: 16px; gap: 12px; } .faq__q { font-size: 16px; } .faq__item p { padding: 0 16px 18px; } }
