/* Shared design tokens, reset and components used on every page. */

:root {
  --color-bg: #1f3a2e;
  --color-surface: #243f33;
  --color-input: #274637;
  --color-card: #2b4b3d;
  --color-card-alt: #34564a;
  --color-border: #3d5e50;
  --color-text: #eef3ee;
  --color-text-muted: #bfd0c4;
  --color-button: #eaf0e6;

  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: Fraunces, Georgia, serif;

  --page-width: 1440px;
  --page-gutter: 64px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: var(--color-text); text-decoration: none; }
a:hover { color: #ffffff; }

.page {
  position: relative;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
}

/* Single-screen pages: exactly the viewport tall, no scrolling. */
.page--fit {
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px var(--page-gutter);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.nav__links {
  display: flex;
  gap: 40px;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
}

.nav__link { padding: 12px 0; text-underline-offset: 6px; }
.nav__link[aria-current="page"] { text-decoration: underline; }

.nav__cta {
  padding: 12px 22px;
  border: 1.5px solid var(--color-text);
  border-radius: 999px;
}
.nav__cta[aria-current="page"] {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---------- Shared components ---------- */

.eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
}

.lead {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--color-button);
  color: var(--color-bg);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.button:hover { color: var(--color-bg); }

/* 3D character sprite, faded at the top/bottom edges. */
.char {
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6%, #000 72%, transparent 97%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 6%, #000 72%, transparent 97%);
}

/* ---------- Page transitions ---------- */

/* Cross-fade between pages (Chrome/Edge/Safari; others just navigate normally).
   The nav gets its own name so it stays put while the content fades. */
@view-transition { navigation: auto; }

.nav { view-transition-name: site-nav; }

::view-transition-old(root) { animation: page-out 0.25s ease both; }
::view-transition-new(root) { animation: page-in 0.35s ease both; }

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

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Fullscreen toggle (injected by fullscreen.js) ---------- */

.nav__fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.nav__fullscreen:hover { border-color: var(--color-text); }
.nav__fullscreen:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; }
.nav__fullscreen .icon-exit,
.nav__fullscreen.is-active .icon-enter { display: none; }
.nav__fullscreen.is-active .icon-exit { display: inline; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  :root { --page-gutter: 40px; }
  .nav { padding-top: 24px; padding-bottom: 24px; }
  .nav__links { gap: 28px; }
}

/* Single-screen pages scroll normally once their content no longer fits side by side. */
@media (max-width: 900px) {
  .page--fit { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
}

@media (max-width: 640px) {
  :root { --page-gutter: 20px; }
  .nav { flex-wrap: wrap; row-gap: 12px; padding-top: 18px; padding-bottom: 18px; }
  .nav__logo { font-size: 22px; }
  .nav__links { width: 100%; justify-content: space-between; gap: 12px; font-size: 15px; }
  .nav__cta { padding: 10px 16px; }
  .nav__fullscreen { display: none; }
  .lead { font-size: 16px; }
}
