:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --line: rgba(236, 231, 223, 0.12);
  --line-strong: rgba(236, 231, 223, 0.24);
  --text: #ece7df;
  --muted: rgba(236, 231, 223, 0.56);
  --faint: rgba(236, 231, 223, 0.32);
  --accent: #c9b48a;
  --ink: #0a0a0b;
  --ink-muted: rgba(10, 10, 11, 0.6);
  --ink-line: rgba(10, 10, 11, 0.14);
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
/* hidden всегда скрывает элемент, даже если у его класса задан display */
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease-out, transform 250ms ease-out;
}
.header.scrolled { border-bottom-color: var(--line); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; height: 72px; }
.logo { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a.link { font-size: 15px; color: var(--muted); transition: color 150ms ease-out; }
.nav a.link[aria-current="page"] { color: var(--text); }
.menu-btn {
  display: none;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text); cursor: pointer;
}
.menu-btn span, .menu-btn span::before {
  display: block; width: 14px; height: 1px; margin: 0 auto; background: currentColor; position: relative;
  transition: transform 200ms ease-out;
}
.menu-btn span::before { content: ""; position: absolute; top: 5px; left: 0; }
.menu-btn span { transform: translateY(-3px); }
.menu-open .menu-btn span { transform: translateY(0) rotate(45deg); }
.menu-open .menu-btn span::before { transform: translateY(-5px) rotate(-90deg); }

.mobile-menu {
  position: fixed; inset: 72px 0 0 0; z-index: 19;
  background: var(--bg);
  padding: 24px var(--gutter) 40px;
  display: none; flex-direction: column; overflow-y: auto;
}
.menu-open .mobile-menu { display: flex; }
.mobile-menu a.m-link {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: 28px; letter-spacing: -0.02em;
}
.mobile-menu a.m-link[aria-current="page"] { font-family: var(--serif); font-style: italic; }
.mobile-menu .btn { margin-top: 32px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.small { height: 40px; padding: 0 20px; font-size: 14px; }
.on-light .btn { background: var(--ink); color: var(--text); border-color: var(--ink); }

/* Type */
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 { font-size: clamp(44px, 7.4vw, 112px); line-height: 0.98; letter-spacing: -0.035em; }
h1 .serif { font-size: 1.06em; }
h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.03em; }
h2 .serif { font-size: 1.08em; }
.lead { margin: 0; color: var(--muted); font-size: 19px; line-height: 1.5; max-width: 480px; }

/* Hero */
.hero { padding: 176px 0 120px; }
.hero h1 { max-width: 15ch; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-top: 48px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.page-hero { padding: 176px 0 120px; }
.page-hero h1 { max-width: 16ch; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.motion .hero-row { animation: rise 800ms cubic-bezier(.2,.7,.2,1) 380ms both; }

/* Sections */
section { padding: 160px 0; border-top: 1px solid var(--line); }
.s-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 80px; }
.s-head .lead { justify-self: end; font-size: 18px; max-width: 440px; }

/* Service index (home) */
.svc-list { border-top: 1px solid var(--line-strong); }
.svc-row {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 48px; align-items: baseline;
  padding: 40px 0; border-bottom: 1px solid var(--line);
  transition: color 150ms ease-out;
}
.svc-name { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -0.03em; transition: color 150ms ease-out; }
.svc-desc { color: var(--muted); font-size: 16px; max-width: 420px; }
.svc-price { font-size: 15px; color: var(--muted); white-space: nowrap; text-align: right; min-width: 140px; }

/* Rows: item list on service pages */
.rows { border-top: 1px solid var(--line-strong); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.row h3 { font-size: 24px; letter-spacing: -0.015em; font-weight: 400; }
.row p { margin: 0; color: var(--muted); max-width: 520px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: step; }
.step { padding: 32px 24px 0 0; border-top: 1px solid var(--line-strong); counter-increment: step; }
.step::before { content: counter(step); display: block; margin-bottom: 48px; font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; color: var(--accent); }
.step h3 { margin: 0 0 12px; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* Tiers */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.tier { border: 1px solid var(--line); border-radius: 4px; padding: 40px 32px; display: flex; flex-direction: column; }
.tier.on-light { background: var(--text); color: var(--ink); border-color: var(--text); }
.tier h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.tier-price { margin: 24px 0 32px; font-size: clamp(56px, 6vw, 88px); line-height: 0.9; font-weight: 300; letter-spacing: -0.05em; }
.tier-price .serif { font-size: 0.55em; margin-left: 4px; }
.tier ul { list-style: none; margin: 0 0 40px; padding: 0; border-top: 1px solid var(--line); flex: 1; }
.tier.on-light ul { border-top-color: var(--ink-line); }
.tier li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.tier.on-light li { border-bottom-color: var(--ink-line); }
.tier .btn { align-self: flex-start; }
.tier-note { margin: 32px 0 0; color: var(--muted); font-size: 16px; }
.tier-note b { color: var(--text); font-weight: 500; }

/* Price block (service pages without tiers) */
.price-block { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.price-block p { margin: 0; color: var(--muted); font-size: 18px; max-width: 480px; }

/* Other services */
.others { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); }
.other { padding: 32px 24px 32px 0; border-right: 1px solid var(--line); }
.other + .other { padding-left: 24px; }
.other:last-child { border-right: 0; }
.other span { display: block; font-size: 22px; letter-spacing: -0.015em; transition: color 150ms ease-out; }
.other small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 28px 0; font-size: clamp(19px, 2vw, 24px); letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--text), var(--text)) center / 14px 1px no-repeat,
    linear-gradient(var(--text), var(--text)) center / 1px 14px no-repeat;
  transition: transform 200ms ease-out;
}
.faq details.is-open summary::after { transform: rotate(45deg); }
.faq-body { overflow: hidden; }
.faq-body p { margin: 0 0 28px; color: var(--muted); max-width: 640px; }

/* CTA */
.cta { padding: 200px 0 160px; }
.cta h2 { font-size: clamp(48px, 9vw, 144px); line-height: 0.95; letter-spacing: -0.045em; max-width: 12ch; }
.cta-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-top: 64px; flex-wrap: wrap; }

/* Contacts */
.contacts { display: grid; grid-template-columns: repeat(3, auto); gap: 64px; margin: 0; }
.contacts dt { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.contacts dd { margin: 0; font-size: 19px; }
.contacts a, .u-link {
  padding-bottom: 3px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat;
  transition: background-size 300ms cubic-bezier(.2,.7,.2,1);
}

/* Form */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 96px; align-items: start; }
.form { display: grid; gap: 32px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  padding: 8px 0 14px;
  font: 400 20px/1.4 var(--sans);
  transition: border-color 150ms ease-out;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 10px) 50%, calc(100% - 4px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
  padding-right: 32px;
}
.field select option { background: var(--bg-2); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--text); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.form-foot { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.form-status { margin: 0; color: var(--muted); font-size: 15px; }
.side-contacts { display: grid; gap: 32px; padding-top: 8px; }
.side-contacts dt { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.side-contacts dd { margin: 0; font-size: 22px; letter-spacing: -0.01em; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 80px 0 32px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.footer .logo { font-size: 44px; }
.footer h3 { font-size: 14px; color: var(--muted); font-weight: 400; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer ul a { display: inline-block; padding: 8px 0; }
.footer ul a {
  color: var(--muted);
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 6px) / 0 1px no-repeat;
  transition: color 150ms ease-out, background-size 300ms cubic-bezier(.2,.7,.2,1);
}
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 1080px) {
  .nav a.link { display: none; }
  .nav { gap: 12px; }
  .menu-btn { display: block; }
}
@media (max-width: 600px) {
  .nav .btn { display: none; }
}
@media (max-width: 960px) {
  section { padding: 112px 0; }
  .hero, .page-hero { padding-top: 136px; }
  .page-hero { padding-bottom: 96px; }
  .hero-row { flex-direction: column; align-items: flex-start; gap: 32px; }
  .s-head, .faq-wrap, .price-block, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { gap: 72px; }
  .s-head { margin-bottom: 56px; }
  .s-head .lead { justify-self: start; }
  .svc-row { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
  .svc-price { text-align: left; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .tiers { grid-template-columns: 1fr; }
  .others { grid-template-columns: 1fr 1fr; }
  .other, .other + .other { padding: 24px 16px 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .contacts { grid-template-columns: 1fr; gap: 24px; }
  .cta { padding: 136px 0 112px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .step::before { margin-bottom: 24px; }
  .tier { padding: 28px 24px; }
  .others { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .actions .btn { flex: 1; }
}

/* Contact page: form sits closer to the heading */
.page-hero.tight { padding-bottom: 72px; }
section.tight { padding-top: 72px; }
.hp, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.form-done .lead { margin-top: 24px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* Symptoms (home): each problem links to the service that fixes it */
.symptoms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.symptom {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  min-height: 240px; padding: 32px;
  border: 1px solid var(--line); border-radius: 4px;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.symptom-text { font-size: clamp(20px, 1.9vw, 26px); line-height: 1.25; letter-spacing: -0.015em; }
.symptom-fix { font-size: 14px; color: var(--muted); }

/* Pain rows on service pages: symptom in full color, consequence muted */
.pain-rows h3 { font-size: clamp(20px, 2vw, 26px); }

.cta-row .lead { max-width: 520px; }
.cta-contacts { margin-top: 96px; padding-top: 32px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  .symptoms { grid-template-columns: 1fr 1fr; }
  .cta-contacts { margin-top: 64px; }
}
@media (max-width: 600px) {
  .symptoms { grid-template-columns: 1fr; }
  .symptom { min-height: 0; padding: 24px; gap: 32px; }
}

@media (hover: hover) {
  .nav a.link:hover { color: var(--text); }
  .btn:hover { background: transparent; color: var(--text); }
  .btn.ghost:hover { border-color: var(--text); }
  .on-light .btn:hover { background: transparent; color: var(--ink); }
  .btn[disabled]:hover { background: var(--text); color: var(--bg); }
  .svc-row:hover .svc-name, .other:hover span { color: var(--accent); }
  .symptom:hover { border-color: var(--line-strong); background: var(--bg-2); }
  .symptom:hover .symptom-fix { color: var(--accent); }
  .footer ul a:hover { color: var(--text); background-size: 100% 1px; }
  .contacts a:hover, .u-link:hover { background-size: 100% 1px, 100% 1px; }
  .check:hover span { color: var(--text); }
}

/* Form errors */
.field-error { margin: 8px 0 0; font-size: 14px; color: #e59a8c; }
.field.invalid input { border-bottom-color: #e59a8c; }
.form-done:focus { outline: none; }

/* Tier: per-day price */
.tier-price { margin-bottom: 8px; }
.tier-day { margin: 0 0 32px; font-size: 14px; color: var(--muted); }
.tier.on-light .tier-day { color: var(--ink-muted); }

/* Outcomes */
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); }
.outcome { padding: 32px 24px 0 0; }
.outcome + .outcome { padding-left: 24px; border-left: 1px solid var(--line); }
.outcome h3 { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 12px; }
.outcome p { margin: 0; color: var(--muted); font-size: 15px; }

/* Example */
.example { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.example-label { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(36px, 4vw, 56px); line-height: 1; color: var(--accent); }
.example-text { margin: 0; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.35; letter-spacing: -0.015em; max-width: 30ch; }

/* Needs */
.needs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.needs li { padding: 24px; border: 1px solid var(--line); border-radius: 4px; font-size: 17px; }

/* Self-check */
.checklist { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: start; }
.checklist ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.checklist li { border-bottom: 1px solid var(--line); }
.check { display: flex; align-items: center; gap: 16px; padding: 18px 0; cursor: pointer; font-size: 18px; }
.check span { color: var(--muted); transition: color 150ms ease-out; }
.check input {
  flex: none; width: 22px; height: 22px; margin: 0;
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line-strong); border-radius: 4px; background: transparent;
  display: grid; place-content: center; cursor: pointer;
}
.check input { transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.check input::after { content: ""; width: 10px; height: 6px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px) scale(0); opacity: 0; transition: transform 220ms cubic-bezier(.2,.7,.2,1), opacity 100ms ease-out; }
.check input:checked { background: var(--text); border-color: var(--text); }
.check input:checked::after { opacity: 1; transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:checked + span { color: var(--text); }
.check-result { position: sticky; top: 112px; border: 1px solid var(--line); border-radius: 4px; padding: 32px; }
#check-count { display: inline-block; }
.check-score { margin: 0; font-size: clamp(56px, 6vw, 88px); line-height: 0.9; font-weight: 300; letter-spacing: -0.05em; }
.check-text { margin: 16px 0 32px; color: var(--muted); min-height: 3em; }

/* Instagram vs site */
.vs-wrap { overflow-x: auto; }
.vs { width: 100%; border-collapse: collapse; font-size: 17px; }
.vs th, .vs td { text-align: left; vertical-align: top; padding: 20px 24px 20px 0; border-bottom: 1px solid var(--line); }
.vs thead th { font-size: 14px; font-weight: 400; color: var(--muted); border-bottom-color: var(--line-strong); }
.vs tbody th { font-weight: 400; width: 34%; }
.vs td { color: var(--muted); width: 33%; }
.vs td:last-child { color: var(--text); }

@media (max-width: 960px) {
  .outcomes { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .outcome:nth-child(3) { padding-left: 0; border-left: 0; }
  .example, .checklist { grid-template-columns: 1fr; gap: 24px; }
  .checklist { gap: 40px; }
  .check-result { position: static; }
  .needs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .outcomes { grid-template-columns: 1fr; }
  .outcome, .outcome + .outcome { padding: 24px 0 0; border-left: 0; }
  .needs { grid-template-columns: 1fr; }
  .check { font-size: 16px; }
  .check-result { padding: 24px; }
  .vs { font-size: 15px; }
  .vs, .vs tbody { display: block; }
  .vs thead { display: none; }
  .vs tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .vs tbody th { grid-column: 1 / -1; width: auto; padding: 0 0 4px; border: 0; color: var(--text); }
  .vs td { width: auto; padding: 0; border: 0; font-size: 14px; }
  .vs td::before { display: block; font-size: 12px; color: var(--faint); margin-bottom: 2px; }
  .vs td:nth-of-type(1)::before { content: "Только Instagram"; }
  .vs td:nth-of-type(2)::before { content: "Instagram и сайт"; }
}

/* Motion. Everything here runs only when the visitor has not asked to reduce motion. */

/* Hero heading: lines rise from under a mask, one after another */
.motion .hero h1:not(.split):not(.done),
.motion .page-hero h1:not(.split):not(.done) { visibility: hidden; animation: show-fallback 0s 1.5s forwards; }
@keyframes show-fallback { to { visibility: visible; } }
h1 .line { display: block; overflow: hidden; padding: 0 0.12em 0.1em 0; margin: 0 -0.12em -0.1em 0; }
h1 .line-in { display: inline-block; animation: line-up 900ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }

/* Mobile menu: panel fades, items follow one by one */
@keyframes fade-in { from { opacity: 0; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(12px); } }
.motion.menu-open .mobile-menu, .motion .menu-open .mobile-menu { animation: fade-in 200ms ease-out both; }
.motion .menu-open .mobile-menu > * { animation: menu-in 350ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 35ms + 60ms); }

/* Header hides on scroll down, returns on scroll up (phones and tablets) */
@media (max-width: 960px) {
  .header.away { transform: translateY(-100%); }
}

/* Page transitions between pages of the site */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 240ms; animation-timing-function: ease-out; }
  .header { view-transition-name: site-header; }
}

/* Custom dropdown (replaces the native select; the select stays hidden and holds the value) */
select.enhanced { display: none; }
.cselect { position: relative; }
.cselect-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  padding: 8px 0 14px; font: 400 20px/1.4 var(--sans);
  transition: border-color 150ms ease-out;
}
.cselect-btn:focus { outline: none; }
.cselect-btn:focus-visible, .cselect.open .cselect-btn { border-bottom-color: var(--text); }
.cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-btn::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: -4px 4px 0 0;
  border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(45deg);
  transition: transform 200ms cubic-bezier(.2,.7,.2,1), margin 200ms cubic-bezier(.2,.7,.2,1);
}
.cselect.open .cselect-btn::after { transform: rotate(-135deg); margin-top: 4px; }
.cselect-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  margin: 0; padding: 6px; list-style: none;
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
  background: #151517; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transform-origin: top center;
  transition: opacity 160ms ease-out, transform 200ms cubic-bezier(.2,.7,.2,1), visibility 0s linear 200ms;
}
.cselect.up .cselect-list { top: auto; bottom: calc(100% + 8px); transform: translateY(6px); transform-origin: bottom center; }
.cselect.open .cselect-list { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.cselect-list:focus { outline: none; }
.cselect-opt {
  position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 12px 11px 36px; border-radius: 4px;
  font-size: 16px; line-height: 1.35; color: var(--muted); cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.cselect-opt .meta { font-size: 14px; color: var(--faint); white-space: nowrap; }
.cselect-opt.active { background: rgba(236, 231, 223, 0.07); color: var(--text); }
.cselect-opt[aria-selected="true"] { color: var(--text); }
.cselect-opt[aria-selected="true"]::before {
  content: ""; position: absolute; left: 15px; top: 50%; width: 9px; height: 5px;
  border: solid var(--accent); border-width: 0 0 1.5px 1.5px; transform: translateY(-70%) rotate(-45deg);
}
.cselect-opt[aria-selected="true"] .meta { color: var(--accent); }
.cselect-sep { height: 1px; margin: 6px 12px; background: var(--line); }

/* Logo intro (first page of a visit only) */
.loader { display: none; }
.intro .loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: var(--bg);
  animation: loader-out 800ms cubic-bezier(.7,0,.2,1) 1350ms forwards;
}
.loader-word { display: flex; overflow: hidden; padding: 0 0.15em 0.12em; font-family: var(--serif); font-style: italic; font-size: clamp(64px, 12vw, 140px); line-height: 1; letter-spacing: -0.01em; }
.loader-word span { display: inline-block; animation: letter-up 800ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 55ms + 100ms); }
.loader-line { position: relative; width: 140px; height: 1px; background: var(--line); overflow: hidden; }
.loader-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; animation: line-draw 1100ms cubic-bezier(.6,0,.2,1) 150ms forwards; }
@keyframes letter-up { from { transform: translateY(110%); } to { transform: none; } }
@keyframes line-draw { to { transform: scaleX(1); } }
@keyframes loader-out { to { transform: translateY(-100%); visibility: hidden; } }
.intro .hero-row { animation-delay: 2s; }
.motion.intro .hero h1:not(.split):not(.done),
.motion.intro .page-hero h1:not(.split):not(.done) { animation-delay: 3.2s; }

/* Lead popup */
.popup {
  width: min(560px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; overflow: visible;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
.popup::backdrop { background: rgba(5, 5, 6, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.popup-body { padding: 48px 40px 40px; }
.popup h2 { font-size: clamp(32px, 4vw, 44px); padding-right: 40px; }
.popup-lead { margin: 16px 0 32px; color: var(--muted); max-width: 400px; }
.popup .form { gap: 24px; }
.popup .form-done h2 { padding-right: 40px; }
.form-stack { display: grid; gap: 24px; }
.popup-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color 150ms ease-out;
}
.popup-close::before, .popup-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1px; background: var(--text); }
.popup-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.popup-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
@media (hover: hover) { .popup-close:hover { border-color: var(--text); } }
@keyframes popup-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@keyframes popup-out { to { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes fade-out { to { opacity: 0; } }
.motion .popup[open] { animation: popup-in 380ms cubic-bezier(.2,.7,.2,1); }
.motion .popup[open]::backdrop { animation: fade-in 380ms ease-out; }
.motion .popup.closing { animation: popup-out 200ms ease-in forwards; }
.motion .popup.closing::backdrop { animation: fade-out 200ms ease-in forwards; }

@media (max-width: 600px) {
  .popup {
    width: 100%; max-height: 92dvh; margin: auto 0 0; overflow-y: auto;
    border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .popup-body { padding: 40px 16px 24px; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  .motion .popup[open] { animation: sheet-in 380ms cubic-bezier(.2,.7,.2,1); }
  .motion .popup.closing { animation: sheet-out 220ms ease-in forwards; }
  /* In the bottom sheet the list opens in place, so it is never cut off */
  .popup .cselect-list { position: static; margin-top: 8px; max-height: none; box-shadow: none; display: none; }
  .popup .cselect.open .cselect-list { display: block; }
}

/* Success state after a lead is sent */
.motion .form-done:not([hidden]) { animation: rise 600ms cubic-bezier(.2,.7,.2,1) both; }
