/* ============================================================
   product pages (/sessions/, /names/, ...)
   Static, server-rendered documents: no JavaScript is needed to show or reach any
   content (the mobile section links are a plain scroll strip; the FAQ is native <details>).
   Tokens come from styles.css.
   ============================================================ */

/* ---------- Header ---------- */
/* Desktop: logo, section links, language switch and sign-in on one row.
   <=1000px: two slim rows. Row 1: logo, language, sign-in. Row 2: the section links as a
   horizontally scrollable strip (overflow only inside the strip, never on the page). Plain
   anchors, no JavaScript and no open/closed state: a tapped link never leaves a panel over its target. */
html { scroll-padding-top: 96px; }
.doc-nav { height: auto; min-height: 72px; padding-block: 10px; gap: 12px 24px; }
.doc-nav__links { display: flex; align-items: center; gap: 8px 22px; margin-left: auto; }
.doc-nav__links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.doc-nav__links a:hover { color: var(--text); }
.doc-nav__actions { display: flex; align-items: center; gap: 12px; }
.doc-nav__lang {
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; background: var(--surface);
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}

@media (max-width: 1000px) {
  html { scroll-padding-top: 92px; }
  .doc-nav { flex-wrap: wrap; min-height: 0; padding: 6px 16px 0; gap: 0 8px; }
  .doc-nav .brand { gap: 8px; margin-right: auto; flex-shrink: 0; }
  .doc-nav .brand__mark svg { width: 28px; height: 28px; }
  .doc-nav .brand__name { font-size: 1.05rem; }
  .doc-nav .brand__sub { font-size: 0.95rem; }
  .doc-nav__actions { gap: 8px; flex-shrink: 0; }
  .doc-nav__lang { padding: 3px 10px; font-size: 0.75rem; }
  .doc-nav__actions .btn { --pad-y: 7px; --pad-x: 12px; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
  .doc-nav__links {
    order: 3; flex: 0 0 calc(100% + 32px); min-width: 0; margin: 0 -16px; padding: 0 16px 0 16px; gap: 0 20px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .doc-nav__links::-webkit-scrollbar { display: none; }
  .doc-nav__links a { flex: 0 0 auto; padding: 9px 2px 10px; font-size: 0.88rem; white-space: nowrap; }
  .doc-nav__links a:last-child { margin-right: 28px; }
}
/* Phones: logo + "ABT" only, the language pill shows its code (EN/RU) so the sign-in label never gets squeezed. */
@media (max-width: 440px) {
  .doc-nav .brand { flex: 0 0 auto; }
  .doc-nav .brand__sep, .doc-nav .brand__sub { display: none; }
  .doc-nav__lang { font-size: 0; }
  .doc-nav__lang::after { content: attr(hreflang); font-size: 0.75rem; text-transform: uppercase; }
}

/* ---------- Hero ---------- */
/* Hero and sections share one centered .container (same max-width, same left edge). Only the text hero
   keeps a readable column (--doc-col). Never cap the direct children of .doc-section: a narrower child
   sits on the container's left edge and shifts the whole section left of the page centre on desktop. */
:root { --doc-col: 872px; }
.hero-doc { padding-block: clamp(40px, 8vw, 96px) clamp(24px, 4vw, 48px); }
:where(.hero-doc:not(.hero-doc--visual)) > * { max-width: var(--doc-col); }
.hero-doc__title {
  font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 22px;
  background: linear-gradient(180deg, #ffffff 30%, #b9c0d6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-doc__lead { font-size: 1.15rem; color: var(--text-muted); max-width: 760px; }
.hero-doc__lead strong { color: var(--text); font-weight: 600; }

/* Hero with an illustration (names: DNS zone mockup): text beside it on desktop, under the text on a phone. */
.hero-doc--visual {
  display: grid; align-items: center; gap: 56px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.hero-doc__copy { min-width: 0; }
.hero-doc__visual { position: relative; isolation: isolate; min-width: 0; }
.hero-doc__visual .product__panel { padding: 22px; }
.hero-doc__visual .agent-flow li { align-items: flex-start; }
.hero-doc__visual .agent-flow li > span:last-child { min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }
.hero-doc__visual .agent-flow__tag { flex: 0 0 auto; }
.nowrap { white-space: nowrap; }

@media (max-width: 960px) {
  .hero-doc--visual { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 480px) {
  .hero-doc__visual .product__panel { padding: 16px; }
  .hero-doc__visual .agent-flow { gap: 10px; }
  .hero-doc__visual .agent-flow li { gap: 10px; font-size: 0.88rem; }
  .hero-doc__visual .agent-flow__tag { min-width: 52px; padding: 3px 8px; }
}

/* ---------- Sections ---------- */
.doc-section { min-width: 0; padding-block: clamp(36px, 6vw, 72px); }
.doc-section .section__kicker { display: inline-block; margin-bottom: 10px; }
.doc-h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 20px; }
.doc-h3 { font-size: 1.15rem; font-weight: 700; margin: 30px 0 10px; }
.doc-section p, .doc-section li { overflow-wrap: anywhere; }
.doc-section p { color: var(--text-muted); margin-bottom: 14px; }
.doc-section strong { color: var(--text); font-weight: 600; }
.doc-section a { color: var(--brand-3); text-decoration: underline; text-underline-offset: 3px; }
.doc-section a.btn { color: #fff; text-decoration: none; }

/* ---------- Code ---------- */
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.88em; color: var(--text); overflow-wrap: anywhere; }
pre {
  margin: 12px 0 18px; padding: 16px 18px; overflow-x: auto; max-width: 100%;
  background: rgba(5, 5, 11, 0.7); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
pre code { font-size: 0.86rem; line-height: 1.55; white-space: pre; overflow-wrap: normal; }

/* ---------- Lists, cards, steps ---------- */
.plain-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.plain-list li { color: var(--text-muted); padding-left: 18px; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-3); }

.feat-grid, .price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feat { padding: 20px 22px; }
.feat h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; }
.feat p { font-size: 0.95rem; margin-bottom: 0; }

.tool-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tool-list li { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }

/* Grid items default to min-width:auto, so a <pre> with white-space:pre inside a step <li> stretched
   the single auto column to the width of its longest line and pushed the page wider than the phone.
   minmax(0, 1fr) + min-width:0 let the <pre> scroll inside its own box instead. */
.steps-doc { counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.steps-doc > li { counter-increment: step; position: relative; padding-left: 46px; min-width: 0; }
.steps-doc > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; color: #fff; background: var(--grad);
}
.steps-doc > li > p { margin-bottom: 6px; }

.cyc { margin: 18px 0 22px; padding: 18px 20px; }
.cyc__svg { width: 100%; height: auto; max-width: 720px; margin-inline: auto; }
.cyc__arrows path { fill: none; stroke: var(--brand-3); stroke-width: 2; marker-end: url(#cyc-arrow); }
.cyc__node rect { fill: #14142a; stroke: var(--brand-2); stroke-width: 1.5; }
.cyc__node text { fill: var(--text); font: 600 15px 'JetBrains Mono', ui-monospace, monospace; }
.cyc__cap { fill: var(--text-muted); font: 500 13px 'Inter', system-ui, sans-serif; }
.cyc figcaption { margin-top: 12px; color: var(--text-muted); font-size: 0.92rem; }
.cyc__text { display: inline-block; }
.cyc__list { counter-reset: skill; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.cyc__list li { color: var(--text-muted); }

/* ---------- Callouts, FAQ, CTA ---------- */
.doc-callout {
  padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid rgba(41, 224, 138, .3);
  background: rgba(41, 224, 138, .08); color: var(--text) !important; margin-bottom: 20px !important;
}
.doc-note { font-size: 0.92rem; }

/* FAQ: native <details>, collapsed by default; answers stay in the DOM for crawlers. */
.faq-item { border-top: 1px solid var(--border); }
.faq-item:first-of-type { border-top: 0; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; padding: 14px 0; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary::after {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--brand-3); border-bottom: 2px solid var(--brand-3);
  transform: rotate(45deg); transition: transform 0.2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover h3 { color: var(--brand-3); }
.faq-item summary:focus-visible { outline: 2px solid var(--brand-3); outline-offset: 2px; border-radius: 6px; }
.faq-item h3 { font-size: 1.08rem; font-weight: 700; margin: 0; min-width: 0; overflow-wrap: anywhere; transition: color 0.2s; }
.faq-item p { margin: 0 0 18px; overflow-wrap: anywhere; }

.doc-cta { padding: 32px 28px; }

@media (max-width: 720px) {
  .feat-grid, .price-grid { grid-template-columns: minmax(0, 1fr); }
}
