/* =====================================================================
 * construction-automation.org — site stylesheet
 * Light, professional palette inspired by blueprints + safety accents.
 * Mobile-first with widescreen-aware layout.
 * ===================================================================*/

:root {
  --color-primary: #1f4e79;
  --color-primary-bright: #2563a6;
  --color-primary-deep: #163a5a;
  --color-accent: #f59e0b;
  --color-accent-bright: #fbbf24;
  --color-slate: #475569;
  --color-slate-soft: #64748b;
  --color-text: #1e293b;
  --color-text-soft: #475569;
  --color-text-muted: #64748b;
  --color-surface: #ffffff;
  --color-paper: #f8fafc;
  --color-paper-2: #eef2f7;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-code-bg: #f1f5f9;
  --color-inline-code-bg: #eef2f7;
  --color-inline-code-text: #1f4e79;
  --color-link: #1f4e79;
  --color-link-hover: #f59e0b;
  --color-success: #16a34a;
  --color-danger: #b91c1c;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);

  --header-height: 68px;
  --content-max: 1360px;
  --content-wide-max: 1480px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;

  --transition-fast: 120ms ease;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: clamp(15.5px, 0.95vw + 13px, 17.5px);
}

img, svg { max-width: 100%; height: auto; display: inline-block; }

/* Default size for any inline SVG that doesn't carry explicit dimensions or
 * a class-based override, so a missing rule never lets one balloon to the
 * UA-default 300x150. */
svg:not([width]):not([height]):not(.logo) { width: 1em; height: 1em; }

a {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

a:hover, a:focus-visible {
  color: var(--color-link-hover);
  border-bottom-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: rgba(245, 158, 11, 0.35); color: var(--color-primary-deep); }

/* ---------- Layout shell ---------- */

.shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
}

.shell-wide {
  width: 100%;
  max-width: var(--content-wide-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 36px);
}

main.site-main {
  flex: 1 0 auto;
  padding: clamp(28px, 4vw, 56px) 0 clamp(48px, 6vw, 80px);
}

/* When the page leads with a full-bleed hero band, let the gradient sit
 * flush under the sticky header instead of leaving a bare strip above it. */
main.site-main:has(> .hero-band:first-child) { padding-top: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--color-primary-deep);
  border: 0;
  font-size: clamp(15px, 0.6vw + 13px, 17px);
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--color-primary-bright); }

.brand .logo {
  display: block;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand-name { white-space: nowrap; }
.brand-name__short { display: none; }

@media (max-width: 560px) {
  .brand-name__full { display: none; }
  .brand-name__short { display: inline; }
}

.nav-toggle {
  display: none;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-primary-deep);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
}

.nav-toggle:hover { background: var(--color-paper-2); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--color-slate);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-primary-deep);
  background: var(--color-paper-2);
  border-color: var(--color-border);
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary-deep);
  background: rgba(31, 78, 121, 0.08);
  border-color: rgba(31, 78, 121, 0.18);
}

.site-nav a[aria-current="page"] .nav-icon { color: var(--color-accent); }

.nav-icon { width: 18px; height: 18px; color: var(--color-primary-bright); flex-shrink: 0; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: clamp(16px, 3vw, 32px);
    left: clamp(16px, 3vw, 32px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 12px; }
}

/* ---------- Hero ---------- */

/* Full-bleed gradient backdrop. Lives outside the shell so it spans 100vw. */
.hero-band {
  position: relative;
  width: 100%;
  isolation: isolate;
  padding: clamp(36px, 6vw, 80px) 0 clamp(24px, 4vw, 56px);
}

.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 70% at 18% 0%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 10%, rgba(245, 158, 11, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 40%);
  pointer-events: none;
}

.hero { width: 100%; }

.hero__logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.hero__logo-row .logo {
  width: clamp(96px, 14vw, 168px);
  height: clamp(96px, 14vw, 168px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
}

.hero__logo-row .logo:hover { transform: translateY(-2px) rotate(-1deg); }

.hero__title {
  font-size: clamp(1.9rem, 2.2vw + 1rem, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-align: center;
  background: linear-gradient(95deg, var(--color-primary-deep), var(--color-primary-bright) 55%, var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  text-align: center;
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.3rem);
  color: var(--color-text-soft);
  margin: 0 auto 16px;
}

.hero__body {
  color: var(--color-text-soft);
  font-size: clamp(1rem, 0.2vw + 0.95rem, 1.1rem);
  column-gap: 36px;
}

@media (min-width: 1100px) {
  .hero__body { column-count: 2; column-gap: 48px; }
  .hero__body p { break-inside: avoid; }
}

.hero__body p { margin: 0 0 14px; }

.hero__cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: clamp(28px, 3vw, 40px);
}

@media (min-width: 720px) {
  .hero__cta-grid { grid-template-columns: repeat(2, 1fr); }
}

.cta-button {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-bright);
  color: var(--color-text);
}

.cta-button__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}

.cta-button__icon svg { width: 28px; height: 28px; }

.cta-button__body { display: flex; flex-direction: column; min-width: 0; }
.cta-button__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-deep);
  margin-bottom: 4px;
  line-height: 1.2;
}
.cta-button__desc { color: var(--color-text-soft); font-size: 0.95rem; line-height: 1.45; }

.cta-button[data-icon="ingest"] .cta-button__icon { background: linear-gradient(135deg, #3b82f6, #1f4e79); }
.cta-button[data-icon="architecture"] .cta-button__icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

/* ---------- Page intro & cards ---------- */

.page-intro {
  margin: 0 auto clamp(24px, 3vw, 40px);
  max-width: 920px;
  color: var(--color-text-soft);
}

.page-intro h1 {
  font-size: clamp(1.7rem, 1.4vw + 1rem, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--color-primary-deep);
}

.section-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: clamp(28px, 3vw, 40px);
}

@media (min-width: 760px) {
  .section-overview { grid-template-columns: repeat(2, 1fr); }
}

.section-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary-bright);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  color: var(--color-text);
}

.section-card:hover,
.section-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
}

.section-card[data-accent="ingest"] { border-top-color: var(--color-primary-bright); }
.section-card[data-accent="architecture"] { border-top-color: var(--color-accent); }

.section-card__head { display: flex; align-items: center; gap: 12px; }
.section-card__icon { width: 36px; height: 36px; color: var(--color-primary-bright); }
.section-card[data-accent="architecture"] .section-card__icon { color: var(--color-accent); }
.section-card__title { font-size: 1.15rem; font-weight: 700; color: var(--color-primary-deep); margin: 0; line-height: 1.2; }
.section-card__blurb { color: var(--color-text-soft); margin: 0; }
.section-card__cta {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  color: var(--color-primary-bright);
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section-card__cta-icon { width: 18px; height: 18px; transition: transform var(--transition); }
.section-card:hover .section-card__cta { color: var(--color-accent); border-bottom-color: currentColor; }
.section-card:hover .section-card__cta-icon { transform: translateX(3px); }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: clamp(16px, 2vw, 24px);
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-slate);
  border-bottom: 1px solid transparent;
  padding: 2px 4px;
  border-radius: 4px;
}
.breadcrumbs a:hover { color: var(--color-primary-bright); background: var(--color-paper-2); }
.breadcrumbs .sep { color: var(--color-border-strong); }
.breadcrumbs .current { color: var(--color-text); font-weight: 600; }

/* ---------- Article body ---------- */

.article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3vw, 44px) clamp(18px, 3vw, 48px);
}

.article h1 {
  font-size: clamp(1.8rem, 1.4vw + 1rem, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  color: var(--color-primary-deep);
  position: relative;
  padding-bottom: 12px;
}

.article h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 84px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary-bright), var(--color-accent));
}

.article h2 {
  margin: clamp(28px, 3vw, 44px) 0 12px;
  font-size: clamp(1.35rem, 0.6vw + 1rem, 1.7rem);
  line-height: 1.2;
  color: var(--color-primary-deep);
  padding-left: 14px;
  border-left: 4px solid var(--color-accent);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.article h3 {
  margin: clamp(22px, 2vw, 32px) 0 10px;
  font-size: clamp(1.15rem, 0.3vw + 1rem, 1.35rem);
  color: var(--color-primary-bright);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.article h4 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
  color: var(--color-slate);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.article p {
  margin: 0 0 14px;
  color: var(--color-text);
}

.article a {
  color: var(--color-primary-bright);
  border-bottom: 1px solid rgba(31, 78, 121, 0.25);
}
.article a:hover,
.article a:focus-visible {
  color: var(--color-accent);
  border-bottom-color: currentColor;
}

/* Header-link anchors injected by markdown-it-anchor */
.article .header-anchor {
  color: inherit;
  border-bottom: 0;
}
.article .header-anchor:hover { color: var(--color-accent); }

.article ul,
.article ol {
  padding-left: 1.4rem;
  margin: 0 0 16px;
}

.article ul li,
.article ol li { margin-bottom: 6px; }

/* Task-list checkboxes (markdown-it-task-lists) */
.article ul li.task-list-item {
  list-style: none;
  margin-left: -1.4rem;
  padding-left: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.article ul li.task-list-item input[type="checkbox"].task-list-item-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--color-primary-bright);
  cursor: pointer;
  flex-shrink: 0;
}

.article ul li.task-list-item input[type="checkbox"].task-list-item-checkbox:checked + label,
.article ul li.task-list-item input[type="checkbox"].task-list-item-checkbox:checked ~ * {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.article ul li.task-list-item label { cursor: pointer; }

/* Inline code */
.article :not(pre) > code {
  background: var(--color-inline-code-bg);
  color: var(--color-inline-code-text);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.92em;
  border: 0;
}

/* Code blocks */
.code-block {
  position: relative;
  margin: 18px 0 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-code-bg);
  overflow: hidden;
}

.code-block pre[class*="language-"],
.code-block pre {
  margin: 0;
  padding: 18px 18px 18px 18px;
  background: transparent;
  color: #1e293b;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
  tab-size: 4;
}

.code-block code { font-family: inherit; background: transparent; padding: 0; }

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--color-border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-slate);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
  z-index: 2;
}

.code-block:hover .code-copy,
.code-block:focus-within .code-copy { opacity: 1; }
.code-copy:hover { color: var(--color-primary-deep); background: #fff; }
.code-copy.copied { color: var(--color-success); border-color: var(--color-success); }

.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.code-block[data-lang] pre { padding-top: 32px; }

/* Light Prism overrides */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b; font-style: italic; }
.token.punctuation { color: #475569; }
.token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #b45309; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #15803d; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #b91c1c; background: transparent; }
.token.atrule, .token.attr-value, .token.keyword { color: #1f4e79; font-weight: 600; }
.token.function, .token.class-name { color: #7c3aed; }
.token.regex, .token.important, .token.variable { color: #be185d; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* Tables */
.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article table th,
.article table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.article table th {
  background: var(--color-paper-2);
  color: var(--color-primary-deep);
  font-weight: 700;
  white-space: nowrap;
}

.article table tr:last-child td { border-bottom: 0; }
.article table tr:nth-child(even) td { background: rgba(248, 250, 252, 0.6); }

/* Blockquote */
.article blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--color-paper-2);
  border-left: 4px solid var(--color-primary-bright);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-soft);
}

/* FAQ / accordion */
.article details.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 0;
  margin: 10px 0;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.article details.faq-item[open] {
  border-color: var(--color-primary-bright);
  box-shadow: var(--shadow-sm);
}

.article details.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--color-primary-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article details.faq-item summary::-webkit-details-marker { display: none; }
.article details.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-accent);
  transition: transform var(--transition);
}
.article details.faq-item[open] summary::after { content: "−"; }

.article details.faq-item > *:not(summary) {
  padding: 0 16px 14px;
  color: var(--color-text-soft);
}

/* Related-pages footer on articles */
.related-pages {
  margin-top: clamp(28px, 3vw, 40px);
  padding-top: 18px;
  border-top: 1px dashed var(--color-border-strong);
}
.related-pages h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--color-primary-deep);
  padding: 0;
  border: 0;
}
.related-pages ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .related-pages ul { grid-template-columns: repeat(2, 1fr); } }
.related-pages a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  font-weight: 600;
  color: var(--color-primary-deep);
  border-bottom: 1px solid var(--color-border);
  transition: transform var(--transition), border-color var(--transition);
}
.related-pages a:hover { transform: translateX(2px); border-color: var(--color-accent); color: var(--color-accent); }

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  margin-top: clamp(48px, 6vw, 96px);
  background: linear-gradient(180deg, transparent, var(--color-paper-2));
  border-top: 1px solid var(--color-border);
  padding: clamp(28px, 4vw, 48px) 0 32px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr; align-items: flex-start; }
}

.site-footer__about {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--color-primary-deep);
  border: 0;
}

.site-footer__nav h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-slate);
  margin: 0 0 10px;
}

.site-footer__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.site-footer__nav a {
  color: var(--color-text-soft);
  border-bottom: 1px solid transparent;
}
.site-footer__nav a:hover { color: var(--color-accent); border-bottom-color: currentColor; }

.site-footer__legal {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-border-strong);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

/* ---------- Mermaid ---------- */
pre.mermaid {
  background: var(--color-paper-2);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  text-align: center;
  overflow-x: auto;
}

/* ---------- KaTeX tweaks ---------- */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Widescreen tuning ---------- */
@media (min-width: 1400px) {
  :root { --content-max: 1440px; --content-wide-max: 1560px; }
}

@media (min-width: 1700px) {
  :root { --content-max: 1560px; --content-wide-max: 1680px; }
  body { font-size: 17.5px; }
}

@media (min-width: 2000px) {
  :root { --content-max: 1720px; --content-wide-max: 1820px; }
}
