:root {
  color-scheme: dark;
  --surface: #141414;
  --header-surface: #151515;
  --text: #ffffff;
  --muted: #b5aeb8;
  --accent: #bd7ad2;
  --focus: #d69aea;
  --content-width: 76rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-height: 4.5rem;
  font-family: 'Montserrat', Arial, sans-serif;
  background-color: var(--surface);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

[hidden] {
  display: none !important;
}

html {
  min-block-size: 100%;
  scroll-padding-block-start: 1rem;
  scrollbar-gutter: auto;
  scrollbar-width: none;
}

/* Hide only the scrollbar; native scrolling stays available on every route. */
html::-webkit-scrollbar {
  display: none;
}

html.has-lightbox {
  overflow: hidden;
}

body {
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
  isolation: isolate;
  background-color: var(--surface);
  color: var(--text);
  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.5;
}

/* One shared surface: root and browser safe areas stay dark on every route. */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0 0 auto;
  /* Paint the full mobile viewport before browser controls retract. */
  block-size: 100vh;
  block-size: 100lvh;
  transform: translateZ(0);
  pointer-events: none;
  content: '';
  background:
    radial-gradient(
      100% 100% at var(--gradient-x-a, 100%) var(--gradient-y-a, 0%),
      #141414 0%,
      transparent
    ),
    radial-gradient(
      100% 100% at var(--gradient-x-b, 0%) var(--gradient-y-b, 100%),
      #191919 0%,
      transparent
    ),
    radial-gradient(100% 100% at 0% 0%, #1e1e1e 0%, transparent),
    radial-gradient(100% 100% at 100% 100%, #232323 0%, transparent), #310a38;
  animation: surface-drift 12s ease-in-out infinite alternate;
}

@property --gradient-x-a {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 100%;
}
@property --gradient-y-a {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
@property --gradient-x-b {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
@property --gradient-y-b {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 100%;
}

@keyframes surface-drift {
  to {
    --gradient-x-a: 18%;
    --gradient-y-a: 18%;
    --gradient-x-b: 82%;
    --gradient-y-b: 80%;
  }
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.15;
  text-wrap: balance;
  min-inline-size: 0;
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

img {
  block-size: auto;
}

picture {
  display: block;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
input[type='submit']:not(:disabled) {
  cursor: pointer;
}

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

main[tabindex='-1']:focus {
  outline: none;
}

main {
  min-block-size: calc(100vh - var(--header-height));
  min-block-size: calc(100svh - var(--header-height));
}

.skip-link {
  position: fixed;
  z-index: 10000;
  inset-block-start: max(0.5rem, env(safe-area-inset-top, 0px));
  inset-inline-start: max(0.5rem, env(safe-area-inset-left, 0px));
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  background: #ffffff;
  color: #141414;
  font-weight: 600;
  transform: translateY(calc(-100% - 2rem));
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: relative;
  z-index: 2;
  padding-block-start: env(safe-area-inset-top, 0px);
  background-color: var(--header-surface);
  font-family: 'League Spartan', 'Montserrat', Arial, sans-serif;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  inline-size: 100%;
  max-inline-size: calc(var(--content-width) + 2 * var(--gutter));
  min-block-size: 4.5rem;
  margin-inline: auto;
  padding: 0.5rem max(var(--gutter), env(safe-area-inset-right, 0px)) 0.5rem
    max(var(--gutter), env(safe-area-inset-left, 0px));
}

.site-name {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  text-decoration: none;
  font-size: 1.375rem;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.125rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  text-decoration: none;
  font-size: 1.125rem;
}

.site-nav a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(50% - 0.65em);
  block-size: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
  pointer-events: none;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current='page']::after {
  transform: scaleX(1);
}

.page-inner,
.section-inner {
  inline-size: calc(100% - 2 * var(--gutter));
  max-inline-size: var(--content-width);
  margin-inline: auto;
}

.page-title,
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
}

.page-title {
  text-align: center;
  text-transform: uppercase;
}

.page-intro {
  max-inline-size: 48rem;
  margin: 1rem auto 2rem;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[data-reveal] {
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}

[data-reveal][data-reveal-pending] {
  opacity: 0;
  transform: translateY(1rem);
}

.not-found {
  padding-block: clamp(3rem, 8vw, 6rem) max(3rem, env(safe-area-inset-bottom, 0px));
}

.not-found .page-inner {
  max-inline-size: 48rem;
}

.not-found h1 {
  margin-block-end: 1.5rem;
}

.not-found p {
  margin-block-end: 1.5rem;
}

@media (min-width: 576px) {
  .site-nav ul {
    gap: 0.25rem 1.5rem;
  }
  .site-name,
  .site-nav a {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a::after {
    transition: none;
  }
  body::before {
    animation: none;
  }
  [data-reveal],
  [data-reveal][data-reveal-pending] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
