/* Мера — психологические и интеллектуальные тесты. Минимализм: одна колонка, один акцент, отступы по шкале 8 px. */
:root {
  --bg: #f5f4f0; --ink: #0e0e0e; --mute: #75736d; --line: rgba(14, 14, 14, .1); --soft: rgba(14, 14, 14, .04);
  --acc: #2b3cff; --acc-ink: #fff; --warn: #c2410c;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 104px;
  --pad: clamp(20px, 5vw, 48px); --col: 760px;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --f: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0c0d; --ink: #f1f0ec; --mute: #8d8b85; --line: rgba(241, 240, 236, .12); --soft: rgba(241, 240, 236, .05);
    --acc: #8c97ff; --acc-ink: #0c0c0d; --warn: #fb923c; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--f); -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--acc); color: var(--acc-ink); }
.num { font-variant-numeric: tabular-nums; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) var(--pad); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.brand { font-weight: 650; letter-spacing: -.02em; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); display: block; transition: transform .6s var(--ease); }
.brand:hover i { transform: scale(1.6); }
.top nav { display: flex; gap: var(--s4); font-size: 15px; color: var(--mute); }
.top nav a { position: relative; padding: var(--s1) 0; transition: color .3s; }
.top nav a:hover, .top nav a.on { color: var(--ink); }
.bar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; background: var(--acc); transform-origin: 0 50%;
  transform: scaleX(0); transition: transform .6s var(--ease); z-index: 20; }

main { flex: 1; width: 100%; max-width: calc(var(--col) + 2 * var(--pad)); margin: 0 auto; padding: var(--s5) var(--pad) var(--s7); }
.view { will-change: transform, opacity, filter; }

/* типографика */
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: var(--s3); }
h1.hero { font-size: clamp(64px, 15vw, 148px); line-height: .9; letter-spacing: -.055em; font-weight: 650; margin: var(--s5) 0 var(--s4); }
h1.hero span { display: inline-block; }
h1.title { font-size: clamp(40px, 7.5vw, 76px); line-height: 1; letter-spacing: -.045em; font-weight: 650; margin-bottom: var(--s4); }
.lead { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.45; color: var(--mute); max-width: 34em; }
.lead b { color: var(--ink); font-weight: 500; }
.small { font-size: 14px; color: var(--mute); line-height: 1.55; }

/* фильтры */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s6) 0 var(--s3); position: relative; }
.filters button { font-size: 15px; color: var(--mute); padding: var(--s2) 0; position: relative; transition: color .3s; }
.filters button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
.filters button:hover { color: var(--ink); }
.filters button.on { color: var(--ink); }
.filters button.on::after { transform: scaleX(1); }

/* список тестов */
.list { list-style: none; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 44px 1fr auto 24px; align-items: center; gap: var(--s3);
  padding: var(--s4) 0; border-bottom: 1px solid var(--line); position: relative; isolation: isolate; }
.row::before { content: ""; position: absolute; inset: 0 calc(-1 * var(--s3)); background: var(--soft); border-radius: 12px; z-index: -1;
  transform: scaleY(.6); opacity: 0; transition: transform .5s var(--ease), opacity .4s; }
.row:hover::before { transform: scaleY(1); opacity: 1; }
.row .n { font-size: 13px; color: var(--mute); }
.row .t { font-size: clamp(19px, 2.6vw, 24px); letter-spacing: -.02em; font-weight: 550; line-height: 1.2; }
.row .d { display: block; font-size: 15px; color: var(--mute); margin-top: 2px; font-weight: 400; letter-spacing: 0; }
.row .m { font-size: 14px; color: var(--mute); white-space: nowrap; }
.row svg { width: 20px; height: 20px; transition: transform .5s var(--ease); }
.row:hover svg { transform: translateX(6px); }
.row.hide { display: none; }

/* кнопки */
.btns { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.btn { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 28px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 550; font-size: 16px;
  transition: transform .4s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--acc); z-index: -1; transform: translateY(101%);
  transition: transform .55s var(--ease); border-radius: inherit; }
.btn:hover::before { transform: none; }
.btn:hover { color: var(--acc-ink); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; transition: transform .5s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost::before { background: var(--ink); }
.btn.ghost:hover { color: var(--bg); }
.link { color: var(--mute); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; transition: color .3s; }
.link:hover { color: var(--ink); }
.link svg { width: 16px; height: 16px; transition: transform .5s var(--ease); }
.link:hover svg { transform: translateX(-4px); }

/* страница теста */
.meta { display: flex; flex-wrap: wrap; gap: var(--s5); margin: var(--s5) 0 0; padding-top: var(--s4); border-top: 1px solid var(--line); }
.meta div b { display: block; font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.meta div span { font-size: 14px; color: var(--mute); }
.note { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); max-width: 40em; }
.note + .note { margin-top: var(--s4); }
.note p + p { margin-top: var(--s2); }

/* прохождение */
.run-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s6); color: var(--mute); font-size: 15px; }
.count { font-size: 15px; color: var(--mute); }
.count b { color: var(--ink); font-weight: 600; display: inline-block; }
.timer { font-size: 15px; }
.timer.low { color: var(--warn); }
.q-prefix { font-size: 15px; color: var(--mute); margin-bottom: var(--s2); }
.q { font-size: clamp(26px, 4.4vw, 40px); line-height: 1.18; letter-spacing: -.03em; font-weight: 550; margin-bottom: var(--s5); max-width: 22em; }
.q.word { font-size: clamp(40px, 8vw, 72px); letter-spacing: -.045em; }
.opts { display: grid; gap: var(--s2); }
.opt { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: var(--s3);
  text-align: left; padding: 18px var(--s4) 18px var(--s3); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 18px; line-height: 1.35; transition: box-shadow .3s, transform .35s var(--ease), color .3s; }
.opt::before { content: ""; position: absolute; inset: 0; background: var(--acc); z-index: -1; transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .45s var(--ease); }
.opt:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.opt:active { transform: scale(.985); }
.opt .k { font-size: 13px; color: var(--mute); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line); transition: color .3s, box-shadow .3s; }
.opt.sel { color: var(--acc-ink); box-shadow: none; }
.opt.sel::before { transform: none; }
.opt.sel .k { color: var(--acc-ink); box-shadow: inset 0 0 0 1px currentColor; }
.opts.scale5 { grid-template-columns: repeat(5, 1fr); }
.opts.scale5 .opt, .opts.scale4 .opt { grid-template-columns: 1fr; text-align: center; padding: 18px 10px; font-size: 15px; justify-items: center; gap: 10px; }
.opts.scale4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) {
  .opts.scale5, .opts.scale4 { grid-template-columns: 1fr; }
  .opts.scale5 .opt, .opts.scale4 .opt { grid-template-columns: 32px 1fr; text-align: left; justify-items: start; padding: 16px; font-size: 17px; }
}
.opts.tiles { grid-template-columns: repeat(3, 1fr); }
.opts.tiles .opt { grid-template-columns: 1fr; justify-items: center; padding: var(--s3); }
.opts.tiles .opt svg { width: 100%; max-width: 110px; aspect-ratio: 1; }
.opts.tiles .opt .k { position: absolute; top: 8px; left: 8px; }
.run-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s5); }
.hint { font-size: 13px; color: var(--mute); }
@media (hover: none) { .hint { display: none; } }

/* таблица в задании */
table.data { border-collapse: collapse; margin: 0 0 var(--s4); font-size: 16px; min-width: min(100%, 360px); }
table.data th { text-align: left; font-weight: 500; color: var(--mute); font-size: 13px; letter-spacing: .04em; padding: 0 var(--s5) var(--s2) 0; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px var(--s5) 10px 0; border-bottom: 1px solid var(--line); }
.q.long { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.3; letter-spacing: -.02em; }
.rv .why { margin-top: var(--s1); color: var(--mute); }

/* задания интеллекта */
.seq { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: clamp(30px, 6vw, 52px); font-weight: 600; letter-spacing: -.03em; margin-bottom: var(--s5); }
.seq .gap { color: var(--acc); }
.matrix { width: 100%; max-width: 360px; aspect-ratio: 1; margin-bottom: var(--s5); }
.shape { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.shape.f1 { fill: var(--ink); }
.shape.f2 { fill: url(#hatch); }
.opt.sel .shape { stroke: var(--acc-ink); }
.opt.sel .shape.f1 { fill: var(--acc-ink); }
.cellbox { fill: none; stroke: var(--line); stroke-width: 1; }
.qmark { fill: var(--acc); font: 600 34px var(--f); }

/* результат */
.res-num { font-size: clamp(96px, 24vw, 220px); line-height: .85; letter-spacing: -.065em; font-weight: 650; margin: var(--s4) 0 var(--s3);
  display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.res-num.word { font-size: clamp(44px, 9vw, 96px); line-height: 1; overflow-wrap: anywhere; hyphens: auto; }
.res-num small { font-size: 18px; letter-spacing: 0; font-weight: 500; color: var(--mute); }
.res-sub { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.25; letter-spacing: -.02em; font-weight: 550; margin-bottom: var(--s3); max-width: 26em; }
.meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: var(--s4) 0 var(--s5); }
.meter i { display: block; height: 100%; background: var(--acc); border-radius: inherit; transform-origin: 0 50%; transform: scaleX(0);
  transition: transform 1.4s var(--ease) .2s; }
.scales { list-style: none; margin-top: var(--s6); border-top: 1px solid var(--line); }
.scales li { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.scales .h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.scales .h b { font-size: 20px; font-weight: 550; letter-spacing: -.015em; }
.scales .h span { font-size: 20px; font-weight: 600; }
.scales .about { font-size: 14px; color: var(--mute); margin-top: 2px; }
.scales .meter { margin: var(--s3) 0 var(--s2); height: 4px; }
.scales p { font-size: 16px; }
.alert { margin-top: var(--s5); padding: var(--s4); border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--warn); }
.alert b { display: block; font-size: 18px; margin-bottom: var(--s2); }
.alert a { text-decoration: underline; text-underline-offset: 3px; }
details.review { margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s3); }
details.review summary { cursor: pointer; list-style: none; font-weight: 550; display: flex; justify-content: space-between; padding: var(--s2) 0; }
details.review summary::-webkit-details-marker { display: none; }
details.review summary::after { content: "+"; font-weight: 400; color: var(--mute); transition: transform .4s var(--ease); }
details.review[open] summary::after { transform: rotate(45deg); }
.rv { padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rv b { font-weight: 550; display: block; margin-bottom: 2px; }
.rv .bad { color: var(--warn); }
.rv .good { color: var(--mute); }

/* внимание, память, реакция */
.schulte { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); width: 100%; max-width: 440px; margin: 0 auto; touch-action: manipulation; }
.schulte button { aspect-ratio: 1; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: clamp(20px, 5vw, 28px); font-weight: 600;
  transition: background .25s, color .25s, transform .3s var(--ease); user-select: none; }
.schulte button:active { transform: scale(.93); }
.schulte button.done { color: var(--mute); background: var(--soft); }
.schulte button.err { animation: shake .35s; box-shadow: inset 0 0 0 1.5px var(--warn); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.task { text-align: center; margin-bottom: var(--s4); font-size: 18px; color: var(--mute); }
.task b { color: var(--ink); font-size: 28px; font-weight: 650; display: inline-block; min-width: 1.6em; }
.digit { font-size: clamp(120px, 34vw, 240px); font-weight: 650; letter-spacing: -.05em; text-align: center; line-height: 1; height: 1.1em;
  display: grid; place-items: center; }
.entry { text-align: center; font-size: clamp(36px, 9vw, 64px); font-weight: 600; letter-spacing: .12em; min-height: 1.3em; margin-bottom: var(--s4); }
.entry .cur { display: inline-block; width: 3px; height: .9em; background: var(--acc); vertical-align: -.1em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); max-width: 340px; margin: 0 auto; }
.pad button { height: 64px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: 24px; font-weight: 550; transition: background .2s, transform .25s var(--ease); }
.pad button:active { transform: scale(.94); background: var(--soft); }
.pad button.wide { font-size: 15px; }
.react { width: min(72vw, 340px); aspect-ratio: 1; border-radius: 50%; margin: var(--s4) auto; display: grid; place-items: center;
  background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); font-size: 18px; color: var(--mute); transition: transform .5s var(--ease);
  user-select: none; touch-action: manipulation; cursor: pointer; }
.react.go { background: var(--acc); color: var(--acc-ink); box-shadow: none; transition: none; }
.react.bad { box-shadow: inset 0 0 0 2px var(--warn); color: var(--warn); }
.react:active { transform: scale(.97); }
.dots { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s3); }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .4s, transform .4s var(--ease); }
.dots i.on { background: var(--acc); transform: scale(1.25); }

/* история */
.hist { list-style: none; border-top: 1px solid var(--line); margin-top: var(--s5); }
.hist li a { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.hist b { font-weight: 550; font-size: 19px; letter-spacing: -.015em; }
.hist span { color: var(--mute); font-size: 14px; }
.hist em { font-style: normal; font-weight: 600; font-size: 19px; text-align: right; }

footer { padding: var(--s5) var(--pad); color: var(--mute); font-size: 13px; max-width: calc(var(--col) + 2 * var(--pad)); margin: 0 auto; width: 100%; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 24px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; pointer-events: none; transition: transform .5s var(--ease), opacity .4s; z-index: 30; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 560px) {
  .row { grid-template-columns: 32px 1fr 20px; }
  .row .m { display: none; }
  .meta { gap: var(--s4); }
  .top nav { gap: var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
