/* ============================================================
   ПИНК ЮНИКОРН — Design System
   Spectral (serif, headlines) + Golos Text (grotesk, body/UI)
   Warm ivory light theme · ink graphite dark theme · coral accent
   ============================================================ */

@import url('fonts.css'); /* самохостинг: Spectral + Golos Text, woff2 в fonts/ */

/* ---------- TOKENS : LIGHT (default) ---------- */
:root {
  /* warm ivory base */
  --bg:            #F3EFE7;
  --bg-sunk:       #EDE8DD;   /* recessed sections */
  --surface:       #FBF9F4;   /* cards */
  --surface-2:     #F7F3EB;
  --surface-raised:#FFFEFB;

  /* ink + warm grays */
  --ink:           #16191F;   /* primary text */
  --text:          #23272F;
  --text-soft:     #595D63;   /* secondary text */
  --text-mute:     #8A8A82;   /* tertiary / captions */
  --line:          #E2DBCD;   /* hairline borders */
  --line-strong:   #D2C9B7;

  /* coral-rose accent (used ≤7% of surface) */
  --coral:         #DC5878;
  --coral-press:   #C44862;
  --coral-tint:    #F7E6EA;   /* very light wash */
  --coral-ink:     #B23E58;   /* coral that passes on light bg for text */

  /* supportive ink-blue for links/diagrams (NOT a brand color, structural) */
  --steel:         #3B4A63;

  /* fx */
  --focus:         #DC5878;
  --shadow-sm:     0 1px 2px rgba(22,25,31,.04);
  --shadow-card:   0 1px 0 rgba(22,25,31,.03);

  /* type */
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans:  'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* spacing scale (4-based) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* radius — never capsule */
  --r-sm: 4px; --r: 8px; --r-lg: 12px;

  --maxw: 1240px;
  --gutter: 40px;

  color-scheme: light;
}

/* ---------- TOKENS : DARK (standalone, not an inversion) ---------- */
[data-theme="dark"] {
  --bg:            #11151C;
  --bg-sunk:       #0D1117;
  --surface:       #181D26;
  --surface-2:     #1B212B;
  --surface-raised:#202734;

  --ink:           #F0EBE0;
  --text:          #E2DDD2;
  --text-soft:     #9DA2AC;
  --text-mute:     #6E747F;
  --line:          #272E3A;
  --line-strong:   #343D4B;

  --coral:         #E8617A;
  --coral-press:   #F07A8F;
  --coral-tint:    #2A1B22;
  --coral-ink:     #F08DA0;

  --steel:         #9FB0CC;

  --shadow-sm:     0 1px 2px rgba(0,0,0,.3);
  --shadow-card:   0 1px 0 rgba(0,0,0,.2);

  color-scheme: dark;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--coral); color: #fff; }

/* suppress every transition/animation during a theme swap (engine stalls transitions on var change) */
.theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important;
}

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s9) 0; }
.section--sunk { background: var(--bg-sunk); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- TYPE ---------- */
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 400; color: var(--ink);
  margin: 0; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.display { font-size: clamp(44px, 6vw, 84px); font-weight: 300; line-height: 1.02;
  letter-spacing: -.02em; }
.h1 { font-size: clamp(36px, 4.4vw, 60px); }
.h2 { font-size: clamp(28px, 3.4vw, 42px); }
.h3 { font-size: clamp(21px, 2vw, 27px); line-height: 1.16; }
p { margin: 0 0 1em; color: var(--text-soft); }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--text); }
.eyebrow { font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--coral-ink);
  display: inline-flex; align-items: center; gap: var(--s2); }
.eyebrow--mute { color: var(--text-mute); }
.serif-accent { font-family: var(--serif); font-style: italic; font-weight: 400; }
.measure { max-width: 64ch; }
.measure-sm { max-width: 46ch; }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1;
  padding: 15px 22px; border-radius: var(--r-sm); border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--coral); color: #fff; }
.btn--primary:hover { background: var(--coral-press); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink); padding: 15px 4px; }
.btn--quiet:hover { color: var(--coral-ink); }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn--lg { padding: 18px 28px; font-size: 17px; }

/* text link with animated underline */
.tlink { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center;
  gap: 6px; position: relative; }
.tlink::after { content:""; position:absolute; left:0; right:14px; bottom:-2px; height:1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.tlink:hover { color: var(--coral-ink); }
.tlink:hover::after { transform: scaleX(1); }
.tlink .arr { transition: transform .2s ease; }
.tlink:hover .arr { transform: translateX(3px); }

/* ---------- CARDS (bordered, not shadowed) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s6); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.card--link { cursor: pointer; }
.card--link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card--link:hover .card-go { color: var(--coral-ink); }
.card--link:hover .card-go .arr { transform: translateX(3px); }
.card-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 15px; color: var(--text-mute); transition: color .2s ease; }
.card-go .arr { transition: transform .2s ease; }

/* tag / chip / badge */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--text-soft); padding: 5px 11px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); }
.tag--code { font-family: var(--sans); letter-spacing: .04em; }
.badge { display:inline-flex; align-items:center; gap:6px; font-size: 12px; font-weight: 700;
  letter-spacing:.06em; text-transform: uppercase; color: var(--coral-ink);
  background: var(--coral-tint); padding: 5px 10px; border-radius: var(--r-sm); }

/* code label for system names */
.kbd { font-family: var(--sans); font-weight: 600; letter-spacing: .02em; }

/* ---------- FORM ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s5); }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .req { color: var(--coral-ink); }
.field .hint { font-size: 13px; color: var(--text-mute); }
.input, .textarea, .select {
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 13px 14px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-tint); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field--error .input, .field--error .textarea, .field--error .select { border-color: var(--coral); }
.field-error { font-size: 13px; color: var(--coral-ink); display: none; }
.field--error .field-error { display: block; }

/* honeypot — скрытое поле-ловушка для ботов, людям не видно */
.hp-input { position: absolute !important; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; }
/* подсветка невалидного поля вне .field-обёртки */
.input--error { border-color: var(--coral) !important; }
/* сообщение «не отправилось» */
.form-fail { display: none; font-size: 14px; line-height: 1.5; color: var(--coral-ink);
  background: var(--coral-tint); border: 1px solid var(--coral); border-radius: var(--r-sm);
  padding: 12px 14px; margin-top: 14px; }
.form-fail a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* строка согласия на обработку ПДн */
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px;
  line-height: 1.5; color: var(--text-soft); cursor: pointer; }
.check-line input { margin: 3px 0 0; width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--coral); }
.check-line a { color: var(--coral-ink); text-decoration: underline; text-underline-offset: 2px; }

/* segmented choice (directions) */
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { font-size: 14px; font-weight: 500; color: var(--text); padding: 9px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-raised);
  transition: all .15s ease; user-select: none; }
.choice:hover { border-color: var(--ink); }
.choice.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="dark"] .choice.is-on { background: var(--ink); color: var(--bg-sunk); }

/* ---------- GRID HELPERS ---------- */
.grid { display: grid; gap: var(--s5); }
.g-2 { grid-template-columns: repeat(2,1fr); }
.g-3 { grid-template-columns: repeat(3,1fr); }
.g-4 { grid-template-columns: repeat(4,1fr); }
.flow { display: flex; flex-direction: column; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.between { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s5); }

/* ---------- HEADER ---------- */
.site-header { position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: var(--s6); height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .mark { width: 30px; height: 30px; }
.brand .wordmark { font-family: var(--sans); font-weight: 700; font-size: 16px;
  letter-spacing: .03em; color: var(--ink); line-height: 1; }
.brand .wordmark small { display:block; font-weight: 500; font-size: 10px; letter-spacing: .22em;
  color: var(--text-mute); margin-top: 3px; }
.wordmark .wm-pink { color: var(--coral-ink); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: var(--s4); }
.nav-link { position: relative; font-size: 15px; font-weight: 500; color: var(--text);
  padding: 9px 13px; border-radius: var(--r-sm); transition: color .15s ease, background .15s ease; }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--coral-ink); }
.nav-link.has-menu::after { content:"›"; display:inline-block; transform: rotate(90deg);
  font-size: 12px; margin-left: 5px; color: var(--text-mute); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }

/* mega dropdown */
.has-dd { position: relative; }
.dd { position: absolute; top: calc(100% + 10px); left: 0; min-width: 540px;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; box-shadow: 0 24px 48px -24px rgba(22,25,31,.28);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease; }
[data-theme="dark"] .dd { box-shadow: 0 24px 48px -20px rgba(0,0,0,.6); }
.has-dd:hover .dd, .has-dd:focus-within .dd { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dd-item { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border-radius: var(--r); transition: background .15s ease; }
.dd-item:hover { background: var(--surface-2); }
.dd-item b { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.dd-item span { font-size: 12.5px; color: var(--text-mute); }
.dd-foot { margin-top: 8px; padding: 12px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; }

/* theme toggle */
.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  color: var(--text); transition: all .15s ease; }
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* burger */
.burger { display: none; width: 38px; height: 38px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); flex-direction: column; gap: 4px;
  align-items: center; justify-content: center; }
.burger span { width: 16px; height: 1.5px; background: var(--ink); transition: .2s; }

/* mobile sheet */
.m-sheet { position: fixed; inset: 0; z-index: 200; background: var(--bg);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; padding: 18px var(--gutter); overflow-y: auto; }
.m-sheet.is-open { transform: translateX(0); }
.m-sheet-top { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.m-close { width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 20px; }
.m-nav { display: flex; flex-direction: column; margin-top: var(--s5); }
.m-nav a { font-family: var(--serif); font-size: 30px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.m-nav a .sub { font-family: var(--sans); font-size: 13px; color: var(--text-mute); display:block; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--bg-sunk); border-top: 1px solid var(--line); padding: var(--s9) 0 var(--s6); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s6); }
.foot-col h5 { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-mute); margin: 0 0 var(--s4); }
.foot-col a { display: block; font-size: 15px; color: var(--text-soft); padding: 6px 0; transition: color .15s; }
.foot-col a:hover { color: var(--coral-ink); }
.foot-contact a { font-size: 16px; color: var(--ink); font-weight: 500; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s5);
  margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot-bottom small { color: var(--text-mute); font-size: 13px; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-legal a { font-size: 13px; color: var(--text-mute); transition: color .15s; }
.foot-legal a:hover { color: var(--coral-ink); }

/* ---------- REVEAL ANIMATION ----------
   Resting state is ALWAYS visible (opacity:1). The entrance animates transform
   only, so if the engine throttles animation timing the content is never hidden. */
.reveal { opacity: 1; }
.reveal.in { animation: reveal-up .6s cubic-bezier(.2,.7,.2,1) both; }
.reveal.d1.in { animation-delay: .06s; } .reveal.d2.in { animation-delay: .12s; }
.reveal.d3.in { animation-delay: .18s; } .reveal.d4.in { animation-delay: .24s; }
@keyframes reveal-up {
  from { transform: translateY(16px); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.in { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- CTA BAND : тёмная тема ----------
   Страницы задают .cta-band { background:var(--ink); color:var(--bg) } у себя.
   В тёмной теме фон меняется на тёмный, поэтому текст принудительно светлый —
   иначе тёмное на тёмном (заголовки с color:inherit и абзацы наследуют). */
[data-theme="dark"] .cta-band { color: var(--text); }
[data-theme="dark"] .cta-band h1, [data-theme="dark"] .cta-band h2 { color: var(--ink); }
/* абзацы внутри полосы наследуют её цвет (а не серый текст со светлого фона) */
.cta-band p { color: inherit; }

/* ---------- MISC ---------- */
.stat-num { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 5vw, 68px);
  line-height: 1; color: var(--ink); letter-spacing: -.02em; }
.stat-num .u { color: var(--coral); }
.note { font-size: 13px; color: var(--text-mute); }
.pill-row { display:flex; flex-wrap:wrap; gap: 8px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .burger { display: flex; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); }
}
@media (max-width: 820px) {
  :root { --gutter: 22px; }
  .section { padding: var(--s8) 0; }
  .g-3, .g-4 { grid-template-columns: repeat(2,1fr); }
  .between { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav { height: 60px; }
}
