/* MB „Arvaidas“ — bazė.
   Reset, tipografija, pagalbinės klasės. Vienas šeimos tipas per visą mastelį. */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;

  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty;
}

main {
  flex: 1;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-color: var(--ink-4);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--duration-fast) var(--ease),
    text-decoration-color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--signal);
  text-decoration-color: var(--signal);
}

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-title);
}

h3 {
  font-size: var(--text-xl);
  line-height: 1.22;
  letter-spacing: var(--tracking-tight);
}

h4 {
  font-size: var(--text-lg);
  line-height: 1.32;
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}

p {
  max-width: var(--measure);
}

strong {
  color: var(--ink);
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin-block: var(--space-6);
}

::selection {
  background: var(--signal);
  color: var(--on-signal);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* —— Pagalbinės klasės —— */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-toast);
  padding: 0.65rem 1.1rem;
  background: var(--signal);
  color: var(--on-signal);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-250%);
  transition: transform var(--duration) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--on-signal);
}

.wrap {
  width: min(100% - var(--pad-x) * 2, var(--w-content));
  margin-inline: auto;
}

.wrap--text {
  width: min(100% - var(--pad-x) * 2, var(--w-text));
}

.wrap--wide {
  width: min(100% - var(--pad-x) * 2, var(--w-wide));
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--sm {
  gap: var(--space-2);
}

.stack--lg {
  gap: var(--space-6);
}

/* —— Tipografinės rolės —— */

.lead {
  font-size: var(--text-lg);
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: var(--measure-narrow);
}

.meta {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--ink-3);
  line-height: 1.4;
}

.small {
  font-size: var(--text-sm);
  line-height: 1.55;
}

.muted {
  color: var(--ink-3);
}

/* —— Judėsena —— */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .back-top,
  .cookie-banner,
  .modal {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
