/* «Угли»: tokens, typography, header, buttons, footer, shared motion. */
:root {
  color-scheme: dark;
  --bg: #0d0b09;
  --bg-2: #14100d;
  --card: #1a1511;
  --card-2: #221b16;
  --line: rgba(240, 228, 210, 0.12);
  --line-strong: rgba(240, 228, 210, 0.24);
  --text: #f0e4d2;
  --muted: #a5967f;
  --ash: #6f6457;
  --ember: #ff5f1f;
  --ember-2: #ffae57;
  --ember-soft: rgba(255, 95, 31, 0.14);
  --ok: #a6d58f;
  --danger: #ff8a7a;
  --serif: 'Cormorant', 'Times New Roman', serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ember); color: #160b05; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ember); color: #160b05; border-radius: 8px; }
.skip:focus { top: 12px; }

/* grain over everything for a warm, analogue feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.kicker {
  margin: 0 0 14px;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-2);
}
.h2 {
  margin: 0;
  font: 500 clamp(40px, 6vw, 84px)/0.98 var(--serif);
  letter-spacing: -0.01em;
}
.h2 em, .hero__title em { font-style: italic; color: var(--ember-2); }
.section-head { padding: 0 var(--gutter); max-width: 1320px; margin: 0 auto 48px; }
.section-head--row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* buttons */
.btn {
  --bg-btn: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-btn);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease), border-color 0.3s, color 0.3s;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 140% at 50% 120%, var(--ember-2), var(--ember) 45%, #b8340a);
  opacity: 0;
  transition: opacity 0.35s;
}
.btn:hover { transform: translateY(-2px); }
.btn--ember { border-color: transparent; color: #1a0b04; --bg-btn: var(--ember); }
.btn--ember::before { opacity: 0; }
.btn--ember:hover::before { opacity: 1; }
.btn--ghost:hover { border-color: var(--ember-2); color: var(--ember-2); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; transform: none; }
.link-quiet { background: none; border: 0; padding: 6px 2px; color: var(--muted); text-decoration: none; cursor: pointer; transition: color 0.2s; }
.link-quiet:hover { color: var(--text); }

/* header */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--gutter);
  transition: transform 0.45s var(--ease), background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.header.is-solid { background: rgba(13, 11, 9, 0.92); border-color: var(--line); }
.header.is-hidden { transform: translateY(-100%); }
.logo { display: inline-flex; align-items: center; gap: 10px; font: italic 600 30px/1 var(--serif); text-decoration: none; }
.logo__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 14px 3px rgba(255, 95, 31, 0.6); animation: ember 2.6s ease-in-out infinite; }
.nav { display: flex; gap: 30px; font-size: 15px; }
.nav a, .footer__nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav a:hover, .footer__nav a:hover { color: var(--text); }
.header__actions { display: flex; align-items: center; gap: 18px; }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: none; cursor: pointer; position: relative; }
.burger span:not(.sr-only) { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease), top 0.3s; }
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 25px; }
.burger[aria-expanded='true'] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(13, 11, 9, 0.97);
}
.mobile-menu nav { display: grid; gap: 18px; text-align: center; }
.mobile-menu a { font: 500 40px/1.1 var(--serif); text-decoration: none; }

@media (max-width: 980px) {
  .nav, .header__actions .link-quiet { display: none; }
  .burger { display: block; }
}
@media (max-width: 480px) {
  :root { --header-h: 64px; }
  .header__actions .btn { display: none; }
}

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--delay, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card-2);
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0s 0.45s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform 0.45s var(--ease); }

/* footer */
.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px 40px;
  padding: 56px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  max-width: 1320px;
  margin: 0 auto;
}
.footer__brand p { margin: 8px 0 0; color: var(--muted); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: start; }
.footer__legal { grid-column: 1 / -1; margin: 0; max-width: 760px; font-size: 13px; color: var(--ash); }
@media (max-width: 720px) { .footer { grid-template-columns: 1fr; } }

@keyframes ember { 50% { box-shadow: 0 0 22px 6px rgba(255, 140, 60, 0.75); transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
