/* BeyondFest 2026 — base layer: tokens, reset, typography, layout primitives.
   Palette: ink #080808 / paper #FDF6EC / bone #F6F4F0 / purple #7B2FF7 /
   lavender #EFE6FF. Purple is the single brand accent from the Beyond
   blueprint. --paper is the warm white that carries body text; --bone is the
   cooler off-white that took over every role the old green #11FA7F held.
   --purple-lift is the same hue lightened to clear 4.5:1 on ink, for text small
   enough that flat --purple would fail WCAG AA. */

:root {
  --ink: #080808;
  --ink-lift: #100a1a;
  --paper: #fdf6ec;
  --bone: #f6f4f0;
  --purple: #7b2ff7;
  --purple-lift: #9254ff;
  --purple-hot: #e900ff;
  --lavender: #efe6ff;
  --rule: rgba(123, 47, 247, 0.5);
  --rule-soft: rgba(123, 47, 247, 0.22);

  --display: "Bebas Neue", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", "IBM Plex Mono", "Courier New", monospace;

  --gutter: clamp(1.25rem, 4vw, 5rem);
  /* --gap is the space between two sections. Each section pays half of it top
     and bottom, so two neighbours add up to exactly one --gap and every break
     on the page measures the same. --rail-pad is the pinned formats rail's
     tighter inner padding, capped at --stack so the compensating margins on
     the rules either side can never go negative. */
  --gap: clamp(4.5rem, 9vw, 9rem);
  --stack: calc(var(--gap) / 2);
  --rail-pad: min(clamp(1.5rem, 4vh, 3rem), var(--stack));
  --measure: 44ch;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;
}

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

/* Every in-page link lands under a 64px sticky header without this, which is
   most noticeable on a phone, where the nav panel closes onto a section whose
   heading is behind the bar. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
video { display: block; max-width: 100%; }
a { color: inherit; }

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

/* ---------- type ---------- */

/* Bebas Neue is a single-weight, uppercase-only display face with no width axis,
   so the Archivo "wdth" setting and the tight negative tracking are gone. */
.display,
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.92;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  margin: 0;
}

.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--purple-lift);
  margin: 0 0 1.25rem;
}

.lead {
  font-family: var(--body);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: var(--measure);
  margin: 0;
}

.accent { color: var(--purple-lift); }
.accent-soft { color: var(--bone); }

/* ---------- layout ---------- */

.shell {
  width: min(100%, 1440px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: var(--stack); position: relative; }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.section-title { font-size: clamp(2.1rem, 4.8vw, 3.9rem); }
.section-title--wide { font-size: clamp(2.8rem, 9vw, 7.8rem); }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  font-size: 1.1rem;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: block;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--purple);
  color: var(--purple-lift);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--purple);
  color: var(--paper);
}

/* The hamburger. Hidden above 860px, where the eight chips fit on one row. */
.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid var(--purple);
  color: var(--purple-lift);
  cursor: pointer;
}

.nav-toggle__bars {
  display: grid;
  gap: 5px;
  width: 20px;
}

/* 2px bars 5px apart sit at 0, 7 and 14, so the outer two travel 7px to meet
   in the middle and cross. Keep the gap and the translate in step. */
.nav-toggle__bars span {
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease-out), opacity 0.15s linear;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--purple), var(--purple-hot), var(--lavender));
}

/* ---------- buttons ---------- */

/* The primary button is the brightest block on the page, because the page is
   near-black and lit purple: a purple fill sits at 3.4:1 against the ink, so it
   sank into the vignette instead of lifting out of it. Paper on ink is 18:1 and
   reads as the one thing to press. The purple stays as the halo under it and as
   the hover fill, so the button is still brand-coloured, just not brand-dim.
   Two pseudo-elements because the label is a bare text node with nothing to
   raise above an overlay: ::before is the resting fill and ::after is the
   hover wipe, both behind the transparent anchor background. */
.btn {
  position: relative;
  display: inline-block;
  padding: 1rem 1.9rem;
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(123, 47, 247, 0.38);
  transition: color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}

.btn::before,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
}

.btn::before {
  background: var(--paper);
  z-index: -2;
}

.btn::after {
  background: var(--purple);
  transform: translateY(101%);
  transition: transform 0.32s var(--ease-out);
  z-index: -1;
}

.btn:hover,
.btn:focus-visible {
  color: var(--paper);
  box-shadow: 0 12px 44px rgba(123, 47, 247, 0.6);
  transform: translateY(-2px);
}

.btn:hover::after,
.btn:focus-visible::after { transform: translateY(0); }

/* The secondary is a thin purple outline so it never competes with the block
   beside it. --purple-lift, not flat purple, because 0.82rem text needs 4.5:1. */
.btn--alt {
  border-color: var(--purple);
  color: var(--purple-lift);
  box-shadow: none;
}
.btn--alt::before { background: transparent; }
.btn--alt::after { background: var(--purple); }
.btn--alt:hover,
.btn--alt:focus-visible {
  color: var(--paper);
  box-shadow: 0 10px 34px rgba(123, 47, 247, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .btn:focus-visible { transform: none; }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

/* ---------- responsive ---------- */

/* Eight chips cannot sit on one row on a phone. They used to wrap onto three,
   which made a sticky header 195px tall — 23% of a 390×844 screen, gone for
   good. Below 860px they move into a panel behind the toggle instead and the
   header stays the one 64px row it is everywhere else.
   Tap targets go to 44px here and only here: that is the touch minimum, and a
   pointer does not need it, so the desktop layout is untouched. */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  /* Hangs off the header rather than covering it, so the bar and the toggle
     stay visible and the panel never has to redraw them.
     absolute, not fixed: .site-header carries a backdrop-filter, which makes it
     the containing block for fixed descendants, so a fixed panel measures
     itself against the 64px bar instead of the viewport and collapses. */
  .nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100svh - var(--header-h));
    padding: clamp(1.25rem, 5vw, 2rem) var(--gutter) 3rem;
    /* Solid, not a tint over a blur: at 97% the hero headline still ghosted
       through behind the links on a near-black page. */
    background: var(--ink);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out),
                visibility 0.22s;
  }

  /* visibility, not just opacity: a closed panel must be untabbable. That is
     also why no focus management is needed — the toggle sits immediately
     before the panel in the DOM, so Tab walks straight into it when it opens
     and straight past it when it does not. */
  .nav-panel[data-nav-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav { flex-direction: column; flex-wrap: nowrap; gap: 0.5rem; }

  .nav a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding-inline: 1rem;
    font-size: 0.82rem;
  }

  .wordmark { padding-block: 0.5rem; }

  /* Scroll behind a panel that covers the screen is scroll the reader cannot
     see and does not get back when it closes. */
  body.nav-open { overflow: hidden; }
}
