/* -----------------------------------
   GLOBAL RESET
----------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* -----------------------------------
   LINKS
----------------------------------- */

a {
  position: relative;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

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

a:hover::after {
  width: 100%;
}

/* Remove underline animation from cards wrapped in <a> */
a:has(.card)::after {
  display: none !important;
}

/* Prevent link underline animation from affecting headings */
h1::after,
h2::after,
h3::after {
  content: none !important;
}


/* -----------------------------------
   WRAPPER
----------------------------------- */
.wrapper {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px; /* keep 24px, it looks better */
}

/* -----------------------------------
   SECTION DIVIDER
----------------------------------- */
.section-divider {
  height: 1px;
  background: var(--border-light);
  margin: 40px 0;
}

/* -----------------------------------
   PDF WRAPPER
----------------------------------- */
.pdf-wrap {
  width: 100%;
  /* An A4 page at the viewer's 100% zoom is 794px wide (595.5pt x 96/72) and
     does not stretch. Capping the box just above that means the page fills it
     whether the viewer honours #view=FitH or falls back to 100% — without the
     cap, any leftover width shows up as grey bars either side of the page. */
  max-width: 812px;
  margin-inline: auto;
  /* A4 ratio (1.4142) plus headroom for the browser's ~56px PDF toolbar.
     The toolbar is a fixed height but the ratio is proportional, so this is
     set slightly generous: erring high leaves a sliver of card background
     below the page, erring low clips the page bottom. Covers widths >=653px. */
  aspect-ratio: 1 / 1.50;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border-light);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.pdf-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
}

/* The toolbar is a fixed height, so it eats a larger share of a smaller box —
   give the page proportionally more room on narrow screens. Covers >=270px. */
@media (max-width: 660px) {
  .pdf-wrap { aspect-ratio: 1 / 1.62; }
}

/* -----------------------------------
   SCROLL REVEAL
----------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* -----------------------------------
   PLACEHOLDER
----------------------------------- */

::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

