/* Reset + typography + global element styles */

/* Gala title face — client-supplied license, packaged with the brand
   guidelines. Used only for the "Works of Heart" lockup (via --font-gala). */
@font-face {
  font-family: "Encorpada Classic Compressed";
  src: url("../assets/fonts/EncorpadaClassicComp-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--gallery);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* guard; root causes are still fixed individually */
}

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

img { height: auto; }

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

a { color: inherit; }

h1, h2, h3, h4 { line-height: 1; font-weight: 400; }

/* Display face — Bodoni 72 direction. Weight 500 + a mid optical size
   keeps hairlines and serifs visible on screen; 700 was filling them in. */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 36, "wght" 500;
  line-height: 0.95;
  letter-spacing: 0;
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: geometricPrecision;
}
.display-xl { font-size: var(--type-display-xl); }
.display-l  { font-size: var(--type-display-l); }
.display-m  { font-size: var(--type-display-m); }

/* Eyebrow — bold Helvetica caps, mirrors the PDF header labels */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Wall-label caption: LOT 014 · OIL ON CANVAS */
.caption {
  font-size: var(--type-caption);
  color: var(--stone);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; }

/* Work titles: The Saint John's Bible is always italic */
em { font-style: italic; }
.display em,
.lot-card__title em,
.lot-info__title em {
  font-family: inherit;
  font-weight: inherit;
  font-style: italic;
}

/* Link hover — a rule that draws itself in under the words */
.link-sweep {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  padding-bottom: 0.14em;
  transition: background-size 0.3s var(--ease-out-expo);
}
.link-sweep:hover, .link-sweep:focus-visible { background-size: 100% 2px; }

/* Focus visibility (sitewide) */
:focus-visible {
  outline: 2px solid var(--tupa-blue);
  outline-offset: 2px;
}
.on-dark :focus-visible, .band :focus-visible {
  outline-color: var(--tupa-yellow);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--ink); color: var(--gallery);
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

::selection { background: var(--tupa-yellow); color: var(--ink); }

/* Visually hidden (screen-reader only) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Cross-document page transitions (progressive enhancement) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: 0.4s;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
