:root {
  color-scheme: dark;
  --bg: #14110d;
  --bg-soft: #211a14;
  --paper: #efe2c8;
  --paper-muted: #cdbb9d;
  --ink: #fff8ea;
  --muted: #b9aa91;
  --line: rgba(239, 226, 200, 0.16);
  --gold: #d49d43;
  --red: #9e302a;
  --green: #526c55;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius: 8px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ead9;
  --bg-soft: #e3d1b3;
  --paper: #fff5df;
  --paper-muted: #6d5639;
  --ink: #21170f;
  --muted: #725b3d;
  --line: rgba(57, 39, 23, 0.18);
  --gold: #9f672b;
  --red: #8f312d;
  --green: #526c55;
  --shadow: 0 18px 48px rgba(78, 48, 21, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(158, 48, 42, 0.22), transparent 27rem),
    linear-gradient(180deg, #17120e 0%, #0e0c0a 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(212, 157, 67, 0.26), transparent 27rem),
    linear-gradient(180deg, #fbf4e7 0%, #ead8bd 100%);
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(20, 17, 13, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .site-header {
  background: rgba(250, 241, 224, 0.86);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-right: auto;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(212, 157, 67, 0.55);
  background: #24190f;
  color: var(--gold);
  font-family: Rye, Georgia, serif;
  font-size: 1.05rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-weight: 800;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0;
  color: var(--paper-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-group {
  position: relative;
  display: flex;
}

.nav-group::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 0.45rem;
  content: "";
}

.nav-group + .nav-group {
  margin-left: -1px;
}

.nav-group + a,
.main-nav > a + .nav-group {
  margin-left: -1px;
}

.main-nav > a,
.nav-group > summary {
  position: relative;
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(239, 226, 200, 0.2);
  border-radius: 0;
  background: rgba(239, 226, 200, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 248, 234, 0.08);
  color: var(--paper-muted);
  cursor: pointer;
  list-style: none;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  width: 0.42rem;
  height: 0.42rem;
  margin-left: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  opacity: 0.72;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 140ms ease;
}

.nav-group[open] > summary::after,
.nav-group:hover > summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.main-nav > a + a {
  margin-left: -1px;
}

.main-nav > a:first-child,
.nav-group:first-child > summary {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.main-nav > a:hover,
.nav-group:hover > summary,
.nav-group[open] > summary {
  z-index: 1;
  border-color: rgba(212, 157, 67, 0.62);
  background: rgba(212, 157, 67, 0.16);
  color: var(--ink);
}

.main-nav > a:focus-visible,
.nav-group > summary:focus-visible,
.nav-menu a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.nav-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.45rem);
  left: 0;
  display: grid;
  min-width: 12rem;
  padding: 0.35rem;
  border: 1px solid rgba(239, 226, 200, 0.18);
  border-radius: var(--radius);
  background: rgba(20, 17, 13, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
  visibility: hidden;
}

.nav-group:last-child .nav-menu {
  right: 0;
  left: auto;
}

.nav-group:hover .nav-menu,
.nav-group[open] .nav-menu,
.nav-group:focus-within .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.nav-menu a {
  display: flex;
  min-height: 2.35rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--paper-muted);
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: rgba(212, 157, 67, 0.16);
  color: var(--ink);
}

html[data-theme="light"] .main-nav > a,
html[data-theme="light"] .nav-group > summary {
  border-color: rgba(57, 39, 23, 0.18);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
  color: #5c4228;
}

html[data-theme="light"] .main-nav > a:hover,
html[data-theme="light"] .nav-group:hover > summary,
html[data-theme="light"] .nav-group[open] > summary {
  border-color: rgba(159, 103, 43, 0.55);
  background: rgba(255, 245, 223, 0.86);
  color: var(--ink);
}

html[data-theme="light"] .nav-menu {
  border-color: rgba(57, 39, 23, 0.18);
  background: rgba(255, 248, 234, 0.96);
}

html[data-theme="light"] .nav-menu a {
  color: #5c4228;
}

html[data-theme="light"] .nav-menu a:hover {
  background: rgba(159, 103, 43, 0.12);
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  gap: 0.55rem;
  margin-left: -1px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(239, 226, 200, 0.08);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 900;
}

.theme-toggle:hover {
  border-color: rgba(212, 157, 67, 0.55);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.theme-toggle-track {
  position: relative;
  width: 2.35rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(239, 226, 200, 0.22);
  box-shadow: inset 0 0 0 1px var(--line);
}

.theme-toggle-thumb {
  position: absolute;
  top: 0.18rem;
  left: 0.2rem;
  width: 0.88rem;
  height: 0.88rem;
  border-radius: 50%;
  background: var(--gold);
  transition: transform 160ms ease;
}

html[data-theme="light"] .theme-toggle {
  border-color: rgba(57, 39, 23, 0.18);
  background: rgba(255, 255, 255, 0.46);
}

html[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(1.08rem);
}

.site-header:not(:has(.main-nav)) .theme-toggle {
  margin-left: 0;
  border-radius: var(--radius);
}

.hero {
  position: relative;
  display: grid;
  min-height: 92svh;
  align-items: end;
  overflow: hidden;
  padding: 8.5rem clamp(1rem, 5vw, 5rem) 4rem;
  border-bottom: 1px solid var(--line);
  color: #fff8ea;
}

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

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.05);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(14, 12, 10, 0.92), rgba(14, 12, 10, 0.42) 58%, rgba(14, 12, 10, 0.72)),
    linear-gradient(180deg, rgba(14, 12, 10, 0.26), rgba(14, 12, 10, 0.92));
}

.hero-content {
  width: min(48rem, 100%);
}

.hero-logo {
  display: block;
  width: clamp(9rem, 18vw, 15rem);
  height: auto;
  margin: 0 0 1.2rem;
  border-radius: 50%;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Rye, Georgia, serif;
  font-weight: 400;
  line-height: 1.04;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1.1rem;
  font-size: clamp(3.2rem, 8vw, 7.4rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 4rem);
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
}

.hero-copy {
  max-width: 42rem;
  color: #efe2c8;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero h1 {
  max-width: 100%;
  font-size: clamp(1.9rem, 7vw, 7.4rem);
  white-space: nowrap;
  color: #fff8ea;
}

.hero-actions,
.connect-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
}

.button.icon-button {
  width: 3rem;
  padding: 0.8rem;
}

.button-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button.primary {
  background: var(--gold);
  color: #211309;
}

.button.secondary {
  border-color: rgba(239, 226, 200, 0.28);
  background: rgba(239, 226, 200, 0.08);
  color: var(--ink);
}

.button.teamspeak {
  border-color: rgba(82, 151, 255, 0.62);
  background: rgba(82, 151, 255, 0.12);
  color: #eef5ff;
}

.button.teamspeak:hover {
  background: rgba(82, 151, 255, 0.18);
}

.button.ts3-info,
.social-button.ts3-info {
  cursor: default;
  user-select: text;
  white-space: nowrap;
}

.button.step-action.ts3-info {
  width: auto;
  min-width: 10.6rem;
}

html[data-theme="light"] .button.teamspeak {
  color: #15345e;
}

.button.discord {
  border-color: rgba(88, 101, 242, 0.72);
  background: rgba(88, 101, 242, 0.16);
  color: #f2f3ff;
}

.button.discord:hover {
  background: rgba(88, 101, 242, 0.24);
}

html[data-theme="light"] .button.discord {
  color: #26307c;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.social-button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(239, 226, 200, 0.22);
  border-radius: var(--radius);
  background: rgba(13, 11, 9, 0.68);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.social-button.icon-only {
  width: 2.85rem;
  padding: 0;
}

.social-button:hover {
  transform: translateY(-1px);
  background: rgba(239, 226, 200, 0.1);
}

.social-button.ts3-info:hover {
  transform: none;
}

.social-button svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.social-button.discord {
  border-color: rgba(88, 101, 242, 0.7);
}

.social-button.teamspeak {
  border-color: rgba(82, 151, 255, 0.62);
}

.social-button.mastodon {
  border-color: rgba(99, 100, 255, 0.68);
}

html[data-theme="light"] .social-button {
  background: rgba(255, 248, 234, 0.9);
  color: #21170f;
  border-color: rgba(57, 39, 23, 0.18);
  box-shadow: 0 10px 30px rgba(78, 48, 21, 0.18);
}

html[data-theme="light"] .social-button:hover {
  background: #fff8ea;
}

html[data-theme="light"] .social-button.discord {
  border-color: rgba(88, 101, 242, 0.55);
}

html[data-theme="light"] .social-button.teamspeak {
  border-color: rgba(82, 151, 255, 0.5);
}

html[data-theme="light"] .social-button.mastodon {
  border-color: rgba(99, 100, 255, 0.55);
}

.server-stats {
  display: grid;
  width: min(34rem, 100%);
  grid-template-columns: minmax(6.5rem, 0.85fr) minmax(6.5rem, 0.85fr) minmax(13rem, 1.5fr);
  gap: 1px;
  margin: 2rem 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.server-stats div {
  padding: 1rem;
  background: rgba(20, 17, 13, 0.72);
}

.server-stats dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.server-stats dd {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.discord-stat-values {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 1.1rem;
  align-items: start;
  padding-top: 0.18rem;
}

.discord-stat-values span {
  display: grid;
  gap: 0.1rem;
  align-content: start;
  min-width: 0;
}

.discord-stat-values strong {
  display: block;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.2;
}

.discord-stat-values small {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--paper-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #35d075;
  box-shadow: 0 0 0 0.2rem rgba(53, 208, 117, 0.16);
}

html[data-theme="light"] .server-stats {
  border-color: rgba(57, 39, 23, 0.18);
  background: rgba(57, 39, 23, 0.16);
}

html[data-theme="light"] .server-stats div {
  background: rgba(255, 248, 234, 0.9);
}

html[data-theme="light"] .server-stats dt {
  color: #725b3d;
}

html[data-theme="light"] .server-stats dd {
  color: #21170f;
}

html[data-theme="light"] .discord-stat-values strong {
  color: #21170f;
}

html[data-theme="light"] .discord-stat-values small {
  color: #725b3d;
}

.intro,
.section,
.split-section,
.rules,
.lore-section {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 5vw, 5rem);
}

.intro {
  background: var(--paper);
  color: #21170f;
}

.intro p {
  width: min(92rem, 100%);
  margin: 0 auto;
  font-size: clamp(1.3rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.3;
}

.intro-lead {
  display: block;
  margin-bottom: clamp(0.85rem, 2vw, 1.35rem);
}

.section-heading {
  width: min(44rem, 100%);
  margin-bottom: 2rem;
}

.section-copy {
  max-width: 42rem;
  color: var(--paper-muted);
  font-size: 1.02rem;
}

.start-guide {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

#start-title {
  max-width: 100%;
  font-size: clamp(1.25rem, 3.6vw, 3.3rem);
  white-space: nowrap;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-section {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(6rem, 11vw, 9rem);
}

.feature-section::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: clamp(4.5rem, 8vw, 7rem);
  background: var(--bg-soft);
  clip-path: polygon(0 20%, 100% 74%, 100% 100%, 0 100%);
  content: "";
  pointer-events: none;
}

.feature-section > * {
  position: relative;
  z-index: 1;
}

.feature-roles {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(18rem, 1.15fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.step-card {
  display: flex;
  flex-direction: column;
  min-height: 15rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.step-action {
  width: min(100%, 10.6rem);
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.step-card > .step-action,
.step-card > .step-actions,
.step-card > .step-note {
  margin-top: auto;
}

.step-note {
  display: inline-flex;
  width: min(100%, 10.6rem);
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(212, 157, 67, 0.45);
  border-radius: var(--radius);
  background: rgba(212, 157, 67, 0.1);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.step-number {
  display: inline-grid;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1.8rem;
  place-items: center;
  border: 1px solid rgba(212, 157, 67, 0.5);
  border-radius: 50%;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
}

.feature-card,
.job-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

html[data-theme="light"] .feature-card,
html[data-theme="light"] .step-card,
html[data-theme="light"] .job-list article,
html[data-theme="light"] .about-panel article,
html[data-theme="light"] .toc,
html[data-theme="light"] .rule-block {
  background: rgba(255, 255, 255, 0.42);
}

.feature-card {
  min-height: 15rem;
  padding: 1.3rem;
}

.feature-card .icon {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 2.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
}

.feature-card .icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.feature-card p,
.job-list p,
.rules li,
.split-section p {
  color: var(--paper-muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.job-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.job-list article {
  padding: 1.2rem;
}

.rules {
  background:
    linear-gradient(rgba(20, 17, 13, 0.88), rgba(20, 17, 13, 0.94)),
    url("assets/the-land-1903-bg.png") center/cover;
  color: #fff8ea;
}

#rules-title {
  max-width: 100%;
  font-size: clamp(1.35rem, 4.2vw, 4rem);
  white-space: nowrap;
}

.rules .section-copy,
.rules .law-card p {
  color: #cdbb9d;
}

.law-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.law-card {
  display: block;
  min-height: 14rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.07);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

html[data-theme="light"] .rules .law-card {
  background: rgba(13, 11, 9, 0.58);
}

html[data-theme="light"] .rules .featured-law {
  background: rgba(120, 74, 32, 0.55);
}

.law-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 157, 67, 0.6);
  background: rgba(239, 226, 200, 0.1);
}

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

.featured-law {
  background: rgba(212, 157, 67, 0.13);
}

.law-icon {
  display: inline-grid;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 1.2rem;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(13, 11, 9, 0.72);
  color: var(--gold);
}

.law-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.law-card p,
.step-card p,
.about-panel p {
  color: var(--paper-muted);
}

.about-panel {
  display: grid;
  gap: 1rem;
}

.about-panel article {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.lore-section {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(6rem, 11vw, 9rem);
  background: var(--bg-soft);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.lore-section::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: clamp(4.5rem, 8vw, 7rem);
  background: var(--bg);
  clip-path: polygon(0 72%, 100% 18%, 100% 100%, 0 100%);
  content: "";
  pointer-events: none;
}

.lore-section > * {
  position: relative;
  z-index: 1;
}

.lore-section .eyebrow {
  color: var(--gold);
}

.lore-section .section-copy {
  color: var(--paper-muted);
}

.lore-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.lore-card {
  min-height: 16rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.lore-card h3 {
  color: var(--gold);
  font-size: clamp(1.15rem, 1.35vw, 1.45rem);
}

.lore-card p {
  color: var(--paper-muted);
}

html[data-theme="light"] .lore-section {
  background: var(--paper);
  color: #21170f;
}

html[data-theme="light"] .lore-section::after {
  background: var(--bg);
}

html[data-theme="light"] .lore-section .eyebrow {
  color: var(--red);
}

html[data-theme="light"] .lore-section .section-copy {
  color: #654d31;
}

html[data-theme="light"] .lore-card {
  border-color: rgba(33, 23, 15, 0.18);
  background: rgba(255, 248, 234, 0.58);
}

html[data-theme="light"] .lore-card p {
  color: #5f4a31;
}

.connect-box {
  justify-content: center;
  margin-top: 1.6rem;
}

code {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  max-width: 100%;
  padding: 0.75rem 1rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0b09;
  color: var(--paper);
  font-size: 0.95rem;
}

.footer-social-bar {
  padding: 1.15rem clamp(1rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  background: rgba(13, 11, 9, 0.56);
}

.footer-social-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
}

.footer-connect-code {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 11, 9, 0.68);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.footer-social-inner .ts3-info {
  min-height: 2.85rem;
  padding: 0.68rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1;
}

.footer-connect-code:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 157, 67, 0.55);
  background: rgba(239, 226, 200, 0.1);
}

html[data-theme="light"] .footer-connect-code {
  background: rgba(255, 248, 234, 0.9);
  color: #21170f;
  border-color: rgba(57, 39, 23, 0.18);
}

html[data-theme="light"] .footer-social-bar {
  background: rgba(255, 248, 234, 0.48);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-end;
}

.footer-links a {
  color: inherit;
}

.document-page {
  background: var(--bg);
}

.document-main {
  padding: 8rem clamp(1rem, 5vw, 5rem) 4rem;
}

.document-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.document-hero h1 {
  max-width: 15ch;
}

.document-hero p {
  max-width: 48rem;
  color: var(--paper-muted);
}

.document-logo {
  width: clamp(7rem, 14vw, 12rem);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.document-layout > * {
  min-width: 0;
}

.rulebook-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 clamp(1.5rem, 4vw, 3rem);
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.rulebook-switcher a {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
  color: var(--paper-muted);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.rulebook-switcher a:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 157, 67, 0.55);
  background: rgba(239, 226, 200, 0.1);
  color: var(--ink);
}

.rulebook-switcher a.is-current {
  border-color: rgba(212, 157, 67, 0.75);
  background: rgba(212, 157, 67, 0.16);
  color: var(--ink);
}

html[data-theme="light"] .rulebook-switcher,
html[data-theme="light"] .rulebook-switcher a {
  background: rgba(255, 255, 255, 0.42);
}

.toc {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 0.55rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.toc strong {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.toc a {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
  color: var(--paper-muted);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

html[data-theme="light"] .toc a {
  background: rgba(255, 255, 255, 0.5);
}

.toc a:hover {
  transform: translateX(2px);
  border-color: rgba(212, 157, 67, 0.55);
  background: rgba(239, 226, 200, 0.1);
  color: var(--ink);
}

.toc a.is-current {
  border-color: rgba(212, 157, 67, 0.75);
  background: rgba(212, 157, 67, 0.16);
  color: var(--ink);
}

.toc a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.document-content {
  display: grid;
  gap: 1rem;
}

.legal-content {
  max-width: 62rem;
}

.legal-content a {
  color: var(--gold);
}

.legal-content code {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: rgba(13, 11, 9, 0.35);
  color: var(--ink);
}

.rule-block {
  min-width: 0;
  scroll-margin-top: 6rem;
  overflow-x: auto;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 226, 200, 0.06);
}

.rule-block h2 {
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
}

.rule-block h3 {
  margin-top: 1.4rem;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.document-date {
  margin-top: -0.45rem;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 800;
}

.rule-block p,
.rule-block li {
  color: var(--paper-muted);
}

.rule-block ul,
.rule-block ol {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.rule-list,
.rule-definitions {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.rule-list {
  padding-left: 0;
  list-style: none;
}

.rule-list li,
.rule-definitions div {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(239, 226, 200, 0.12);
  border-radius: var(--radius);
  background: rgba(13, 11, 9, 0.18);
}

.rule-list strong,
.rule-definitions dt {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gold);
  font-weight: 900;
}

.rule-definitions {
  margin-bottom: 1.2rem;
}

.rule-definitions dt {
  margin-bottom: 0.25rem;
}

.rule-definitions dd {
  margin: 0;
  color: var(--paper-muted);
}

html[data-theme="light"] .rule-list li,
html[data-theme="light"] .rule-definitions div {
  border-color: rgba(57, 39, 23, 0.12);
  background: rgba(255, 255, 255, 0.36);
}

.rule-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.rule-table th,
.rule-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rule-table th {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.rule-table td {
  color: var(--paper-muted);
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
  }

  .main-nav {
    display: none;
  }

  .theme-toggle {
    margin-left: 0;
    border-radius: var(--radius);
  }

  .hero {
    min-height: auto;
    align-items: start;
    padding-top: 7.5rem;
  }

  .feature-grid,
  .step-grid,
  .law-grid,
  .split-section,
  .feature-roles,
  .job-list,
  .lore-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  .feature-card .icon {
    margin-bottom: 1rem;
  }

  .site-footer {
    flex-direction: column;
  }

  .document-main {
    padding-top: 7.5rem;
  }

  .document-hero,
  .document-layout {
    grid-template-columns: 1fr;
  }

  .rulebook-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc {
    position: static;
  }
}

@media (max-width: 520px) {
  .hero-actions .button:not(.icon-button),
  .social-button:not(.icon-only),
  .connect-box .button,
  .footer-connect-code,
  code {
    width: 100%;
  }

  h1 {
    font-size: 3.1rem;
  }

  .rulebook-switcher {
    grid-template-columns: 1fr;
  }
}
