/* Fonts (self-hosted, Latin subset; chosen in Phase 1, docs/PROGRESS.md). Preloads in
   partials/head.ejs must use the exact same URLs as the src below. To switch to the
   licensed Amarieta / Birds of Paradise later, add their files here and change
   --font-display / --font-script in tokens.css. */
/* Display serif, in two parts until the full licensed Amarieta file arrives: the file we
   have (the Personal Use build) draws letters only, so Amarieta (Hishand Studio) sets the
   letters and Noto Serif Display, at normal width, the punctuation, numbers and symbols.
   Each file holds only its own characters (README › Fonts). One Amarieta face serves
   weights 300-400, so the browser never draws a fake bold or light version. */
@font-face {
  font-family: 'Amarieta';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('/fonts/amarieta-letters-400.woff2') format('woff2');
  unicode-range: U+0020, U+0026, U+0041-005A, U+0061-007A, U+00A0, U+00C0-00D6, U+00D8-00F6, U+00F8-00FF, U+0152-0153;
}

@font-face {
  font-family: 'Noto Serif Display';
  font-style: normal;
  font-weight: 300 400;
  font-stretch: 62.5% 100%;
  font-display: swap;
  src: url('/fonts/noto-serif-display-marks-300-400.woff2') format('woff2');
  unicode-range: U+0021-0025, U+0027-0040, U+005B-0060, U+007B-007E, U+00A1-00BF, U+00D7, U+00F7, U+0131, U+0178, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Parisienne';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/parisienne-normal-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 200 500;
  font-display: swap;
  src: url('/fonts/montserrat-normal-200-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('/fonts/montserrat-italic-300-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Local fonts resized to each web font's metrics, so the swap doesn't shift the
   layout. Values come from the fonts' own tables (README › Fonts). */
@font-face {
  font-family: 'Montserrat Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 106.61%;
  ascent-override: 90.79%;
  descent-override: 23.54%;
  line-gap-override: 0%;
}

/* Amarieta Regular */
@font-face {
  font-family: 'Amarieta Fallback';
  src: local('Times New Roman'), local('TimesNewRomanPSMT');
  size-adjust: 106.5%;
  ascent-override: 83.85%;
  descent-override: 22.53%;
  line-gap-override: 0%;
}

/* Tuned on short accent phrases ("Premium Quality"), which is how the script is used. */
@font-face {
  font-family: 'Parisienne Fallback';
  src: local('Times New Roman Italic'), local('TimesNewRomanPS-ItalicMT');
  size-adjust: 91.3%;
  ascent-override: 100.27%;
  descent-override: 48.94%;
  line-gap-override: 0%;
}

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

body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

/* Base */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-s));
  /* The cookie notice's height while it shows (public/js/tracking.js), else nothing. */
  scroll-padding-bottom: var(--consent-height, 0px);
}

body {
  min-height: 100vh;
  padding-bottom: var(--consent-height, 0px);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-stretch: var(--font-display-stretch);
  font-weight: var(--font-display-weight);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
}

h2 {
  font-size: var(--step-4);
}

h3 {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
}

/* Weight 300 gets thin at small sizes in the condensed cut. */
h4 {
  font-size: var(--step-1);
  font-weight: 400;
  line-height: var(--leading-snug);
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color var(--duration-fast) var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

/* The ring sits outside the element, on the surrounding surface, so its colour comes
   from that surface (--color-focus), not from the element's own text colour. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

::selection {
  background: var(--pg-charcoal);
  color: var(--pg-light);
}

hr {
  height: var(--hairline);
  margin: 0;
  border: 0;
  background: var(--color-line);
}

address {
  font-style: normal;
}

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: var(--z-skip);
  padding: var(--space-xs) var(--space-m);
  background: var(--pg-charcoal);
  color: var(--pg-light);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Ring inside the link's own charcoal box, so it shows over marble and light alike. */
.skip-link:focus-visible {
  outline-color: var(--pg-light);
  outline-offset: -5px;
}

/* The hidden attribute always wins, even over components that set display (.icon-button). */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
