/* Reset and page defaults. */

/* The serif for titles (--font-serif in css/tokens.css), from fonts/ on our own site.
   font-display: swap shows the text right away in Georgia until the font has loaded. */
@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-400.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-600.woff2") format("woff2");
}

/* Links to a place on the page (the wordmark to the top, "Discover the collection" to the packs) glide
   there instead of jumping. Switched off below for "reduce motion". */
html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

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

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

/* Hidden on screen but still read by screen readers (e.g. a label for an input). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

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

  html {
    scroll-behavior: auto;
  }
}

/* Titles in spaced capitals, like "C L E A R  Y O U R  M I N D": the last word in the accent colour (ice blue)
   (<span class="title-accent">, or setSpacedTitle() in js/lib/titles.js) and a short line
   under it, half text colour and half accent colour. .spaced-title-small: the same without the line,
   for names on cards. */
.spaced-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.35;
  text-transform: uppercase;
}

.spaced-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 14px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--color-text) 50%, var(--color-title-accent) 50%);
}

.spaced-title-small {
  font-size: 16px;
  letter-spacing: 0.16em;
}

.spaced-title-small::after {
  display: none;
}

.title-accent {
  color: var(--color-title-accent);
}

/* Fades in when it scrolls into view (js/lib/reveal.js). --reveal-delay makes a wave in a
   grid. Only added by JavaScript, so without it everything is visible. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms var(--ease-out) var(--reveal-delay, 0ms),
    transform 700ms var(--ease-out) var(--reveal-delay, 0ms);
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* Film grain: a very light noise over a section (class .grain), so large dark areas look
   like film instead of flat digital colour and gradients do not band. Under the content:
   the section's content sits on z-index 1 or higher. Made with an SVG noise filter, no file. */
.grain {
  position: relative;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
