/* 1minQuiz, design "Stories". Tokens: design/DESIGN.md (wins over the handoff
   for tokens); forms and behaviour: design/projects/test-page/FOR_ARCHITECT_test-page.md.
   @font-face rules for Nunito are printed by inc/setup.php. */

:root {
  /* colors */
  --st: #46607a;      /* story slate: the page, selected answer, icons on white */
  --deep: #263443;    /* harbour deep: around the column, CoreTypes block */
  --tx: #fff;         /* paper white: type on slate, stickers */
  --soft: rgba(255, 255, 255, .78);
  --glass: rgba(255, 255, 255, .15);
  --glass2: rgba(255, 255, 255, .26);
  --glassh: rgba(38, 52, 67, .35);   /* glass-hover: darker, 8:1 for white type (review 2026-11-14) */
  --glassp: rgba(38, 52, 67, .5);    /* glass-pressed: :active on every glass plate (B6) */
  --deeph: #1d2833;                  /* deep-hover: the dark "One more" */
  --ink: #1d2430;
  --ink2: #4f5b6b;
  --pill: #edf0f4;
  --pillh: #e1e6ec;
  --whiteh: #e6ebf0;
  --pollf: #cfd7e0;
  --pollo: #a9bccf;
  /* type and motion */
  --f: Nunito, ui-rounded, ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* spacing */
  --gut: 16px;        /* column side gutter */
  --gut-hd: 10px;     /* header and share bar */
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: var(--glass2) var(--st);
  /* R1: focus never lands under the sticky strip/header; the result adds the bottom panel (result.js) */
  scroll-padding-top: 72px;
  scroll-padding-bottom: var(--sp-bottom, 0px);
}
body {
  margin: 0;
  background: var(--st);
  color: var(--tx);
  font: 700 17px/1.36 var(--f);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  touch-action: manipulation;
}
::selection { background: var(--tx); color: var(--st); }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; font: inherit; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--tx); outline-offset: 2px; }
svg { display: block; }

/* ---------- a test: the story column, full width on phones, phone-width wider ---------- */
.col { position: relative; min-height: 100vh; min-height: 100svh; }
/* R11: landscape with viewport-fit=cover - keep clear of the notch sides */
@media (max-width: 599px) { .col { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); } }
@media (min-width: 600px) {
  body.is-test { background: var(--deep); }
  .col { max-width: 520px; margin: 0 auto; background: var(--st); }
}
@media (min-width: 1000px) {
  .col { width: 470px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
}


/* ---------- "Skip to content" (R8): first in body, seen only with focus ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 22px; background: var(--tx); color: var(--st); font-weight: 900; text-decoration: none; }
.skip:focus { top: max(8px, env(safe-area-inset-top)); }

/* ---------- T1-T2: story header ---------- */
.hd { padding: max(8px, env(safe-area-inset-top)) var(--gut-hd) 0; }
.bars { display: flex; gap: 4px; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: var(--glass2); overflow: hidden; }
.bars i::after { content: ''; display: block; width: 0; height: 100%; background: var(--tx); }
.bars i.on::after { width: 100%; }
.bars i.now::after { width: 100%; opacity: .5; }
.bars.anim i.now::after { animation: omq-seg .3s ease-out both; }
@keyframes omq-seg { from { width: 0; } }
.who { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 6px 2px 0; }
/* L1: the logo 24 px in the story header, leading home */
.who .brand { display: flex; flex: none; align-items: center; min-height: 44px; margin-left: 4px; padding: 0; }
.who .brand img { display: block; width: auto; height: 24px; }
.clock { flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.clock i { display: inline-block; width: .6em; text-align: center; font-style: normal; }
.clock i.c { width: .3em; }
/* R3: 44x44 targets, drawn as before (negative margins keep the row's look) */
.x, .bk { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -2px; color: var(--tx); }
.bk { margin: -2px -11px -2px -13px; }
.x svg, .bk svg { width: 20px; height: 20px; }
/* the quiz title: own line, full width, two lines at most, shrinks 22 -> 16 px (task 04)
   (assets/js/chrome.js), never truncated, words never broken */
.tt { margin-top: 2px; padding: 0 4px; font-size: 22px; line-height: 1.16; font-weight: 900; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: normal; }

/* ---------- fallback (index.php) and the password form; not .page - WordPress puts that on <body> of every page ---------- */
.fbk { padding-top: 14px; }
.is-test .fbk { padding: 24px var(--gut) 0; }
.ph { font-size: 32px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
.pc { margin-top: 16px; }

/* ---------- footer F1 (Lex, 2026-11-14): links 14 px; language and (c) in one row under them;
   on the desktop (not in the test column) all in one row; the language list opens upwards ---------- */
.foot { margin: 40px var(--gut) 0; padding-bottom: calc(28px + env(safe-area-inset-bottom)); font-size: 15px; color: var(--soft); }
.foot.wrap { margin: 44px auto 0; }
.foot .in { padding-top: 18px; border-top: 1px solid var(--glass2); }
.fl { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 0; font-size: 14px; }
.fl a[aria-current="page"] { color: var(--tx); font-weight: 900; text-decoration: none; }
.fl a { display: inline-flex; align-items: center; max-width: 100%; min-height: 44px; text-underline-offset: 3px; }
.fbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.lang { position: relative; }
.lang summary {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 44px; padding: 0 14px 0 12px; border-radius: 22px;
  background: var(--glass); color: var(--tx); font-weight: 800;
  list-style: none; cursor: pointer; transition: background-color .12s;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 18px; height: 18px; }
.lang summary svg:last-child { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .15s; }
.lang[open] summary { background: var(--glassh); }
.lang[open] summary svg:last-child { transform: rotate(90deg); }
.lang ul { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: grid; min-width: 180px; padding: 6px; border-radius: 16px; background: var(--deep); box-shadow: inset 0 0 0 1px var(--glass2); }
/* The list stays out of rendering until it opens, so its Cyrillic names
   ("Русский", "Українська") never pull the Cyrillic font onto an en/es page
   that nobody opened the list on (measured: latin only until opened). */
.lang:not([open]) ul { display: none; }
.lang ul a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--tx); font-size: 15px; font-weight: 800; text-decoration: none; }
.cpy { margin: 0; font-size: 14px; white-space: nowrap; }
@media (min-width: 1000px) {
  .foot.wrap .in { display: flex; align-items: center; column-gap: 22px; }
  .foot.wrap .fl { flex: 1; min-width: 0; column-gap: 14px; }
  .foot.wrap .fbar { margin: 0; gap: 22px; }
}

/* ---------- "One more" (R6, P3) - also on the home page for a returning visitor ---------- */
.go { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 6px 16px 6px 22px; border-radius: 30px; background: var(--deep); color: var(--tx); text-align: left; text-decoration: none; }
.go > span { flex: 1; min-width: 0; }
.go strong { display: block; font-size: 19px; line-height: 1.06; font-weight: 900; letter-spacing: -.015em; }
.go small { display: block; margin-top: 1px; font-size: 13px; line-height: 1.16; font-weight: 700; color: var(--soft); overflow-wrap: normal; text-wrap: balance; }
.go small:empty { display: none; }
.go svg { flex: none; width: 22px; height: 22px; color: var(--tx); }
.go:active { transform: scale(.99); }
.go:focus-visible { outline: 3px solid var(--tx); outline-offset: 3px; }

/* ============ shared components (DESIGN.md, review 2026-11-14) ============ */
/* the dark tag - one for the site ("Quiz of the day", "404", "CoreTypes"): 13 / 900, radius 10, -2deg; on a sticker +2deg */
.dtag { display: inline-block; max-width: 100%; padding: 4px 10px 5px; border-radius: 10px; background: var(--deep); color: var(--tx); font-size: 13px; line-height: 1.1; font-weight: 900; transform: rotate(-2deg); }
/* the "all ->" link - one glass pill: 44 px, 16 / 900, arrow 16 */
.pill { display: inline-flex; flex: none; align-items: center; gap: 4px; max-width: 100%; min-height: 44px; padding: 0 12px 0 16px; border-radius: 22px; background: var(--glass); color: var(--tx); font-size: 16px; font-weight: 900; text-decoration: none; white-space: nowrap; transition: background-color .12s; }
.pill svg { width: 16px; height: 16px; }
/* chips: tag strip, home and 404 topics */
.chip { display: inline-flex; align-items: center; max-width: 100%; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--glass); font-size: 16px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: background-color .12s; }
.chip[aria-current="page"] { background: var(--tx); color: var(--st); font-weight: 900; }
/* the quiz tile - catalog, tag page, "New" on the home page and the 404 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 132px; padding: 12px 14px 14px; border-radius: 18px; background: var(--glass); text-decoration: none; transition: background-color .12s; }
.tile .tn { margin-top: 18px; font-size: 18px; line-height: 1.14; font-weight: 900; overflow-wrap: normal; }
/* P3: one bar per question, white once finished here; "star 4,9 · 6 questions" or the date */
.tbar { display: flex; gap: 3px; }
.tbar i { flex: 1; height: 3px; border-radius: 2px; background: var(--glass2); }
.tile.done .tbar i { background: var(--tx); }
.tmeta { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 13px; line-height: 1.2; font-weight: 800; color: var(--tx); white-space: nowrap; }
.tmeta:empty { display: none; }
.tmeta svg { flex: none; width: 15px; height: 15px; }
.tmeta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .8; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.h2 { font-size: 22px; line-height: 1.12; font-weight: 900; letter-spacing: -.01em; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
  .tile { min-height: 156px; }
  .tile .tn { font-size: 20px; }
}
/* touch response - one rule for every glass plate (B6) */
.tile:active, .chip:active, .pill:active, .iconbtn:active, .lang summary:active, .row:active, .mail:active, .pager ol a:active, a.pbtn:active, .rl a:active { background: var(--glassp); }

/* ============ N3: every page except a test (design/projects/nav/FOR_ARCHITECT_nav.md) ============ */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(var(--pad, 16px), env(safe-area-inset-right)) 0 max(var(--pad, 16px), env(safe-area-inset-left)); }
body:not(.is-test) { --pad: 16px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
/* taste 3: on a short page the footer sits at the bottom of the screen */
.site { display: flex; flex: 1 0 auto; flex-direction: column; }
.site > main { flex: 1 0 auto; }
body.locked { overflow: hidden; }
.sp { flex: 1; }
.nhd { padding-top: env(safe-area-inset-top); }
.nhd .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-right: 10px; }
.brand { display: block; flex: none; padding: 8px 0; }
.brand img { display: block; width: auto; height: 28px; }
.dnav { display: none; }
.iconbtn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 22px; background: var(--glass); color: var(--tx); transition: background-color .12s; }
.iconbtn svg { width: 20px; height: 20px; }
/* tag stickers: the sheet (two columns) and the desktop dropdown (three) */
.tagstk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tagstk a { display: flex; align-items: center; min-height: 52px; padding: 8px 16px; border-radius: 16px; background: var(--tx); color: var(--st); font-size: 17px; line-height: 1.15; font-weight: 900; text-decoration: none; transform: rotate(-1deg); transition: transform .12s var(--ease); overflow-wrap: normal; }
.tagstk li:nth-child(even) a { transform: rotate(1deg); }
.tagstk a[aria-current="page"] { background: var(--st); color: var(--tx); box-shadow: inset 0 0 0 2px var(--tx); }
/* the sheet: full screen, deep, from above in .24 s */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; overflow-y: auto; padding: env(safe-area-inset-top) 0 calc(24px + env(safe-area-inset-bottom)); background: var(--deep); }
.sheet[hidden] { display: none; }
.sheet:focus { outline: none; }
.sheet.anim { animation: omq-sheetin .24s var(--ease) both; }
@keyframes omq-sheetin { from { opacity: 0; transform: translateY(-14px); } }
.sheet .wrap { display: flex; flex: 1; flex-direction: column; }
.sheet .top { display: flex; align-items: center; min-height: 64px; margin-right: -6px; }
.sheet .big { display: inline-flex; align-items: center; align-self: flex-start; max-width: 100%; min-height: 44px; margin-top: 14px; font-size: 32px; line-height: 1.1; font-weight: 900; letter-spacing: -.02em; text-decoration: none; }
.sheet .lbl { margin-top: 26px; font-size: 14px; font-weight: 800; color: var(--soft); }
.sheet .bottom { display: flex; flex-wrap: wrap; column-gap: 22px; row-gap: 6px; margin-top: auto; padding-top: 32px; font-size: 15px; color: var(--soft); }
.sheet .bottom a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
@media (min-width: 600px) { body:not(.is-test) { --pad: 28px; } }
@media (min-width: 1000px) {
  body:not(.is-test) { --pad: 40px; }
  .nhd .wrap { min-height: 80px; gap: 30px; padding-right: var(--pad); }
  .brand img { height: 32px; }
  .burger { display: none; }
  .sheet { display: none !important; }
  .dnav { display: flex; flex: 1; align-items: center; gap: 6px; }
  .dnav > a, .dd > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: 17px; font-weight: 900; text-decoration: none; transition: background-color .12s; }
  .dnav > a[aria-current="page"] { background: var(--tx); color: var(--st); }
  .dnav .quiet { padding: 0 10px; font-size: 15px; font-weight: 800; color: var(--soft); }
  .dnav .quiet[aria-current="page"] { background: none; color: var(--tx); text-decoration: underline; text-underline-offset: 4px; }
  .dd { position: relative; }
  .dd > button svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
  .dd > button[aria-expanded="true"] { background: var(--glass); }
  .dd > button[aria-expanded="true"] svg { transform: rotate(-90deg); }
  .ddp { position: absolute; left: 0; top: calc(100% + 10px); z-index: 40; width: 560px; padding: 20px; border-radius: 22px; background: var(--deep); box-shadow: inset 0 0 0 1px var(--glass2); }
  .ddp[hidden] { display: none; }
  .ddp .tagstk { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
  .ddp .tagstk a { min-height: 48px; font-size: 16px; }
}

@media (hover: hover) and (pointer: fine) {
  .fl a:hover { color: var(--tx); }
  .lang ul a:hover { background: rgba(255, 255, 255, .08); }
  .lang summary:hover, .iconbtn:hover, .pill:hover, .chip:hover, .tile:hover { background: var(--glassh); }
  .chip[aria-current="page"]:hover { background: var(--tx); }
  .go:hover { background: var(--deeph); }
  .tagstk a:hover { transform: rotate(0) scale(1.02); }
  .dnav > a:hover, .dd > button:hover { background: var(--glassh); }
  .dnav > a[aria-current="page"]:hover { background: var(--tx); }
  .dnav .quiet:hover { background: none; color: var(--tx); }
}

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

/* R9: Windows high contrast - the selected answer and the current item keep a frame */
@media (forced-colors: active) {
  .chip[aria-current="page"], .tagstk a[aria-current="page"], .dnav > a[aria-current="page"], .pager ol a[aria-current="page"] { outline: 2px solid CanvasText; outline-offset: -2px; }
}
