/**
 * @file
 * Base styles — reset, typography, global element styles.
 */

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

body {
  margin: 0;
  background: var(--color-page);
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty;
  line-height: var(--line-height-body);
}

/* ── Links ── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Headings ── */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: var(--line-height-heading);
}

h1 {
  font-size: var(--font-size-h1);
  letter-spacing: var(--letter-spacing-h1);
}

h2 {
  font-size: var(--font-size-h2);
  letter-spacing: var(--letter-spacing-h2);
}

h3 {
  font-size: var(--font-size-h3);
  letter-spacing: var(--letter-spacing-h3);
}

/* ── Paragraphs ── */
p {
  margin: 0;
  line-height: var(--line-height-body);
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Buttons ── */
button {
  font-family: inherit;
  cursor: pointer;
}

/* ── Lists ── */
ul, ol {
  margin: 0;
  padding: 0;
}

/* ── Form elements ── */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Utility: visually hidden (a11y) ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 1000;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
  top: 0;
}

/* ── Animations ── */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Responsive typography ── */
@media (max-width: 768px) {
  :root {
    --font-size-display: 31px;
    --font-size-h1: 28px;
    --font-size-h2: 22px;
    --font-size-h2-lg: 24px;
    --font-size-h3: 17.5px;
    --font-size-body-lg: 15px;
    --letter-spacing-display: -1px;
    --letter-spacing-h1: -0.9px;
    --letter-spacing-h2: -0.7px;
  }
}
