@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@300;400;500;600;700&family=Onest:wght@300;400;500;600&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap");

/* ════════════════════════════════════════════════════════════════════════
   PM Agency — Editorial Studio design system
   Public landing + shared chrome (auth / dashboard bridge tokens below)
   Breakpoints: 480 / 640 / 900 / 1024 / 1200 / 1440 / 1680
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Robust horizontal-overflow guard: clip keeps overflow-y visible (sticky still works). */
html, body { overflow-x: clip; }
body { overflow-x: hidden; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Tokens ───────────────────────────────────────────────────────────── */
:root {
  /* Editorial palette */
  --bg: #f4f1ea;
  --bg-soft: #ebe6d6;
  --paper: #ece6d4;
  --ink: #14130f;
  --ink-soft: #2a2820;
  --muted: #79766c;
  --muted-soft: #a8a394;
  --line: #d9d3c2;
  --line-strong: #c4beac;
  --accent: #ff4a1c;
  --accent-dark: #d63808;
  --accent-ink: #ffffff;
  --on-dark: #f4f1ea;
  --danger: #b3261e;
  --success: #1f7a3e;

  /* Fonts */
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;
  --font-body: "Onest", "Inter", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Cormorant Garamond", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1440px;
  --pad-x: 24px;

  /* Type scale — fluid display sizes scale with the viewport so long Russian
     words always fit; smaller tokens keep their per-breakpoint steps below. */
  --t-mono: 11px;
  --t-body: 15px;
  --t-lede: 17px;
  --t-h3: 20px;
  --t-h2: clamp(28px, 4.5vw, 64px);
  --t-h1: clamp(32px, 6vw, 84px);
  --t-display: clamp(33px, 9vw, 100px);

  /* Spacing rhythm */
  --sp-section: 72px;
  --sp-section-tight: 56px;

  /* ── Legacy bridge: keep auth.css / dashboard.css harmonised ── */
  --c-bg: var(--bg);
  --c-surface: #fffdf7;
  --c-text: var(--ink);
  --c-muted: var(--muted);
  --c-line: var(--line);
  --c-primary: var(--accent);
  --c-primary-dark: var(--accent-dark);
  --c-accent: var(--accent);
  --c-accent-2: #d4a017;
  --c-success: var(--success);
  --c-warning: #b07d13;
  --c-danger: var(--danger);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(20, 19, 15, .05);
  --shadow-md: 0 16px 38px rgba(20, 19, 15, .10);
  --shadow-lg: 0 26px 70px rgba(20, 19, 15, .16);
  --gradient: linear-gradient(135deg, var(--ink), #34302330);
  --gradient-solid: var(--ink);
  --gradient-soft: linear-gradient(135deg, #efeadb 0%, #f4ece2 100%);
}

@media (min-width: 640px) {
  :root {
    --pad-x: 32px; --t-body: 16px; --t-lede: 18px; --t-h3: 22px;
    --sp-section: 96px; --sp-section-tight: 72px;
  }
}
@media (min-width: 900px) {
  :root {
    --pad-x: 40px; --t-lede: 19px; --t-h3: 24px;
    --sp-section: 120px; --sp-section-tight: 88px;
  }
}
@media (min-width: 1200px) {
  :root {
    --pad-x: 48px; --t-mono: 12px; --t-lede: 20px; --t-h3: 26px;
    --sp-section: 140px;
  }
}
@media (min-width: 1440px) {
  :root { --pad-x: 56px; --maxw: 1480px; }
}
@media (min-width: 1680px) {
  :root { --maxw: 1560px; }
}

/* ─── Base ─────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.1; font-weight: 500; font-family: var(--font-display); letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

/* Paper texture — landing + auth only (kept off the working dashboard) */
.page-public::before, .page-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .5;
}
.page-public .site-shell,
.page-public main,
.page-public .header,
.page-public .footer,
.page-auth .auth-shell { position: relative; z-index: 1; }

/* ─── Typography helpers ───────────────────────────────────────────────── */
.display, .h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.04em; line-height: 0.92; }
.h1 { font-size: var(--t-h1); }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-h2); line-height: 0.96; letter-spacing: -0.035em; margin: 0; }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-h3); line-height: 1.1; letter-spacing: -0.02em; }
.eyebrow { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.04em; }
.lede { font-size: var(--t-lede); line-height: 1.4; color: var(--ink-soft); max-width: 52ch; text-wrap: pretty; margin: 0; }

/* ─── Layout ───────────────────────────────────────────────────────────── */
.wrap, .container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad-x); width: 100%; }
.section { padding-block: var(--sp-section); }
.section-tight { padding-block: var(--sp-section-tight); }

/* ─── Buttons (unified across whole site) ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s, transform .2s, filter .2s;
  line-height: 1; white-space: nowrap; font-family: var(--font-body);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { color: var(--ink-soft); padding-inline: 12px; }
.btn-ghost:hover { color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 15px; }
.btn-sm { padding: 9px 15px; font-size: 13px; }
@media (min-width: 900px) {
  .btn { padding: 14px 22px; }
  .btn-lg { padding: 18px 28px; }
}
.btn .arrow { width: 14px; height: 14px; transition: transform .25s ease; }
.btn:hover .arrow { transform: translate(3px, -3px); }

/* ─── Brand / logo mark (auth header + dashboard sidebar) ──────────────── */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--on-dark); font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.02em; flex-shrink: 0; }
.logo-text { font-size: 16px; }

/* ─── Header ───────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--accent); }
.brand .dot { color: var(--accent); }
.nav { display: none; align-items: center; gap: 28px; font-size: 14px; }
@media (min-width: 1024px) { .nav { display: flex; } }
.nav a { color: var(--ink-soft); position: relative; transition: color .2s; padding: 4px 0; }
.nav a:hover { color: var(--accent); }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 8px; }
/* Logout is a POST form (CSRF-safe); render it transparently so the button keeps the layout slot. */
.logout-form { display: contents; }
/* Honeypot: off-screen anti-spam field — never shown to humans. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.menu-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: transparent; border: 0; padding: 10px; margin-right: -10px; }
.menu-toggle span { width: 22px; height: 1.5px; background: var(--ink); transition: transform .25s, opacity .2s; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

/* Mobile drawer */
.mobile-nav {
  position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: flex; flex-direction: column; padding: 20px var(--pad-x);
  transform: translateY(-100%);
  transition: transform .4s cubic-bezier(.7, 0, .2, 1), visibility 0s linear .4s;
  overflow-y: auto; overflow-x: hidden; visibility: hidden;
}
.mobile-nav.open { visibility: visible; transform: translateY(0); transition: transform .4s cubic-bezier(.7, 0, .2, 1), visibility 0s; }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.mobile-nav-close { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); border: 0; display: grid; place-items: center; }
.mobile-nav-list { margin-top: 32px; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-list a { font-family: var(--font-display); font-size: 32px; font-weight: 500; letter-spacing: -0.03em; padding-block: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.mobile-nav-list a:last-child { border-bottom: 1px solid var(--line); }
.mobile-nav-list a span.idx { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.mobile-nav-cta { margin-top: auto; padding-block: 24px; display: flex; gap: 10px; }

/* ─── HERO ─────────────────────────────────────────────────────────────── */
.hero { padding-top: 24px; padding-bottom: 0; }
@media (min-width: 900px) { .hero { padding-top: 40px; } }
@media (min-width: 1200px) { .hero { padding-top: 64px; } }
.hero-grid { display: flex; flex-direction: column; gap: 40px; }
@media (min-width: 900px) { .hero-grid { gap: 56px; } }
.hero-top { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: end; }
/* Two-column hero only on wide screens, where the title column is wide enough for
   the large display words; below this the title spans the full width, panel under it. */
@media (min-width: 1280px) { .hero-top { grid-template-columns: 2.2fr 1fr; gap: 56px; } }
.hero-title { font-family: var(--font-display); font-weight: 500; font-size: var(--t-display); line-height: 0.88; letter-spacing: -0.045em; margin: 0; color: var(--ink); text-wrap: balance; }
.hero-title .word { display: block; }
.hero-title em { font-style: italic; font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.005em; color: var(--accent); }
.hero-title .dot { display: inline-block; width: 0.18em; height: 0.18em; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-left: 0.04em; margin-bottom: 0.12em; transform: translateY(-0.05em); }
.hero-meta { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.hero-meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: var(--t-body); }
.hero-meta-row > span:first-child { color: var(--muted); font-family: var(--font-mono); font-size: var(--t-mono); text-transform: uppercase; letter-spacing: 0.14em; }
.hero-meta-row > span:last-child { font-weight: 500; text-align: right; }
.hero-bottom { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: end; padding-top: 28px; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .hero-bottom { grid-template-columns: 1.4fr auto; align-items: end; } .hero-stats { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .hero-bottom { grid-template-columns: 1.2fr auto 1fr; gap: 40px; } .hero-stats { grid-column: auto; justify-self: end; } }
.hero-lede { max-width: 40ch; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
@media (min-width: 1200px) { .hero-stats { gap: 40px; } }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: clamp(32px, 4vw, 56px); line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.stat-lbl { margin-top: 6px; font-family: var(--font-mono); font-size: var(--t-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

/* ─── Marquee ──────────────────────────────────────────────────────────── */
.marquee { margin-top: var(--sp-section-tight); padding-block: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.marquee-track { display: flex; gap: 48px; white-space: nowrap; animation: marquee 42s linear infinite; width: max-content; align-items: center; }
.marquee-item { font-family: var(--font-display); font-size: clamp(22px, 3vw, 40px); font-weight: 400; letter-spacing: -0.025em; color: var(--ink); display: inline-flex; align-items: center; gap: 48px; }
.marquee-item::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.marquee-item em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─── Section heads ────────────────────────────────────────────────────── */
.section-head { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: end; margin-bottom: 48px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .section-head { grid-template-columns: 1fr 1.6fr; gap: 40px; margin-bottom: 64px; padding-bottom: 28px; } }
@media (min-width: 1200px) { .section-head { grid-template-columns: 1fr 2fr; margin-bottom: 80px; } }
.section-head-left { display: flex; flex-direction: column; gap: 12px; }
.section-head-left .num { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--accent); letter-spacing: 0.12em; font-weight: 500; }
.section-head h2 { margin: 0; }
.section-head-right p { color: var(--muted); margin: 0; font-size: var(--t-lede); max-width: 52ch; text-wrap: pretty; line-height: 1.4; }

/* ─── Services ─────────────────────────────────────────────────────────── */
.services { display: flex; flex-direction: column; }
.service { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 6px 16px; align-items: center; padding-block: 24px; border-top: 1px solid var(--line); position: relative; transition: color .3s ease; cursor: pointer; }
.service:last-child { border-bottom: 1px solid var(--line); }
.service::before { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleY(0); transform-origin: top; transition: transform .4s cubic-bezier(.7, 0, .2, 1); z-index: 0; }
.service:hover::before { transform: scaleY(1); }
.service:hover { color: var(--bg); }
.service:hover .service-meta { color: rgba(244, 241, 234, .65); }
.service:hover .service-num { color: rgba(244, 241, 234, .55); }
.service:hover .service-arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
.service > * { position: relative; z-index: 1; }
.service-num { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.1em; color: var(--muted); align-self: center; }
.service-title { font-family: var(--font-display); font-size: clamp(22px, 3vw, 36px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }
.service-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.service-price { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.06em; color: var(--muted); margin-top: 6px; }
.service:hover .service-price { color: rgba(244, 241, 234, .7); }
.service-meta { grid-column: 2 / -1; color: var(--ink-soft); font-size: var(--t-body); line-height: 1.45; max-width: 56ch; transition: color .3s; }
.service-arrow { width: 40px; height: 40px; border-radius: 50%; background: transparent; border: 1px solid currentColor; display: grid; place-items: center; transition: transform .3s, background .3s, color .3s, border-color .3s; grid-row: 1 / 3; align-self: center; }
@media (min-width: 1100px) {
  .service { grid-template-columns: 80px 0.9fr 1.4fr auto; grid-template-rows: auto; padding-block: clamp(28px, 3vw, 40px); gap: 24px; }
  .service-meta { grid-column: auto; }
  .service-title { font-size: clamp(26px, 2.4vw, 40px); }
  .service-arrow { width: 44px; height: 44px; grid-row: auto; }
}
@media (min-width: 1440px) { .service { grid-template-columns: 100px 1fr 1.6fr 80px; } }

/* ─── Manifesto ────────────────────────────────────────────────────────── */
.manifesto { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 900px) { .manifesto { grid-template-columns: 1fr 1.7fr; gap: 64px; } }
@media (min-width: 1200px) { .manifesto { gap: 96px; } .manifesto-left { position: sticky; top: 120px; } }
.manifesto-text { font-family: var(--font-display); font-size: clamp(24px, 3vw, 44px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 400; margin: 0; text-wrap: pretty; }
.manifesto-text em { font-family: var(--font-serif); font-style: italic; color: var(--accent); font-weight: 400; }
.manifesto-text .strike { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.manifesto-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-soft); background: var(--bg); }
.tag-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ─── Process (dark capsule) ───────────────────────────────────────────── */
.process-section { padding-block: var(--sp-section-tight); }
.section-dark { background: var(--ink); color: var(--on-dark); margin-inline: var(--pad-x); border-radius: 24px; padding-block: var(--sp-section); padding-inline: var(--pad-x); position: relative; overflow: hidden; }
@media (min-width: 1200px) { .section-dark { border-radius: 32px; padding-inline: 0; } }
.section-dark .wrap-inner { max-width: var(--maxw); margin: 0 auto; padding-inline: 0; }
@media (min-width: 1200px) { .section-dark .wrap-inner { padding-inline: var(--pad-x); } }
.section-dark .eyebrow, .section-dark .section-head-right p { color: rgba(244, 241, 234, .55); }
.section-dark .section-head { border-bottom-color: rgba(244, 241, 234, .14); }
.process-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .process-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .process-grid { grid-template-columns: repeat(5, 1fr); } }
.process-step { padding: 24px 20px 28px; border-top: 1px solid rgba(244, 241, 234, .18); position: relative; display: flex; flex-direction: column; min-height: 220px; }
@media (min-width: 1024px) { .process-step { min-height: 280px; padding: 28px 22px 32px; } }
.process-step + .process-step { border-left: 0; }
@media (min-width: 640px) { .process-step:nth-child(2n) { border-left: 1px solid rgba(244, 241, 234, .18); } }
@media (min-width: 1024px) { .process-step:nth-child(2n) { border-left: 0; } .process-step + .process-step { border-left: 1px solid rgba(244, 241, 234, .18); } }
.process-num { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.1em; color: var(--accent); margin-bottom: 16px; }
.process-step h3 { font-family: var(--font-display); font-size: var(--t-h3); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 12px; }
.process-step p { color: rgba(244, 241, 234, .65); font-size: 14px; line-height: 1.5; margin: 0; }
.process-time { margin-top: auto; padding-top: 18px; font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244, 241, 234, .45); }

/* ─── Portfolio ────────────────────────────────────────────────────────── */
.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .portfolio-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .portfolio-grid { grid-template-columns: repeat(12, 1fr); gap: 18px; } }
@media (min-width: 1440px) { .portfolio-grid { gap: 22px; } }
.case { position: relative; border-radius: 14px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); cursor: pointer; aspect-ratio: 4 / 3; }
.case img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.7, 0, .2, 1); }
.case:hover img { transform: scale(1.04); }
.case .ph { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, var(--paper) 0, var(--paper) 9px, var(--bg-soft) 9px, var(--bg-soft) 18px); display: grid; place-items: center; }
.case .ph-label { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--muted); background: var(--bg); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); letter-spacing: 0.08em; text-transform: uppercase; }
.case-meta { position: absolute; inset: auto 0 0 0; padding: 18px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; background: linear-gradient(to top, rgba(20, 19, 15, .85) 0%, rgba(20, 19, 15, 0) 100%); color: var(--on-dark); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.case:hover .case-meta, .case:focus-within .case-meta { opacity: 1; transform: translateY(0); }
.case-title { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
@media (min-width: 1200px) { .case-title { font-size: 22px; } }
.case-cat { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.1em; text-transform: uppercase; opacity: .7; margin-top: 4px; }
.case-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; background: var(--accent); color: var(--accent-ink); padding: 5px 10px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
@media (min-width: 640px) and (max-width: 1023px) {
  .case-1 { grid-column: span 6; } .case-2 { grid-column: span 3; } .case-3 { grid-column: span 3; }
  .case-4 { grid-column: span 2; } .case-5 { grid-column: span 2; } .case-6 { grid-column: span 2; } .case-7 { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .case-1 { grid-column: span 7; aspect-ratio: 16 / 11; } .case-2 { grid-column: span 5; aspect-ratio: 4 / 3; }
  .case-3 { grid-column: span 4; aspect-ratio: 4 / 5; } .case-4 { grid-column: span 4; aspect-ratio: 4 / 5; }
  .case-5 { grid-column: span 4; aspect-ratio: 4 / 5; } .case-6 { grid-column: span 6; aspect-ratio: 16 / 10; } .case-7 { grid-column: span 6; aspect-ratio: 16 / 10; }
}

/* ─── Big number ───────────────────────────────────────────────────────── */
.bignum-section { text-align: center; padding-block: var(--sp-section); }
.bignum { font-family: var(--font-display); font-size: clamp(120px, 22vw, 320px); font-weight: 400; letter-spacing: -0.055em; line-height: 0.85; margin: 0; color: var(--ink); }
@media (min-width: 1680px) { .bignum { font-size: 360px; } }
.bignum em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.bignum-caption { margin: 24px auto 0; max-width: 56ch; color: var(--muted); font-size: var(--t-lede); line-height: 1.45; }

/* ─── Reviews ──────────────────────────────────────────────────────────── */
.reviews { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 900px) { .reviews { grid-template-columns: 1fr 1.7fr; gap: 64px; } }
@media (min-width: 1200px) { .reviews { gap: 96px; } }
.reviews-nav { display: flex; flex-direction: column; gap: 0; padding-top: 4px; }
.review-pick { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; transition: padding .3s, color .3s; font-family: var(--font-body); width: 100%; cursor: pointer; }
.review-pick:hover { padding-left: 8px; }
.review-pick.active { color: var(--accent); }
.review-pick:last-child { border-bottom: 1px solid var(--line); }
.review-pick-num { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--muted); }
.review-pick.active .review-pick-num { color: var(--accent); }
.review-pick-name { display: block; font-weight: 500; font-size: 15px; }
.review-pick-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.review-pick-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.review-pick.active .review-pick-dot { background: var(--accent); transform: scale(1.4); }
.review-panel { position: relative; }
.review-slide { display: none; }
.review-slide.active { display: block; animation: reviewIn .4s ease; }
@keyframes reviewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.review-quote { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 38px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 400; margin: 0; text-wrap: pretty; color: var(--ink); }
.review-quote::before { content: "\201C"; font-family: var(--font-serif); font-style: italic; color: var(--accent); font-size: 1.3em; line-height: 0; vertical-align: -0.25em; margin-right: 0.08em; }
.review-quote::after { content: "\201D"; font-family: var(--font-serif); font-style: italic; color: var(--accent); font-size: 1.3em; line-height: 0; vertical-align: -0.25em; }
.review-author { margin-top: 28px; display: flex; align-items: center; gap: 16px; }
.review-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.review-author-name { font-weight: 500; font-size: 16px; }
.review-author-meta { color: var(--muted); font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.04em; margin-top: 2px; }
.review-stars { color: var(--accent); letter-spacing: 3px; font-size: 15px; margin-bottom: 18px; }
.review-stars .off { color: var(--line-strong); }

/* ─── FAQ ──────────────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--line); padding-block: 2px; overflow: hidden; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; background: transparent; border: 0; padding: 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; text-align: left; font-family: var(--font-display); font-size: clamp(18px, 1.8vw, 26px); letter-spacing: -0.02em; font-weight: 500; color: var(--ink); transition: color .2s; line-height: 1.25; }
@media (min-width: 900px) { .faq-q { padding: 26px 0; } }
.faq-q:hover { color: var(--accent); }
.faq-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: var(--bg); flex-shrink: 0; transition: transform .3s, background .3s, color .3s, border-color .3s; color: var(--ink); }
.faq-item.open .faq-toggle { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.7, 0, .2, 1); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; color: var(--ink-soft); font-size: var(--t-body); line-height: 1.55; max-width: 70ch; }
.faq-a-inner > div { padding: 0 0 24px; }
@media (min-width: 900px) { .faq-a-inner > div { padding-right: 60px; } }

/* ─── CTA / Contact ────────────────────────────────────────────────────── */
.cta { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 1100px) { .cta { grid-template-columns: 1fr 1fr; gap: 56px; } }
@media (min-width: 1280px) { .cta { gap: 80px; } }
.cta-left h2 { margin: 0 0 20px; font-family: var(--font-display); font-size: var(--t-h1); line-height: 0.95; letter-spacing: -0.035em; font-weight: 500; text-wrap: balance; }
.cta-left h2 em { font-family: var(--font-serif); font-style: italic; color: var(--accent); font-weight: 400; }
.cta-info-list { margin-top: 32px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cta-info-row { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 110px 1fr; gap: 20px; align-items: center; }
.cta-info-row .lbl { font-family: var(--font-mono); font-size: var(--t-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.cta-info-row .val { font-size: 16px; font-weight: 500; }
.cta-info-row a:hover { color: var(--accent); }

/* Dark form card (landing brief) */
.form-card { background: var(--ink); color: var(--on-dark); padding: 28px; border-radius: 22px; }
@media (min-width: 900px) { .form-card { padding: 36px; } }
@media (min-width: 1200px) { .form-card { padding: 44px; } }
.form-card h3 { font-family: var(--font-display); font-size: var(--t-h3); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 6px; }
.form-card .form-hint { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244, 241, 234, .55); margin: 0 0 24px; }
.form-card .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-width: none; }
.form-card .field-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .form-card .field-row { grid-template-columns: 1fr 1fr; } }
.form-card .field label, .form-card .field > span { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244, 241, 234, .55); margin: 0; font-weight: 500; }
.form-card .field input, .form-card .field select, .form-card .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid rgba(244, 241, 234, .25);
  color: var(--on-dark); padding: 8px 0 12px; font-family: var(--font-body); font-size: 16px;
  outline: none; transition: border-color .2s; width: 100%; border-radius: 0;
}
.form-card .field input::placeholder, .form-card .field textarea::placeholder { color: rgba(244, 241, 234, .32); }
.form-card .field input:focus, .form-card .field select:focus, .form-card .field textarea:focus { border-color: var(--accent); box-shadow: none; }
.form-card .field select { appearance: none; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23f4f1ea' stroke-width='1.5'><path d='M1 1.5l5 5 5-5'/></svg>") no-repeat right 4px center / 12px; padding-right: 24px; color-scheme: dark; }
.form-card .field select option { background: var(--ink); color: var(--on-dark); }
.form-card .field textarea { min-height: 90px; resize: vertical; }
.form-card .field input[type="date"] { color-scheme: dark; }
.budget-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(244, 241, 234, .22); background: transparent; color: rgba(244, 241, 234, .8); font-size: 13px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; font-family: var(--font-body); }
.chip:hover { border-color: rgba(244, 241, 234, .5); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.form-submit { margin-top: 14px; width: 100%; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 16px 22px; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; font-family: var(--font-body); transition: filter .2s, transform .2s; }
.form-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.form-submit .arrow-w { width: 16px; height: 16px; }
.form-card .form-error-top { background: rgba(255, 74, 28, .14); color: #ffd9cd; border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.form-card .field-error { color: #ffb9a6; font-size: 12px; font-style: normal; font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ─── General light form fields (auth / dashboard / generic) ───────────── */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-family: var(--font-mono); font-size: var(--t-mono); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font-body); background: var(--c-surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 74, 28, .12); }
.field textarea { min-height: 96px; resize: vertical; }
.field-error { display: block; color: var(--danger); font-size: 13px; margin-top: 6px; font-style: normal; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error-top { background: #fbe6e1; color: #8a241a; padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid #f0c4ba; }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer { background: var(--ink); color: var(--on-dark); padding-top: var(--sp-section); padding-bottom: 32px; position: relative; overflow: hidden; }
.footer-big { font-family: var(--font-display); font-size: clamp(44px, 11vw, 180px); line-height: 0.92; letter-spacing: -0.05em; font-weight: 500; margin: 0 0 48px; text-wrap: balance; }
@media (min-width: 1280px) { .footer-big { font-size: clamp(110px, 12vw, 180px); } }
@media (min-width: 1680px) { .footer-big { font-size: 220px; } }
.footer-big em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-top: 32px; border-top: 1px solid rgba(244, 241, 234, .15); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; } }
.footer-col h5 { font-family: var(--font-mono); font-size: var(--t-mono); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244, 241, 234, .55); margin: 0 0 16px; }
.footer-col a, .footer-col span { display: block; color: rgba(244, 241, 234, .85); margin-bottom: 10px; font-size: 14px; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(244, 241, 234, .15); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244, 241, 234, .5); }

/* ─── Flash ────────────────────────────────────────────────────────────── */
.flash-wrap { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 92%; width: max-content; }
.flash { padding: 13px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md); animation: slideDown .3s ease-out; background: var(--c-surface); border: 1px solid var(--line); border-left: 3px solid var(--muted); }
.flash--success { border-left-color: var(--success); color: #145a2c; }
.flash--error { border-left-color: var(--danger); color: #8a241a; }
.flash--info { border-left-color: var(--accent); color: var(--ink-soft); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ─── Error page ───────────────────────────────────────────────────────── */
.error-page { padding: 120px 0; text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: clamp(96px, 18vw, 180px); font-weight: 500; letter-spacing: -0.05em; color: var(--ink); line-height: 0.9; }
.error-page__code em { font-family: var(--font-serif); font-style: italic; color: var(--accent); }
.error-page h1 { margin-top: 12px; }
.error-page p { color: var(--muted); margin-bottom: 30px; }

/* ─── Empty state ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-md); }
.empty-state__icon { font-size: 40px; margin-bottom: 14px; opacity: .55; }
.empty-state p { max-width: 52ch; margin: 0 auto 18px; }

/* ─── Badges ───────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; font-family: var(--font-mono); text-transform: uppercase; }
.badge-blue { background: #e3edf7; color: #2a5a86; }
.badge-purple { background: #ece6f5; color: #5a3e96; }
.badge-yellow { background: #f7eed3; color: #7a5a14; }
.badge-cyan { background: #dceef0; color: #1a5a64; }
.badge-green { background: #e0f0e4; color: #1f6a3a; }
.badge-green-dark { background: #cfe6d2; color: #14502a; }
.badge-gray { background: #ebe7da; color: #5a5648; }

/* ─── Utility / a11y ───────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.t-muted { color: var(--muted); }
.t-right { text-align: right; }
.t-center { text-align: center; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ─── Responsive overflow safety ───────────────────────────────────────────
   Lets grid/flex children shrink instead of blowing the page width, and allows
   the large display words to wrap as a last resort so nothing ever overflows. */
.hero-top > *, .hero-bottom > *, .section-head > *,
.manifesto > *, .reviews > *, .cta > * { min-width: 0; }
.hero-title, .cta-left h2, .section-head h2,
.manifesto-text, .review-quote, .bignum, .footer-big {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* On phones the burger replaces the nav and CTAs (the mobile drawer already
   carries Войти/Кабинет + Заявка), so hide the crowded header action buttons. */
@media (max-width: 639px) {
  .header-actions .btn,
  .header-actions .logout-form { display: none; }
}
