/* Shared foundations for both looks: fonts, reset, reveal motion, accessibility. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Recursive Mono"; src: url("/fonts/recursive-mono.ttf") format("truetype"); font-weight: 300 1000; font-display: swap; }

:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Recursive Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Reveal on scroll. Content is visible without JavaScript; the .js class turns the motion on. */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity .95s var(--ease), transform .95s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal="left"] { transform: translate3d(-40px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(40px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* Page-to-page crossfade where the browser supports view transitions. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .28s var(--ease-io) both vt-out; }
::view-transition-new(root) { animation: .45s var(--ease-io) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

:focus-visible { outline: 3px solid #8B7BFF; outline-offset: 3px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  @view-transition { navigation: none; }
}
