/* ==========================================================================
   michaelimas.com · site.css
   Shared building blocks for every page. Page CSS (home.css, wwm.css,
   legal.css) loads after this file, is scoped to its body class and never
   touches .nav, .footer or .social.
   --------------------------------------------------------------------------
   01  Fonts
   02  Tokens and context colours
   03  Reset and base
   04  Helpers: skip link, visually hidden, keep, wrap, focus
   05  Grain
   06  Nav (below 1200px: name and one short link, no menu since round 8)
   07  (removed in round 8: the phone menu)
   08  Footer
   09  Social icons
   10  Etymology card
   11  Section label and divider
   12  Buttons: block-cta, line-cta, arrow, mail link
   13  Badge
   14  Reveal
   15  Page transitions
   16  Reduced motion
   17  Print
   Breakpoints (min-width): 480, 720, 900, 1080, 1200
   ========================================================================== */


/* 01  Fonts ---------------------------------------------------------------- */
/* Variable fonts, latin subset, served from this site (technik-spec Teil 1). */

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

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

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost-latin.woff2') format('woff2');
}


/* 02  Tokens and context colours ------------------------------------------ */

:root {
  --parchment:   #F7F4EF;
  --parchment-2: #FBF9F6;
  --warm-mid:    #E8E2D9;
  --stone-light: #C4BDB5;
  --stone:       #8C867E;   /* lines, numbers, large type, icons */
  --stone-text:  #67615A;   /* small grey text on light grounds (5.57 : 1) */
  --charcoal:    #1E1B18;
  --charcoal-2:  #2A2622;
  --ink:         #141210;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Jost', 'Helvetica Neue', Arial, sans-serif;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(1.5rem, 5vw, 4rem);
  --max-w:  1440px;

  /* Context colours: light by default, dark under [data-dark]. */
  --fg:       var(--charcoal);
  --fg-muted: var(--stone-text);
  --rule:     var(--warm-mid);
}

[data-dark] {
  --fg:       var(--parchment);
  --fg-muted: var(--stone-light);
  --rule:     var(--charcoal-2);
  background-color: var(--charcoal);
  color: var(--fg);
}


/* 03  Reset and base ------------------------------------------------------- */
/* Same reset as the pages had before (margin and padding 0 on everything),
   so section CSS carried over from the old pages keeps its spacing. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  /* Jumps and focus land below the fixed nav (6rem, also when tabbing back). */
  scroll-padding-top: 6rem;
}

body {
  overflow-x: clip;
  background-color: var(--parchment);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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


/* 04  Helpers -------------------------------------------------------------- */

.skip {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9500;
  padding: 0.9rem 1.4rem;
  background: var(--charcoal);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-300%);
}

.skip:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 340px) {
  .keep { white-space: nowrap; }
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 4px;
}

[data-dark] :focus-visible,
.nav--dark :focus-visible {
  outline-color: var(--parchment);
}


/* 05  Grain ---------------------------------------------------------------- */
/* Desktop: the moving grain as before. Touch screens and reduced motion: the
   same grain standing still, no oversize layer and no blend mode, so
   scrolling stays light. */

.grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  background-repeat: repeat;
}

@media (hover: hover) and (pointer: fine) {
  .grain {
    mix-blend-mode: multiply;
    opacity: 0.045;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .grain {
    inset: -260px;
    animation: grain-shift 0.75s steps(1, end) infinite;
    will-change: transform;
  }
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-14px, 9px); }
  33%  { transform: translate(11px, -12px); }
  50%  { transform: translate(-8px, -7px); }
  66%  { transform: translate(13px, 10px); }
  83%  { transform: translate(-11px, 4px); }
  100% { transform: translate(0, 0); }
}


/* 06  Nav ------------------------------------------------------------------ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1300;
  padding-block: 1.6rem;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease-in-out),
              border-color 0.4s var(--ease-in-out);
}

.nav.is-scrolled {
  padding-block: 0.9rem;
  background-color: rgba(247, 244, 239, 0.97);
  border-bottom-color: var(--warm-mid);
}

/* Blur only where it is cheap (desktop); touch screens get a nearly opaque bar. */
@media (hover: hover) and (pointer: fine) {
  .nav.is-scrolled {
    background-color: rgba(247, 244, 239, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.nav--dark.is-scrolled {
  background-color: rgba(30, 27, 24, 0.82);
  border-bottom-color: var(--charcoal-2);
}

@media (hover: none), (pointer: coarse) {
  .nav--dark.is-scrolled { background-color: rgba(30, 27, 24, 0.96); }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__mark {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--charcoal);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.4s var(--ease-in-out);
}

.nav__list {
  display: none;
  list-style: none;
  align-items: center;
  gap: 1.8rem;
}

.nav__link {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--stone-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s var(--ease-out);
}

a.nav__link:hover,
a.nav__link:focus-visible,
.nav__link[aria-current="page"] { color: var(--charcoal); }

/* "Coming soon" items in nav and footer: plain text, not a link, not in the
   tab order. The note is read by screen readers and shows on hover. */
.nav__link--soon,
.footer__link--soon {
  position: relative;
  cursor: default;
}

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

.nav__link--soon:hover .soon-note,
.footer__link--soon:hover .soon-note {
  top: 100%;
  left: 50%;
  z-index: 2;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  background: var(--charcoal);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  line-height: 1.3;
  text-transform: uppercase;
  pointer-events: none;
  transform: translateX(-50%);
  animation: soon-in 0.25s var(--ease-out);
}

@keyframes soon-in {
  from { opacity: 0; transform: translate(-50%, -4px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.social.nav__social { display: none; }

/* Below 1200px there is no menu (round 8, card 1): the bar carries one short
   link to the other page instead ("Work with me" on the home page, "Home"
   elsewhere). Same type as the desktop links, charcoal, 44px tap height. */
.nav__short {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -0.6rem;         /* 44px tap area without a taller bar */
  padding: 0 0.25rem;
  margin-right: -0.25rem;
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s var(--ease-out);
}

.nav__short:hover,
.nav__short:focus-visible { color: var(--stone-text); }

/* Without JavaScript the bar never gets is-scrolled, so it is opaque from the start. */
html:not(.js) .nav {
  background-color: rgba(247, 244, 239, 0.97);
  border-bottom-color: var(--warm-mid);
}

/* Tablet (720 to 1199px): the five icons join the short link in the bar. */
@media (min-width: 720px) {
  .social.nav__social { display: flex; }
}

@media (min-width: 1200px) {
  .nav { padding-block: 2rem; }
  .nav.is-scrolled { padding-block: 1.1rem; }
  .nav__list { display: flex; }
  .nav__short { display: none; }
}

@media (min-width: 1440px) {
  .nav__list { gap: 2.4rem; }
}

/* Over a dark section (any [data-dark] behind the middle of the bar). */
.nav--dark .nav__mark,
.nav--dark .nav__short { color: var(--parchment); }
.nav--dark .nav__short:hover,
.nav--dark .nav__short:focus-visible { color: var(--stone-light); }
.nav--dark .nav__link { color: var(--stone-light); }
.nav--dark a.nav__link:hover,
.nav--dark a.nav__link:focus-visible,
.nav--dark .nav__link[aria-current="page"] { color: var(--parchment); }
.nav--dark .nav__link--soon:hover .soon-note { background: var(--parchment); color: var(--charcoal); }
.nav--dark .social a { color: var(--stone-light); }
.nav--dark .social a:hover,
.nav--dark .social a:focus-visible { color: var(--parchment); }

/* Home page only (header carries data-nav-split): from 1080px the bar is
   opaque on the left 55 % and clear on the right while the hero is in view,
   so the brush stroke shows through. */
@media (min-width: 1080px) {
  .nav.nav--split,
  .nav.nav--split.is-scrolled {
    background-color: transparent;
    background-image: linear-gradient(to right, var(--parchment) 55%, rgba(247, 244, 239, 0) 55%);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom-color: transparent;
  }
}

/* Home page: the bar fades in, at most 0.6 s late, never the short link. */
.js [data-nav-split] .nav__mark,
.js [data-nav-split] .nav__list,
.js [data-nav-split] .nav__social {
  animation: nav-in 0.9s var(--ease-out) both;
}
.js [data-nav-split] .nav__mark   { animation-delay: 0.2s; }
.js [data-nav-split] .nav__list   { animation-delay: 0.4s; }
.js [data-nav-split] .nav__social { animation-delay: 0.6s; }

/* Once faded in, site.js sets is-shown: items that appear later (the list
   from 1200px, the icons from 720px, phone turned) show at once instead of
   fading in again. */
.js [data-nav-split].is-shown .nav__mark,
.js [data-nav-split].is-shown .nav__list,
.js [data-nav-split].is-shown .nav__social { animation: none; }

@keyframes nav-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 08  Footer --------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--warm-mid);
  background-color: var(--parchment);
  padding-block: 3rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  text-align: center;
}

/* Page links only where the bar shows all seven too (from 1200px); on phone
   and tablet the footer holds icons and the legal line (round 8, card 2). */
.footer__pages {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2rem;
  list-style: none;
}

@media (min-width: 1200px) {
  .footer__pages { display: flex; }
}

.footer__link,
.footer__legal a {
  display: inline-block;
  padding-block: 0.3rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--stone-text);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

a.footer__link:hover,
a.footer__link:focus-visible,
.footer__link[aria-current="page"],
.footer__legal a:hover,
.footer__legal a:focus-visible,
.footer__legal a[aria-current="page"] { color: var(--charcoal); }

.footer__social { justify-content: center; }

.footer__legal {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--stone-text);
}

.footer__legal a {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

/* Letter spacing trails the first word; even out the space around the dot. */
.footer__legal a:last-child { margin-left: 0.18em; }


/* Touch screens without hover (a touch desktop from 1200px): the five
   unfinished pages show their note all the time, small and set off by a
   thin line. The words stay Stone-Text: Stone-Light on parchment is 1.7 : 1,
   Lighthouse accessibility fell to 95. */
@media (hover: none) {
  .footer__link--soon .soon-note,
  .footer__link--soon:hover .soon-note {   /* a tap sets :hover; no dark label */
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    margin: 0 0 0 0.7em;
    padding: 0 0 0 0.4em;
    border-left: 1px solid var(--stone-light);
    background: none;
    color: var(--stone-text);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    transform: none;
    animation: none;
  }
}


/* 09  Social icons --------------------------------------------------------- */
/* Order everywhere: Instagram, TikTok, YouTube, Substack, Facebook. */

.social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--stone);
  transition: color 0.3s var(--ease-out);
}

.social a:hover,
.social a:focus-visible { color: var(--charcoal); }

.social svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Footer on touch screens: 44px tap areas. */
@media (hover: none) {
  .footer .social a { width: 44px; height: 44px; }
}


/* 10  Etymology card ------------------------------------------------------- */

.etym {
  max-width: 480px;
  font-family: var(--font-serif);
  color: var(--fg);
}

.etym__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.etym__word {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--fg);
}

.etym__pos {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.etym__ipa {
  margin-top: 0.3rem;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--fg-muted);
}

.etym__rule {
  width: 2rem;
  height: 1px;
  margin: 1.2rem 0;
  border: 0;
  background: var(--stone-light);
}

[data-dark] .etym__rule { background: var(--stone); }

.etym__origin {
  margin-bottom: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--fg-muted);
}

.etym__text {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--fg);
  text-wrap: pretty;
}

.etym__text em {
  font-style: italic;
  color: var(--fg-muted);
}

.etym__note {
  margin-top: 1.4rem;
  padding-left: 1.2rem;
  border-left: 1px solid var(--stone-light);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg-muted);
}


/* 11  Section label and divider -------------------------------------------- */

.section-label {
  display: block;
  margin-bottom: 2.5rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--fg-muted);
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--warm-mid);
}


/* 12  Buttons -------------------------------------------------------------- */

/* Charcoal block: hero "Work with me" and "Book a first conversation". */
.block-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.9rem 2.2rem;
  border: 0;
  background: var(--charcoal);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.block-cta:hover,
.block-cta:focus-visible { background: var(--stone-text); }

[data-dark] .block-cta { background: var(--parchment); color: var(--charcoal); }
[data-dark] .block-cta:hover,
[data-dark] .block-cta:focus-visible { background: var(--stone-light); }

/* Line with arrow: "Work with me", "How it starts", "Subscribe via Substack". */
.line-cta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 24px;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid currentColor;
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.6;
  text-decoration: none;
  transition: gap 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.line-cta:hover,
.line-cta:focus-visible {
  gap: 1.5rem;
  color: var(--fg-muted);
}

/* Quieter variant: "Beyond Skepticism" next to the block button. */
.line-cta--quiet {
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--fg-muted);
  border-bottom-color: var(--stone-light);
}

.line-cta--quiet:hover,
.line-cta--quiet:focus-visible {
  gap: 1rem;
  color: var(--fg);
  border-bottom-color: currentColor;
}

[data-dark] .line-cta--quiet { border-bottom-color: var(--stone); }

/* Arrow after link text, silent for screen readers. Inside a flex link the
   gap sets the distance, elsewhere the padding does. */
.arrow {
  display: inline-block;
  padding-left: 0.5em;
  font-family: var(--font-sans);
}

.line-cta .arrow { padding-left: 0; }

/* E-mail text link (built into a mail link by site.js). */
.mail {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--stone-light);
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.mail:hover,
.mail:focus-visible {
  color: var(--fg);
  border-bottom-color: currentColor;
}


/* 13  Badge ---------------------------------------------------------------- */
/* Written in lower case in the HTML, capitals come from here. */

.soon {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.6rem 0.3rem;
  border: 1px solid currentColor;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--fg-muted);
}

[data-dark] .soon { border-color: #4A4540; }

@media (min-width: 480px) {
  .soon { white-space: nowrap; }
}


/* 14  Reveal --------------------------------------------------------------- */
/* Hidden only when JavaScript runs (class js on html). Runs as an animation,
   so a transition the page sets on the same element (hover) does not cancel
   it. Sideways movement becomes upward below 720px. */

.js .reveal-up:not(.is-in),
.js .reveal-left:not(.is-in),
.js .reveal-right:not(.is-in),
.js .reveal-fade:not(.is-in) { opacity: 0; }

.js .reveal-up.is-in    { animation: reveal-up 0.95s var(--ease-out) both; }
.js .reveal-left.is-in,
.js .reveal-right.is-in { animation: reveal-side 0.95s var(--ease-out) both; }
.js .reveal-fade.is-in  { animation: reveal-fade 1.2s var(--ease-out) both; }

/* One animation for both directions; the breakpoint only changes the
   offset. A changed variable does not restart an animation, a changed
   animation name would (turning the phone across 720px). */
.reveal-left,
.reveal-right {
  --reveal-x: 0px;
  --reveal-y: 32px;
}

@media (min-width: 720px) {
  .reveal-left  { --reveal-x: -44px; --reveal-y: 0px; }
  .reveal-right { --reveal-x: 44px;  --reveal-y: 0px; }
}

/* Safety net: if site.js never runs (blocked, network error), html keeps
   the class js but never gets js-ready, and the blocks show after 3 s. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.js-ready) .reveal-up:not(.is-in),
  html.js:not(.js-ready) .reveal-left:not(.is-in),
  html.js:not(.js-ready) .reveal-right:not(.is-in),
  html.js:not(.js-ready) .reveal-fade:not(.is-in) {
    animation: reveal-fade 0.6s 3s both;
  }
}

.js .is-in.d1 { animation-delay: 0.08s; }
.js .is-in.d2 { animation-delay: 0.22s; }
.js .is-in.d3 { animation-delay: 0.38s; }
.js .is-in.d4 { animation-delay: 0.55s; }

@keyframes reveal-up     { from { opacity: 0; transform: translateY(40px); }  to { opacity: 1; transform: none; } }
@keyframes reveal-side   { from { opacity: 0; transform: translate(var(--reveal-x), var(--reveal-y)); } to { opacity: 1; transform: none; } }
@keyframes reveal-fade   { from { opacity: 0; }                               to { opacity: 1; } }


/* 15  Page transitions ----------------------------------------------------- */
/* Fade in on load; fade out before an internal link opens. Nav and
   grain sit outside main, so nothing fixed is affected by the transform. */

.js main,
.js .footer {
  animation: page-in 0.7s var(--ease-in-out) both;
}

.js .footer { animation-name: page-in-fade; }

.js.is-restored main,
.js.is-restored .footer { animation: none; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes page-in-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade out as an animation too: the fade-in holds opacity 1 with fill both,
   so a transition would have nothing to start from and cut hard. The html
   in front outranks page CSS such as .js .page-home main. */
html.js.is-leaving main   { animation: page-out 0.45s var(--ease-in-out) both; }
html.js.is-leaving .footer { animation: page-out-fade 0.45s var(--ease-in-out) both; }

@keyframes page-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-12px); }
}

@keyframes page-out-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}


/* 16  Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .grain { animation: none; }

  .js .reveal-up.reveal-up,
  .js .reveal-left.reveal-left,
  .js .reveal-right.reveal-right,
  .js .reveal-fade.reveal-fade {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .js main,
  .js .footer,
  html.js.is-leaving main,
  html.js.is-leaving .footer {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js [data-nav-split] .nav__mark,
  .js [data-nav-split] .nav__list,
  .js [data-nav-split] .nav__social { animation: none; }

  .nav__link--soon:hover .soon-note,
  .footer__link--soon:hover .soon-note { animation: none; }

  .line-cta,
  .line-cta--quiet { transition: color 0.3s, border-color 0.3s; }
}


/* 17  Print ---------------------------------------------------------------- */
/* Every block visible, whether scrolled to or not; no fixed bar, grain or
   skip link. Dark sections keep their ground, otherwise their light text
   would print white on white. */

@media print {
  .js .reveal-up,
  .js .reveal-left,
  .js .reveal-right,
  .js .reveal-fade {
    opacity: 1 !important;
    animation: none !important;
  }

  .nav,
  .grain,
  .skip { display: none; }

  .js main,
  .js .footer { animation: none; }

  [data-dark] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
