/* ==========================================================================
   Reset + Base
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

html, body { height: 100%; }

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

table { border-collapse: collapse; border-spacing: 0; }

/* Запрет переноса для длинных слов в заголовках */
h1, h2, h3, h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ==========================================================================
   Selection
   ========================================================================== */
::selection {
  background: var(--c-amber-500);
  color: var(--c-ink);
}

/* ==========================================================================
   Focus visible
   ========================================================================== */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--c-amber-500);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ==========================================================================
   Scrollbar (тонкий, только для десктопа)
   ========================================================================== */
@media (pointer: fine) {
  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: var(--c-stone-300);
    border-radius: var(--r-full);
    border: 2px solid var(--c-bg);
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--c-graphite-400); }
}

/* ==========================================================================
   Skip link (доступность)
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: var(--z-tooltip);
  padding: var(--s-3) var(--s-5);
  background: var(--c-ink);
  color: var(--c-white);
  border-radius: var(--r-md);
  font-weight: var(--fw-semibold);
  transition: top var(--dur-fast);
}

.skip-link:focus { top: var(--s-4); }

/* ==========================================================================
   Type utility classes
   ========================================================================== */
.t-display-1 {
  font-size: var(--fs-display-1);
  line-height: 0.95;
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
}

.t-display-2 {
  font-size: var(--fs-display-2);
  line-height: 1;
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
}

.t-h1 {
  font-size: var(--fs-h1);
  line-height: 1.1;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.t-h2 {
  font-size: var(--fs-h2);
  line-height: 1.2;
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
}

.t-h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

.t-h4 {
  font-size: var(--fs-h4);
  line-height: 1.3;
  font-weight: var(--fw-semibold);
}

.t-body-lg {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
}

.t-body { font-size: var(--fs-body); line-height: var(--lh-relaxed); }
.t-body-sm { font-size: var(--fs-body-sm); line-height: 1.55; }

.t-caption {
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--c-text-muted);
}

.t-label {
  font-size: var(--fs-label);
  line-height: 1.4;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.t-mono {
  font-family: var(--ff-mono);
  font-feature-settings: 'tnum';
}

.t-num {
  font-feature-settings: 'tnum';
}

.t-muted { color: var(--c-text-muted); }
.t-subtle { color: var(--c-text-subtle); }
.t-accent { color: var(--c-accent); }

.t-balance { text-wrap: balance; }
.t-pretty { text-wrap: pretty; }

/* ==========================================================================
   Default heading стили (если без класса)
   ========================================================================== */
h1 { font-size: var(--fs-h1); line-height: 1.1; font-weight: var(--fw-bold); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: var(--fw-bold); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: var(--fw-semibold); }

/* ==========================================================================
   Eyebrow tag (маленькая надпись над заголовком)
   ========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-amber-500);
  box-shadow: 0 0 12px hsl(48 100% 50% / 0.6);
}

.eyebrow--light {
  color: var(--c-graphite-400);
}

/* ==========================================================================
   Helpers
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.no-scroll { overflow: hidden; }

/* HTML-атрибут [hidden] всегда побеждает любой display: flex/grid/etc.
   Без !important его перебивают .success-state { display: flex }, .calc__step, и т.д. */
[hidden] { display: none !important; }
