/* Shared base for every page. Each direction sets its own tokens on :root in its own stylesheet:
   --bg --fg --muted --line --accent --font-display --font-body --font-mono */

@font-face { font-family: 'Archivo'; src: url('../fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Michroma'; src: url('../fonts/michroma.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('../fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

/* Lenis smooth scroll (from lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

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

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px; background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Placeholder text the owner still has to fill in. Visible on purpose. */
.todo { color: var(--accent); }

/* Nav: shared shape, each direction restyles it */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.nav__links a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; opacity: 0.75; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }
.nav__cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
/* Phones: links fold into a Menu button (common.js toggles .is-open) */
.nav__toggle { display: none; min-height: 44px; padding: 0 16px; border: 1px solid currentColor; border-radius: 999px; background: transparent; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; align-items: center; }
  .nav__links {
    position: absolute; top: calc(100% - 4px); right: clamp(16px, 4vw, 40px); min-width: 220px;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px;
    background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav__links a, .nav__links a:not(.nav__cta) { display: flex; align-items: center; min-height: 48px; padding: 0 14px; font-size: 13px; opacity: 1; border-radius: 8px; }
  .nav__links .nav__cta { justify-content: center; margin-top: 6px; }
}

/* Scroll reveal: common.js adds .is-in */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* Direction switcher shown while the directions are being compared: All · prev · current · next */
.switcher {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(10, 10, 12, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px;
  font: 500 11px/1 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
.switcher a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 12px; border-radius: 999px; color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.switcher a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.switcher span { padding: 0 10px; color: #fff; }
.switcher b { font-weight: 500; color: rgba(255, 255, 255, 0.5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
