/* Sections below the hero: 04 services, 05 paths, 06 enlist, footer.
   Builds on the tokens and shared pieces in hero.css (labels, pills, chrome logo). */

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.section-label,
.contract__of,
.contract__cat,
.contract__client,
.contract__meta dt,
.filter__q,
.filter__btn,
.filter__ask input,
.filter__hint,
.services__loader,
.paths__tag,
.paths__meta,
.enlist__facts span,
.site-foot__h,
.site-foot__legal {
  font: var(--label);
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-label span {
  margin-right: 0.5em;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
}

.section-label b { font-weight: 700; }

/* the hero's bottom bar retires once the hero has scrolled away */
.dock {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.dock.is-away {
  opacity: 0;
  transform: translateY(14px);
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

/* ---------- 04 the world ---------- */

.world {
  position: relative;
  padding: 16vh var(--gutter) 20vh;
  background: #0f0e0d;
}

.world__head {
  display: flex;
  justify-content: space-between;
  gap: 2em;
  margin-bottom: 8vh;
}

.world__meta {
  font: var(--label);
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* sized so the paragraph (~9 lines) fits well inside one screen */
.world__text {
  max-width: 25em;
  font-size: clamp(28px, 3.35vw, 64px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--ink);
}

/* armed by sections.js; without JS the paragraph simply reads white */
.world__text.is-armed .w {
  color: #3a3532;
  transition: color 0.35s ease;
}

.world__text.is-armed .w.is-on { color: var(--ink); }

/* a word, its picture and the punctuation after it never split across lines */
.world__keep { white-space: nowrap; }

.world__pill {
  display: inline-block;
  width: 2.25em;
  height: 0.8em;
  margin: 0 0.06em;
  vertical-align: -0.04em;
  border-radius: 999px;
  overflow: hidden;
}

.world__pill img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

/* unrevealed: a narrow grey capsule that opens into the picture */
.world__text.is-armed .world__pill img {
  clip-path: inset(0 41% round 999px);
  filter: grayscale(1) brightness(0.35);
  transition: clip-path 0.7s cubic-bezier(0.7, 0, 0.2, 1), filter 0.7s ease;
}

.world__text.is-armed .world__pill.is-on img {
  clip-path: inset(0 0 round 999px);
  filter: none;
}

.world__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16vh 0 0;
}

.world__stats div {
  padding-top: 1.3em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.world__stats dt {
  font: var(--label);
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.world__stats dd {
  margin: 0.35em 0 0;
  font-size: clamp(30px, 3.6vw, 66px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 05 special services ---------- */

.services {
  position: relative;
  height: 1500vh;
  height: 1500svh;
  background: #120e10;
}

/* the section eases in out of the dark world section instead of starting on a hard edge;
   it sits over the pinned stage only while the section top is still on screen */
.services::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  height: 42vh;
  background: linear-gradient(to bottom, #0f0e0d 0%, rgba(15, 14, 13, 0.45) 35%, rgba(15, 14, 13, 0) 100%);
  pointer-events: none;
}

.services__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.services__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.services__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 14, 13, 0) 0%, #0f0e0d 88%);
  opacity: 0;
  pointer-events: none;
}

.services__label,
.paths__label {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 9.5vh);
  left: var(--gutter);
  z-index: 2;
}

.contract {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 9vh);
  right: calc(var(--gutter) + 3.4vw);
  width: min(19.5rem, 24vw);
  opacity: 0;
  transform: translateY(10px);
  text-shadow: 0 1px 14px rgba(12, 8, 10, 0.75);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.services.is-browsing .contract {
  opacity: 1;
  transform: none;
}

.contract__num {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: clamp(30px, 2.6vw, 46px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.contract__of { color: var(--ink-faint); }

.contract__cat {
  margin-top: 1.5em;
  color: var(--ember);
}

.contract__title {
  min-height: 1em;
  margin-top: 0.35em;
  font-size: clamp(17px, 1.42vw, 25px);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.contract__client {
  margin-top: 1.2em;
  color: var(--ink-faint);
}

.contract__client b { color: var(--ink); }

.contract__desc {
  margin-top: 1em;
  color: #b0a8a1;
  font-size: clamp(10.5px, 0.72vw, 13px);
  line-height: 1.45;
}

.contract__meta {
  display: flex;
  gap: 2.6em;
  margin: 1.3em 0 0;
  padding-top: 1.1em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.contract__meta dt { color: var(--ink-faint); }

.contract__meta dd {
  margin: 0.55em 0 0;
  font-size: clamp(11px, 0.78vw, 13.5px);
  font-weight: 700;
}

.contract__danger {
  display: flex;
  gap: 3px;
  height: 1.2em;
  align-items: center;
}

.contract__danger i {
  width: 6px;
  height: 11px;
  border: 1px solid #ff5b3a;
}

.contract__danger i.is-on { background: #ff5b3a; }

.contract__cta { margin-top: 1.5em; }

.pill--ember {
  color: var(--ember);
  border-color: rgba(255, 138, 61, 0.32);
}

.pill--ember:hover {
  border-color: rgba(255, 138, 61, 0.6);
  background: #241612;
}

.filter {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  width: min(16rem, 22vw);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.services.is-browsing .filter { opacity: 1; }

.filter__q {
  margin-bottom: 1em;
  font-weight: 700;
}

.filter__list {
  display: grid;
  gap: 0.2em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter__btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.3em 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.25s ease;
}

.filter__btn:hover,
.filter__btn.is-active { color: var(--ink); }

.filter__btn.is-active { font-weight: 800; }

.filter__arrow { color: var(--ember); }

.filter__count {
  color: var(--ink-faint);
  font-weight: 400;
}

.filter__ask input {
  width: 100%;
  height: 2.9em;
  margin-top: 1.4em;
  padding: 0 1.2em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(23, 20, 19, 0.72);
  color: var(--ink);
  letter-spacing: 0.05em;
}

.filter__ask input::placeholder { color: var(--ink-faint); }

.filter__ask input:focus-visible {
  outline: 1.5px solid var(--ember);
  outline-offset: 2px;
}

.filter__hint {
  min-height: 1.3em;
  margin-top: 0.7em;
  color: var(--ink-dim);
}

.ruler {
  position: absolute;
  top: 50%;
  right: calc(var(--gutter) * 0.9);
  display: grid;
  justify-items: end;
  gap: 8px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.services.is-browsing .ruler { opacity: 1; }

.ruler i {
  display: block;
  width: 22px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  transform: scaleX(0.4545);
  transform-origin: right;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.ruler i.is-active {
  transform: none;
  background: var(--ember);
}

.services__loader {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 0.9em;
  color: var(--ink-dim);
  transform: translate(-50%, -50%);
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.services__loader-pct { color: var(--ink-faint); }

.services__stage.is-ready .services__loader { opacity: 0; }
.services__stage.is-failed .loader__track,
.services__stage.is-failed .services__loader-pct { display: none; }

/* ---------- 05 choose your path ---------- */

.paths {
  position: relative;
  height: 520vh;
  height: 520svh;
  background: #0f0e0d;
}

.paths__stage {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 5vw;
  height: 100vh;
  height: 100svh;
  padding: 0 calc(var(--gutter) + 5vw) 0 var(--gutter);
  overflow: hidden;
}

.paths__list {
  display: grid;
  margin: 8vh 0 0;
  padding: 0;
  list-style: none;
}

.paths__item {
  position: relative;
  padding: 0.04em 0;
  border: 0;
  background: none;
  color: #6b635d;
  font-size: clamp(22px, 2.55vw, 46px);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 1.02;
  letter-spacing: -0.005em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.45s ease, transform 0.45s ease;
}

.paths__item:hover { color: #948a83; }

.paths__item.is-active {
  color: var(--ink);
  transform: translateX(0.5em);
}

.paths__item::before {
  content: '';
  position: absolute;
  left: -0.5em;
  top: 50%;
  width: 0.22em;
  height: 0.22em;
  background: var(--ember);
  opacity: 0;
  transform: translateY(-50%) scale(0.4);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.paths__item.is-active::before {
  opacity: 1;
  transform: translateY(-50%);
}

.paths__media {
  margin: 8vh 0 0;
  width: min(100%, 40vw);
}

.paths__frame {
  position: relative;
  aspect-ratio: 1216 / 768;
  overflow: hidden;
  border-radius: 4px;
  background: #1a1816;
}

.paths__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  clip-path: inset(100% 0 0 0);
  transition: opacity 0.6s ease, transform 1.3s cubic-bezier(0.2, 0.7, 0.2, 1), clip-path 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}

.paths__img.is-active {
  z-index: 1;
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

.paths__tag {
  position: absolute;
  z-index: 2;
  top: 0.9em;
  left: 0.9em;
  padding: 0.5em 0.85em;
  border-radius: 999px;
  background: rgba(15, 14, 13, 0.72);
  color: var(--ink);
  backdrop-filter: blur(6px);
}

.paths__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2.4em;
  margin-top: 1.4em;
}

.paths__desc {
  max-width: 44ch;
  color: #b0a8a1;
  font-size: clamp(11px, 0.8vw, 14px);
  line-height: 1.5;
}

.paths__meta {
  display: grid;
  gap: 0.8em;
  margin: 0;
  text-align: right;
}

.paths__meta dt { color: var(--ink-faint); }

.paths__meta dd {
  margin: 0.3em 0 0;
  color: var(--ink);
}

/* ---------- 06 enlist ---------- */

.enlist {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 18vh var(--gutter) 16vh;
  overflow: hidden;
  background: #0c0b0a;
  isolation: isolate;
}

.enlist__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.enlist__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  transform: scale(1.12);
  will-change: transform;
}

.enlist__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #0f0e0d 0%, rgba(15, 14, 13, 0) 28%, rgba(12, 11, 10, 0) 62%, #0c0b0a 100%),
    radial-gradient(110% 85% at 50% 50%, rgba(12, 11, 10, 0.3) 0%, rgba(12, 11, 10, 0.82) 72%);
}

.enlist__word {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: -1;
  display: flex;
  justify-content: center;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.enlist__word span,
.site-foot__word span {
  font-size: 15vw;
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.enlist__word span { color: rgba(243, 238, 232, 0.07); }

.enlist__inner {
  display: grid;
  justify-items: center;
  gap: 1.7em;
  max-width: 56rem;
  text-align: center;
}

.enlist__title {
  font-size: clamp(34px, 5.6vw, 96px);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.enlist__title span { display: block; }

.enlist__copy {
  max-width: 46ch;
  color: #c2bab3;
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.55;
}

.enlist__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
}

.enlist .pill--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: #141210;
}

.enlist .pill--solid .pill__icon { background: rgba(20, 18, 16, 0.1); }
.enlist .pill--solid:hover { background: #fff; }

.enlist__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4em 3.6em;
  margin: 1em 0 0;
  padding: 1.5em 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}

.enlist__facts b {
  display: block;
  margin-bottom: 0.35em;
  font-size: clamp(16px, 1.45vw, 25px);
  font-weight: 850;
  font-stretch: 125%;
  text-transform: uppercase;
}

.enlist__facts span { color: var(--ink-faint); }

[data-reveal] > * {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.9s ease;
}

[data-reveal].is-in > * {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-reveal] > :nth-child(2) { transition-delay: 0.08s; }
[data-reveal] > :nth-child(3) { transition-delay: 0.16s; }
[data-reveal] > :nth-child(4) { transition-delay: 0.24s; }
[data-reveal] > :nth-child(5) { transition-delay: 0.32s; }

/* ---------- footer ---------- */

.site-foot {
  position: relative;
  /* the bottom keeps a row clear for the fixed Members button */
  padding: 10vh var(--gutter) calc(var(--gutter) + 3.4rem + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: #0c0b0a;
}

.site-foot__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  align-items: start;
  gap: 4vw;
}

.site-foot__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-foot__brand p {
  max-width: 26ch;
  margin-top: 0.9em;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.5;
}

.site-foot__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2vw;
}

.site-foot__h {
  margin-bottom: 1.2em;
  color: var(--ink-faint);
}

.site-foot__cols ul {
  display: grid;
  gap: 0.75em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot__cols a {
  font-size: 14px;
  transition: color 0.2s ease;
}

.site-foot__cols a:hover { color: var(--ember); }

.site-foot__word {
  display: flex;
  justify-content: center;
  margin: 8vh 0 0;
  pointer-events: none;
}

.site-foot__word span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 238, 232, 0.16);
}

.site-foot__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8em 2em;
  margin-top: 3vh;
  padding-top: 1.4em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--ink-faint);
}

/* ---------- site menu ---------- */

/* the page holds still behind the open menu (the reserved gutter stops a layout jump) */
html.menu-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(10, 9, 8, 0.87);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.menu.is-open {
  opacity: 1;
  transition-duration: 0.3s;
}

.menu__nav {
  align-self: center;
  padding: 0 var(--gutter) 0 max(14.6vw, calc(var(--gutter) + 2.6em));
}

.menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the lines rise in one after another on open, and all leave together on close */
.menu__list li {
  opacity: 0;
  transform: translateY(18px);
}

.menu.is-open .menu__list li {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) calc(0.08s + var(--i) * 0.045s),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) calc(0.08s + var(--i) * 0.045s);
}

.menu__link {
  position: relative;
  display: inline-block;
  color: #6b635d;                   /* dim, but still 3:1 on the overlay: the floor for large text */
  font-size: min(6vw, 10.5vh);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 0.93;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.menu__link:hover,
.menu__link:focus-visible { color: var(--ink); }

.menu__link:focus-visible {
  outline-offset: 4px;
  border-radius: 4px;
}

/* section number, hung to the left of the line at cap height */
.menu__n {
  position: absolute;
  right: 100%;
  top: 0.45em;
  margin-right: 1.2em;
  color: var(--ember);
  font: var(--label);
  font-stretch: 125%;
  letter-spacing: 0.04em;
}

.menu__hint {
  justify-self: center;
  padding-bottom: calc(var(--gutter) * 0.9 + env(safe-area-inset-bottom, 0px));
  color: var(--ink-faint);
  font: var(--label);
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* nothing to press on a touch screen */
@media (hover: none) {
  .menu__hint { visibility: hidden; }
}

/* ---------- trailer ---------- */

/* the page holds still behind an open player or panel (the reserved gutter stops a layout jump) */
html:has(.trailer[open], .join[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

/* as large as the screen allows at 16:9, leaving room for the header row */
.trailer {
  width: min(92vw, 1440px, calc((100dvh - 7.5rem) * 16 / 9));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.trailer::backdrop {
  background: rgba(12, 10, 9, 0.88);
  backdrop-filter: blur(6px);
}

.trailer[open] { animation: trailer-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.trailer[open]::backdrop { animation: trailer-fade 0.4s ease; }

@keyframes trailer-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes trailer-fade { from { opacity: 0; } }

.trailer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.9rem;
}

.trailer__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.trailer__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- join the society ---------- */

/* a wide panel that slides in from the right: knight on the left, application on the right */
.join {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(1240px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: radial-gradient(90% 70% at 24% 58%, #302b28 0%, var(--bg) 48%, var(--bg-deep) 100%);
  color: var(--ink);
  overflow: hidden;
  box-shadow: -50px 0 120px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.join[open] {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
}

.join.is-open { transform: none; }

.join.is-closing {
  transition-duration: 0.42s;
  transition-timing-function: cubic-bezier(0.55, 0, 0.8, 0.3);
}

.join::backdrop {
  background: rgba(10, 9, 8, 0);
  transition: background-color 0.5s ease, backdrop-filter 0.5s ease;
}

.join.is-open::backdrop {
  background: rgba(10, 9, 8, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* the art column: the hero's canvas is moved in here while Join is open (hero.js); Members
   draws its mining claim into its own canvas (claim.js) */
.join__knight,
.join__claim {
  position: relative;
  overflow: hidden;
}

.join__knight .stage__canvas { opacity: 1; }

.join__claim-3d,
.join__claim-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* the model fades in once it has loaded */
.join__claim-3d {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.join__claim.is-ready .join__claim-3d { opacity: 1; }

.join__knight::after,
.join__claim::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(110% 85% at 50% 52%, transparent 58%, rgba(10, 8, 7, 0.5) 100%),
    linear-gradient(to right, transparent 78%, rgba(18, 15, 14, 0.55) 100%);
  pointer-events: none;
}

/* a low-contrast wordmark behind him, like the hero title */
.join__word {
  position: absolute;
  inset: 17% 0 auto;
  display: flex;
  justify-content: center;
  margin: 0;
  pointer-events: none;
}

.join__word span {
  color: var(--title);
  font-size: clamp(56px, 8.4vw, 118px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

/* right: the application */
.join__panel {
  position: relative;
  display: grid;
  min-height: 0;
  background: linear-gradient(to right, rgba(19, 16, 15, 0.6), rgba(19, 16, 15, 0.88));
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.join__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding:
    calc(clamp(56px, 9vh, 92px) + env(safe-area-inset-top, 0px))
    max(clamp(24px, 3.4vw, 56px), calc((100% - 34rem) / 2))
    calc(clamp(36px, 6vh, 64px) + env(safe-area-inset-bottom, 0px));
}

.join__x {
  position: absolute;
  top: calc(var(--gutter) * 0.55 + env(safe-area-inset-top, 0px));
  right: var(--gutter);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: var(--pill);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.join__x:hover { background: #221e1c; border-color: rgba(255, 255, 255, 0.28); }

.join__title {
  margin-top: 1.1rem;
  font-size: clamp(34px, 3.7vw, 60px);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.join__title span { display: block; }

.join__lede {
  max-width: 44ch;
  margin-top: 1.1rem;
  color: #c2bab3;
  font-size: clamp(13.5px, 1vw, 15.5px);
  line-height: 1.55;
}

.join__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem 0.9rem;
  margin-top: clamp(24px, 4vh, 38px);
}

.join__field { min-width: 0; }

.join__field--full { grid-column: 1 / -1; }

.join__field > label,
.join__paths legend {
  display: flex;
  gap: 0.9em;
  width: 100%;
  margin-bottom: 0.75em;
  padding: 0;
  color: var(--ink-dim);
  font: var(--label);
  font-size: 11px;
  font-stretch: 125%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.join__field > label i,
.join__paths legend i {
  color: var(--ink-faint);
  font-style: normal;
  font-weight: 500;
}

.join__field input,
.join__field select,
.join__field textarea {
  display: block;
  width: 100%;
  height: 3rem;
  padding: 0 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(23, 20, 19, 0.72);
  color: var(--ink);
  font: 400 15px / 1.3 'Archivo', system-ui, sans-serif;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.join__field select {
  padding-right: 2.6rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23b2aaa3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px;
  cursor: pointer;
}

/* nothing chosen yet reads like a placeholder */
.join__field select:has(option[value=""]:checked) { color: var(--ink-faint); }
.join__field option { background: var(--bg-deep); color: var(--ink); }

.join__field textarea {
  height: auto;
  min-height: 6.5rem;
  padding: 0.85rem 1.15rem;
  border-radius: 18px;
  line-height: 1.5;
  resize: vertical;
}

.join__field input::placeholder,
.join__field textarea::placeholder { color: var(--ink-faint); opacity: 1; }

.join__field input:hover,
.join__field select:hover,
.join__field textarea:hover { border-color: rgba(255, 255, 255, 0.18); }

.join__field input:focus-visible,
.join__field select:focus-visible { outline-offset: 2px; }

.join__field textarea:focus-visible {
  outline-offset: 2px;
  border-radius: 18px;              /* the global focus ring rounds everything to a pill */
}

.join [aria-invalid="true"] { border-color: rgba(255, 138, 61, 0.75); }

.join__hint,
.join__error {
  margin-top: 0.55em;
  font-size: 12.5px;
  line-height: 1.45;
}

.join__hint { color: var(--ink-faint); }
.join__error { color: var(--ember-hot); }
.join__form > .join__error { grid-column: 1 / -1; margin-top: -0.6rem; }

/* paths: toggle chips */
.join__paths {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.join__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.join__chip {
  position: relative;
  cursor: pointer;
}

.join__chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.join__chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  height: 2.9em;
  padding: 0 1.2em 0 1em;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill);
  color: var(--ink-dim);
  font: var(--label);
  font-size: 11px;
  font-stretch: 125%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.join__chip span::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.join__chip:hover span { border-color: rgba(255, 255, 255, 0.16); color: var(--ink); }

.join__chip input:checked + span {
  border-color: rgba(255, 138, 61, 0.55);
  background: #241612;
  color: var(--ember);
}

.join__chip input:checked + span::before { opacity: 1; }

.join__chip input:focus-visible + span {
  outline: 1.5px solid var(--ember);
  outline-offset: 3px;
}

/* checkbox row: consent on Join, "keep me signed in" on Members */
.join__check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-top: 0.2rem;
  color: #c2bab3;
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
}

.join__check input {
  display: grid;
  place-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.1rem 0 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(23, 20, 19, 0.72);
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.join__check input::before {
  content: '';
  width: 0.62rem;
  height: 0.34rem;
  border: solid var(--bg-deep);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 0.15s ease;
}

.join__check input:checked {
  border-color: var(--ember);
  background: var(--ember);
}

.join__check input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.join__check input:focus-visible { border-radius: 6px; outline-offset: 3px; }

/* bots fill this in; people never see it */
.join__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.join__status {
  grid-column: 1 / -1;
  padding: 0.85em 1.05em;
  border: 1px solid rgba(255, 138, 61, 0.35);
  border-radius: 14px;
  background: rgba(255, 138, 61, 0.07);
  color: var(--ember-hot);
  font-size: 13.5px;
  line-height: 1.45;
}

.join__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.join__actions .pill,
.join__done .pill {
  height: 3.1em;
  padding-left: 1.4em;
  font-size: 11px;
}

.join__cancel { padding-right: 1.4em; }

.join__submit[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

/* sent */
.join__done {
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  margin-top: clamp(28px, 5vh, 56px);
  outline: none;
}

.join__done-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0;
  border: 1px solid rgba(255, 138, 61, 0.5);
  border-radius: 50%;
}

.join__done-mark::before {
  content: '';
  width: 1rem;
  height: 0.55rem;
  border: solid var(--ember);
  border-width: 0 0 2px 2px;
  transform: translateY(-2px) rotate(-45deg);
}

.join__done-title {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 1;
  text-transform: uppercase;
}

.join__done-copy {
  max-width: 42ch;
  color: #c2bab3;
  font-size: 15px;
  line-height: 1.55;
}

.join__done-name { color: var(--ink); font-weight: 600; }

/* ---------- members: the same panel, mirrored ---------- */

/* form on the left, the knight on the right facing it */
.join--members {
  background: radial-gradient(90% 70% at 76% 58%, #302b28 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

.join--members[open] { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }

.join--members .join__panel {
  border-left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(to left, rgba(19, 16, 15, 0.6), rgba(19, 16, 15, 0.88));
}

.join--members .join__claim::after {
  background:
    radial-gradient(110% 85% at 50% 52%, transparent 58%, rgba(10, 8, 7, 0.5) 100%),
    linear-gradient(to left, transparent 78%, rgba(18, 15, 14, 0.55) 100%);
}

/* sign-in is short: centre it in the column */
.join--members .join__body { align-self: center; }

.join__form--single { grid-template-columns: minmax(0, 1fr); }

/* password with a show / hide toggle inside the field */
.join__secret { position: relative; }

.join__field .join__secret input { padding-right: 5.2rem; }

.join__reveal {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  height: 2.2rem;
  padding: 0 0.95rem;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  background: var(--pill);
  color: var(--ink-dim);
  font: var(--label);
  font-size: 11px;
  font-stretch: 125%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateY(-50%);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.join__reveal:hover,
.join__reveal[aria-pressed="true"] { color: var(--ink); border-color: rgba(255, 255, 255, 0.16); }

.join__switch {
  margin-top: 1.6rem;
  color: var(--ink-faint);
  font-size: 13.5px;
}

.join__switch-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ember);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 138, 61, 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
}

.join__switch-btn:hover { text-decoration-color: var(--ember); }
.join__switch-btn:focus-visible { border-radius: 4px; }

/* loot log under the claim: a line drops in after each extraction, as in game */
.join__loot {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  z-index: 1;                       /* above the column's vignette */
  display: grid;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-dim);
  font: var(--label);
  font-size: 11px;
  font-stretch: 125%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.join__loot li {
  display: flex;
  align-items: center;
  gap: 0.7em;
  animation: loot-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: opacity 0.6s ease;
}

.join__loot li::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: #8dffa6;
}

.join__loot li.is-old { opacity: 0.45; }
.join__loot b { color: var(--ember); font-weight: 700; }

@keyframes loot-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .world { padding-top: 12vh; padding-bottom: 22vh; }
  .world__head { flex-direction: column; gap: 0.6em; margin-bottom: 6vh; }
  .world__text { font-size: clamp(24px, 6.8vw, 36px); }
  .world__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.2em; column-gap: 1.2em; margin-top: 10vh; }

  .services__label,
  .paths__label { top: calc(env(safe-area-inset-top, 0px) + 64px); }

  .contract {
    top: auto;
    left: var(--gutter);
    right: var(--gutter);
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
    width: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1em;
  }

  .services__stage::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(to top, rgba(14, 11, 12, 0.92) 30%, rgba(14, 11, 12, 0));
    pointer-events: none;
  }

  .contract { z-index: 1; }
  .contract__num { grid-row: span 2; font-size: 34px; }
  .contract__cat { margin-top: 0; }
  .contract__title { font-size: 19px; }
  .contract__client,
  .contract__desc { grid-column: 1 / -1; }
  .contract__desc { display: none; }
  .contract__meta,
  .contract__cta { grid-column: 1 / -1; }
  .contract__meta { margin-top: 0.9em; padding-top: 0.8em; }
  .contract__cta { margin-top: 1em; justify-self: start; }

  .filter,
  .ruler { display: none; }

  .paths__stage {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 3.5vh;
    padding: 0 var(--gutter);
  }

  .paths__list { margin-top: 10vh; }
  .paths__item { font-size: clamp(20px, 6.2vw, 28px); }
  .paths__media { width: 100%; margin-top: 0; }
  .paths__caption { grid-template-columns: 1fr; gap: 1em; }
  .paths__meta { grid-auto-flow: column; justify-content: start; gap: 2em; text-align: left; }

  .enlist__facts { gap: 1.2em 2em; }

  /* bigger lines; the long names wrap, with a little air between entries */
  .menu__nav { padding-left: calc(var(--gutter) + 26px); }
  .menu__list li + li { margin-top: 0.14em; }
  .menu__link {
    font-size: 9.4vw;
    white-space: normal;
  }
  .menu__list li { font-size: 9.4vw; }

  /* join: one column, the knight in a band at the top, the whole panel scrolls */
  .join { overflow-y: auto; overscroll-behavior: contain; }
  .join[open] {
    grid-template-columns: 1fr;
    grid-template-rows: 36svh auto;
  }
  .join__word { inset: 14% 0 auto; }
  .join__word span { font-size: 23vw; }
  .join__panel { display: block; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
  .join__body { overflow: visible; padding-top: 2rem; }
  .join__x { position: fixed; }
  .join__form { grid-template-columns: 1fr; }
  .join__actions { justify-content: stretch; }
  .join__actions .pill { flex: 1; justify-content: center; }
  /* members: the knight band leads here too */
  .join--members .join__claim { order: -1; }
  .join--members .join__panel { border-right: 0; }

  .site-foot__top { grid-template-columns: 1fr; gap: 2.4em; }
  .site-foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2em 1em; }
  .to-top { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .world__text.is-armed .world__pill img { transition: none; }
  .paths__img,
  [data-reveal] > * { transition: opacity 0.3s ease; filter: none; transform: none; clip-path: none; }
  .trailer[open],
  .trailer[open]::backdrop { animation: none; }
  .menu__list li,
  .menu.is-open .menu__list li { transform: none; transition: none; }
  /* the panel fades in place instead of sliding */
  .join,
  .join.is-open { transform: none; transition: opacity 0.25s ease; }
  .join { opacity: 0; }
  .join.is-open { opacity: 1; }
}
