/* По картам "Проявка": tokens, fonts, base typography, shell (header, menu, footer, grain). */

@font-face { font-family: "Forum"; font-weight: 400; font-display: swap; src: url(/fonts/forum-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Forum"; font-weight: 400; font-display: swap; src: url(/fonts/forum-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/eb-garamond-cyrillic-400-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/eb-garamond-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(/fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(/fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(/fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(/fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(/fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(/fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* One theme: a darkroom under red light. Saturated wine is the surface, bone is the ink. */
  --wine-950: oklch(0.14 0.045 18);
  --wine-900: oklch(0.18 0.06 18);
  --wine-800: oklch(0.23 0.075 18);
  --wine-700: oklch(0.30 0.085 18);
  --wine-600: oklch(0.38 0.09 18);
  --bone: oklch(0.94 0.012 80);
  --bone-dim: oklch(0.78 0.02 40);
  --bone-faint: oklch(0.70 0.03 25);
  --accent: oklch(0.76 0.16 38);
  --accent-ink: oklch(0.2 0.06 30);
  --danger: oklch(0.88 0.13 95); /* pale yellow: must not look like the coral accent */
  --line: oklch(0.94 0.012 80 / 0.16);

  --font-display: "Forum", "Times New Roman", serif;
  --font-italic: "EB Garamond", "Times New Roman", serif; /* Forum has no italic: quotes and card names use this */
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --fs-small: 14px;
  --fs-body: clamp(16px, 0.95rem + 0.2vw, 18px);
  --fs-lead: clamp(18px, 1.05rem + 0.45vw, 22px);
  --fs-h3: clamp(22px, 1.3rem + 0.8vw, 30px);
  --fs-h2: clamp(34px, 1.6rem + 3.4vw, 72px);
  --fs-h1: clamp(38px, 1.9rem + 2.9vw, 72px);

  --gutter: clamp(20px, 4vw, 48px);
  --max: 1320px;
  --radius: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 160ms;  /* press feedback */
  --dur-ui: 200ms;     /* small interface changes: hover, accordion, menu */
  --dur-route: 150ms;  /* leaving a page */

  /* z-index scale */
  --z-sticky: 10;
  --z-header: 50;
  --z-menu: 60;
  --z-float: 70;
  --z-tag: 80;
  --z-grain: 90;
  --z-skip: 100;

  --header-h: 72px;
  color-scheme: dark;
  interpolate-size: allow-keywords;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--wine-900); color: var(--bone); -webkit-text-size-adjust: 100%; scrollbar-color: var(--wine-600) var(--wine-950); }
/* Touch: no grey flash on tap, no tap delay, controls are not selected by a long press (the content still is). */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, [role="button"] { touch-action: manipulation; }
button, .card, .filters button { user-select: none; -webkit-user-select: none; }
body { margin: 0; min-height: 100dvh; font: 400 var(--fs-body)/1.6 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, canvas { max-width: 100%; }
img { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0; max-width: 68ch; }
a { color: inherit; }
main { display: block; min-height: 60dvh; overflow-x: clip; }
main:focus { outline: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 400; letter-spacing: -0.01em; line-height: 1.2; }
em, i.it { font-style: italic; }

.mono { margin: 0; font: 400 13px/1.5 var(--font-mono); letter-spacing: 0.02em; color: var(--bone-faint); }
.lede { font-size: var(--fs-lead); line-height: 1.55; color: var(--bone-dim); max-width: 58ch; }
.note { font-size: var(--fs-small); color: var(--bone-faint); line-height: 1.5; max-width: 52ch; }
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; left: 16px; top: -80px; z-index: var(--z-skip); padding: 12px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }

/* ---- film grain (fixed, never on scrolling containers) ---- */
.grain { position: fixed; inset: -50%; z-index: var(--z-grain); pointer-events: none; background: url(/img/grain.png); opacity: 0.3; animation: grain 1s steps(1) infinite; }
@keyframes grain {
  0% { transform: translate(0, 0); } 12% { transform: translate(-6%, 4%); } 25% { transform: translate(5%, -7%); } 37% { transform: translate(-3%, 8%); }
  50% { transform: translate(7%, 3%); } 62% { transform: translate(-8%, -4%); } 75% { transform: translate(3%, 6%); } 87% { transform: translate(-5%, -8%); }
}

/* ---- header ---- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: var(--z-header); height: var(--header-h); display: flex; align-items: center; gap: 32px; padding-inline: var(--gutter); transition: background-color 0.4s, box-shadow 0.4s; }
.site-header.is-scrolled { background: oklch(0.18 0.06 18 / 0.94); box-shadow: 0 1px 0 var(--wine-700); }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--bone); }
.brand-word { font: 400 26px/1 var(--font-display); letter-spacing: 0.035em; white-space: nowrap; }
.brand-note { font: 400 12px/1 var(--font-mono); color: var(--bone-faint); white-space: nowrap; }
.brand--big .brand-word { font-size: clamp(38px, 5vw, 72px); font-weight: 400; }
.brand--big .brand-note { font-size: 12px; }
.nav { display: flex; gap: clamp(20px, 2.6vw, 40px); margin-inline: auto; }
.nav a { position: relative; padding: 8px 0; font-size: 15px; text-decoration: none; color: var(--bone-dim); transition: color 0.25s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-ui) var(--ease-out); }
.nav a[aria-current="page"] { color: var(--bone); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--bone); } }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .nav a:hover::after { transform: scaleX(1); } }
.menu-toggle { display: none; align-items: center; gap: 12px; margin-left: auto; min-height: 44px; padding: 0 4px; background: none; border: 0; font: 500 15px var(--font-body); }
.menu-toggle i { position: relative; width: 22px; height: 10px; border-block: 1.5px solid currentColor; }
.menu-toggle i::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1.5px solid currentColor; transform: translateY(-50%); }

.menu-panel { position: fixed; inset: 0; z-index: var(--z-menu); padding: calc(var(--header-h) + 24px) var(--gutter) 40px; background: var(--wine-950); overflow-y: auto; }
.menu-panel nav { display: grid; gap: 4px; }
.menu-panel a { display: block; padding: 14px 0; font: 400 clamp(32px, 9vw, 52px)/1.1 var(--font-display); letter-spacing: -0.02em; text-decoration: none; border-bottom: 1px solid var(--line); animation: menu-in var(--dur-ui) var(--ease-out) both; }
.menu-panel a:nth-child(2) { animation-delay: 0.03s; } .menu-panel a:nth-child(3) { animation-delay: 0.06s; } .menu-panel a:nth-child(4) { animation-delay: 0.09s; }
.menu-panel a:nth-child(5) { animation-delay: 0.12s; } .menu-panel a:nth-child(6) { animation-delay: 0.15s; }
.menu-panel .menu-cta { margin-top: 24px; color: var(--accent); border: 0; }
.menu-panel a[aria-current="page"] { color: var(--accent); }
@keyframes menu-in { from { opacity: 0; transform: translateY(8px); } }
.menu-open .site-header { z-index: calc(var(--z-menu) + 1); background: var(--wine-950); box-shadow: none; }
.menu-open .menu-toggle i { border-color: transparent; }
.menu-open .menu-toggle i::before, .menu-open .menu-toggle i::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1.5px solid currentColor; }
.menu-open .menu-toggle i::before { transform: rotate(45deg); }
.menu-open .menu-toggle i::after { transform: rotate(-45deg); }
.menu-open .grain { opacity: 0.3; }
.menu-open { overflow: hidden; }

.nav-account { font-size: 15px; color: var(--bone); text-decoration: none; padding: 8px 0; border-bottom: 1px solid oklch(0.94 0.012 80 / 0.35); transition: color 0.25s, border-color 0.25s; }
@media (hover: hover) and (pointer: fine) { .nav-account:hover { color: var(--accent); border-color: currentColor; } }

@media (max-width: 860px) {
  .site-header .nav, .site-header .nav-cta { display: none; }
  .menu-toggle { display: inline-flex; margin-left: 20px; }
  .site-header .nav-account { margin-left: auto; }
}

/* ---- footer ---- */
.site-footer { margin-top: clamp(80px, 12vw, 160px); padding: clamp(56px, 8vw, 96px) 0 96px; background: var(--wine-950); border-top: 1px solid var(--wine-700); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.8fr)); gap: 48px clamp(24px, 5vw, 80px); }
.footer-brand p { margin-top: 28px; font: 400 var(--fs-lead)/1.5 var(--font-display); color: var(--bone-dim); max-width: 26ch; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.site-footer nav h2 { margin-bottom: 8px; }
.site-footer nav h2 { font: 400 13px/1.5 var(--font-mono); letter-spacing: 0.02em; color: var(--bone-faint); }
.footer-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 28px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--bone-faint); }
.footer-legal p { max-width: 52ch; }
.footer-codeword { font: 400 12px var(--font-mono); letter-spacing: 0.04em; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

.demo-tag { position: fixed; left: 14px; bottom: 12px; z-index: var(--z-tag); max-width: calc(100vw - 28px); margin: 0; padding: 6px 10px; background: oklch(0.14 0.045 18 / 0.92); border: 1px solid var(--wine-700); border-radius: var(--radius); font: 400 12px/1.3 var(--font-mono); color: var(--bone-dim); }

/* ---- page transitions: the next page "develops" ---- */
.site-header { view-transition-name: site-header; }
.grain { view-transition-name: grain; }
.demo-tag { view-transition-name: demo-tag; }
::view-transition-group(site-header), ::view-transition-group(grain), ::view-transition-group(demo-tag) { animation-duration: 0s; }
/* Only between marketing pages (main.js); leaving is faster than arriving, the blur stays small and cheap. */
::view-transition-old(root) { animation: vt-out var(--dur-route) var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 300ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; filter: blur(4px); } }

.perf-low .grain { animation: none; inset: 0; }
@media (pointer: coarse) { .grain { animation: none; inset: 0; } }
.perf-low .page-head::after { animation: none; }

/* Less motion, not none: movement and decorative loops go, a soft change of opacity and colour stays (it shows that a state changed). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-property: opacity, color, background-color, border-color !important; transition-duration: var(--dur-ui) !important; transition-delay: 0s !important; }
  .grain, .page-head::after, .hero-shaft, .hero-smoke, .dealt-card[data-wait], .menu-panel a { animation: none !important; }
  .grain { inset: 0; }
}
