@font-face {
  font-family: Cinzel;
  src: url("fonts/cinzel.ttf") format("truetype");
  font-weight: 500 700;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #131511;
  --panel: #20231c;
  --field: #171a15;
  --border: #3b4033;
  --text: #f3eddf;
  --muted: #c0beae;
  --gold: #e3b86f;
  --sage: #b7c79c;
  --danger: #ffd1bc;
  --display: Cinzel, Georgia, serif;
  font-family: "DM Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 40% 0%, #29291d, transparent 64%), var(--background);
}

a { color: inherit; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.frame {
  width: min(75rem, calc(100% - 5rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  display: block;
  width: clamp(7.25rem, 20vw, 10.25rem);
  height: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 3vw, 2.4rem);
  font-size: .875rem;
}

nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

.nav-action {
  padding: .6rem .9rem;
  border: 1px solid #8e7346;
  border-radius: .25rem;
  color: var(--gold);
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(22rem, 1fr);
  align-items: start;
  gap: clamp(1.75rem, 4vw, 4rem);
  padding-block: clamp(2.25rem, 5vw, 4.5rem);
}

.worlds, .signup { scroll-margin-top: 1.25rem; }

.home-hero {
  display: grid;
  align-items: center;
  min-block-size: max(32rem, calc(100vh - 4.75rem));
  min-block-size: max(32rem, calc(100svh - 4.75rem));
  background:
    linear-gradient(90deg, #0b1119c9, #0b111957 42%, transparent 72%),
    linear-gradient(0deg, #0b1119a8, transparent 36%),
    url("/weltbild.jpg") 72% center / cover no-repeat;
}

.home-hero-content { padding-block: clamp(3rem, 12vh, 8rem); }
.home-hero-content h1 { margin: 0; }
.home-hero-content h1 img {
  display: block;
  width: min(100%, 33rem);
  height: auto;
  filter: drop-shadow(0 3px 8px #0009);
}
.home-hero-content h2 {
  margin: clamp(1.65rem, 4vw, 2.75rem) 0 .4rem;
  color: var(--gold);
  font: 600 clamp(1.4rem, 3vw, 2rem) / 1.2 var(--display);
}
.home-hero-content p {
  max-inline-size: 32rem;
  margin: .65rem 0 0;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  text-shadow: 0 1px 5px #000;
}

.discord-login { margin-block-start: .7rem; }
.portal-action.discord-sign-in {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-block-size: 2.75rem;
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}
.portal-action.discord-sign-in:hover {
  background: #4752c4;
  border-color: #4752c4;
}
.discord-sign-in img { flex: none; inline-size: 1.35rem; block-size: auto; }

.world-intro {
  min-height: 25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: 2rem;
  position: relative;
  isolation: isolate;
}

.world-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1rem 0 0;
  background:
    linear-gradient(0deg, var(--background) 0%, #1315119e 36%, transparent 73%),
    linear-gradient(90deg, #1518119c, #2f271326 88%),
    url("../weltbild.jpg") 78% 58% / cover;
  mask-image: linear-gradient(90deg, transparent, black 13%, black 93%, transparent);
}

.world-intro h1 {
  margin: 0;
}

.world-intro h1 img {
  display: block;
  width: min(100%, 26rem);
  height: auto;
  filter: drop-shadow(0 2px 9px #0009);
}

.world-intro p {
  max-width: 28rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.realm {
  --realm-accent: var(--gold);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 2px solid var(--realm-accent);
  padding: 1rem;
  background: var(--panel);
}

.newschool { --realm-accent: var(--sage); }

.realm-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.realm h2 {
  margin: .25rem 0 0;
  color: var(--realm-accent);
  font: 600 clamp(1.12rem, 1.75vw, 1.6rem) / 1.05 var(--display);
  letter-spacing: -.05em;
}

.realm-level {
  display: flex;
  flex-direction: column;
  align-items: end;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.25;
}

.realm-level strong {
  color: var(--realm-accent);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.realm p {
  flex-grow: 1;
  margin: .9rem 0;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.4;
}

.realm ul {
  display: flex;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.realm li {
  padding: .25rem .45rem;
  border: 1px solid var(--border);
  border-radius: .2rem;
  font-size: .75rem;
  line-height: 1;
}

.signup {
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: clamp(1.3rem, 3vw, 2.5rem);
  background: linear-gradient(160deg, #272a21, var(--panel) 54%);
  box-shadow: 0 16px 42px #0c0e0b60;
}

.signup h2 {
  margin: 0 0 1.6rem;
  font: 600 clamp(1.6rem, 3vw, 2.2rem) / 1.1 var(--display);
  letter-spacing: -.055em;
}

form, .field { display: grid; gap: .4rem; }
form { gap: 1.25rem; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

label { font-size: .875rem; font-weight: 600; }

input {
  min-width: 0;
  width: 100%;
  padding: .78rem .85rem;
  border: 1px solid #555947;
  border-radius: .25rem;
  background: var(--field);
  color: var(--text);
  font: inherit;
}

input[aria-invalid="true"] { border-color: #dc8a69; }

.hint, .field-error {
  margin: 0;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.35;
}

.field-error { color: var(--danger); }

.notice {
  margin: 0 0 1.1rem;
  border: 1px solid currentColor;
  border-radius: .25rem;
  padding: .8rem;
  line-height: 1.4;
}

.notice-success { color: #deefbb; background: #303925; }
.notice-error { color: var(--danger); background: #3b2d25; }

button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-top: .15rem;
  padding: .85rem 1rem;
  border: 1px solid #eec782;
  border-radius: .25rem;
  background: var(--gold);
  color: #211b10;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #f3cd8b; }
button span { font-size: 1.2rem; line-height: 1; }

@media (max-width: 53rem) {
  .frame { width: min(37rem, calc(100% - 2.5rem)); }
  .main { grid-template-columns: minmax(0, 1fr); }
  .world-intro { min-height: 18rem; }
  .realm-head { flex-wrap: nowrap; }
}

@media (max-width: 36rem) {
  .home-hero {
    align-items: end;
    min-block-size: max(31rem, calc(100vh - 7rem));
    min-block-size: max(31rem, calc(100svh - 7rem));
    background:
      linear-gradient(0deg, #0b1119f5, #0b111992 36%, transparent 70%),
      url("/weltbild.jpg") 73% center / cover no-repeat;
  }
  .home-hero-content { padding-block: 2.5rem; }
}

@media (max-width: 26rem) {
  .frame { width: calc(100% - 1.75rem); }
  .site-header { min-height: 4.3rem; }
  .main { padding-block: 1rem 2rem; }
  .world-intro { min-height: 15rem; }
  .realm-head { flex-wrap: wrap; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
}
