/* ============================================================
   base.css — Rose City Stay
   Reset · Typography · Container · Buttons · Accessibility
   
   Значения 1:1 совпадают с инлайн-критическим CSS в index.html.
   При правке любого числа здесь — правьте то же значение
   в критическом <style> в index.html (иначе CLS ≠ 0.000).
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* компенсация фиксированной шапки при переходе по якорю */
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: var(--lh-tight);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 600; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -.015em; }
h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
}
h5, h6 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dt, dd { margin: 0; }

em { font-style: italic; }
strong, b { font-weight: 700; }

/* ---------- links & media ---------- */
a { color: inherit; text-decoration: none; }

img, svg, video, picture, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
img { border-style: none; -webkit-user-drag: none; }
svg { fill: currentColor; }

/* ---------- form element resets ---------- */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
textarea { resize: vertical; }
select { -webkit-appearance: none; appearance: none; }

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

/* ---------- skip-link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -72px;
  z-index: 120;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  transition: top var(--t-base) var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: var(--ui-focus-outline);
  outline-offset: 3px;
}

/* ---------- container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ---------- focus visible (глобально) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: var(--ui-focus-outline);
  outline-offset: 3px;
  border-radius: inherit;
}

/* ---------- icon utility ---------- */
.ic {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  fill: currentColor;
  flex: 0 0 auto;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.btn:focus-visible {
  outline: var(--ui-focus-outline);
  outline-offset: 3px;
}
.btn svg,
.btn .ic { flex: 0 0 auto; }

/* primary — accent fill */
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 26%, transparent);
}

/* outline — для второстепенных действий на светлом фоне */
.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--outline:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ghost — для второстепенных действий на тёмном (hero) фоне */
.btn--ghost {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .22); }

/* text — tertiary, без фона */
.btn--text {
  background: transparent;
  color: var(--accent);
  padding: 8px 4px;
  border-radius: var(--r-xs);
}
.btn--text:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* размеры */
.btn--sm { padding: 10px 18px; font-size: 13.5px; }
.btn--xs { padding: 8px 14px;  font-size: 12.5px; }
.btn--block { width: 100%; }

/* disabled */
.btn[disabled],
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- заголовочный хинт (жирная строка под h2) ---------- */
.h2-hint {
  display: block;
  max-width: 560px;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- selection ---------- */
::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink);
}

/* ---------- hr ---------- */
hr {
  border: 0;
  height: 1px;
  margin: 0;
  background: var(--line);
}
