/* Dear Prelude storefront — tokens and shared rules */
:root {
  /* Layout: one sideways track of full-screen chapters with floating chrome; product pages scroll vertically in their own view. */
  --paper: #F7F4EE;        /* studio paper */
  --paper-deep: #ECE7DD;   /* pressed shadow of the paper */
  --ink: #2F2B26;          /* warm writing ink */
  --soft: #7D7466;         /* secondary ink */
  --accent: #A8977B;       /* champagne */
  --line: rgba(47, 43, 38, .2);
  --font-display: 'Instrument Serif', Georgia, serif;           /* main */
  --font-text: 'Montserrat', 'Helvetica Neue', Arial, sans-serif; /* body */
  --font-script: 'Luxurious Script', 'Snell Roundhand', cursive;  /* fine calligraphy, paired with the serif */
  --track-display: -0.03em;   /* Canva letter spacing −30 */
  --track-text: -0.05em;      /* Canva letter spacing −50 */
  --lead-text: 1.1;           /* Canva line spacing 1.1 */
  --ease: cubic-bezier(.22, .61, .21, 1);
  --gutter: clamp(20px, 4.5vw, 72px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-weight: 400; font-size: 1.0625rem; line-height: var(--lead-text); letter-spacing: var(--track-text);
  overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }

:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; border-radius: 2px; }

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

.view { position: absolute; inset: 0; isolation: isolate; }   /* each view stacks as one layer, so the product page fully covers the gallery */
.view[hidden] { display: none; }

/* The signature script: one face, used only for a few short phrases. */
.script {
  font-family: var(--font-script); font-weight: 400; font-style: normal; line-height: 1; letter-spacing: 0;
  white-space: nowrap; display: inline-flex; align-items: baseline; padding: .15em .1em .2em 0;
}
/* a long pen stroke carried on from the last letter, drawn rather than stretched */

/* Serif and calligraphy together (DP.mix in js/type.js). The serif is set in capitals; calligraphy
   words (*word*) sit large on the same baseline; a calligraphy initial (^A) is swashed and the serif
   tucks in under it. */
.mix { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: var(--track-display); line-height: .95; }
.mix .sc, .mix .cap { font-family: var(--font-script); text-transform: none; letter-spacing: 0; font-weight: 400; }
/* Luxurious Script comes in one weight only; a fine outline in the letter colour thickens every stroke
   evenly, which reads far cleaner than the browser's synthetic bold. --script-weight sets how bold. */
.mix .sc, .mix .cap, .script { -webkit-text-stroke: var(--script-weight, .011em) currentColor; paint-order: stroke fill; }
.mix .sc { font-size: 1.32em; line-height: 0; margin: 0 .03em; white-space: nowrap; }
.mix .cap { display: inline-block; font-size: 2.1em; line-height: 0; margin-right: -.16em; transform: translateY(.06em); }

/* The travelling preview between the gallery and a product page (see app.js) */
.flyer { position: fixed; z-index: 70; margin: 0; overflow: hidden; transform-origin: 50% 0; will-change: transform; pointer-events: none; backface-visibility: hidden; }
.flyer img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }

/* Collection films (js/film.js): the film lies exactly over the still and fades in once it is
   actually playing, so a film that hasn't loaded, or can't play, never shows as a blank or a frozen box. */
.film { position: relative; display: block; width: 100%; height: 100%; }
.film > img { display: block; }
.film-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.film.is-playing .film-video { opacity: 1; }

.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 16px var(--gutter); background: var(--ink); color: var(--paper); z-index: 80; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; transition-delay: 0s !important; }
}
