/* css/base.css
   ─────────────────────────────────────────────────────────────────────────────
   Reset, typography defaults and layout helpers.
   ───────────────────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

}

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

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

.calculator-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: .15em;
}

ul, ol {
  list-style: none;
}

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

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

/* ── Focus styles ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  letter-spacing: -0.025em;
}

h1 { font-size: var(--text-5xl); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }


p {
  max-width: 65ch;
  line-height: var(--line-normal);
}

strong { font-weight: var(--weight-semibold); }

small { font-size: var(--text-sm); }

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

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

.section--dark {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-ink);
}

/* ── Scroll-reveal animation ────────────────────────────────────────────────── */
.reveal-pending {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }

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

.text-accent   { color: var(--color-accent); }
.text-muted    { color: var(--color-ink-muted); }
.text-center   { text-align: center; }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

/* Star rating */
.stars {
  color: var(--color-accent);
  letter-spacing: 2px;
  font-size: var(--text-sm);
}

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .reveal-pending { opacity: 1; transform: none; transition: none; } }
