/* dPAM public site */
:root {
  --bg-base: #0d1117;
  --bg-raised: #161b22;
  --bg-surface: #21262d;
  --border: #30363d;
  --text-primary: #f0f6fc;
  --text-secondary: #c9d1d9;
  --text-muted: #8b949e;
  --accent-blue: #58a6ff;
  --accent-green: #238636;
  --accent-green-hov: #2ea043;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 56px;
  --content-max: 920px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg-base);
  color: var(--text-secondary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ─── Header ─── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-base) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}
.site-logo:hover {
  text-decoration: none;
  color: var(--accent-blue);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

.nav-link {
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 450;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
  text-decoration: none;
}
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}
.site-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
}

@media (max-width: 768px) {
  .site-header-inner {
    flex-wrap: wrap;
    position: relative;
  }
  .site-nav-toggle {
    display: flex;
  }
  .site-nav {
    display: none;
    order: 10;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin: 0.75rem 0 0;
    padding: 0.5rem 0 0;
    border-top: 1px solid var(--border);
    margin-left: 0;
    margin-right: 0;
  }
  .site-nav--open {
    display: flex;
  }
}

.nav-link--active {
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.btn--primary {
  background: var(--accent-green);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-green-hov);
  text-decoration: none;
  color: #fff;
}
.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--secondary:hover {
  background: var(--bg-raised);
  text-decoration: none;
  color: var(--text-primary);
}
.btn--ghost {
  background: transparent;
  color: var(--accent-blue);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: var(--bg-surface);
  text-decoration: none;
  color: var(--text-primary);
}
.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* ─── Main shell ─── */
.main-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
}

/* Главная: шире контейнер под двухколоночный hero */
body[data-page="home"] .main-shell {
  max-width: min(1280px, 100% - 2rem);
}

@media (min-width: 1200px) {
  body[data-page="home"] .main-shell {
    max-width: min(1320px, 100% - 2rem);
  }
}

.section {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type {
  border-bottom: none;
}

.section--tight {
  padding: 2rem 0;
}

.section--inline .prose {
  margin-bottom: 0;
}

.section--contact {
  padding-bottom: 0;
}

h1,
h2,
h3 {
  color: var(--text-primary);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.65rem, 4.2vw, 2.1rem);
  margin: 0 0 1.1rem;
}

h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  margin: 0;
}

/* Внутренние страницы: отступ под заголовком секции перед контентом (плашки, сетки) */
main:not(.main-shell) .section > h2 {
  margin-bottom: 1.35rem;
}

h3 {
  font-size: 0.98rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-head {
  margin-bottom: 1.35rem;
  max-width: 38rem;
}

.section-head h2 {
  margin-bottom: 0.35rem;
}

.section-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Одна строка без переноса (на узком экране — прокрутка только этого блока) */
.section-head--wide-desc {
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section-head--wide-desc .section-desc {
  white-space: nowrap;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 38rem;
  margin: 0 0 1rem;
  line-height: 1.62;
}

.lead--full {
  max-width: none;
}

.muted {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.fineprint {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── Hero ─── На одном уровне: текст слева, иллюстрация справа (на мобильных — колонка). */
.hero {
  padding: 2.5rem 0 3rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 880px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.28fr);
    gap: 2.25rem 2.5rem;
    align-items: center;
    padding: 3rem 0 3.5rem;
  }
}

@media (min-width: 1100px) {
  .hero {
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.42fr);
    gap: 2.5rem 3rem;
    padding: 3.25rem 0 3.75rem;
  }
}

.hero-copy {
  min-width: 0;
  max-width: 44rem;
}

@media (min-width: 880px) {
  .hero-copy {
    max-width: none;
  }
}

.hero-visual {
  width: 100%;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.5);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-cta {
  margin-top: 1.65rem;
}

/* ─── Checklist (зачем dPAM) ─── */
.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 40rem;
}

.checklist li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  opacity: 0.75;
}

.checklist li:last-child {
  margin-bottom: 0;
}

/* ─── «Зачем dPAM»: карточки с иконками ─── */
.why-cards {
  display: grid;
  gap: 1rem;
  margin: 0;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .why-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.1rem;
  }
}

@media (min-width: 960px) {
  .why-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem 1.2rem;
  }
}

/* Три карточки в ряд: «Кому подойдёт», «Типовые сценарии» (перекрывает .why-cards @560) */
@media (min-width: 640px) {
  .grid-unified--cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.05rem;
  }

  .why-cards.why-cards--cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.05rem;
  }
}

@media (min-width: 960px) {
  .grid-unified--cols-3 {
    gap: 1.1rem 1.2rem;
  }

  .why-cards.why-cards--cols-3 {
    gap: 1.1rem 1.2rem;
  }
}

.why-card {
  margin: 0;
  padding: 1.25rem 1.3rem 1.35rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.85rem;
  row-gap: 0.65rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.why-card:hover {
  border-color: color-mix(in srgb, var(--border) 65%, var(--accent-blue));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.why-card__icon,
.tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border));
}

.why-card__icon {
  grid-row: 1;
  grid-column: 1;
}

.tile__icon {
  grid-row: 1;
  grid-column: 1;
}

.why-card__icon svg,
.tile__icon svg {
  display: block;
  flex-shrink: 0;
}

.why-card__title {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
  align-self: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.why-card__text {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--text-muted);
}

/* ─── Unified grid (по умолчанию одна колонка; модификатор --cols-3 — см. выше) ─── */
.grid-unified {
  display: grid;
  gap: 1rem;
}

.tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.85rem;
  row-gap: 0.55rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}

.tile:hover {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent-blue));
}

.tile p {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tile h3 {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
  align-self: center;
}

/* ─── Prose blocks ─── */
.prose {
  max-width: 40rem;
}

.prose p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.prose p:last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .prose--two-col {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2.25rem;
    align-items: start;
  }

  .prose--two-col p {
    margin: 0;
  }
}

.figure {
  margin: 1.75rem 0 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 1rem 1.1rem;
}

.figure--flush {
  max-width: none;
}

.figure img,
.figure svg {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

/* ─── Legacy: cards / grids for pricing & inner pages ─── */
.grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cards {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .cards--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card h3 {
  color: var(--accent-blue);
  font-size: 1rem;
}

.bullet-list {
  margin: 0;
  padding-left: 1.15rem;
}
.bullet-list li {
  margin-bottom: 0.5rem;
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare-table th,
.compare-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table th {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-table td:first-child {
  font-weight: 600;
  color: var(--accent-blue);
  white-space: nowrap;
}

.contact-form {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 0.35rem;
}

@media (max-width: 639px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}

.contact-form__full {
  grid-column: 1 / -1;
}

.contact-form__submit {
  margin-top: 0.15rem;
}

.contact-form__submit .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .contact-form__submit .btn {
    width: auto;
    min-width: 12rem;
  }
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.page-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  margin-bottom: 0.5rem;
}

/* inner pages use wider main - reset */
main:not(.main-shell) {
  width: 100%;          /* Явная ширина: без неё flex-item c margin:auto сжимается до контента */
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  box-sizing: border-box;
}

.pricing-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.tier-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.tier-card--featured {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}
.tier-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}
.tier-metrics {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.tier-limits {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.tier-price {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

.tier-extras {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
  line-height: 1.55;
}

.pricing-disclaimer {
  margin-top: 1.75rem;
  margin-bottom: 0;
  max-width: none;
}

.tier-card .btn {
  margin-top: auto;
}

.metric-box {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}
@media (min-width: 640px) {
  .metric-box {
    grid-template-columns: 1fr 1fr;
  }
}
.metric-box .card {
  margin: 0;
}

.metric-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  min-width: 0;
}

.metric-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border));
}

.metric-card__icon svg {
  display: block;
}

.metric-card__head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.metric-card > p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.doc-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.doc-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.doc-card:hover {
  border-color: var(--accent-blue);
  text-decoration: none;
}
.doc-card h3 {
  margin: 0 0 0.35rem;
  color: var(--accent-blue);
  font-size: 1rem;
}
.doc-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.faq-list details {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  padding: 0;
}
.faq-list summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}
.faq-list summary::-webkit-details-marker {
  display: none;
}
.faq-list details[open] summary {
  border-bottom: 1px solid var(--border);
}
.faq-list .faq-a {
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

#site-footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: auto;
  padding: 2.5rem 1.25rem 1.5rem;
  font-size: 0.9rem;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}
@media (min-width: 640px) {
  .site-footer-inner {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Регистрация ПО / правообладатель (тёмная тема, структура как на светлом макете) */
.footer-eod__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.footer-eod__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border));
}

.footer-eod__icon svg {
  display: block;
}

.footer-eod__title {
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  min-width: 0;
}

.footer-eod__line {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-eod__line strong {
  color: var(--text-primary);
  font-weight: 600;
}

.footer-eod__fips {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
}

.footer-eod__fips a {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.footer-contact-block__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.footer-contact-block__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border));
}

.footer-contact-block__icon svg {
  display: block;
}

.footer-contact-block__title {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.footer-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.footer-legal {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
}
.footer-contact {
  margin: 0 0 0.75rem;
}
.site-footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.usecase-steps {
  font-size: 0.92rem;
}
.usecase-steps strong {
  color: var(--text-primary);
}

/* ─── Documentation viewer ─── */
body[data-page="documentation"] .page-hero {
  border-bottom: none;
  padding-bottom: 0.35rem;
}
body[data-page="documentation"] .doc-tiles {
  margin-top: 1.35rem;
}

.doc-tiles {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
  .doc-tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

.doc-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 1.15rem 1.25rem;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, var(--border));
}
.doc-tile__icon svg {
  display: block;
}
.doc-tile:hover {
  border-color: color-mix(in srgb, var(--accent-blue) 55%, var(--border));
}
.doc-tile:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent);
}
.doc-tile--active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}
.doc-tile__title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  min-width: 0;
  line-height: 1.35;
}

.doc-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 2rem;
  min-height: 12rem;
}

.doc-prose {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.doc-prose > *:first-child {
  margin-top: 0;
}
.doc-prose > *:last-child {
  margin-bottom: 0;
}
.doc-prose h1 {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.doc-prose h2 {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 1.5rem 0 0.6rem;
}
.doc-prose h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem;
}
.doc-prose h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1rem 0 0.45rem;
}
.doc-prose p {
  margin: 0 0 0.85rem;
}
.doc-prose ul,
.doc-prose ol {
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
}
.doc-prose li {
  margin-bottom: 0.35rem;
}
.doc-prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.35rem 0;
}
.doc-prose blockquote {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0 0.65rem 1rem;
  border-left: 3px solid var(--accent-blue);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-base) 70%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.doc-prose strong {
  color: var(--text-primary);
  font-weight: 600;
}
.doc-prose a {
  color: var(--accent-blue);
}
.doc-prose code {
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.doc-prose pre {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
}
.doc-prose pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: inherit;
}
.doc-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.doc-prose th,
.doc-prose td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border: 1px solid var(--border);
}
.doc-prose th {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}
.doc-prose .doc-placeholder {
  margin: 0;
}
