:root {
  color-scheme: dark;
  --background: #151515;
  --page-background: #141412;
  --brand: #ffd19b;
  --text: #efefed;
  --active: #b8b8b8;
  --muted: #a8a8a8;
  --subtle: #858585;
  --credit: #8a8a8a;
  --copyright: #565656;
  --navigation: #676767;
  --line: #292929;
  --text-edge: 0 1px 1px rgba(0, 0, 0, 0.28);
  --text-edge-glow: 0 0 8px rgba(255, 209, 155, 0.16);
}

* { 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:
    radial-gradient(circle at 72% 12%, rgba(81, 59, 40, 0.24) 0, rgba(81, 59, 40, 0.12) 24%, rgba(23, 23, 21, 0) 52%),
    radial-gradient(circle at 18% 78%, rgba(82, 50, 28, 0.18) 0, rgba(82, 50, 28, 0.09) 28%, rgba(23, 23, 21, 0) 56%),
    linear-gradient(148deg, #151515 0%, #191715 34%, #2b2119 61%, #1c201f 100%);
  background-color: var(--page-background);
  color: var(--text);
  font-family: Quicksand, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-shadow: var(--text-edge);
  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: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  padding: 13px clamp(28px, 5vw, 80px) 32px;
}
.site-header { grid-row: 1; min-width: 0; min-height: 0; text-align: center; padding-top: 24px; }
.photo-rail {
  --logo-width: clamp(120px, 12vw, 165px);
  --tile-gap: clamp(6.8px, 0.68vw, 10.88px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.gallery-track {
  position: relative;
  --gallery-cell-size: calc(var(--logo-width) * 0.364);
  display: grid;
  grid-template-rows: repeat(2, var(--gallery-cell-size));
  grid-auto-columns: var(--gallery-cell-size);
  grid-auto-flow: column;
  gap: var(--tile-gap);
  width: 100%;
  min-width: 0;
  height: calc((var(--gallery-cell-size) * 2) + var(--tile-gap) + 12px);
  padding: 10px 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  user-select: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible, .gallery-tile:focus-visible, .gallery-preview:focus-visible, .rules:focus-visible, .side-nav:focus-visible { outline-offset: -3px; }
.gallery-tile {
  position: relative;
  width: var(--gallery-cell-size);
  height: var(--gallery-cell-size);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 19%;
  background: var(--background);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
.gallery-tile::after, .gallery-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--brand);
  opacity: 0.1;
  pointer-events: none;
}
.gallery-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; transition: opacity 650ms ease-in-out; transition-delay: var(--gallery-fade-delay, 0ms); }
.gallery-image-current { z-index: 1; opacity: 1; }
.gallery-image-next { z-index: 2; opacity: 0; }
.gallery-track.is-crossfading .gallery-image-next { opacity: 1; }
.gallery-tile[role="button"] { cursor: pointer; }
.gallery-preview {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--background);
}
.gallery-preview[hidden] { display: none; }
.gallery-preview img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.logo-lockup {
  display: block;
  position: relative;
  flex: 0 0 auto;
  width: var(--logo-width);
  margin: 0 0 4px;
}
.logo { display: block; width: 100%; height: auto; margin: 0 auto; }
.logo-word { display: none; }

@media (min-width: 0px) {
  .logo-lockup {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  .logo-lockup .logo { display: none; }
  .logo-word {
    display: block;
    width: var(--logo-width);
    aspect-ratio: 848 / 203;
    background-image: url("assets/mirai-clan-logo.png?v=5");
    background-size: 100% auto;
    background-repeat: no-repeat;
  }
  .logo-word-mirai { background-position: center top; transform: translateX(calc(var(--tile-gap) * -1)); }
  .logo-word-clan {
    background-position: center calc(var(--logo-width) * -168 / 848);
    clip-path: inset(20% 0 0);
    transform: translateX(calc(var(--gallery-fitted-cell-size, 0px) * 0.2));
  }
}

.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;
}
.site-footer .header-rail,
.footer-rail { color: var(--credit); }
.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); }
.site-footer .rail-line { border-top-color: rgba(239, 239, 237, 0.09); }
.codex {
  --rule-line-width: 90%;
  --rule-copy-inset: 60px;
  --side-nav-icon-width: 26px;
  position: relative;
  width: min(760px, 100%);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}
.codex-heading { height: 32px; flex: 0 0 auto; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; width: var(--rule-line-width); 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; }
.codex-heading > span {
  display: block;
  align-self: center;
  width: 100%;
  border-top: 1px solid var(--line);
}
.codex-heading > :last-child { justify-self: end; }
.codex-heading .rule-count,
.codex-heading .rule-count span,
.count-display { color: var(--subtle); text-transform: none; }
.count-current { color: var(--text); }
.rule-nav { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--subtle); font-size: 15px; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.codex-heading .rule-nav { grid-column: 3; }
.rule-nav-button { min-width: 24px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--subtle); font-size: 1.2em; cursor: pointer; }
.rule-nav-button:hover { color: var(--subtle); }
.rule-nav-up::before, .rule-nav-down::before { content: ">"; display: inline-block; }
.rule-nav-up::before { transform: rotate(-90deg); }
.rule-nav-down::before { transform: rotate(90deg); }
.side-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: center;
  position: absolute;
  top: 56%;
  z-index: 2;
  width: var(--rule-copy-inset);
  height: 52px;
  color: var(--navigation);
  transform: translateY(-50%);
}
.side-nav[hidden] { display: none; }
.side-nav span {
  display: block;
  width: var(--side-nav-icon-width);
  height: 100%;
  background: currentColor;
  -webkit-mask: var(--side-nav-icon) center / contain no-repeat;
  mask: var(--side-nav-icon) center / contain no-repeat;
}
.side-nav-prev {
  --side-nav-icon: url("assets/chevron.compact.left.svg?v=20260930-0141");
  left: calc((100% - var(--rule-line-width)) / 2);
}
.side-nav-next {
  --side-nav-icon: url("assets/chevron.compact.right.svg?v=20260930-0141");
  right: calc((100% - var(--rule-line-width)) / 2);
}
.side-nav:hover { color: var(--subtle); }
/* Every slide shares a bounded stage; copy scrolls independently of its action. */
.rules { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); flex: 1 1 0; width: var(--rule-line-width); min-height: 0; margin: 0 auto; padding: 0; list-style: none; overflow: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; }
.rules > .rule { grid-area: 1 / 1; min-width: 0; min-height: 0; height: 100%; align-self: start; }
.rules .rule-toggle { display: none; }
.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(--text); }
.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(--text); }
.rules .rule-panel,
.about-codex .founders-panel {
  --rule-copy-width: min(625px, calc(100% - (var(--rule-copy-inset) * 2)));
  position: static;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}
.rule-panel > * { flex-shrink: 0; }
.rule-panel > .slide-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
.slide-copy > * { flex-shrink: 0; }
.slide-copy:focus-visible { outline-offset: -3px; }
.slide-copy::-webkit-scrollbar { width: 3px; }
.slide-copy::-webkit-scrollbar-thumb { background: var(--credit); border-radius: 3px; }
/* Keep inactive copy in layout while excluding it from view and interaction. */
.rules .rule-panel[hidden], .founder-profile[hidden] { visibility: hidden; pointer-events: none; }
.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(18.9px, 1.602vw, 23.4px); font-weight: 600; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.1em; }
.rule-panel p { margin: 0 0 16px; font-size: clamp(16.2px, 1.431vw, 20.7px); font-weight: 500; line-height: 1.45; letter-spacing: 0.02em; }
.rule-panel p:last-child { margin-bottom: 0; }
.rule-panel p.bullet-point {
  position: relative;
  padding-left: 1.05em;
}
.rule-panel p.bullet-point::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--text);
}
.slide-arrow {
  display: block;
  position: static;
  width: var(--rule-copy-width, min(625px, calc(100% - 120px)));
  height: 1.15em;
  margin-top: 24px;
  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: relative;
  margin-top: 24px;
  text-align: center;
  pointer-events: auto;
}
.scroll-hint {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  width: 100%;
  color: var(--credit);
  font-size: 10px;
  line-height: 1.4;
}
.scroll-hint[hidden] { display: none; }
.join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 218px;
  min-height: 42px;
  padding: 8px 24px;
  border: 1.3px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.join-button:hover { color: var(--text); border-color: var(--subtle); }
.builders-codex #rule-1 .join-button { width: 100%; }
.rule-panel p.sponsor-note {
  width: auto;
  margin: 12px auto 0;
  margin-bottom: 0;
  max-width: min(100%, 430px);
  color: var(--credit);
  font-size: 12.1px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.rule-panel strong { font-weight: 600; }

@media (min-width: 1025px) {
  .rule-panel p.sponsor-note { max-width: 100%; font-size: 10px; }
}

.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: var(--text-edge-glow);
}
.active-tab {
  background: linear-gradient(180deg, #fff7e7 0%, #ffd19b 48%, #f1a56c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
  text-shadow: var(--text-edge-glow);
}
.active-tab:hover { color: transparent; }
.event-kicker {
  width: var(--rule-copy-width, min(625px, calc(100% - 120px)));
  margin: 0 0 13px;
  color: var(--credit);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.builders-codex #rule-1 .slide-copy,
.builders-codex #rule-2 .slide-copy {
  display: grid;
  flex: 1 1 0;
  place-items: center;
  overflow-y: hidden;
  padding: 0;
}
.event-thumbnail-link {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  gap: 8px;
  width: 240px;
  max-width: 100%;
  color: var(--credit);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  text-align: center;
}
.builders-codex #rule-1 .event-thumbnail-link,
.builders-codex #rule-2 .event-thumbnail-link { width: min(90%, 34svh); }
.event-thumbnail {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 11px;
  border: 0.25px solid transparent;
  background:
    linear-gradient(transparent, transparent) padding-box,
    linear-gradient(180deg, rgba(255, 247, 231, 0.5) 0%, rgba(255, 209, 155, 0.5) 48%, rgba(241, 165, 108, 0.5) 100%) border-box;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}
.event-thumbnail-caption {
  color: var(--copyright);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;
}
@media (max-width: 600px) {
  .builders-codex #rule-1 .event-thumbnail-link,
  .builders-codex #rule-2 .event-thumbnail-link { width: min(95%, 42svh); }
}
.founders-panel {
  --rule-copy-width: min(760px, calc(100% - (var(--rule-copy-inset) * 2)));
}
.founders-shell {
  width: var(--rule-copy-width);
}
.founder-tabs {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  z-index: 3;
  padding: 0;
  transform: translateY(-50%);
}
.founder-tabs[hidden] { display: none; }
.founder-avatar {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  width: var(--founder-avatar-size, 74px);
  height: var(--founder-avatar-size, 74px);
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: var(--background);
  color: var(--credit);
  cursor: pointer;
  overflow: hidden;
}
.founder-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.founder-avatar:not(.is-active) img { filter: grayscale(1) brightness(0.55); }
.founder-avatar.is-active {
  border-color: rgba(255, 209, 155, 0.15) !important;
  color: #ffd19b;
  box-shadow: 0 0 12px rgba(255, 209, 155, 0.08);
}
.founder-copy {
  display: grid;
  width: 100%;
  margin: 0 auto;
}
.founder-profile {
  display: block;
  grid-area: 1 / 1;
  width: 100%;
}
.founder-profile[data-founder-panel="alex"] {
  margin-left: auto;
  text-align: right;
}
.founder-profile[data-founder-panel="alex"] .founder-role,
.founder-profile[data-founder-panel="alex"] h3,
.founder-profile[data-founder-panel="alex"] p {
  text-align: right;
}
.founder-role {
  display: block;
  margin-bottom: 10px;
  color: var(--credit);
  font-size: clamp(13px, 1.12vw, 16px);
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.founder-profile h3 {
  width: 100%;
  margin-bottom: 18px;
}
.founder-profile p {
  width: 100%;
}
.about-codex .codex-heading {
  --founder-avatar-size: 74px;
  --founder-label-width: 180px;
  --founder-line-gap: 10px;
  display: block;
  width: var(--rule-line-width);
  position: relative;
  height: 32px;
  margin-top: 0;
  margin-bottom: 36px;
  padding: 0;
  text-align: center;
}
.about-codex .codex-heading::before,
.about-codex .codex-heading::after {
  content: "";
  position: absolute;
  top: 50%;
  z-index: 0;
  width: calc((100% - (var(--founder-avatar-size) * 2) - (var(--founder-line-gap) * 2) - var(--founder-label-width)) / 2);
  border-top: 1px solid var(--line);
}
.about-codex .codex-heading::before { left: calc(var(--founder-avatar-size) + var(--founder-line-gap)); }
.about-codex .codex-heading::after {
  right: calc(var(--founder-avatar-size) + var(--founder-line-gap));
  border-top-color: #2b2b2b;
}
.about-codex .codex-heading h2 {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 0 18px;
  z-index: 2;
  transform: translate(-50%, -50%);
}
.about-codex .rules {
  border-top: 0;
}
.about-codex .rule {
  border-bottom: 0;
}
.site-footer { grid-row: 3; min-width: 0; display: grid; gap: 18px; margin-top: 0; min-height: 0; }
.site-footer .header-rail { margin-bottom: 4px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 24px; }
.credit-rail {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  color: var(--copyright);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.credit-rail span:last-child { text-align: right; }
.join-button {
  position: relative;
  border-color: transparent;
  background: transparent;
}
.join-button,
.join-button:hover {
  border-color: transparent;
  background: transparent;
  color: transparent;
}
.join-button::before {
  content: attr(data-label);
  position: absolute;
  z-index: 1;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff7e7 0%, #ffd19b 48%, #f1a56c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: var(--text-edge-glow);
}
.join-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.3px;
  background: linear-gradient(180deg, rgba(255, 247, 231, 0.8) 0%, rgba(255, 209, 155, 0.8) 48%, rgba(241, 165, 108, 0.8) 100%);
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@media (max-width: 600px) {
  .gallery-tile.is-hidden-slot { display: none; }
  .codex {
    --rule-line-width: 100%;
    --rule-copy-inset: 44px;
    --side-nav-icon-width: 23.8px;
  }
  .page { min-height: 100svh; padding: 11px 20px 6px; }
  .site-header { padding-top: 0; }
  .photo-rail { --logo-width: 138.6px; }
  .logo-lockup { margin: 0 0 4px; }
  .logo { width: 138.6px; }
  .header-rail, .footer-rail { gap: 7px; font-size: 12.42px; }
  .rail-line { min-width: 8px; }
  .site-footer .rail-line { border-top-color: rgba(239, 239, 237, 0.11); }
  .codex { padding: 32px 0 12px; }
  .codex-heading,
  .rules { width: 100%; }
  .codex-heading h2, .codex-heading span, .rule-nav { font-size: 12.42px; }
  .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; }
  .side-nav { top: 57%; height: 57.4px; }
  .rule-panel { padding: 0; }
  .rules .rule-panel { --rule-copy-width: min(460px, calc(100% - (var(--rule-copy-inset) * 2))); }
  .rule-panel h3,
  .rule-panel p { width: var(--rule-copy-width); }
  .rule-panel h3 { font-size: 20.4px; }
  .rule-panel p {
    font-size: 17.28px;
    letter-spacing: -0.005em;
    word-spacing: -0.01em;
  }
  .slide-arrow { font-size: 20.4px; }
  .event-kicker { font-size: 10.8px; }
  .event-codex .rule-panel { gap: 0; }
  .event-codex .event-kicker { margin-bottom: 8px; }
  .event-codex .event-title-row { margin-bottom: 24px; }
  .event-codex .rule-panel p { margin-bottom: 22px; }
  .event-panel .event-title-row,
  .slide-cta { width: var(--rule-copy-width); }
  .event-panel .event-title-row span { font-size: 20.4px; }
  .join-button { min-height: 46px; }
  .founders-panel {
    --rule-copy-width: min(460px, calc(100% - 40px));
  }
  .founders-panel .founders-shell,
  .founders-panel .founder-copy {
    width: 100%;
  }
  .founder-tabs { gap: 18px; }
  .about-codex .codex-heading {
    --founder-avatar-size: 70px;
    --founder-label-width: 145px;
    --founder-line-gap: 8px;
    margin-bottom: 36px;
  }
  .founder-avatar {
    width: var(--founder-avatar-size);
    height: var(--founder-avatar-size);
  }
  .founder-profile {
    width: calc(100% - (var(--rule-copy-inset) * 2));
  }
  .founder-profile[data-founder-panel="hai"] {
    width: 100%;
    margin-left: 0;
  }
  .founder-profile[data-founder-panel="alex"] {
    width: 100%;
    margin-right: 0;
  }
  .founder-profile[data-founder-panel="alex"] .founder-role,
  .founder-profile[data-founder-panel="alex"] h3,
  .founder-profile[data-founder-panel="alex"] p {
    width: 100%;
    margin-left: auto;
    text-align: right !important;
  }
  .founder-role {
    margin-bottom: 8px;
    font-size: 9.8px;
  }
  .founder-profile h3 { margin-bottom: 14px; }
  .rule-panel p .highlight { font-size: inherit; line-height: inherit; }
  .event-panel .join-button { width: 100%; min-height: 47px; }
  .join-button { min-width: 94px; padding: 7px 18px; font-size: 12.42px; }
  .rule-panel p.sponsor-note {
    margin-top: 10px;
    max-width: min(100%, 290px);
    font-size: 8.14px;
    line-height: 1.3;
  }
  .closing { font-size: 13px; }
  .site-footer { gap: 10px; }
  .site-footer .header-rail { margin-bottom: 9px; }
  .credit-rail { padding-top: 12px; font-size: 7.4px; }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .codex {
    --rule-line-width: 100%;
    --rule-copy-inset: 74px;
    --side-nav-icon-width: 24px;
  }
  .photo-rail { --logo-width: clamp(179.4px, 17.94vw, 247.25px); }
  .logo { width: clamp(179.4px, 17.94vw, 247.25px); }
  .header-rail, .footer-rail { font-size: 17.25px; }
  .codex { width: 100%; }
  .event-codex .codex-heading,
  .event-codex .rules { width: 100%; }
  .codex-heading h2, .codex-heading span, .rule-nav { font-size: 13.8px; }
  .event-kicker { font-size: 13.8px; }
  .rule-number { font-size: 19.55px; }
  .rule-title { font-size: 24.15px; }
  .rule-panel { padding-right: 0; padding-left: 0; }
  .rule-panel h3 { font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .rule-panel p { font-size: clamp(20.7px, 1.83vw, 26.45px); }
  .side-nav { height: 50px; }
  .slide-arrow { font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .event-panel .event-title-row span { font-size: clamp(24.15px, 2.05vw, 29.9px); }
  .event-panel .join-button {
    min-width: 218px;
    min-height: 50px;
    padding: 10px 29px;
  }
}

@media (max-height: 600px) {
  .page { padding-top: 12px; padding-bottom: 12px; }
  .site-header { padding-top: 0; }
  .photo-rail { --logo-width: 96px; }
  .logo { width: 100%; }
  .codex { padding: 16px 0; }
  .about-codex .codex-heading { --founder-avatar-size: 44px; margin-bottom: 16px; }
  .founder-avatar { width: var(--founder-avatar-size); height: var(--founder-avatar-size); }
  .site-footer { gap: 10px; }
  .site-footer .header-rail { margin-bottom: 0; }
  .credit-rail { padding-top: 8px; }
}

@media (max-height: 400px) {
  .photo-rail { --logo-width: 64px; }
  .codex { padding: 12px 0 4px; }
  .codex-heading, .about-codex .codex-heading { height: 24px; margin-bottom: 8px; }
  .about-codex .codex-heading { --founder-avatar-size: 36px; }
  .rules { grid-template-rows: auto; overflow-y: auto; }
  .rules > .rule, .rules .rule-panel { height: auto; }
  .rule-panel > .slide-copy { overflow: visible; }
}

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

/* Desktop: the section rail and slide belong to one stable reading block. */
@media (min-width: 1025px) {
  .event-codex,
  .home-codex,
  .about-codex { padding-top: clamp(32px, 6vh, 64px); }
  .event-codex .codex-heading,
  .home-codex .codex-heading { margin-bottom: 8px; }
  .event-codex .rule-panel,
  .home-codex .rule-panel { justify-content: flex-start; }
  .event-codex .slide-copy,
  .home-codex .slide-copy { padding-top: 64.5px; }
  .event-codex .slide-copy:has(.event-kicker) { padding-top: 32px; }
  .event-codex .event-kicker { height: 19.5px; margin-bottom: 13px; }
  .event-codex .slide-cta { margin-top: 48px; }
  .about-codex .codex-heading { height: var(--founder-avatar-size); margin-bottom: 24px; }
  .about-codex .founders-panel { justify-content: flex-start; }
}
@media (min-width: 1025px) and (max-height: 600px) {
  .event-codex,
  .home-codex,
  .about-codex { padding-top: 24px; }
  .event-codex .slide-copy,
  .home-codex .slide-copy { padding-top: 48.5px; }
  .event-codex .slide-copy:has(.event-kicker) { padding-top: 16px; }
}

@media (max-width: 600px) {
  .logo-word { width: calc(var(--logo-width) * 0.85); }
  .logo-word-clan {
    background-position: center calc(var(--logo-width) * 0.85 * -168 / 848);
  }
  .about-codex .codex-heading { margin-bottom: 12px; }
  .about-codex .founders-panel {
    justify-content: flex-start;
    padding-top: var(--mobile-founder-top, 0px);
  }
  .event-codex #rule-3:has(.event-kicker) .slide-cta { margin-top: 12px; }
  .sponsors-codex .rule-panel,
  .investors-codex .rule-panel,
  .home-codex .rule-panel {
    justify-content: flex-start;
    padding-top: var(--mobile-slide-top, 0px);
  }
}

/* Mobile copy and actions share the section rail edges. */
@media (max-width: 600px) {
  .codex { --rule-copy-inset: 0px; }
  .rules .rule-panel { --rule-copy-width: 100%; }
  .slide-cta,
  .slide-cta .join-button { width: 100%; }
}

/* Keep the home Codex title and copy on one shared mobile reading edge. */
@media (max-width: 600px) {
  .home-codex .rule-panel > .slide-copy {
    align-items: center;
  }
  .home-codex .rule-panel h3,
  .home-codex .rule-panel p,
  .home-codex .rule-panel .slide-cta {
    width: min(460px, calc(100% - (var(--rule-copy-inset) * 2)));
    margin-left: auto;
    margin-right: auto;
  }
  .home-codex .rule-panel h3 {
    text-align: left;
  }
}

.mobile-title-reference { position: absolute !important; inset: 0; }

/* Measure the same investor reference on every aligned mobile page. */
@media (max-width: 600px) {
  .mobile-title-reference .event-title-row { margin-bottom: 24px; }
  .mobile-title-reference p,
  .mobile-title-reference p:last-child { margin-bottom: 22px; }
}
