:root {
  color-scheme: dark;
  --background: #181818;
  --text: #efefed;
  --active: #b8b8b8;
  --muted: #a8a8a8;
  --subtle: #858585;
  --credit: #676767;
  --line: #292929;
}

* { box-sizing: border-box; }
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  scroll-behavior: smooth;
  touch-action: manipulation;
}
body {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Quicksand, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }

.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;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 5;
  padding: 12px 16px;
  background: var(--text);
  color: var(--background);
}
.skip-link:focus { top: 16px; }

.page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  padding: 13px clamp(28px, 5vw, 80px) 32px;
}
.site-header { text-align: center; padding-top: 55px; }
.logo-lockup {
  position: relative;
  width: clamp(120px, 12vw, 165px);
  margin: 0 auto 8px;
}
.beta-label {
  position: absolute;
  top: -9px;
  left: 3.54%;
  color: var(--credit);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
}
.logo { display: block; width: clamp(120px, 12vw, 165px); height: auto; margin: 0 auto; }
.header-rail, .footer-rail {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.header-rail a:first-child, .footer-rail a:first-child,
.header-rail span:first-child, .footer-rail span:first-child { text-align: left; }
.header-rail a:last-child, .footer-rail a:last-child,
.header-rail span:last-child, .footer-rail span:last-child { text-align: right; }
.rail-line { flex: 1; min-width: 20px; border-top: 1px solid var(--line); }

.codex {
  width: min(760px, 100%);
  margin: auto;
  padding: 44px 0;
}
.codex-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; width: 90%; margin: 0 auto 16px; color: var(--subtle); }
.codex-heading h2, .codex-heading span { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.1em; }
.rule-nav { justify-self: end; display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 15px; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.rule-nav-button { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.rule-nav-button:hover { color: var(--text); }
.rules { position: relative; width: 90%; height: 326px; margin: 0 auto; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rule { border-bottom: 1px solid var(--line); }
.rule-toggle {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.rule-toggle:hover { color: var(--text); }
.rule.is-open .rule-toggle { color: var(--active); }
.rule-number { color: var(--subtle); font-size: 17px; }
.rule-title { font-size: 21px; font-weight: 600; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.1em; }
.rule.is-open .rule-number { color: var(--active); }
.rules.has-open .rule-title,
.rules.has-open .chevron { display: none; }
.rules.has-open .rule { border-bottom: 0; }
.rules.has-open .rule-toggle { display: none; }
.chevron {
  display: none;
}
.rule.is-open .rule-number, .rule.is-open .chevron { color: var(--active); }
.rules.has-open .rule.is-open .rule-panel {
  --rule-copy-width: min(625px, calc(100% - 120px));
  position: absolute;
  inset: 68px 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
}
.rule-panel { padding: 0 34px 24px 58px; }
.rule-panel h3,
.rule-panel p { width: var(--rule-copy-width, min(625px, calc(100% - 120px))); }
.rule-panel h3 { margin: 0 0 22px; color: #9c9c9c; font-size: clamp(21px, 1.78vw, 26px); font-weight: 600; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.1em; }
.rule-panel p { margin: 0 0 16px; font-size: clamp(18px, 1.59vw, 23px); font-weight: 500; line-height: 1.45; letter-spacing: 0.02em; }
.rule-panel p:last-child { margin-bottom: 0; }
.slide-arrow {
  display: block;
  position: absolute;
  left: 50%;
  top: clamp(230px, 31vh, 280px);
  width: var(--rule-copy-width, min(625px, calc(100% - 120px)));
  height: 1.15em;
  transform: translateX(-50%);
  color: #303030;
  font-size: clamp(21px, 1.78vw, 26px);
}
.slide-arrow::after {
  content: "";
  display: block;
  width: 3.4em;
  height: 1.15em;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: url("assets/arrow-right.svg") center / contain no-repeat;
  mask: url("assets/arrow-right.svg") center / contain no-repeat;
}
.event-panel .event-title-row,
.slide-cta {
  width: var(--rule-copy-width, min(625px, calc(100% - 120px)));
}
.event-panel .event-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin: 0 0 22px;
}
.event-panel .event-title-row h3 { width: auto; margin: 0; }
.event-panel .event-title-row span {
  color: #9c9c9c;
  font-size: clamp(21px, 1.78vw, 26px);
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.slide-cta {
  position: absolute;
  left: 50%;
  top: clamp(230px, 31vh, 280px);
  transform: translateX(-50%);
  text-align: center;
}
.join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 42px;
  padding: 8px 24px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.join-button:hover { color: var(--text); border-color: var(--subtle); }
.rule-panel strong { font-weight: 600; }
.flow-arrow { color: #9c9c9c; }
.highlight {
  background: linear-gradient(180deg, #fff7e7 0%, #ffd19b 48%, #f1a56c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 8px rgba(255, 209, 155, 0.18);
}
.site-footer { display: grid; gap: 18px; margin-top: auto; }
.site-footer .header-rail { margin-bottom: 13px; }
.credit-rail {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  color: var(--credit);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.credit-rail span:last-child { margin-left: auto; text-align: right; }

@media (max-width: 600px) {
  .page { min-height: 100svh; padding: 11px 20px 6px; }
  .site-header { padding-top: 27px; }
  .logo-lockup { width: 126px; margin-bottom: 9px; }
  .beta-label { top: -8px; font-size: 7.4px; }
  .logo { width: 126px; }
  .header-rail, .footer-rail { gap: 7px; font-size: 10.8px; }
  .rail-line { min-width: 8px; }
  .codex { padding: 40px 0; }
  .codex-heading,
  .rules { width: 100%; }
  .codex-heading h2, .codex-heading span, .rule-nav { font-size: 10.8px; }
  .rule-nav { gap: 6px; }
  .rule-toggle { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; min-height: 61px; }
  .rule-number { font-size: 20.4px; }
  .rule-title { font-size: 19.2px; }
  .codex { padding: 21px 0 18px; }
  .rules { height: 346px; }
  .rules.has-open .rule.is-open .rule-panel { inset: 14px 0 18px; justify-content: center; }
  .rule-panel { padding: 0 18px 0 32px; }
  .rules.has-open .rule.is-open .rule-panel { --rule-copy-width: min(460px, calc(100% - 22px)); }
  .rule-panel h3,
  .rule-panel p { width: var(--rule-copy-width); }
  .rule-panel h3 { font-size: 20.4px; }
  .rule-panel p { font-size: 19.2px; }
  .slide-arrow { top: auto; bottom: 28px; font-size: 20.4px; }
  .event-panel .event-title-row,
  .slide-cta { width: var(--rule-copy-width); }
  .event-panel .event-title-row span { font-size: 20.4px; }
  .slide-cta { top: auto; bottom: 28px; }
  .join-button { min-width: 94px; min-height: 36px; padding: 7px 18px; font-size: 10.8px; }
  .closing { font-size: 13px; }
  .site-footer { gap: 14px; }
  .site-footer .header-rail { margin-bottom: 17px; }
  .credit-rail { padding-top: 12px; font-size: 7.4px; }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .logo-lockup { width: clamp(156px, 15.6vw, 215px); }
  .logo { width: clamp(156px, 15.6vw, 215px); }
  .header-rail, .footer-rail { font-size: 17.25px; }
  .codex-heading h2, .codex-heading span, .rule-nav { font-size: 17.25px; }
  .rule-number { font-size: 19.55px; }
  .rule-title { font-size: 24.15px; }
  .rule-panel h3 { font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .rule-panel p { font-size: clamp(20.7px, 1.83vw, 26.45px); }
  .slide-arrow { top: clamp(300px, 25vh, 360px); font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .event-panel .event-title-row span { font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .slide-cta { top: clamp(300px, 25vh, 360px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
