:root {
  --primary: #1A1F36;
  --primary-dark: #10142A;
  --brand: #F26522;
  --brand-dark: #C44E14;
  --accent: #FFB300;
  --bg: #FDFDFD;
  --bg-alt: #F7F7FB;
  --text: #1A1F36;
  --text-muted: #5C6373;
  --border: #E6E8F0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.01em; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.hdr-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 900; font-size: 1.25rem; letter-spacing: 0.05em; color: var(--primary); text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-sub { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { color: var(--text); font-weight: 500; }
.hdr-actions { display: flex; align-items: center; gap: 1rem; }
.lang-switch a { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.btn-cta { background: var(--brand); color: #fff; padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 700; border: 1px solid var(--brand-dark); }

/* Hero */
.hero { padding: 4rem 0 3rem; background: linear-gradient(180deg, var(--bg-alt), transparent); }
.hero .eyebrow { color: var(--brand-dark); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; margin: 0 0 0.5rem; }
.hero h1 { font-size: 2.75rem; margin: 0 0 1rem; max-width: 20ch; }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; margin: 0 0 2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { background: var(--brand); color: #fff; padding: 0.85rem 1.6rem; border-radius: 8px; font-weight: 700; border: 1px solid var(--brand-dark); }
.btn-secondary { background: transparent; color: var(--primary); padding: 0.85rem 1.6rem; border-radius: 8px; font-weight: 700; border: 1px solid var(--border); }

/* Sections */
.section { padding: 3.5rem 0; }
.section h2 { font-size: 1.85rem; margin: 0 0 1.5rem; }

/* Service + Post grids */
.service-grid, .posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.service-card, .post-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-decoration: none; color: inherit; transition: transform 0.15s, border-color 0.15s; display: block; }
.service-card:hover, .post-card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.service-card h3, .post-card h3 { margin: 0 0 0.6rem; font-size: 1.15rem; color: var(--primary); }
.service-card p, .post-card p { margin: 0 0 0.8rem; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.post-card .eyebrow { color: var(--brand-dark); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; margin: 0 0 0.4rem; }
.post-card time { font-size: 0.82rem; color: var(--text-muted); }

/* Blog post */
.blog-post { max-width: 780px; padding-top: 2rem; padding-bottom: 4rem; }
.crumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.crumbs a { color: var(--brand-dark); }
.post-hero { margin-bottom: 2rem; }
.post-hero .eyebrow { color: var(--brand-dark); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; }
.post-hero h1 { font-size: 2.35rem; margin: 0.5rem 0 1rem; }
.post-hero .lead { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 1.25rem; }
.post-meta { color: var(--text-muted); font-size: 0.9rem; }
.post-meta .dot { margin: 0 0.5rem; }
.tldr { background: var(--bg-alt); border-left: 4px solid var(--brand); padding: 1.25rem 1.5rem; margin: 2rem 0; border-radius: 0 8px 8px 0; }
.tldr h2 { font-size: 1rem; margin: 0 0 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-dark); }
.tldr ul { margin: 0; padding-left: 1.2rem; }
.tldr li { margin: 0.35rem 0; }
/* markdown-it-anchor injects <a class="header-anchor">#</a> inside each H2/H3.
   Hidden until the heading is hovered, so the "#" is not read as body text. */
.header-anchor { opacity: 0; margin-left: -1em; padding-right: 0.25em; color: var(--brand); text-decoration: none; font-weight: 400; }
h2:hover > .header-anchor, h3:hover > .header-anchor, .header-anchor:focus { opacity: 1; }

.post-body p, .post-body li { line-height: 1.75; }
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 0.85rem; }
.post-body h3 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
.post-body th, .post-body td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.post-body th { background: var(--bg-alt); font-weight: 700; }
.post-body code { background: var(--bg-alt); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.9em; }
.post-body pre { background: #1A1F36; color: #fff; padding: 1rem; border-radius: 8px; overflow-x: auto; }
.post-body pre code { background: transparent; padding: 0; color: inherit; }

/* Footer */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.85); padding: 3rem 0 1.5rem; margin-top: 4rem; }
.ft-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.ft-brand .logo { color: #fff; margin-bottom: 1rem; }
.ft-brand p { font-size: 0.9rem; margin: 0.5rem 0; }
.ft-brand a { color: var(--brand); }
.ft-addr { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.ft-col h4 { color: #fff; font-size: 0.95rem; margin: 0 0 0.75rem; letter-spacing: 0.02em; }
.ft-col a, .ft-col button { display: block; color: rgba(255,255,255,0.7); font-size: 0.9rem; padding: 0.25rem 0; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; }
.ft-col a:hover, .ft-col button:hover { color: var(--brand); text-decoration: none; }
.ft-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* Cookie consent */
.cc-wrap { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 9999; opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.cc-wrap.cc-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cc-inner { max-width: 1100px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -16px rgba(0,0,0,0.18); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cc-text { flex: 1 1 320px; }
.cc-text strong { display: block; font-size: 0.95rem; color: var(--primary); }
.cc-text p { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--text-muted); }
.cc-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cc-btn { padding: 0.65rem 1.2rem; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.cc-btn-primary { background: var(--brand); color: #fff; border-color: var(--brand-dark); }
.cc-btn-secondary { background: var(--bg-alt); color: var(--primary); border-color: var(--border); }

/* Page header */
.page-header { text-align: center; margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2.5rem; margin: 0 0 0.75rem; }
.page-header .lead { color: var(--text-muted); font-size: 1.1rem; max-width: 55ch; margin: 0 auto; }

/* Buttons — .btn is the shared base already used by legacy-page.njk and the CTA blocks. */
.btn { display: inline-block; }
.btn + .btn { margin-left: 0.5rem; }

/* Hero stats row — /ru/ home and both /pricing/ pages. */
.stats-row { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.stats-row > div { display: flex; flex-direction: column; }
.stats-row strong { font-size: 1.45rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.stats-row span { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.2rem; }

/* Price tables — /pricing/ and /ru/pricing/. */
.price-table-wrap { overflow-x: auto; margin: 1.25rem 0 1rem; }
.price-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-size: 0.95rem; }
.price-table th, .price-table td { padding: 0.8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.price-table th { background: var(--bg-alt); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.price-table tr:last-child td { border-bottom: none; }
.price-table small { display: block; margin-top: 0.3rem; font-size: 0.83rem; font-weight: 400; color: var(--text-muted); line-height: 1.5; }
.price-table .amount { font-weight: 800; color: var(--primary); white-space: nowrap; }
/* Price columns stay on one line; .price-table-prose opts a table out (long text in col 3). */
.price-table:not(.price-table-prose) td:nth-child(2), .price-table:not(.price-table-prose) td:nth-child(3) { white-space: nowrap; }

/* Portfolio category pills — /ru/ home. */
.cat-pill { display: inline-block; background: #fff; border: 1px solid var(--border); color: var(--primary); padding: 0.5rem 1rem; border-radius: 999px; font-weight: 600; font-size: 0.88rem; margin: 0 0.5rem 0.5rem 0; }
.cat-pill:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.card-link { color: var(--brand-dark); font-weight: 700; font-size: 0.88rem; }

/* FAQ — plain headings + answers, mirrored by the FAQPage JSON-LD on the same page. */
.faq { margin: 3rem 0; }
.faq h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; color: var(--primary); }
.faq p { margin: 0 0 0.5rem; line-height: 1.7; }
.faq .faq-depth { color: var(--text-muted); font-size: 0.95rem; }

/* CTA block — also styles the aside already emitted by legacy-page.njk. */
.cta { background: var(--bg-alt); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 0 12px 12px 0; padding: 1.75rem; margin: 3rem 0; }
.cta h3 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.cta p { margin: 0 0 1rem; color: var(--text-muted); max-width: 60ch; }
.cta p:last-child { margin-bottom: 0; }

/* Legal/long-form text pages (e.g. /privacy/) — narrower measure than .container. */
.legal-page { max-width: 860px; padding-top: 2rem; padding-bottom: 3rem; }
.legal-page h2 { font-size: 1.4rem; margin: 2.5rem 0 0.8rem; }
.legal-page h3 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; }
.legal-page p, .legal-page li { line-height: 1.7; }
.legal-page ul { padding-left: 1.5rem; margin: 0.6rem 0 1.2rem; }
.cookie-reset-link { background: var(--brand); color: #fff; border: 1px solid var(--brand-dark); padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.cookie-reset-link:hover { background: var(--brand-dark); }

@media (max-width: 780px) {
  .hero h1 { font-size: 2.1rem; }
  .main-nav { display: none; }
  .ft-grid { grid-template-columns: 1fr; }

  /* Tables written inline in post markdown have no .price-table-wrap around
     them, so they pushed the whole page wider than the phone viewport.
     display:block lets the table itself scroll instead of the document. */
  .post-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: max-content; max-width: 100%; }
  /* nowrap price columns fight the narrow viewport once the table scrolls. */
  .post-body .price-table td { white-space: normal; }
}
