/* DNK Editorial — design tokens & base styles
   Используется на всех страницах сайта. */

:root {
  /* Colors — off-white warm + true ink + single accent */
  --bg: #FAFAF7;
  --bg-elevated: #FFFFFF;
  --bg-soft: #F4F2EC;
  --bg-rule: #ECE9E1;
  --ink: #0A0A0A;
  --ink-2: #1F1F1F;
  --text-muted: #6E6E6E;
  --border: #E4E0D6;
  --border-strong: #C9C4B6;
  --accent: #0337FE;
  --accent-foreground: #FFFFFF;
  --accent-soft: #E6ECFE;
  --accent-2: #0026B8;

  /* Type scale — editorial */
  --ff-display: 'Onest', ui-sans-serif, system-ui, sans-serif;
  --ff-body: 'Onest', ui-sans-serif, system-ui, sans-serif;

  --fs-display-xl: clamp(44px, 5.6vw, 96px);
  --fs-display-l:  clamp(38px, 4.4vw, 72px);
  --fs-display-m:  clamp(30px, 3.2vw, 52px);
  --fs-h1:         clamp(32px, 3.2vw, 52px);
  --fs-h2:         clamp(24px, 2.2vw, 36px);
  --fs-h3:         clamp(20px, 1.6vw, 26px);
  --fs-body-l:     19px;
  --fs-body:       17px;
  --fs-caption:    13px;

  --lh-display: 0.96;
  --lh-h: 1.08;
  --lh-body: 1.55;

  /* Spacing — 4px-based */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 28px; --s-12: 40px; --s-16: 56px;
  --s-24: 80px; --s-32: 112px; --s-48: 160px;

  /* Layout */
  --col: 12;
  --gutter: 24px;
  --page-margin: clamp(24px, 5vw, 64px);
  --max-w: 1440px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* Typography classes */
.display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-display); letter-spacing: -0.045em; font-weight: 500; }
.display-l  { font-size: var(--fs-display-l);  line-height: var(--lh-display); letter-spacing: -0.04em;  font-weight: 500; }
.display-m  { font-size: var(--fs-display-m);  line-height: 1.02;              letter-spacing: -0.035em; font-weight: 500; }

h1 { font-size: var(--fs-h1); line-height: var(--lh-h); letter-spacing: -0.025em; margin: 0; font-weight: 500; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h); letter-spacing: -0.02em; margin: 0; font-weight: 500; }
h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.01em; margin: 0; font-weight: 500; }

p { margin: 0; }
.lead { font-size: var(--fs-body-l); line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.muted { color: var(--text-muted); }
.caption { font-size: var(--fs-caption); line-height: 1.45; letter-spacing: 0.01em; color: var(--text-muted); }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500; color: var(--text-muted);
}
.serial { font-variant-numeric: tabular-nums; font-feature-settings: "tnum","zero"; letter-spacing: -0.02em; }
em.editorial, .editorial-i { font-style: italic; font-weight: 400; color: var(--accent); }
.accent-text { color: var(--accent); }
.ink-accent { color: var(--accent); }

/* Layout primitives */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1; }
.wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding-left: var(--page-margin); padding-right: var(--page-margin);
}
.grid-12 {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
}
@media (max-width: 760px) {
  .grid-12 { grid-template-columns: repeat(6, 1fr); }
}

/* Section rhythm */
.section { padding: var(--s-16) 0; border-top: 1px solid var(--border); }
.section.no-rule { border-top: 0; }
.section.tight { padding: var(--s-12) 0; }
.section-mark { display: flex; align-items: baseline; gap: 16px; margin-bottom: var(--s-8); }
.section-mark .num { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--text-muted); }
.section-mark .label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); font-weight: 500; }

/* Buttons / links */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 0;
  font-size: 15px; font-weight: 500; line-height: 1;
  border: 1px solid var(--accent); background: var(--accent); color: white;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--ink); color: white; border-color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }
.btn-lg { padding: 18px 26px; font-size: 16px; }

.link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; color: var(--ink); position: relative;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%; background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: color .2s ease, background-size .25s ease;
}
.link:hover { color: var(--accent); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500;
}
.arrow-link svg { transition: transform .2s ease; }
.arrow-link:hover svg { transform: translateX(4px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,247,.85); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.site-header .logo { display: flex; align-items: center; gap: 10px; }
.site-header .logo img { height: 36px; }
.site-header .nav { display: flex; gap: 28px; }
.site-header .nav a {
  font-size: 14.5px; color: var(--ink-2); padding: 6px 0;
  border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.site-header .nav a:hover { color: var(--accent); }
.site-header .nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 900px) {
  .site-header .nav { display: none; }
}

/* Footer */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.75);
  padding: var(--s-16) 0 var(--s-6);
  margin-top: var(--s-24);
}
.site-footer h4 {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.45); font-weight: 500; margin-bottom: 16px;
}
.site-footer a { color: rgba(255,255,255,.85); display: block; padding: 6px 0; font-size: 14.5px; }
.site-footer a:hover { color: white; text-decoration: underline; text-underline-offset: 4px; }
.site-footer .grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; gap: 32px;
}
@media (max-width: 900px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
}
.site-footer .brand img { height: 40px; margin-bottom: 18px; }
.site-footer .brand p { font-size: 14px; color: rgba(255,255,255,.65); max-width: 280px; line-height: 1.5; }
.site-footer .bot {
  margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: rgba(255,255,255,.55);
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted); margin-top: var(--s-8);
  width: 100%;
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--border-strong); }

/* Utility */
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-12 { grid-column: span 12; }
.col-start-2 { grid-column-start: 2; }
.col-start-4 { grid-column-start: 4; }
.col-start-6 { grid-column-start: 6; }
.col-start-7 { grid-column-start: 7; }
@media (max-width: 760px) {
  .col-span-3, .col-span-4, .col-span-5, .col-span-6, .col-span-7, .col-span-8, .col-span-9, .col-span-12 { grid-column: span 6; }
  .col-start-2, .col-start-4, .col-start-6, .col-start-7 { grid-column-start: 1; }
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
/* Failsafe — first-paint elements should never stay invisible */
.home-hero .reveal,
.home-hero .reveal.in { opacity: 1 !important; transform: none !important; }

/* Hairlines */
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Pricing row */
.pricing {
  border-top: 1px solid var(--ink);
}
.pricing-row {
  display: grid;
  grid-template-columns: 80px minmax(220px, 1.3fr) minmax(0, 2fr) 200px 140px;
  align-items: center; gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: background .15s ease, padding .2s ease;
  position: relative;
}
.pricing-row:hover { background: var(--bg-soft); }
.pricing-row .num { font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pricing-row .ttl { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
.pricing-row .desc { font-size: 14.5px; color: var(--text-muted); line-height: 1.5; }
.pricing-row .price { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; text-align: right; font-variant-numeric: tabular-nums; }
.pricing-row .price small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.pricing-row .term { font-size: 14.5px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .pricing-row { grid-template-columns: 36px 1fr; gap: 12px 18px; padding: 22px 0; }
  .pricing-row .desc { grid-column: 2; }
  .pricing-row .price { grid-column: 2; text-align: left; font-size: 20px; }
  .pricing-row .term { grid-column: 2; text-align: left; }
}

/* Service tile */
.tile {
  display: block; padding: 28px 0 32px;
  border-top: 1px solid var(--border);
  transition: padding-left .25s ease, color .15s ease;
}
.tile:hover { padding-left: 12px; color: var(--accent); }
.tile .tile-num { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.tile .tile-ttl { font-size: 32px; line-height: 1.05; letter-spacing: -0.02em; font-weight: 500; }
.tile .tile-desc { font-size: 15px; color: var(--text-muted); margin-top: 12px; max-width: 52ch; line-height: 1.5; }
.tile .tile-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--ink-2); }

/* Vertical card */
.vert {
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px; background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: transform .2s ease, border-color .2s ease;
}
.vert:hover { transform: translateY(-3px); border-color: var(--ink); }
.vert .vert-num { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.vert .vert-ttl { font-size: 22px; letter-spacing: -0.015em; font-weight: 500; }
.vert .vert-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.vert .vert-mockup {
  aspect-ratio: 16/10; background: var(--bg-soft);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}

/* FAQ */
.faq { border-top: 1px solid var(--ink); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item button {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 60px 1fr 24px; gap: 16px; align-items: baseline;
  padding: 24px 0; font-size: 19px; letter-spacing: -0.01em; font-weight: 500;
}
.faq-item .q-num { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.faq-item .q-plus { width: 16px; height: 16px; position: relative; align-self: center; }
.faq-item .q-plus::before, .faq-item .q-plus::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink);
  transform: translate(-50%, -50%); transition: transform .25s ease, opacity .25s ease;
}
.faq-item .q-plus::before { width: 16px; height: 1.5px; }
.faq-item .q-plus::after { width: 1.5px; height: 16px; }
.faq-item.open .q-plus::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.faq-item .ans {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease;
}
.faq-item .ans > .inner { overflow: hidden; min-height: 0; }
.faq-item.open .ans { grid-template-rows: 1fr; }
.faq-item .ans p {
  padding: 0 0 28px 76px; max-width: 640px;
  font-size: 16px; line-height: 1.6; color: var(--ink-2);
}
@media (max-width: 760px) {
  .faq-item button { grid-template-columns: 36px 1fr 24px; font-size: 17px; gap: 12px; }
  .faq-item .ans p { padding-left: 48px; }
}

/* CTA section — full bleed dark, no gap to footer */
.cta-section { padding: 0; border: 0; margin-top: var(--s-16); }
.cta-section .wrap { padding-left: 0; padding-right: 0; max-width: none; }
.cta-block {
  background: var(--ink); color: white; padding: var(--s-16) var(--page-margin);
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: end;
  max-width: var(--max-w); margin: 0 auto; box-sizing: border-box; width: 100%;
}
.cta-block h2 { color: white; font-size: clamp(28px, 3.4vw, 56px); letter-spacing: -0.025em; max-width: 18ch; }
.cta-block p { color: rgba(255,255,255,.7); margin-top: 14px; max-width: 52ch; }
.cta-actions { display: flex; flex-direction: column; gap: 14px; align-items: stretch; min-width: 220px; }
.btn-on-dark { background: white; color: var(--ink); border-color: white; }
.btn-on-dark:hover { background: var(--accent); color: white; border-color: var(--accent); }
.link-on-dark { color: rgba(255,255,255,.85); }
.link-on-dark:hover { color: white; }
@media (max-width: 760px) { .cta-block { grid-template-columns: 1fr; gap: 28px; } }

.site-footer { margin-top: 0 !important; padding-top: var(--s-12); }

/* Static helix svg accents */
.helix-static {
  width: 100%; height: 100%;
  color: var(--ink);
}

/* Mockup frame for case previews */
.mockup {
  background: var(--bg-soft); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.mockup .chrome {
  height: 28px; background: var(--bg-rule); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 5px; padding: 0 10px;
}
.mockup .chrome .d { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.mockup .body { padding: 12% 10% 10%; }
