/* ============================================================
   Genesis design system — landing for merrow.dev
   Tokens → base → components → sections → responsive
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --border: #E8E8EC;
  --border-strong: #D9D9E0;
  --text: #0A0A0A;
  --text-2: #6B6B6B;
  --muted: #9C9C9C;
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --ring: rgba(99, 102, 241, 0.14);
  --success: #10B981;
  --danger: #EF4444;
  --chip-bg: #F0F0F4;
  --hover-bg: #F4F4F7;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.14);
  --glow: 0 4px 12px rgba(99, 102, 241, 0.35);

  --font-display: "General Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  --container: 1280px;
  --nav-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0C0E;
    --surface: #151518;
    --border: #26262B;
    --border-strong: #34343B;
    --text: #F2F2F4;
    --text-2: #A6A6AE;
    --muted: #71717A;
    --primary: #6366F1;
    --primary-hover: #818CF8;
    --ring: rgba(99, 102, 241, 0.32);
    --success: #34D399;
    --danger: #F87171;
    --chip-bg: #1C1C21;
    --hover-bg: #1A1A1F;
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.55);
    --glow: 0 4px 12px rgba(99, 102, 241, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #0C0C0E;
  --surface: #151518;
  --border: #26262B;
  --border-strong: #34343B;
  --text: #F2F2F4;
  --text-2: #A6A6AE;
  --muted: #71717A;
  --primary: #6366F1;
  --primary-hover: #818CF8;
  --ring: rgba(99, 102, 241, 0.32);
  --success: #34D399;
  --danger: #F87171;
  --chip-bg: #1C1C21;
  --hover-bg: #1A1A1F;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.55);
  --glow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font: 400 15px/1.6 var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(99, 102, 241, 0.25); }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--r-md);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }

/* ---------- Type utilities ---------- */
.overline {
  font: 500 11px/1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.display {
  font: 600 clamp(40px, 7vw, 72px)/1.05 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  font: 600 clamp(26px, 3.4vw, 32px)/1.2 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  font: 600 16px/1.35 var(--font-display);
  letter-spacing: -0.01em;
}

.lead {
  font-size: 16px;
  color: var(--text-2);
  max-width: 600px;
  margin-top: 12px;
}

.section-head { margin-bottom: 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 500 15px/1 var(--font-body);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-md { height: 38px; padding: 0 16px; }
.btn-lg { height: 44px; padding: 0 24px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover {
  background: var(--hover-bg);
  transform: translateY(-1px);
}

.btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  font: 600 17px/1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark-dot { color: var(--muted); }

.nav-links { display: flex; gap: 2px; margin: 0 auto; }
.nav-link {
  font: 500 14px/1 var(--font-body);
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--r-md);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-link:hover { color: var(--text); background: var(--hover-bg); }
.nav-link.active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.theme-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { color: var(--text); background: var(--hover-bg); }

.ico-sun { display: none; }
.ico-moon { display: block; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: block; }
  :root:not([data-theme="light"]) .ico-moon { display: none; }
}

.nav-burger {
  display: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text);
}
.nav-burger .ico-close { display: none; }
.nav-burger.open .ico-menu { display: none; }
.nav-burger.open .ico-close { display: block; }

.mobile-menu {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mobile-menu:not([hidden]) { display: flex; animation: menu-in 0.18s ease; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.mobile-link {
  font: 500 17px/1 var(--font-body);
  color: var(--text);
  padding: 14px 8px;
  border-radius: var(--r-lg);
}
.mobile-link:hover { background: var(--hover-bg); }
.mobile-cta { margin-top: 16px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 112px 0 120px;
  overflow: hidden;
}
#dotgrid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-inner {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1 var(--font-body);
  color: var(--text-2);
  background: var(--chip-bg);
  border-radius: 9999px;
  padding: 8px 14px;
  margin-bottom: 32px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--success);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero .display { max-width: 900px; margin: 0 auto 24px; }

.hero-sub {
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 720px;
  margin: 0 auto;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease,
              background-color 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.card p { color: var(--text-2); margin-top: 8px; }

.card-ico {
  width: 40px;
  height: 40px;
  border-radius: var(--r-lg);
  background: var(--chip-bg);
  color: var(--text);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  transition: background-color 0.2s ease;
}

/* CTA card inside services grid */
.card-cta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
}
.card-cta .btn { flex: none; }
.card-cta p { max-width: 640px; }

/* ---------- Case ---------- */
/* Cases slider: native scroll + snap, JS adds arrows/dots/keyboard */
.case-slider { position: relative; }
.case-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.case-track::-webkit-scrollbar { display: none; }
.case-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.case-arrow {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.case-arrow:hover { border-color: var(--primary); color: var(--primary); }
.case-arrow:disabled { opacity: 0.35; pointer-events: none; }
.case-arrow--prev { left: 18px; }
.case-arrow--next { right: 18px; }
.case-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.case-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--border-strong);
  transition: background-color 0.2s ease, width 0.2s ease;
}
.case-dot:hover { background: var(--muted); }
.case-dot.active { width: 24px; background: var(--primary); }

.case-title {
  font: 600 20px/1.25 var(--font-display);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.case-soon {
  display: inline-flex;
  align-items: center;
  font: 500 12px/1 var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 8px 13px;
}

/* Placeholder preview for upcoming cases */
.case-stub {
  background: #0F0F13;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 30px;
}
.sk { display: block; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.12); }
.sk-logo { width: 90px; height: 10px; }
.sk-link { width: 46px; height: 7px; }
.sk-line { width: 55%; height: 12px; }
.sk-line-short { width: 34%; }
.sk-btn { width: 112px; height: 30px; border-radius: var(--r-md); background: var(--primary); opacity: 0.85; }
.sk-block { width: 100%; height: 44px; background: rgba(255, 255, 255, 0.08); }
.mk-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mk-hero { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
.mk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mk-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 12px;
}

.case-desc { color: var(--text-2); margin-bottom: 24px; }

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.case-link-ico {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.case-link:hover .case-link-ico,
.case-link:focus-visible .case-link-ico { color: var(--primary); transform: translate(2px, -2px); }

.case-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.case-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
}
.case-features li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 7px;
  margin-top: 7px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.case-visual { position: relative; }

/* Live site preview in a browser chrome */
.browser {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.browser-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--border-strong);
}
.browser-addr {
  margin: 0 auto;
  font: 400 11px/1 var(--font-mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 4px 14px;
}
.browser-screen {
  aspect-ratio: 16 / 9;
  background: var(--bg);
}
.browser-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0F0F13;
}

.case-preview-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 14px;
}
.case-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-tab {
  font: 500 12px/1 var(--font-body);
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text-2);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.case-tab:hover { color: var(--text); border-color: var(--border-strong); }
.case-tab.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--ring);
}

.case-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px/1 var(--font-mono);
  color: var(--text-2);
  transition: color 0.2s ease;
}
.case-site-link:hover { color: var(--primary); }

.case-note {
  margin-top: 10px;
  font: 400 13px/1.5 var(--font-body);
  color: var(--muted);
}

/* Mobile: no live iframe, point to the site instead */

/* ---------- Process ---------- */
.process { counter-reset: step; }
.step-num {
  display: block;
  font: 500 13px/1 var(--font-mono);
  color: var(--muted);
  margin-bottom: 20px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: start;
}

.contact-sub {
  font: 500 13px/1 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease,
              background-color 0.2s ease;
}
.contact-row + .contact-row { margin-top: 12px; }
.contact-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.contact-ico {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--chip-bg);
  color: var(--text);
}
.contact-label { display: block; font-size: 12px; color: var(--muted); }
.contact-value { display: block; font: 500 15px/1.3 var(--font-body); color: var(--text); }
.contact-note { margin-top: 20px; font-size: 13px; color: var(--muted); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  transition: background-color 0.2s ease;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font: 500 13px/1 var(--font-body);
  margin-bottom: 8px;
  color: var(--text);
}
.field input,
.field textarea {
  width: 100%;
  font: 400 14px/1.5 var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-color: var(--primary);
}
.input-error { border-color: var(--danger) !important; }

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  font-size: 13px;
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.form-privacy {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Contact picker: messenger chips */
.contact-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  font: 500 12px/1 var(--font-body);
  padding: 7px 11px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--ring);
}

.field-hint { margin-top: 6px; font: 400 12px/1.4 var(--font-body); color: var(--muted); }
.hint-switch {
  font: inherit;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Consent checkbox */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 14px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.consent-box {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.consent input:checked + .consent-box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.consent input:focus-visible + .consent-box { box-shadow: 0 0 0 3px var(--ring); }
.consent.error .consent-box { border-color: var(--danger); }
.consent-text { font: 400 12.5px/1.45 var(--font-body); color: var(--text-2); }

/* Submit button: loading spinner */
.btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}
.btn.loading { pointer-events: none; opacity: 0.85; }
.btn.loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Error shake on the form card */
@keyframes shake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.form-card.shake { animation: shake 0.35s ease; }
@media (prefers-reduced-motion: reduce) {
  .form-card.shake { animation: none; }
}

/* Success: animated check draw */
.form-success { padding: 8px 0; }
.form-success.play { animation: pop-in 0.3s ease; }
.success-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  margin-bottom: 16px;
}
.ok-circle { stroke-dasharray: 151; stroke-dashoffset: 0; }
.ok-check { stroke-dasharray: 36; stroke-dashoffset: 0; }
.form-success.play .ok-circle { animation: draw-circle 0.55s ease-out backwards; }
.form-success.play .ok-check { animation: draw-check 0.3s ease-out 0.45s backwards; }
@keyframes draw-circle { from { stroke-dashoffset: 151; } to { stroke-dashoffset: 0; } }
@keyframes draw-check { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .form-success.play, .form-success.play .ok-circle, .form-success.play .ok-check { animation: none; }
}
.form-success p { color: var(--text-2); margin-top: 8px; }
.form-success a { color: var(--primary); font-weight: 500; }
.form-success a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.footer-brand p { color: var(--text-2); margin-top: 12px; max-width: 320px; }
.footer-col h4 {
  font: 500 13px/1 var(--font-body);
  margin-bottom: 16px;
  color: var(--text);
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--text); }
.footer-requisites { font-size: 13px; color: var(--muted); margin-top: 8px; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 13px;
  color: var(--muted);
}
.footer-stack { font: 400 12px/1 var(--font-mono); }

/* ---------- 404 ---------- */
.nf {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}
.nf-code { font: 500 13px/1 var(--font-mono); color: var(--muted); }
.nf-title { font: 600 32px/1.2 var(--font-display); letter-spacing: -0.02em; }
.nf-text { color: var(--text-2); margin-bottom: 16px; }

/* ---------- Reveal ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
html.js .reveal.in { opacity: 1; transform: none; }
html.js .grid .reveal:nth-child(2) { transition-delay: 60ms; }
html.js .grid .reveal:nth-child(3) { transition-delay: 120ms; }
html.js .grid .reveal:nth-child(4) { transition-delay: 180ms; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 14px;
  font: 500 14px/1 var(--font-body);
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 12px; }

/* ---------- Scroll to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease,
              border-color 0.2s ease, color 0.2s ease;
}
.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: grid; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 48px 0; }
  .hero { padding: 72px 0 80px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .card-cta { flex-direction: column; align-items: flex-start; }
  .case-slide { padding: 20px; }
  .to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .browser, .case-tabs, .case-arrow { display: none; }
  .case-note {
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    font: 400 14px/1.55 var(--font-body);
    color: var(--text-2);
  }
  .form-card { padding: 24px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .br-lg { display: none; }
}

@media (min-width: 641px) {
  .br-lg { display: inline; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  .pulse-dot { animation: none; }
}
