:root {
  color-scheme: dark;
  --background: #130f0e;
  --ink: #eee1c5;
  --muted: #c4b394;
  --gold: #d7aa66;
  --gold-light: #f5d497;
  --bronze: #765538;
  --dark-edge: #34241a;
  --paper-ink: #302016;
  --paper-accent: #78341d;
  --display: Georgia, "Times New Roman", serif;
  --body: Verdana, Geneva, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-width: 280px;
  background: radial-gradient(ellipse at top, #52271870, transparent 40rem), url("assets/stone.webp"), var(--background);
  color: var(--ink);
  font: 0.9rem/1.75 var(--body);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
p, h1, h2, h3, figure { margin: 0; }
::selection { color: #1d1008; background: var(--gold-light); }
:focus-visible { outline: 2px solid #f6bf68; outline-offset: 4px; }
.paper :focus-visible { outline-color: #792d19; }

.shell { width: min(69rem, calc(100% - 3rem)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 5;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--gold-light);
  color: var(--paper-ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(#28201a, #17120f 60%, #120e0c);
  border-block: 1px solid #534031;
  box-shadow: 0 3px 12px #0008;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--gold-light); text-decoration: none; }
.brand img { width: 2.375rem; height: 2.375rem; }
.brand span { font: bold small-caps 1.2rem/1 var(--display); white-space: nowrap; }
.site-nav { display: flex; gap: 0.2rem; align-self: stretch; align-items: end; }
.site-nav a {
  display: grid;
  min-height: 2.35rem;
  place-items: center;
  padding: 0.2rem 1.2rem;
  border: 1px solid #564130;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#37291f, #241b16);
  color: var(--muted);
  font: bold 0.81rem/1.2 var(--display);
  text-align: center;
  text-decoration: none;
}

.site-nav a:hover, .site-nav a[aria-current="location"] {
  border-color: var(--bronze);
  background: linear-gradient(#653b28, #3a2118);
  color: var(--gold-light);
}

.header-discord { color: var(--gold-light); font-weight: bold; font-size: 0.75rem; text-decoration: none; white-space: nowrap; }
.header-discord:hover { text-decoration: underline; }
.header-discord span { margin-left: 0.25rem; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 1.65rem;
  background: #17100d;
  border: 1px solid var(--bronze);
  box-shadow: 0 0 0 3px #16100d, 0 0 0 4px #473120, 0 0.75rem 1.5rem #0007;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 0.35rem;
  border: 1px solid #d6ab7054;
}

.hero-media { position: absolute; z-index: -1; inset: 0 0 0 38%; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--art-x, 50%) var(--art-y, 35%); }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #17100d 0%, #17100dc9 16%, transparent 56%),
    linear-gradient(0deg, #160e0cf5, #160e0c22 38%, #160e0c00 72%, #160e0c42);
}

.hero-inner { display: flex; min-height: clamp(25rem, 45vw, 32rem); flex-direction: column; justify-content: space-between; }
.hero-copy { position: relative; padding: clamp(2.7rem, 5.5vw, 4.35rem) clamp(1.4rem, 5vw, 3.75rem) 1.5rem; }
.eyebrow { display: flex; align-items: center; gap: 0.6em; color: var(--gold); font: bold 0.68rem/1.4 var(--body); letter-spacing: 0.13em; text-transform: uppercase; }
.diamond { display: inline-block; flex: none; width: 0.43rem; height: 0.43rem; margin-inline: 0.16rem; background: currentColor; transform: rotate(45deg); }
.separator { margin-inline: 0.15rem; opacity: 0.75; }

h1 {
  margin: 0.9rem 0 1.05rem;
  color: #f5d69a;
  font: bold small-caps clamp(3.45rem, 8vw, 6rem)/0.78 var(--display);
  letter-spacing: -0.065em;
  text-shadow: 0 1px #6f4026, 0 3px #3b2015, 0 6px 14px #000;
}

.hero-grin { display: inline-block; font-size: 1.2em; margin-top: 0.03em; }
.hero-description { max-width: 26rem; color: #eee2c9; text-shadow: 0 1px 3px #000, 0 1px 5px #000; }
.hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 2.7rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--bronze);
  border-top-color: #b98b57;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #0006, 0 2px 2px #0008;
  color: #f7dfac;
  font: bold 0.91rem/1.2 var(--display);
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px #000;
}

.button-primary { background: linear-gradient(#85442d, #542718 55%, #3a1d14); }
.button-outline, .button-dark { background: linear-gradient(#382b23, #1e1713 55%, #140f0d); }
.button-primary:hover { background: linear-gradient(#a45737, #65301f 55%, #4a2417); }
.button-outline:hover, .button-dark:hover { background: linear-gradient(#584232, #32231a 55%, #221610); }
.button:active { transform: translateY(1px); }
.hero-foot { display: flex; justify-content: space-between; align-items: end; gap: 0.8rem; padding: 0 1.1rem 0.75rem; font-size: 0.66rem; }
.hero-foot a { color: var(--muted); text-decoration: none; }
.hero-foot a:hover { text-decoration: underline; }
.scroll-link span { color: var(--gold-light); margin-right: 0.3rem; }

.guild-bar {
  position: relative;
  margin-top: 0.55rem;
  border: 1px solid var(--bronze);
  background: linear-gradient(#493322, #2b2019 53%, #211713);
  box-shadow: inset 0 0 0 2px #251912;
}

.guild-bar-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.guild-bar-inner > * {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 2.65rem;
  padding: 0.4rem 0.3rem;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 0.075em;
  text-align: center;
  text-transform: uppercase;
}

.guild-bar-inner > * + * { border-left: 1px solid #765538; }
.guild-bar-inner .diamond, .guild-bar-inner a { color: var(--gold-light); }
.guild-bar-inner a { text-underline-offset: 0.2em; }
.guild-bar-inner a:hover { background: #6c422766; }

.paper, .lore, .join {
  margin-top: 1.1rem;
  border: 1px solid var(--bronze);
  padding: clamp(1.6rem, 4.4vw, 3.35rem) clamp(1.2rem, 5vw, 3.65rem);
  box-shadow: 0 0 0 2px #170f0c, 0 0 0 3px #483221, 0 0.65rem 1.2rem #0004;
}

.paper {
  color-scheme: light;
  background: radial-gradient(ellipse at 40% 30%, #f4e7c577, #94643c38), url("assets/parchment.webp"), #ddc69d;
  color: var(--paper-ink);
  box-shadow: inset 0 0 1.2rem #633a2955, 0 0 0 2px #170f0c, 0 0 0 3px #483221;
}

.paper .eyebrow, .paper .text-link { color: var(--paper-accent); }
h2 { font: bold small-caps clamp(2rem, 5.5vw, 3.55rem)/0.99 var(--display); letter-spacing: -0.045em; }
.eyebrow + h2 { margin-top: 0.45rem; }
.guild-inner, .join-inner, .faq-inner { display: grid; align-items: start; gap: 1.35rem 3rem; }
.guild-inner { grid-template-columns: 0.95fr 1.25fr; }
.guild-copy > * + * { margin-top: 0.75rem; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--gold-light);
  font: bold 0.93rem/1.5 var(--display);
  text-underline-offset: 0.23em;
}

.text-link:hover { text-decoration-thickness: 2px; }
.lore { background: linear-gradient(#221812dc, #19130fed), url("assets/stone.webp"), #1a130f; }
.lore-heading, .join h2 { color: var(--gold-light); }
.lore-layout { display: grid; grid-template-columns: 0.76fr 1.24fr; gap: 1.65rem 2.65rem; align-items: start; margin-top: 1.5rem; }
.lore-figure { min-width: 0; }
.banner-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: radial-gradient(ellipse at center, #f3e3be55, #91664444), url("assets/parchment.webp"), #ddc69d;
  border: 1px solid #b28b5b;
  box-shadow: inset 0 0 0 4px #986f44, inset 0 0 0 5px #4e3324, inset 0 0 1.4rem #714b34;
}

.banner-art img { width: min(100%, 16.5rem); height: auto; mix-blend-mode: multiply; }
.lore-figure figcaption { margin-top: 0.45rem; color: var(--muted); font: italic 0.81rem/1.4 var(--display); text-align: center; }
.lore-chapters { border-top: 1px solid var(--bronze); }
details > summary {
  display: grid;
  align-items: center;
  gap: 0.8rem;
  grid-template-columns: 1fr 1rem;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
.lore-chapters details { border-bottom: 1px solid var(--bronze); }
.lore-chapters summary {
  grid-template-columns: 1.75rem 1fr 1rem;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  font: bold 1.1rem/1.3 var(--display);
}

.lore-chapters summary:hover, .lore-chapters details[open] summary { background: linear-gradient(90deg, #4a3022, #2d2018); color: var(--gold-light); }
.chapter-number { color: var(--gold); font: bold 0.7rem/1 var(--display); letter-spacing: 0.07em; }
.disclosure { position: relative; width: 0.7rem; height: 0.7rem; color: var(--gold); }
.disclosure::before, .disclosure::after { content: ""; position: absolute; inset: calc(50% - 0.5px) 0 auto; height: 1px; background: currentColor; }
.disclosure::after { transform: rotate(90deg); }
details[open] .disclosure::after { display: none; }
.chapter-copy { padding: 0.8rem 0.9rem 1rem 3.4rem; color: var(--muted); }

.join { background: radial-gradient(ellipse at 0% 15%, #703922, transparent 75%), linear-gradient(#432117bb, #2a1611ea), url("assets/stone.webp"), #402117; }
.join-inner { grid-template-columns: 0.78fr 1.22fr; align-items: center; }
.join-copy .button { margin-top: 1rem; }
.invite { padding: clamp(0.95rem, 2.5vw, 1.55rem); border: 1px solid #a27349; background: #18120e; box-shadow: inset 0 0 0 2px #3c281c, 0 2px 4px #0006; }
.invite h3 { margin-top: 0.28rem; color: var(--gold-light); font: bold 1.45rem/1.25 var(--display); }
.invite > p:not(.eyebrow) { margin-top: 0.48rem; color: var(--muted); }
.command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
  padding: 0.35rem 0.4rem 0.35rem 0.65rem;
  border: 1px solid #634731;
  background: #0d0a08;
  color: var(--gold-light);
}

code { font: 0.95em/1.5 var(--mono); }
.command code { user-select: all; }
.copy-command {
  cursor: pointer;
  padding: 0.25rem 0.65rem;
  border: 1px solid #87613e;
  background: linear-gradient(#493224, #241a14);
  color: var(--gold-light);
  font-size: 0.7rem;
}

.copy-command:hover { background: #5c3c28; }
.faq-inner { grid-template-columns: 0.7fr 1.3fr; }
.faq-questions { border-top: 1px solid #956d4e; }
.faq-questions details { border-bottom: 1px solid #956d4e; }
.faq-questions summary { padding: 0.7rem 0; color: #552818; font: bold 1.02rem/1.35 var(--display); }
.faq-questions summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.faq-questions .disclosure, .faq-questions a { color: var(--paper-accent); }
.faq-questions p { padding: 0 1.5rem 0.8rem 0; }

.site-footer { padding: 1.5rem 0 2.1rem; color: var(--muted); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem; padding-top: 0.7rem; border-top: 1px solid #674b34; margin-top: 0.7rem; font-size: 0.68rem; }
.footer-bottom a { text-underline-offset: 0.2em; }
.footer-bottom a:hover { color: var(--gold-light); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-media img {
    object-position: calc(var(--art-x, 50%) + var(--art-pan, 0%)) calc(var(--art-y, 35%) + var(--art-pan, 0%));
  }

  .hero-copy > * { animation: rise-in 650ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero-copy h1 { animation-delay: 70ms; }
  .hero-description { animation-delay: 150ms; }
  .hero-actions { animation-delay: 230ms; }
  .reveal.is-entering { animation: rise-in 620ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  :is(.guild-copy, .invite, .lore-chapters, .faq-questions).is-entering { animation-delay: 90ms; }

  @keyframes rise-in {
    from { opacity: 0.8; transform: translateY(1.65rem); }
    to { opacity: 1; transform: translateY(0); }
  }

  details[open] > :is(.chapter-copy, p) { animation: unfold-in 240ms ease-out; }

  @keyframes unfold-in {
    from { opacity: 0.65; transform: translateY(-0.35rem); }
    to { opacity: 1; transform: translateY(0); }
  }

  .button { transition: transform 180ms ease, box-shadow 180ms ease; }
  .button:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px #0006, 0 4px 7px #0008; }
  .button:active { transform: translateY(1px); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 7rem; }
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { flex-wrap: wrap; gap: 0; padding-top: 0.15rem; }
  .site-nav { width: 100%; order: 1; }
  .site-nav a { flex: 1; padding-inline: 0.35rem; min-height: 2.2rem; }
  .hero { margin-top: 0.85rem; }
  .hero-inner { min-height: 27rem; }
  .hero-media { inset-inline-start: 0; --art-x: 58%; --art-y: 30%; }
  .hero-media::after { background: linear-gradient(90deg, #17100dcf, #17100d31), linear-gradient(0deg, #17100d 0%, #17100da0 40%, #17100d25 100%); }
  .guild-inner, .join-inner, .faq-inner { grid-template-columns: 1fr; }
  .lore-layout { column-gap: 1rem; }
}

@media (max-width: 510px) {
  .hero-copy { padding: 2.55rem 1.1rem 1.2rem; }
  .hero-copy .eyebrow { flex-wrap: wrap; gap: 0.45em; }
  h1 { font-size: clamp(2.8rem, 12vw, 4rem); }
  .guild-bar-inner { grid-template-columns: 1fr 1fr; }
  .guild-bar-inner > :nth-child(n + 3) { border-top: 1px solid var(--bronze); }
  .guild-bar-inner > :nth-child(3) { border-left: 0; }
  .lore-layout { grid-template-columns: 1fr; }
  .banner-art img { width: min(100%, 12rem); }
  .lore-chapters summary { padding-inline: 0.55rem; }
  .chapter-copy { padding-left: 1.1rem; }
  .footer-top .brand span { font-size: 1rem; }
}
