/* Каркас: один на все страницы. Тихий: моноширинный шрифт, мелкий кегль, цвета берёт у страницы. */

/* ---------- шрифты (OFL, лицензии в fonts/LICENSES.txt); браузер качает только те, что реально использованы ---------- */
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url(../fonts/plexmono-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url(../fonts/plexmono-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(../fonts/plexmono-cyrillic-500.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(../fonts/plexmono-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Oswald"; font-weight: 200 700; font-display: swap; src: url(../fonts/oswald-cyrillic-wght.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-weight: 200 700; font-display: swap; src: url(../fonts/oswald-latin-wght.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Oranienbaum"; font-weight: 400; font-display: swap; src: url(../fonts/oranienbaum-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oranienbaum"; font-weight: 400; font-display: swap; src: url(../fonts/oranienbaum-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; font-weight: 400; font-display: swap; src: url(../fonts/cormorant-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-weight: 400; font-display: swap; src: url(../fonts/cormorant-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-cyrillic-500-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-latin-500-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraktur"; font-weight: 700; font-display: swap; src: url(../fonts/unifrakturcook-latin-700.woff2) format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 100 900; font-display: swap; src: url(../fonts/intertight-cyrillic-wght.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Tight"; font-weight: 100 900; font-display: swap; src: url(../fonts/intertight-latin-wght.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токены: страница переопределяет --bg/--fg/--accent ---------- */
:root {
  --pad: clamp(16px, 4vw, 48px);
  --head-h: 48px;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --grot: "Oswald", "Arial Narrow", sans-serif;
  --bg: #e9e7e0;
  --fg: #121211;
  --accent: #c8ff00;
  --dim: color-mix(in srgb, var(--fg) 58%, transparent);
  --rule: color-mix(in srgb, var(--fg) 16%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body { margin: 0; font: 400 13px/1.55 var(--mono); overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
figure, blockquote { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--fg); color: var(--bg); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 100; left: 8px; top: -64px; padding: 8px 12px; background: var(--fg); color: var(--bg); text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- шапка ---------- */
.fr-head {
  position: fixed; z-index: 50; inset: 0 0 auto 0;
  height: calc(var(--head-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--pad) 0;
  display: flex; align-items: center; gap: 20px;
  font-size: 12px; letter-spacing: .02em; color: var(--head-fg, var(--fg));
  background: color-mix(in srgb, var(--head-bg, var(--bg)) 84%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
  transition: transform .5s var(--ease);
  view-transition-name: fr-head;
}
.fr-head.hide { transform: translateY(-101%); }
.fr-logo { position: relative; font: 600 21px/1 var(--grot); letter-spacing: .02em; text-decoration: none; white-space: nowrap; padding: 6px 0; }
.fr-logo::after { content: ""; position: absolute; left: 100%; top: 9px; width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; background: var(--accent); }
.fr-nav { display: flex; gap: 18px; margin-left: auto; }
.fr-nav a { position: relative; padding: 10px 0; text-decoration: none; opacity: .72; transition: opacity .2s; }
.fr-nav a:hover, .fr-nav a[aria-current="page"] { opacity: 1; }
.fr-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; }
.fr-geo { display: none; margin: 0; gap: 16px; color: var(--dim); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-langs { display: flex; gap: 8px; }
.fr-langs a { text-decoration: none; opacity: .6; } .fr-langs a[aria-current] { opacity: 1; }
@media (min-width: 900px) {
  .fr-geo { display: flex; margin-left: auto; }
  .fr-nav { margin-left: 56px; }
}

/* ---------- появление при скролле ---------- */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- соседние страницы ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.pager a { display: grid; gap: 6px; align-content: start; padding: 32px var(--pad) 40px; text-decoration: none; transition: background .3s; }
.pager a + a { text-align: right; border-left: 1px solid var(--rule); }
.pager a:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.pager small { color: var(--dim); font-size: 11px; letter-spacing: .06em; }
.pager b { font: var(--pager-font, 500 clamp(26px, 5vw, 56px)/1 var(--grot)); text-transform: var(--pager-case, uppercase); }

/* ---------- подвал ---------- */
.fr-foot { position: relative; padding: 72px var(--pad) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); color: var(--dim); font-size: 12px; background: var(--foot-bg, transparent); }
.fr-joke { max-width: 24ch; margin: 0 0 56px; color: var(--fg); font: 500 clamp(22px, 3.2vw, 38px)/1.04 var(--grot); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; }
.fr-foot-grid { display: grid; gap: 4px 24px; }
.fr-foot-grid p { margin: 0; }
.fr-foot-grid a { text-decoration: none; }
.fr-foot-grid a:hover { color: var(--fg); }
.fr-dim { opacity: .6; }
@media (min-width: 760px) { .fr-foot-grid { grid-template-columns: 1fr 1fr auto; } }

/* «сайт сделал snjr.uz»: блик бежит по имени, при наведении линия и стрелка */
.made-by-row { display: flex; justify-content: flex-end; margin: 36px 0 0; }
.made-by { position: relative; display: inline-flex; align-items: baseline; gap: 7px; padding: 6px 0 4px; color: var(--dim); text-decoration: none; letter-spacing: .08em; }
.made-by::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.mb-name { font-size: 13px; letter-spacing: .16em; font-weight: 500; background: linear-gradient(100deg, var(--dim) 0%, var(--dim) 36%, var(--fg) 45%, var(--accent) 50%, var(--fg) 55%, var(--dim) 64%, var(--dim) 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
.mb-arrow { display: inline-block; color: var(--accent); opacity: .7; transition: transform .35s var(--ease), opacity .35s; }
.made-by:hover, .made-by:focus-visible { color: var(--fg); }
.made-by:hover::after, .made-by:focus-visible::after { transform: scaleX(1); }
.made-by:hover .mb-arrow, .made-by:focus-visible .mb-arrow { transform: translate(3px, -3px); opacity: 1; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- тост для шуток интерфейса ---------- */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); width: max-content; max-width: min(92vw, 440px); padding: 11px 15px; background: var(--fg); color: var(--bg); font-size: 12px; line-height: 1.45; opacity: 0; transform: translate(-50%, 16px); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- переходы между страницами: новая страница въезжает снизу шторкой ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-old .32s ease both; }
::view-transition-new(root) { animation: vt-new .62s var(--ease) both; }
@keyframes vt-old { to { opacity: .35; transform: scale(.985); } }
@keyframes vt-new { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
