:root {
  color-scheme: dark;
  --background: #050505;
  --gold: #f7d67a;
  --gold-mid: #d7a93a;
  --gold-deep: #bd861a;
  --rail-width: clamp(12rem, 15.65vw, 12.5rem);
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--gold);
  background:
    radial-gradient(ellipse at 78% 73%, rgba(173, 127, 35, 0.08), transparent 18rem),
    radial-gradient(ellipse at 43% 35%, rgba(247, 214, 122, 0.035), transparent 24rem),
    var(--background);
  font-family: 'Gelasio', Georgia, serif;
  text-shadow: 0 0 0.35em rgba(247, 214, 122, 0.18);
}

#stars {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(10, 17, 22, 0.8), rgba(2, 3, 3, 1) 55%);
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: 7rem minmax(calc(100vh - 7rem), auto);
  grid-template-rows: 7rem minmax(calc(100svh - 7rem), auto);
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
}

.brand-rail {
  position: fixed;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: clamp(1.25rem, 3vw, 2.5rem);
  width: var(--rail-width);
  grid-column: 1;
  grid-row: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 0;
  padding-top: 1.1rem;
  border-right: 1px solid rgba(247, 214, 122, 0.9);
}

.brand-rail .community-links {
  position: fixed;
  top: 7rem;
  bottom: 1rem;
  left: clamp(1.25rem, 3vw, 2.5rem);
  width: calc(var(--rail-width) - 0.75rem);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(9, minmax(3rem, 1fr));
  gap: 0.55rem;
  overflow-y: auto;
  padding: 0.35rem 0.45rem 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 214, 122, 0.56) transparent;
}

.page-header {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  padding: 0 clamp(0.75rem, 3vw, 2.5rem);
  text-align: center;
}

.page-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(247, 214, 122, 0.9);
  content: "";
}

h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.015em;
  text-shadow: 0 0 0.12em rgba(255, 239, 171, 0.72), 0 0 0.65em rgba(247, 214, 122, 0.42);
}

.main-content {
  grid-column: 2;
  grid-row: 2;
  padding: clamp(3rem, 5.6vw, 4.5rem) clamp(1.25rem, 3.5vw, 3rem);
}

.experience-layout {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.left-pane {
  display: grid;
  min-width: 0;
  gap: clamp(2rem, 4vw, 3rem);
}

.experience-links {
  display: grid;
  justify-items: start;
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  max-width: 31rem;
}

.community-links {
  display: grid;
  width: min(100%, 31rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.55rem, 1.2vw, 0.9rem);
}

.community-button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 3.25rem;
  place-items: center;
  padding: 0.55rem 0.45rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--community-light), white 30%);
  border-radius: 0.85rem;
  color: #111;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px rgba(255, 239, 171, 0.38);
  background:
    radial-gradient(ellipse at 28% 0%, rgba(255, 255, 255, 0.52), transparent 56%),
    linear-gradient(145deg, var(--community-light), var(--community-dark) 78%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.58),
    inset 0 -3px 5px rgba(0, 0, 0, 0.22),
    0 0 0.85rem color-mix(in srgb, var(--community-light), transparent 58%),
    0 0.35rem 0.55rem rgba(0, 0, 0, 0.45);
  font-size: clamp(0.92rem, 1.25vw, 1.08rem);
  line-height: 1.15;
  transition: filter 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.community-button::before {
  position: absolute;
  top: 0;
  left: -130%;
  width: 90%;
  height: 100%;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.85) 48%, rgba(255, 255, 255, 0.12) 58%, transparent 82%);
  content: "";
  transform: skewX(-22deg);
  transition: left 480ms ease;
}

.community-button::after {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #fffbd9;
  box-shadow: 0 0 0.38rem 0.12rem rgba(255, 255, 255, 0.88);
  content: "";
  opacity: 0;
}

.community-button:hover,
.community-button:focus-visible {
  filter: brightness(1.18) saturate(1.15);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -3px 5px rgba(0, 0, 0, 0.18),
    0 0 1.2rem color-mix(in srgb, var(--community-light), transparent 28%),
    0 0.5rem 0.7rem rgba(0, 0, 0, 0.52);
  transform: translateY(-2px);
}

.community-button:hover::before,
.community-button:focus-visible::before {
  left: 155%;
}

.community-button:hover::after,
.community-button:focus-visible::after {
  animation: button-glimmer 900ms ease-in-out infinite alternate;
}

.community-button:active {
  transform: translateY(1px) scale(0.98);
}

@keyframes button-glimmer {
  0% {
    opacity: 0.2;
    transform: scale(0.65);
  }

  100% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.community-button:focus-visible {
  outline: 2px solid #fff1ad;
  outline-offset: 3px;
}

.community-button:nth-child(8n + 1) {
  --community-light: #52d6c8;
  --community-dark: #087b83;
}

.community-button:nth-child(8n + 2) {
  --community-light: #9ce35e;
  --community-dark: #368443;
}

.community-button:nth-child(8n + 3) {
  --community-light: #8bb8ff;
  --community-dark: #4359b4;
}

.community-button:nth-child(8n + 4) {
  --community-light: #d69aff;
  --community-dark: #743aab;
}

.community-button:nth-child(8n + 5) {
  --community-light: #ff9b69;
  --community-dark: #b33b45;
}

.community-button:nth-child(8n + 6) {
  --community-light: #ffe46b;
  --community-dark: #b77b16;
}

.community-button:nth-child(8n + 7) {
  --community-light: #ff83b5;
  --community-dark: #ad3d78;
}

.community-button:nth-child(8n) {
  --community-light: #7ee1ff;
  --community-dark: #2764a7;
}

.community-button:last-child {
  font-size: 1.5rem;
  letter-spacing: 0.16em;
}

.caption-carousel {
  display: grid;
  min-width: 0;
  min-height: 18rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  background: transparent;
}

.caption-content {
  display: grid;
  min-width: 0;
  min-height: 15rem;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.caption-image {
  display: block;
  width: min(100%, 24rem);
  max-height: 18rem;
  object-fit: contain;
}

.caption-image[hidden] {
  display: none;
}

.caption-text {
  margin: 0;
  color: rgba(247, 214, 122, 0.88);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  text-wrap: pretty;
  white-space: pre-wrap;
}

.caption-arrow {
  position: relative;
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  place-items: center;
  border: 1px solid rgba(255, 239, 171, 0.76);
  border-radius: 50%;
  color: #231805;
  background: linear-gradient(145deg, #fff0a8 0%, #e2b946 52%, #a56c12 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.68),
    inset 0 -2px 3px rgba(75, 43, 0, 0.3),
    0 0 0.65rem rgba(247, 214, 122, 0.3);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 0 1px rgba(255, 240, 180, 0.48);
  transition: filter 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.caption-arrow img {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  transition: transform 180ms ease;
}

.caption-arrow--previous img {
  transform: scaleX(-1);
}

.caption-arrow:hover:not(:disabled),
.caption-arrow:focus-visible {
  filter: brightness(1.16);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    inset 0 -2px 3px rgba(75, 43, 0, 0.24),
    0 0 1rem rgba(247, 214, 122, 0.72);
  transform: scale(1.08);
}

.caption-arrow--previous:hover:not(:disabled) img,
.caption-arrow--previous:focus-visible img {
  transform: scaleX(-1) rotate(-12deg);
}

.caption-arrow--next:hover:not(:disabled) img,
.caption-arrow--next:focus-visible img {
  transform: rotate(12deg);
}

.caption-arrow:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.caption-arrow:disabled {
  opacity: 0.7;
  filter: saturate(0.55);
  cursor: default;
}

.experience-button {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: min(100%, 30rem);
  min-height: clamp(4.75rem, 7vw, 5.5rem);
  padding: 0.8rem 2.25rem 0.8rem 3.7rem;
  overflow: hidden;
  border: 1px solid rgba(255, 239, 171, 0.68);
  clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%, 9% 50%);
  color: #111;
  text-decoration: none;
  background: linear-gradient(105deg, var(--gold-deep) 0%, var(--gold-mid) 42%, #f5d240 76%, var(--gold-mid) 100%);
  box-shadow: 0 0 0.75rem rgba(247, 214, 122, 0.28);
  cursor: pointer;
  font: inherit;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 0 0.45em rgba(255, 248, 213, 0.72), 0 1px rgba(255, 239, 171, 0.28);
  filter: drop-shadow(0 0.25rem 0.35rem rgba(0, 0, 0, 0.55));
  transition: filter 180ms ease, transform 180ms ease, background-position 250ms ease;
}

.experience-button::after {
  position: absolute;
  z-index: -1;
  top: -55%;
  bottom: -55%;
  left: -45%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.64), transparent);
  content: "";
  transform: skewX(-24deg);
  transition: left 500ms ease;
}

.experience-button:hover {
  background-position: 100% 50%;
  filter:
    drop-shadow(0 0 0.45rem rgba(247, 214, 122, 0.85))
    drop-shadow(0 0.55rem 0.6rem rgba(0, 0, 0, 0.72));
  transform: translateY(-3px);
}

.experience-button:hover::after,
.experience-button:focus-visible::after {
  left: 125%;
}

.experience-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
  filter: drop-shadow(0 0 0.55rem rgba(247, 214, 122, 0.85));
}

.experience-button:active {
  filter:
    drop-shadow(0 0 0.2rem rgba(247, 214, 122, 0.75))
    drop-shadow(0 0.1rem 0.18rem rgba(0, 0, 0, 0.8));
  transform: translateY(2px) scale(0.99);
}

@media (max-width: 640px) {
  :root {
    --rail-width: clamp(7.25rem, 30vw, 8rem);
  }

  .page-shell {
    grid-template-rows: 6.25rem minmax(calc(100svh - 6.25rem), auto);
    padding-inline: 1rem;
  }

  .brand-rail {
    left: 1rem;
    width: var(--rail-width);
    padding-top: 1rem;
  }

  .page-header {
    padding-inline: 0.5rem;
  }

  h1 {
    font-size: clamp(1.35rem, 5vw, 1.9rem);
  }

  .main-content {
    padding: 2.5rem 0.75rem;
  }

  .experience-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .left-pane {
    gap: 2rem;
  }

  .experience-links {
    width: 100%;
    gap: 1.5rem;
  }

  .brand-rail .community-links {
    top: 6.25rem;
    left: 1rem;
    width: calc(var(--rail-width) - 0.4rem);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(9, minmax(2.25rem, 1fr));
    gap: 0.35rem;
    padding-right: 0.25rem;
  }

  .community-button {
    min-height: 2.25rem;
    padding: 0.35rem 0.4rem;
    border-radius: 0.55rem;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  .community-button:last-child {
    font-size: 1rem;
  }

  .caption-carousel {
    min-height: 12rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .caption-content {
    min-height: 10rem;
  }

  .experience-button {
    min-height: 4.25rem;
    padding-left: 2.8rem;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
