/* Purpose: Self-hosted fonts, element reset, global typography, focus and reduced-motion baseline. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/playfair-display.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/playfair-display-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/poppins-300.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500.woff2") format("woff2");
}

html {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: var(--text-body-sm);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
p { margin: 0; }

:focus-visible { outline: 1.5px solid var(--color-accent); outline-offset: 3px; }

/* Type scale — four sizes only */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--weight-regular);
  margin: 0;
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); line-height: var(--leading-tightest); }
h2 { font-size: var(--text-h2); line-height: var(--leading-tight); }
h3 { font-size: var(--text-h3); line-height: var(--leading-snug); }

.lede { font-size: var(--text-base); line-height: var(--leading-loose); max-width: 36em; }
.small { font-size: var(--text-sm); line-height: var(--leading-normal); }
.serif-i { font-style: italic; display: block; color: var(--color-accent); }
.muted { color: var(--color-text-muted); }

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background: var(--color-ivory);
  color: var(--color-primary);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

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

/* md */
@media (min-width: 641px) {
  body { font-size: var(--text-base); }
  .lede { font-size: var(--text-lede); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
