/*
 * ARMA AREÁL — global tokens, base styles, shared classes.
 *
 * Imported jednou na úrovni homepage (Step 4) přes regular CSS import.
 * Definuje `.arma-root` scope, který:
 *   1. mapuje `--theme-color-*` / `--theme-custom-*` z buildCssVariables.ts
 *      na designové aliasy (`--bg`, `--accent`, `--surface-1`, …) — tím
 *      pádem JSX z arma-components.jsx funguje 1:1 bez přepisu var názvů
 *   2. nastavuje base typografii, dotted grid pozadí, focus styly
 *   3. drží sdílené třídy (.eyebrow, .mono, .wrap, .btn, .tag, .reveal)
 *
 * Per-section layouty jdou do component-specific .module.css souborů.
 * .arma-root je intencionálně regulární třída (ne CSS Module), aby
 * subkomponenty mohly používat .reveal / .eyebrow / .btn jako
 * koordinované utility napříč sekcemi.
 */

.arma-root {
  /* ── Variable aliases ─────────────────────────────────────────────── */
  --bg: var(--theme-color-bg);
  --text: var(--theme-color-text);
  --text-muted: var(--theme-custom-text-muted);
  --text-disabled: var(--theme-custom-text-disabled);

  --surface-1: var(--theme-custom-surface-1);
  --surface-2: var(--theme-custom-surface-2);
  --surface-3: var(--theme-custom-surface-3);
  --border: var(--theme-custom-border);
  --border-strong: var(--theme-custom-border-strong);

  --accent: var(--theme-color-primary);
  --accent-2: var(--theme-color-accent);
  --accent-glow: var(--theme-custom-accent-glow);
  --accent-tint: var(--theme-custom-accent-tint);
  --accent-edge: var(--theme-custom-accent-edge);

  --warn: var(--theme-custom-warn);
  --danger: var(--theme-custom-danger);

  --font-display: var(--theme-font-heading);
  --font-body: var(--theme-font-body);
  --font-mono: var(--theme-custom-font-mono);

  --r-sm: var(--theme-custom-r-sm);
  --r-md: var(--theme-custom-r-md);
  --r-lg: var(--theme-radius);

  --t-fast: 120ms ease;
  --t-base: 180ms ease;
  --t-slow: 280ms ease;
  --arma-wrap-max: 1440px;
  --arma-wrap-pad: 32px;
  --arma-frame-offset: 12px;
  --arma-frame-x: calc(
    max(0px, (100vw - var(--arma-wrap-max)) / 2) +
    var(--arma-wrap-pad) -
    var(--arma-frame-offset)
  );

  /* ── Base ─────────────────────────────────────────────────────────── */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  /*
   * `overflow-x: clip` (ne `hidden`) — moderní CSS která hide horizontal
   * overflow stejně jako `hidden`, ale NEVYTVÁŘÍ nový scroll containing
   * block. To je kritické: `overflow: hidden` na ancestoru zlomí
   * `position: sticky` na všech descendants (sticky se přilepí k tomuto
   * scroll bloku, který scrolluje s page contentem -> sticky element se
   * nikam nepřilepí).
   *
   * Před touto změnou hi-fi SEOContent sticky TOC na HP nefungoval z
   * tohoto důvodu. `overflow-x: clip` zachová ořezání full-bleed sekcí
   * (Hero / Areal decorative offsety) a zároveň povolí sticky.
   *
   * Browser support: Chrome 90+, Firefox 81+, Safari 15.4+ — pokrývá
   * storefront browserslist (Chrome 109+ / FF 115+ / Safari 16.4+).
   */
  overflow-x: clip;
  color-scheme: dark;
}

.arma-root::before {
  /* Dotted grid pattern, subtle; covers viewport */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

.arma-root img {
  max-width: 100%;
  display: block;
}

.arma-root a {
  color: inherit;
  text-decoration: none;
}

.arma-root section[id] {
  scroll-margin-top: 104px;
}

.arma-root ::selection {
  background: var(--accent);
  color: #0a0a0b;
}

.arma-root :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Display headings ───────────────────────────────────────────────── */

.arma-root h1,
.arma-root h2,
.arma-root h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.95;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.arma-root h1 { font-size: clamp(56px, 9vw, 148px); }
.arma-root h2 { font-size: clamp(44px, 6vw, 96px); }
.arma-root h3 { font-size: clamp(28px, 3vw, 44px); }

/* ── Container ──────────────────────────────────────────────────────── */

.arma-root .wrap {
  max-width: var(--arma-wrap-max);
  margin: 0 auto;
  padding: 0 var(--arma-wrap-pad);
}

@media (max-width: 720px) {
  .arma-root {
    --arma-wrap-pad: 20px;
  }

  .arma-root section[id] {
    scroll-margin-top: 76px;
  }
}

/* ── Eyebrow + mono micro-text ──────────────────────────────────────── */

.arma-root .mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.arma-root .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.arma-root .eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.arma-root .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base),
    border-color var(--t-base), box-shadow var(--t-base),
    transform var(--t-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.arma-root .btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.arma-root .btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 0 28px 0 var(--accent-glow);
}

.arma-root .btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.arma-root .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.arma-root .btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 14px;
}

.arma-root .btn-ghost:hover {
  color: var(--text);
}

.arma-root .btn .arrow {
  display: inline-block;
  transition: transform var(--t-base);
}

.arma-root .btn:hover .arrow {
  transform: translateX(3px);
}

/* ── Tag / Pill ─────────────────────────────────────────────────────── */

.arma-root .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid var(--accent-edge);
  border-radius: 999px;
}

.arma-root .tag.amber {
  color: var(--warn);
  background: rgba(255, 184, 0, 0.08);
  border-color: rgba(255, 184, 0, 0.25);
}

.arma-root .tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ── Reveal animations ──────────────────────────────────────────────── */

.arma-root .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.arma-root .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.arma-root .reveal.s1 { transition-delay: 60ms; }
.arma-root .reveal.s2 { transition-delay: 120ms; }
.arma-root .reveal.s3 { transition-delay: 180ms; }
.arma-root .reveal.s4 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .arma-root .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .arma-root *,
  .arma-root *::before,
  .arma-root *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Skip link ──────────────────────────────────────────────────────── */

.arma-root .skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 8px 12px;
  background: var(--accent);
  color: #0a0a0b;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transform: translateY(-200%);
  z-index: 9999;
  transition: transform 150ms;
}

.arma-root .skip-link:focus {
  transform: translateY(0);
}

/* ── Custom block (admin-editable per-page snippet) ─────────────────── */

.arma-root .arma-custom-block {
  padding: 32px 0;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.arma-root .arma-custom-block__content {
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

.arma-root .arma-custom-block__content p {
  margin: 0 0 14px 0;
}

.arma-root .arma-custom-block__content p:last-child {
  margin-bottom: 0;
}

.arma-root .arma-custom-block__content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.arma-root .arma-custom-block__content h2,
.arma-root .arma-custom-block__content h3,
.arma-root .arma-custom-block__content h4 {
  color: var(--text);
  margin: 24px 0 12px 0;
}

.arma-root .arma-custom-block__content ul,
.arma-root .arma-custom-block__content ol {
  margin: 0 0 14px 0;
  padding-left: 24px;
}

.arma-root .arma-legal-doc {
  color: var(--text-muted);
}

.arma-root .arma-legal-meta,
.arma-root .arma-legal-base {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-disabled);
}

.arma-root .arma-legal-section {
  margin: 0 0 36px;
}

.arma-root .arma-legal-section:last-child {
  margin-bottom: 0;
}

.arma-root .arma-legal-section h2 {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.arma-root .arma-legal-subsection {
  margin: 20px 0 0;
}

.arma-root .arma-legal-subsection h3 {
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
  margin: 0 0 8px;
}

.arma-root .arma-legal-doc table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  color: var(--text-muted);
  font-size: 14px;
}

.arma-root .arma-legal-doc th,
.arma-root .arma-legal-doc td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.arma-root .arma-legal-doc th {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
}

@media (max-width: 720px) {
  .arma-root .arma-legal-doc table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
