/* =========================================================
   BASE — reset, typografia, saavutettavuuden perusta
   ========================================================= */

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Hento punainen sävy taustassa — ei tasaista valkoista */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(56rem 38rem at 88% -6%, rgba(215, 38, 56, 0.055), transparent 62%),
    radial-gradient(44rem 32rem at 4% 8%, rgba(240, 75, 95, 0.035), transparent 60%);
}

main,
header,
footer {
  position: relative;
  z-index: var(--z-base);
}

/* ---------- Otsikot ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
  color: var(--text);
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tighter);
}

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

h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { text-wrap: pretty; }

/* Brändin tyylikeino: piste korostetaan punaisella.
   Käyttö: <h2>Rohkeaa<span class="dot">.</span></h2> */
.dot {
  color: var(--accent-text);
}

/* ---------- Linkit ---------- */

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}

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

/* ---------- Listat ---------- */

ul,
ol {
  list-style: none;
}

/* ---------- Media ---------- */

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

/* ---------- Lomake-elementit ---------- */

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

button {
  cursor: pointer;
}

/* ---------- Fokus ---------- */

:focus {
  outline: none;
}

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

/* ---------- Valinta ---------- */

::selection {
  background: var(--brand-red);
  color: var(--neutral-0);
}

/* ---------- Vierityspalkki ---------- */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-50);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-red);
}

/* ---------- Apuluokat ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-modal);
  padding: var(--sp-3) var(--sp-5);
  background: var(--brand-red);
  color: var(--neutral-0);
  font-weight: var(--fw-bold);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}

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

/* ---------- Liikkeen vähentäminen ---------- */

@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;
  }
}
