/* ==========================================================
   PIXATHON — shared styles
   Palette pulled from the final logo + reveal video.
   ========================================================== */
:root {
  --cream: #FDF4E5;
  --cream-2: #F8ECD6;
  --grid: #F1E7D6;
  --navy: #1A2A6C;
  --navy-deep: #0B1336;
  --gold: #D4A437;
  --gold-deep: #A87E1F;
  --ice: #DDE2F3;
  --ink: #1A2A6C;
  --ink-2: #47507A;
  --ink-3: #7A7F9C;
  --danger: #B3372B;

  --f-pixel: "Silkscreen", "Courier New", monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Playfair Display", Georgia, serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-inout: cubic-bezier(.7, 0, .2, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 72px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--navy-deep); }

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

.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;
}

/* ---------- background grid canvas ---------- */
#bg-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  transition: background .3s, box-shadow .3s, opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--grid);
}
.nav-logo { display: block; width: 116px; flex-shrink: 0; }
.nav-logo img { width: 100%; height: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vw, 12px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: inline-block;
  font-family: var(--f-pixel);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 10px;
  color: var(--ink-2);
  transition: color .2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 2px;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.nav-links a:hover { color: var(--navy); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--navy); }

/* ---------- pixel button ---------- */
.btn {
  --bg: var(--navy);
  --fg: var(--cream);
  --sh: var(--navy-deep);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-pixel);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--sh);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--sh); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--sh); }
.btn .arrow { display: inline-block; transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-gold { --bg: var(--gold); --fg: var(--navy-deep); --sh: var(--navy-deep); }
.btn-ghost {
  --bg: transparent; --fg: var(--navy); --sh: transparent;
  box-shadow: inset 0 0 0 2px var(--navy);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--navy), 5px 5px 0 var(--gold); }
.btn-ghost:active { box-shadow: inset 0 0 0 2px var(--navy); }
.btn-sm { padding: 10px 14px; font-size: 12px; box-shadow: 4px 4px 0 var(--sh); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- pixel label ---------- */
.label {
  font-family: var(--f-pixel);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--gold);
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 2px 2px 0 var(--navy-deep);
}

/* pixel icons (filled in by common.js) */
[data-icon] { display: block; }
[data-icon] svg { width: 100%; height: 100%; }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter);
  font-size: 13px;
  color: var(--ink-3);
}
.byline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}
.byline .by { font-family: var(--f-body); font-size: 1em; color: var(--ink-2); }
/* the badge is white line art, so it sits on a navy disc like in the reveal video */
.byline img { width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--navy); }
.byline .org {
  font-family: var(--f-serif);
  font-weight: 600;
  letter-spacing: .14em;
  font-size: 1.05em;
}
.linkish {
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.linkish:hover { color: var(--navy); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--f-pixel);
  font-size: 12px;
  letter-spacing: .06em;
  line-height: 1.6;
  box-shadow: 5px 5px 0 var(--gold);
  transform: translate(-50%, 140%);
  transition: transform .5s var(--ease-spring);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- pixel page transition ---------- */
#wipe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  pointer-events: none;
}
html.wipe-in #wipe-fallback {
  position: fixed; inset: 0; z-index: 999; background: var(--navy);
  animation: px-failsafe .3s 1.5s forwards; /* never strand the page if JS fails */
}
@keyframes px-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 560px) {
  :root { --nav-h: 60px; }
  .nav-logo { width: 88px; }
  .nav-links a { font-size: 11px; padding: 8px 6px; }
  .nav-links a::after { left: 6px; right: 6px; }
  .nav .btn-sm { padding: 8px 10px; font-size: 11px; }
}

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