/* 2base base layer — reset, typography, accessibility and layout primitives. */
/* ----------------------------------------------------------------------------
   WCAG 2.3.3 (Animation from Interactions) — respect user's OS-level setting
   to reduce motion. Collapses animations and transitions to ~0 for users who
   are sensitive to motion (vestibular disorders, migraines, etc.). Applied
   globally via *, *::before, *::after so every transition/animation defined
   later in this file or in Tailwind utilities is automatically covered.
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------------------
   Display-heading typography — letter-spacing system for large headings.
   Applied via templates: `.app-h-display` for text-4xl/5xl/6xl (>= 32px),
   `.app-h-large` for text-2xl/3xl (24-30px). Tightens optical tracking on
   large type to match premium editorial look.
   ---------------------------------------------------------------------------- */
.app-h-display,
.app-display {
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.app-h-large,
.app-page-title {
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.app-mono,
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.app-mono {
  font-family: var(--font-mono);
}

/* Canonical public layout. Component CSS is deliberately used here instead of
   a Tailwind @apply layer: app.css is not purged and remains safe around Go
   template interpolation on the Tailwind 3 Windows toolchain. */
.app-container {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.app-container--prose {
  max-width: var(--container-prose);
}

/* Status screens — вход, отписка, статус заказа/пополнения, 404. Tokens put
   these at 460–720px so the single message stays a message and does not
   stretch into a page-wide banner. */
.app-container--status {
  max-width: var(--container-status);
}

.app-section {
  padding-block: 4rem;
}

.app-section--compact {
  padding-block: 2.5rem;
}

.app-page-header {
  max-width: 48rem;
  margin-bottom: 2rem;
}

.app-page-header > :where(p) {
  max-width: 42rem;
  margin-top: 0.75rem;
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.app-eyebrow {
  margin-bottom: 0.75rem;
  color: var(--brand-700);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-kicker {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.app-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(233, 251, 78, 0.10), transparent 28rem),
    linear-gradient(145deg, var(--gray-900) 0%, #232327 58%, #111113 100%);
}

.app-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 4rem 4rem;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  content: "";
}

.app-hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 2rem 6rem rgba(2, 44, 34, 0.24);
}

.app-index-link {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.app-index-link:hover {
  border-color: var(--brand-300);
  color: var(--brand-800);
  transform: translateX(2px);
}

.app-index-link__meta {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.app-result-row {
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  padding: 1rem 1.125rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.app-result-row:hover {
  border-color: var(--color-border-hover);
  background: var(--tint);
  transform: translateY(-1px);
}

.app-result-row__name {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-result-row--exact {
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-md);
  background: var(--brand-50);
  padding: 1.125rem;
}

.search-page-head {
  max-width: 860px;
}

.search-page-head__title {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.search-page-head__lead {
  margin-top: 10px;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Editorial content. The project intentionally has no Tailwind Typography
   plugin, so the historical `prose` classes previously provided no spacing
   after Preflight reset margins. Keep the familiar class contract and define
   the readable rhythm here. */
.prose {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.prose-sm {
  font-size: 0.9375rem;
}

.prose-lg {
  font-size: 1.0625rem;
}

.prose :where(h2, h3, h4) {
  color: var(--gray-900);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.prose :where(h2) {
  margin-top: 2.25em;
  margin-bottom: 0.75em;
  font-size: 1.5em;
  line-height: 1.25;
}

.prose :where(h3) {
  margin-top: 1.75em;
  margin-bottom: 0.6em;
  font-size: 1.15em;
  line-height: 1.35;
}

.prose :where(p, ul, ol, blockquote, table) {
  margin-block: 1em;
}

.prose :where(ul, ol) {
  padding-left: 1.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose a {
  color: var(--brand-700);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--brand-200);
  text-underline-offset: 0.18em;
}

.prose a:hover {
  color: var(--brand-800);
  text-decoration-color: currentColor;
}

.prose strong {
  color: var(--color-text-primary);
  font-weight: 650;
}

.prose blockquote {
  border-left: 3px solid var(--brand-300);
  padding-left: 1.25rem;
  color: var(--color-text-secondary);
}

.prose code {
  border-radius: 0.25rem;
  background: var(--gray-100);
  padding: 0.1em 0.35em;
  color: var(--gray-800);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose > :first-child {
  margin-top: 0;
}

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

@media (min-width: 640px) {
.app-section {
    padding-block: 5rem;
  }
}

@media (min-width: 1024px) {
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Contact blur effect on company pages */
.blur-contact {
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
}

/* Alpine.js cloak: hide elements until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* Smooth collapse transition for Alpine x-collapse */
[x-collapse] {
  overflow: hidden;
}

/* Focus visible ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
html.app-scroll-locked,
html.app-scroll-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}
