/* codexxx.tech — палитра и маскот из bidlens-pro/reels (src/brand/tokens.ts). */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  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;
}

:root {
  --cream: #FDF6EC;
  --ink: #22223B;
  --coral: #FF6B4A;
  --coral-shade: #E0502F;
  --teal: #3BA99C;
  --yellow: #FFC93C;
  --sand: #EDE4D3;

  --bg: var(--cream);
  --text: var(--ink);
  --muted: #5B5A72;
  --line: #E4D9C6;
  --cell-ink: var(--ink);
  --shadow-floor: rgba(34, 34, 59, .12);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --font: "Nunito", ui-rounded, system-ui, sans-serif;
  --measure: 34rem;
  --gutter: clamp(20px, 5vw, 56px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --text: var(--cream);
    --muted: #B7B4C8;
    --line: #3A3A5E;
    --cell-ink: var(--cream);
    --shadow-floor: rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--ink);
  --text: var(--cream);
  --muted: #B7B4C8;
  --line: #3A3A5E;
  --cell-ink: var(--cream);
  --shadow-floor: rgba(0, 0, 0, .28);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

a { color: inherit; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--bg); padding: 8px 12px; z-index: 10; }

/* ── шапка ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: -.01em; text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 40px; padding: 0 12px;
  border: 2px solid var(--line); border-radius: 12px; background: none;
  color: inherit; font: inherit; font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: border-color 160ms ease;
}
.chip-btn:hover { border-color: var(--text); }
.chip-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* ── первый экран: словесный знак слева, поле клеток с маскотом справа ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(32px, 7vw, 96px) 0 clamp(56px, 9vw, 128px);
}
.wordmark {
  font-weight: 900;
  font-size: clamp(64px, 9.2vw, 132px);
  line-height: .9;
  letter-spacing: -.045em;
  margin-left: -.04em;
}
.lede { font-size: clamp(20px, 2.1vw, 25px); line-height: 1.38; font-weight: 600; max-width: 22ch; margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 36px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 26px;
  background: var(--coral); color: var(--ink);
  border: 0; border-radius: 16px;
  box-shadow: 0 5px 0 var(--coral-shade);
  font: inherit; font-weight: 800; font-size: 18px; text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-shade); }
.text-link { font-weight: 700; }

/* Поле: 6×5 клеток, маскот занимает 2×2 в центре (колонки 3–4, ряды 2–3). */
.field {
  --step: calc(100% / 6);
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  aspect-ratio: 6 / 5;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}
.cell {
  --dx: calc((2.5 - var(--c)) * 100%);
  --dy: calc((1.5 - var(--r)) * 100%);
  grid-column: calc(var(--c) + 1);
  grid-row: calc(var(--r) + 1);
  margin: 9%;
  border-radius: 24%;
  background: var(--fill);
  transform: rotate(var(--rot, 0deg));
}
.cell.ring { background: none; border: clamp(5px, 1.1vw, 9px) solid var(--fill); }
.cell.ink { --fill: var(--cell-ink); }
.cell.teal { --fill: var(--teal); }
.cell.yellow { --fill: var(--yellow); }
.cell.coral { --fill: var(--coral); }
.cell.sand { --fill: var(--sand); }
:root[data-theme="dark"] .cell.sand { --fill: #44446A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cell.sand { --fill: #44446A; } }

.mascot-btn {
  grid-column: 3 / span 2;
  grid-row: 2 / span 2;
  position: relative;
  z-index: 1;
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease-out);
}
.mascot-btn:active { transform: scale(.96); }
.mascot-btn svg { display: block; width: 160%; height: 160%; margin: -30% -30% -30%; overflow: visible; }

/* Эмоции маскота: показывается одна группа лица. */
.mascot [data-face] { display: none; }
.mascot[data-emotion="calm"] [data-face~="calm"],
.mascot[data-emotion="surprised"] [data-face~="surprised"],
.mascot[data-emotion="explaining"] [data-face~="explaining"],
.mascot[data-emotion="happy"] [data-face~="happy"] { display: inline; }
.mascot .floor { fill: var(--shadow-floor); }
.mascot .eyes { transform-box: view-box; transform-origin: 100px 96px; animation: blink 3.2s infinite; }
@keyframes blink {
  0%, 95.5%, 100% { transform: scaleY(1); }
  97.5% { transform: scaleY(.1); }
}

/* Заставка один раз за загрузку: маскот падает, из-под него разлетаются клетки. */
.js .field.intro .mascot-btn { animation: drop 560ms var(--ease-out) both; }
.js .field.intro .cell { animation: burst 620ms var(--ease-out) both; animation-delay: calc(300ms + var(--i) * 32ms); }
@keyframes drop {
  0% { transform: translateY(-46%); opacity: 0; }
  55% { transform: translateY(0) scale(1.06, .92); opacity: 1; }
  100% { transform: none; }
}
@keyframes burst {
  from { transform: translate(var(--dx), var(--dy)) scale(.5) rotate(calc(var(--rot, 0deg) + 90deg)); opacity: 0; }
  to { transform: rotate(var(--rot, 0deg)); opacity: 1; }
}

/* ── что делаем ── */
.section { padding: clamp(56px, 8vw, 104px) 0; border-top: 2px solid var(--line); }
.section h2 { font-weight: 900; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.025em; }
.section-intro { color: var(--muted); max-width: var(--measure); margin-top: 14px; }

.board { list-style: none; padding: 0; margin-top: clamp(32px, 5vw, 56px); display: grid; gap: clamp(36px, 5vw, 56px); }
.item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px clamp(18px, 3vw, 32px); }
.item .glyph { grid-row: span 3; width: 76px; height: 76px; }
.item h3 { font-weight: 900; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -.015em; }
.item p { max-width: var(--measure); }
.item .status { color: var(--muted); font-size: 16px; font-weight: 600; margin-top: 6px; }
.item .status a { font-weight: 700; }


@media (min-width: 900px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item { grid-template-columns: 1fr; align-content: start; row-gap: 12px; }
  .item .glyph { grid-row: auto; margin-bottom: 8px; }
}

.order { margin-top: clamp(40px, 6vw, 64px); padding: 22px 24px; border: 2px dashed var(--line); border-radius: 20px; max-width: 46rem; font-weight: 600; }

/* ── контакты ── */
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.mail { font-weight: 900; font-size: clamp(26px, 4.6vw, 52px); letter-spacing: -.02em; line-height: 1.1; text-decoration-thickness: 3px; overflow-wrap: anywhere; }
.contact-list { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 8px; font-weight: 600; }

/* ── подвал ── */
.foot { padding: 40px 0 56px; border-top: 2px solid var(--line); color: var(--muted); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; }
.req { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; }
.req dt { font-weight: 700; color: var(--text); }
.foot-links { list-style: none; padding: 0; display: grid; gap: 6px; align-content: start; }

/* ── уведомление «скопировано» ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 800; font-size: 16px;
  transform: translate(-50%, calc(100% + 32px)); opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ── текстовые страницы (политики) ── */
.doc { padding: clamp(32px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.doc h1 { font-weight: 900; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -.025em; max-width: 18ch; }
.doc .updated { color: var(--muted); margin-top: 14px; font-weight: 600; }
.doc h2 { font-weight: 900; font-size: 24px; letter-spacing: -.01em; margin-top: 44px; }
.doc p, .doc ul { max-width: 40rem; margin-top: 12px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc .lang-switch { margin-top: 20px; font-weight: 700; }
.doc section > h1:first-child { margin-top: 80px; padding-top: 48px; border-top: 2px solid var(--line); }

.doc .lost { display: block; width: 140px; height: 140px; margin-bottom: 24px; overflow: visible; }

/* ── узкие экраны ── */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .field { order: -1; justify-self: center; max-width: 420px; }
  .lede { max-width: none; }
  .item { grid-template-columns: 48px minmax(0, 1fr); align-items: center; row-gap: 10px; }
  .item .glyph { grid-row: auto; width: 48px; height: 48px; }
  .item > :not(.glyph, h3) { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .js .field.intro .mascot-btn,
  .js .field.intro .cell { animation: fade 200ms ease both; animation-delay: 0ms; }
  .mascot .eyes { animation: none; }
  .btn, .mascot-btn { transition: none; }
  .toast { transform: translate(-50%, 0); transition: opacity 200ms ease; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
