:root {
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-display: Cinzel, Georgia, serif;
  --color-night: #05070d;
  --color-ink: #f8f1df;
  --color-parchment: #f0e5cc;
  --color-muted: #aaaec0;
  --color-dim: #696e82;
  --color-faint: #747b91;
  --color-quiet: #858ba3;
  --color-soft: #969caf;
  --color-bright: #cbd0e4;
  --color-gold: #e9c46a;
  --color-gold-bright: #ffe39a;
  color-scheme: dark;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-night);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(56, 76, 171, 0.2), transparent 28rem),
    radial-gradient(circle at 15% 80%, rgba(129, 77, 180, 0.12), transparent 34rem),
    linear-gradient(145deg, #080b14, #030409 65%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(226, 197, 124, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 197, 124, 0.07) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(ellipse at center, #000 5%, transparent 70%);
}

.aurora {
  position: fixed;
  width: 60rem;
  height: 60rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.13;
  background: conic-gradient(from 45deg, transparent, #6078ff, #d7a93e, transparent 45%);
  animation: drift 18s linear infinite;
}

.stars,
.stars::before,
.stars::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 76% 12%, rgba(246, 211, 129, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 89% 62%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 27% 83%, rgba(119, 146, 255, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 62% 77%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.5px);
}

.stars::before {
  transform: rotate(52deg) scale(0.84);
  opacity: 0.7;
}

.stars::after {
  transform: rotate(108deg) scale(0.7);
  opacity: 0.45;
}

main {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(240px, 0.84fr) 1.16fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
  width: min(94vw, 1080px);
  min-width: 0;
  min-height: min(88svh, 760px);
  margin: 3rem auto;
  padding: clamp(2rem, 6vw, 5rem);
  overflow: hidden;
  border: 1px solid rgba(233, 196, 106, 0.26);
  border-radius: 4px 56px 4px 56px;
  background: linear-gradient(135deg, rgba(15, 20, 36, 0.94), rgba(5, 7, 14, 0.86));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    inset 0 0 80px rgba(68, 88, 184, 0.08);
  backdrop-filter: blur(20px);
}

main::before,
main::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-color: var(--color-gold);
  opacity: 0.72;
  pointer-events: none;
}

main::before {
  top: 13px;
  left: 13px;
  border-top: 2px solid;
  border-left: 2px solid;
}

main::after {
  right: 13px;
  bottom: 13px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.crest-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: clamp(21rem, 39vw, 34rem);
}

.crest-wrap::before {
  content: "";
  position: absolute;
  width: 115%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 125, 255, 0.26), transparent 64%);
  animation: breathe 4s ease-in-out infinite;
}

.crest {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.68))
    drop-shadow(0 0 25px rgba(86, 112, 255, 0.18));
  transition: transform 0.3s ease;
}

.gnome {
  position: absolute;
  z-index: 2;
  bottom: -2.25rem;
  width: min(52%, 16.5rem);
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1.25rem 1.5rem rgba(0, 0, 0, 0.72));
}

.gnome-mapmaker {
  left: -10%;
}

.gnome-engineer {
  right: -12%;
}

.content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1rem;
  color: var(--color-gold);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 38px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.2vw, 5.9rem);
  font-weight: 600;
  line-height: 0.91;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
}

h1 span {
  display: block;
  color: transparent;
  background: linear-gradient(180deg, #fff3c4 0%, #d7a63e 58%, #8f6520 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.motto {
  margin: 1.35rem 0 0.8rem;
  color: var(--color-parchment);
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.8vw, 1.18rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro {
  max-width: 48ch;
  margin: 0 0 2rem;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.discord-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.78rem;
  min-height: 60px;
  padding: 0 1.55rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #6a74ff, #4b57dc);
  box-shadow:
    0 14px 42px rgba(88, 101, 242, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.22);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.discord-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.24) 50%,
    transparent 65%
  );
  transform: translateX(-130%);
  transition: transform 0.6s ease;
}

.discord-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.09);
  box-shadow: 0 20px 52px rgba(88, 101, 242, 0.48);
}

.discord-button:hover::after {
  transform: translateX(130%);
}

.discord-button:focus-visible {
  outline: 3px solid var(--color-gold-bright);
  outline-offset: 5px;
}

.discord-mark {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 20px;
}

.discord-mark::before {
  content: "";
  position: absolute;
  inset: 1px 0;
  border-radius: 10px 10px 12px 12px;
  background: #fff;
  clip-path: polygon(
    15% 9%,
    35% 0,
    39% 12%,
    61% 12%,
    65% 0,
    85% 9%,
    100% 72%,
    78% 100%,
    69% 78%,
    31% 78%,
    22% 100%,
    0 72%
  );
}

.copy-invite {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  margin: 0.85rem 0 0;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 7px;
  color: var(--color-quiet);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.copy-invite:hover {
  color: var(--color-bright);
  background: rgba(255, 255, 255, 0.045);
}

.copy-invite:focus-visible {
  outline: 2px solid var(--color-gold-bright);
  outline-offset: 3px;
}

.invite-code {
  margin: 0.85rem 0 0;
  color: var(--color-dim);
  font-size: 0.8rem;
  letter-spacing: 0.045em;
}

.copy-action {
  display: inline-block;
  width: 6.6rem;
  color: var(--color-gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.invite-help {
  max-width: 50ch;
  margin: 0.45rem 0 0;
  color: var(--color-faint);
  font-size: 0.8rem;
  line-height: 1.6;
}

.invite-help strong {
  color: var(--color-soft);
  font-weight: 600;
}

@keyframes drift {
  to {
    transform: rotate(360deg) scale(1.08);
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.06);
    opacity: 0.65;
  }
}

@media (min-width: 1101px) {
  main {
    grid-template-columns: minmax(28rem, 0.96fr) minmax(0, 1.18fr);
    gap: clamp(2.75rem, 5vw, 5.5rem);
    width: min(96vw, 1440px);
    min-height: min(86svh, 760px);
    margin: 2rem auto;
    padding: clamp(2.75rem, 4.5vw, 4.75rem);
  }

  .crest {
    width: min(100%, 460px);
  }

  .content {
    max-width: 680px;
  }

  .eyebrow {
    margin-bottom: 1.2rem;
    font-size: 0.82rem;
  }

  h1 {
    font-size: clamp(4.3rem, 6.5vw, 6.7rem);
  }

  .motto {
    margin: 1.65rem 0 1rem;
    font-size: clamp(1.08rem, 1.55vw, 1.35rem);
  }

  .intro {
    max-width: 55ch;
    margin-bottom: 2.35rem;
    font-size: 1.12rem;
    line-height: 1.75;
  }

  .discord-button {
    min-height: 66px;
    padding-inline: 2rem;
    font-size: 1.05rem;
  }

  .discord-mark {
    width: 30px;
    height: 22px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: calc(100% - 2rem);
    min-height: auto;
    margin: 1rem auto;
    padding: 2.25rem;
    text-align: center;
  }

  .crest-wrap {
    min-height: 20rem;
  }

  .crest {
    width: 260px;
  }

  .gnome {
    bottom: -1rem;
    width: min(25vw, 10.5rem);
  }

  .gnome-mapmaker {
    left: calc(50% - 15.5rem);
  }

  .gnome-engineer {
    right: calc(50% - 15.5rem);
  }

  .eyebrow {
    justify-content: center;
  }

  .eyebrow::before {
    display: none;
  }

  h1 {
    font-size: 4.5rem;
  }

  .intro {
    margin-inline: auto;
  }

  .discord-button {
    width: min(100%, 360px);
  }

  .invite-help {
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
  }

  main {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    width: calc(100% - 1rem);
    min-height: auto;
    margin: 0.5rem auto;
    padding: 1.4rem 1rem 1.75rem;
    border-radius: 3px 34px 3px 34px;
    text-align: center;
  }

  .crest-wrap {
    min-height: clamp(12.5rem, 61vw, 17.5rem);
  }

  .crest {
    width: min(54vw, 210px);
  }

  .gnome {
    bottom: -0.5rem;
    width: min(30vw, 8.1rem);
  }

  .gnome-mapmaker {
    left: calc(50% - min(43vw, 11.5rem));
  }

  .gnome-engineer {
    right: calc(50% - min(43vw, 11.5rem));
  }

  .eyebrow {
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 0.66rem;
    letter-spacing: 0.17em;
  }

  .eyebrow::before {
    display: none;
  }

  h1 {
    font-size: clamp(2.3rem, 13vw, 3.6rem);
    line-height: 0.94;
  }

  .motto {
    margin: 0.9rem 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .intro {
    margin: 0 auto 1.35rem;
    font-size: 0.93rem;
    line-height: 1.58;
  }

  .discord-button {
    width: min(100%, 330px);
    min-height: 56px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .copy-invite {
    margin-top: 0.7rem;
  }

  .invite-help {
    margin: 0.4rem auto 0;
    font-size: 0.7rem;
  }
}

@media (max-width: 390px) {
  main {
    padding-inline: 0.85rem;
  }

  .crest-wrap {
    min-height: 11rem;
  }

  .crest {
    width: 145px;
  }

  .gnome {
    bottom: -0.2rem;
    width: 5.8rem;
  }

  .gnome-mapmaker {
    left: calc(50% - 9rem);
  }

  .gnome-engineer {
    right: calc(50% - 9rem);
  }

  .invite-code {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
