:root {
  --page-width: 1080px;
  --header-height: 48px;
  --dynamic-height: 40vh;
  --footer-height: 28px;

  --bg: #050505;
  --fg: #cccac0;
  --mg: #a3a3a3;
  --muted: #666;
  --dim: #888;

  --item-gap: 12px;
}

* {
  box-sizing: border-box;

  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);

  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

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

/* Page shell  */

.page {
  position: relative;
  width: min(var(--page-width), 100%);
  height: 100dvh;
  margin-inline: auto;
}

/* Top menu */

.top-menu {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 50%;
  translate: -50% 0;

  width: min(var(--page-width), 100%);
  height: var(--header-height);

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding-inline: 12px;
  background: var(--bg);
}

.menu-toggle-wrap {
  justify-self: start;
}

.logo {
  justify-self: center;
}

.logo,
.logo img {
  display: block;
  width: 138px;
  height: 32px;
}

/* =========================================================
   Language dropdown
   ========================================================= */

.language-dropdown {
  position: relative;
  justify-self: end;
  align-self: center;
}

.language-trigger {
  appearance: none;
  border: 0;
  outline: 0;
  padding: 0;
  margin: 0;

  background: transparent;
  color: var(--dim);
  cursor: pointer;

  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  transition: color 120ms ease;
}

.language-trigger:hover {
  color: var(--mg);
}

.language-trigger[aria-expanded="true"] {
  color: var(--fg);
}

.language-current {
  display: inline-block;
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  display: grid;
  grid-template-columns: repeat(3, minmax(120px, auto));
  gap: 24px 32px;

  padding: 20px 24px;

  background: var(--bg);
  color: var(--fg);

  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 10px;

  z-index: 110;
}

.language-menu[hidden] {
  display: none;
}

.language-section {
  min-width: 0;
}

.language-section-title {
  margin: 0 0 12px;

  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: capitalize;
  letter-spacing: 0.08em;
}

.language-list {
  margin: 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

.language-list button {
  appearance: none;
  border: 0;
  outline: 0;
  padding: 4px 0;
  margin: 0;

  background: transparent;
  color: var(--dim);
  cursor: pointer;

  font: inherit;
  text-align: left;

  transition: color 120ms ease;
}

.language-list button:hover {
  color: var(--fg);
}

.language-list button[aria-current="true"] {
  color: var(--fg);
}

@media (max-width: 700px) {
  .language-menu {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 18px;

    min-width: 200px;
    max-width: calc(100vw - 24px);
  }
}

/* menu top left */

.menu-button {
  appearance: none;
  border: 0;
  outline: 0;
  padding: 12px;
  margin: -12px;

  background: transparent;
  color: var(--dim);
  cursor: pointer;

  display: inline-flex; /* was: inlin-flexc */
  align-items: center;
  justify-content: center;

  transition: color 120ms ease;
}

/* menu panel overlay*/

.menu-overlay {
  position: fixed;
  z-index: 95;

  top: var(--header-height);
  left: 50%;
  translate: -50% 0;

  width: min(var(--page-width), 100%);

  /* Size to content, capped by the viewport. */
  max-height: calc(100dvh - var(--header-height));

  background: var(--bg);

  /* Only scroll if content exceeds the cap. */
  overflow-y: auto;
  overscroll-behavior: contain;

  border-bottom: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);

  opacity: 0;
  pointer-events: none;

  transition: opacity 200ms ease;
}

.menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-overlay-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;

  padding: 40px 24px;
}

/* menu sections */

.menu-section {
  min-width: 0;
}

.menu-section-title {
  margin: 0 0 16px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: capitalize;
  letter-spacing: 0.08em;
}

.menu-section-list {
  margin: 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-section-list a {
  display: block;
  padding: 4px 0;

  color: var(--dim);
  transition: color 120ms ease;
}

.menu-section-list a:hover {
  color: var(--fg);
}

@media (max-width: 700px) {
  :root {
    --header-height: 52px;
  }

  .menu-overlay-inner {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
/* =========================================================
   Dynamic block
   ========================================================= */

.dynamic {
  position: fixed;
  z-index: 90;
  top: var(--header-height);
  left: 50%;
  translate: -50% 0;

  width: min(var(--page-width), 100%);
  height: var(--dynamic-height);

  overflow: hidden;
  isolation: isolate;
  background: #111;
}

.dynamic-media {
  position: absolute;
  inset: 0;
  z-index: -2;

  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  opacity: 0;
  transition: opacity 320ms ease;
  will-change: opacity, background-position;
}

.dynamic-media.is-active {
  opacity: 1;
}

.dynamic-media.is-panning {
  animation: pan-image 11s linear infinite alternate;
}

@keyframes pan-image {
  from {
    background-position: center top;
  }

  to {
    background-position: center bottom;
  }
}

.dynamic::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--bg) 20%, transparent),
    color-mix(in srgb, var(--bg) 0%, transparent) 2%,
    transparent
  );
}

.dynamic::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 20%, transparent),
    color-mix(in srgb, var(--bg) 0%, transparent) 2%,
    transparent
  );
}

.dynamic-content {
  position: absolute;
  inset-inline: 24px;
  bottom: 24px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.dynamic-text {
  min-width: 0;
}

.dynamic-content h1 {
  margin: 0 0 8px;

  font-size: clamp(24px, 4vw, 48px);
  line-height: 1;
  text-transform: capitalize;
}

.dynamic-content p {
  max-width: 680px;
  margin: 0;

  line-height: 1.5;
}

.dynamic-content h1,
.dynamic-content p {
  color: var(--fg);

  display: table;
  width: fit-content;
  max-width: 100%;

  background: var(--bg);

  padding: 0 14px;
  border-radius: 10px;

  white-space: pre-line;
}

.dynamic-read {
  align-self: end;

  display: inline-block;

  padding: 0 14px;

  font-family: inherit;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: normal;
  text-transform: capitalize;

  color: var(--fg);
  background: var(--bg);

  border-radius: 10px;

  cursor: pointer;

  transition:
    color 120ms ease,
    background-color 120ms ease;
}

.dynamic-read span {
  display: block;
}

.dynamic-read:hover {
  color: var(--bg);
  background: var(--fg);
}

.dynamic-read:active {
  color: var(--bg);
  background: var(--mg);
}

/* =========================================================
   Menu — JS-controlled scroll region
   ========================================================= */

.menu {
  position: fixed;
  padding-left: 20px;
  z-index: 10;

  top: calc(var(--header-height) + var(--dynamic-height));
  bottom: var(--footer-height);
  left: 50%;
  translate: -50% 0;

  width: min(var(--page-width), 100%);

  overflow-x: hidden;
  overflow-y: auto;

  scroll-snap-type: none;
  scroll-behavior: auto;

  touch-action: pan-y;
  overscroll-behavior: contain;

  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu-list {
  padding-inline: 20px;
}

.snap-spacer {
  height: 0;
  min-height: 0;
  pointer-events: none;
}

.snap-spacer--top {
  position: relative;
}

.snap-spacer--bottom {
  position: relative;
}

.scroll-hint {
  pointer-events: none;
  user-select: none;

  position: absolute;
  left: 50%;
  top: 65%;
  translate: -50% -50%;

  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;

  max-width: 100%;
  text-align: center;
}

/* =========================================================
   Custom scrollbar
   ========================================================= */

.menu-scrollbar {
  position: absolute;
  top: calc(var(--header-height) + var(--dynamic-height) + 12px);
  bottom: var(--footer-height);
  right: -6px;

  width: 32px;

  pointer-events: auto;
  cursor: pointer;
  touch-action: none;

  opacity: 0.5;
  transition: opacity 200ms ease;
  z-index: 20;
}

.menu-scrollbar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 15px;
  width: 2px;

  background: color-mix(in srgb, var(--muted) 20%, transparent);
  border-radius: 2px;
  pointer-events: none;

  transition: width 200ms ease;
}

.menu-scrollbar-thumb {
  position: absolute;
  top: 0;
  right: 15px;
  width: 2px;
  height: 0;

  background: var(--mg);
  border-radius: 2px;

  transform: translateY(0);
  transition:
    background-color 120ms ease,
    width 200ms ease;
  will-change: transform;

  pointer-events: none;
}

.menu-scrollbar:hover,
.menu-scrollbar.is-dragging {
  opacity: 1;
}

.menu-scrollbar:hover::before,
.menu-scrollbar.is-dragging::before,
.menu-scrollbar:hover .menu-scrollbar-thumb,
.menu-scrollbar.is-dragging .menu-scrollbar-thumb {
  width: 5px;
}

.menu-scrollbar.is-dragging .menu-scrollbar-thumb {
  background: var(--fg);
}

/* =========================================================
   Menu headings
   ========================================================= */

.menu-heading {
  margin: 28px 0 12px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: capitalize;
  letter-spacing: 0.08em;
}

.menu-heading:first-child {
  margin-top: 0;
}

/* =========================================================
   Menu item
   ========================================================= */

.menu-item {
  position: relative;

  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 20px;

  min-height: 72px;
  padding: 20px 10px;

  color: var(--dim);

  cursor: pointer;

  transition: color 120ms ease;

  overflow: visible;
}

.menu-item + .menu-item {
  margin-top: var(--item-gap);
}

/* =========================================================
   Menu item number
   ========================================================= */

.menu-item-number {
  display: inline-block;
  flex: 0 0 auto;
  min-width: 1.5ch;

  font-size: 0.8em;

  color: var(--muted);

  font-family: inherit;
  font-variant-numeric: tabular-nums;
  line-height: inherit;
  text-decoration: none;

  transition: color 120ms ease;
}

.menu-item.is-selected .menu-item-number {
  color: var(--muted);
}

/* =========================================================
   Menu item title + show-more
   ========================================================= */

.menu-item-title {
  transition: transform 160ms ease;
}

.show-more {
  color: var(--mg);
  opacity: 0;
  transition:
    opacity 160ms ease,
    color 120ms ease;
}

.menu-item.is-selected {
  color: var(--fg);
}

.menu-item.is-selected .menu-item-title {
  transform: translateX(8px);
}

.menu-item.is-selected .show-more {
  opacity: 1;

  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}

.menu-item:hover {
  color: var(--mg);
}

.menu-item.is-selected:hover {
  color: var(--fg);
}

/* =========================================================
   Sponsors
   ========================================================= */

.sponsors-item {
  display: block;
  min-height: 0;
  padding: 0;

  color: var(--dim);
}

.sponsors-inner {
  padding-bottom: 32px;
}

.sponsors-item .menu-heading {
  margin-top: 48px;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 32px;
  margin-top: 20px;
}

.sponsors-grid a {
  min-height: 72px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.sponsors-grid img {
  display: block;
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
}

.sponsors-grid a:hover {
  opacity: 0.65;
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
  position: fixed;
  z-index: 100;

  left: 50%;
  bottom: 0;
  translate: -50% 0;

  width: min(var(--page-width), 100%);
  height: var(--footer-height);

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--bg);
  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {
  :root {
    --header-height: 52px;
    --dynamic-height: 30vh;
  }

  html {
    text-size-adjust: 80%;
  }  

  .top-menu {
    padding: 5px 12px;
  }

  .dynamic-content {
    inset-inline: 18px;
    bottom: 18px;

    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .dynamic-content h1 {
    font-size: clamp(24px, 8vw, 40px);
    font-weight: 700;
  }

  .dynamic-content p {
    max-width: none;
    font-size: 12px;
  }

  .dynamic-read {
    justify-self: end;
    font-size: clamp(24px, 8vw, 40px);
    font-weight: 700;
  }

  .menu-list {
    padding-inline: 18px;
  }

  .menu-item {
    min-height: 64px;
    padding: 20px 10px;

    align-items: baseline;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .menu-item-number {
    flex: 0 0 auto;
    min-width: 1.5ch;
    font-size: 0.8em;
    color: var(--muted);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    line-height: inherit;
    text-decoration: none;
  }

  .menu-item.is-selected .menu-item-number {
    color: var(--muted);
  }

  .menu-item.is-selected .show-more {
    opacity: 1;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-skip-ink: auto;
  }

  .sponsors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .scroll-hint {
    font-size: 11px;
    letter-spacing: 0.04em;
    padding-inline: 12px;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .dynamic-media,
  .menu-item-title,
  .show-more,
  .menu-item-number {
    transition: none;
  }
}

/* =========================================================
   Focus
   ========================================================= */

a:focus,
a:focus-visible,
.menu-item:focus,
.menu-item:focus-visible {
  outline: none;
}

.dropdown-trigger:focus-visible {
  color: var(--fg);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
