:root {
  --iron: #1d2129;
  --iron-raised: #262b35;
  --rule: #3a404c;
  --bone: #e6decd;
  --ash: #a9a397;
  --gold: #c9a24a;

  --display: "Grenze Gotisch", "Palatino Linotype", serif;
  --body: "Alegreya Sans", "Segoe UI", sans-serif;

  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: clamp(2.1rem, 4.5vw, 2.8rem);
  --step-3: clamp(3.4rem, 12vw, 8rem);
}

[data-faction="accord"] { --cloth: #2f5ba6; --trim: #d9b24c; --mark: #d9b24c; --tone: #6f95d6; }
[data-faction="pact"]   { --cloth: #5b3a96; --trim: #2eb0a4; --mark: #5fe0d2; --tone: #a587d8; }
[data-faction="union"]  { --cloth: #8e3622; --trim: #c8b48a; --mark: #e8d9b4; --tone: #d4785c; }

/* The hero field takes the cloth colours of the two kingdoms in the matchup. */
[data-a="accord"] { --a: #2f5ba6; } [data-a="pact"] { --a: #5b3a96; } [data-a="union"] { --a: #8e3622; }
[data-b="accord"] { --b: #2f5ba6; } [data-b="pact"] { --b: #5b3a96; } [data-b="union"] { --b: #8e3622; }

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

html { background: var(--iron); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--iron);
  color: var(--bone);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-underline-offset: 0.2em; }
a:hover { color: var(--bone); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font-size: var(--step-2); margin-bottom: 1.75rem; }
h3 { font-size: var(--step-1); margin-bottom: 0.4rem; }
p { margin: 0 0 1rem; }

.wrap { width: min(70rem, 100% - 2rem); margin-inline: auto; }
main > section { padding-block: 5rem; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--gold); color: var(--iron); padding: 0.5rem 1rem; z-index: 2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.button {
  display: inline-block;
  font: 500 1.05rem/1 var(--body);
  color: var(--bone);
  text-decoration: none;
  border: 1px solid var(--ash);
  border-radius: 2px;
  padding: 0.9rem 1.4rem;
}
.button:hover { border-color: var(--bone); color: var(--bone); }
.button.primary { background: var(--gold); border-color: var(--gold); color: var(--iron); font-weight: 700; }
.button.primary:hover { background: var(--bone); border-color: var(--bone); color: var(--iron); }

/* Hero: a field split between the two kingdoms */

.hero { position: relative; isolation: isolate; overflow: hidden; padding-bottom: 5rem; text-align: center; }
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: background-color 700ms ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero::before { background-color: color-mix(in oklab, var(--a) 34%, var(--iron)); clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%); }
.hero::after  { background-color: color-mix(in oklab, var(--b) 34%, var(--iron)); clip-path: polygon(55% 0, 100% 0, 100% 100%, 45% 100%); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; text-align: left; }
.mark { font: 700 1.5rem/1 var(--display); color: var(--bone); text-decoration: none; }
.top ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.top ul a { color: var(--bone); text-decoration: none; font-size: 1rem; opacity: 0.85; }
.top ul a:hover { opacity: 1; text-decoration: underline; }

.hero-body { padding-top: clamp(2.5rem, 7vw, 5rem); }
.studio { color: var(--ash); margin-bottom: 0.5rem; }
.hero h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.01em; color: var(--gold); text-shadow: 0 2px 24px rgb(0 0 0 / 0.35); }
.lede { font-size: var(--step-1); line-height: 1.45; max-width: 36rem; margin: 1.25rem auto 2rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.status { color: var(--ash); font-size: 1rem; margin-top: 1.25rem; }

.matchup { margin-top: 3.5rem; }
.field { display: flex; align-items: flex-start; justify-content: center; gap: clamp(1rem, 7vw, 6rem); }

.banner { margin: 0; width: clamp(8rem, 24vw, 14rem); }
.banner svg { display: block; width: 100%; height: auto; --pole: #8a6f3a; transform-origin: top; animation: unfurl 900ms cubic-bezier(.2, .8, .2, 1) both; filter: drop-shadow(0 14px 18px rgb(0 0 0 / 0.35)); }
.banner[data-side="b"] svg { animation-delay: 150ms; }
.banner figcaption { margin-top: 0.85rem; }
.banner strong { display: block; font: 500 var(--step-1)/1.2 var(--display); color: var(--tone); }
.banner span { color: var(--ash); font-size: 1rem; }

.versus { font: 500 var(--step-1)/1 var(--display); color: var(--bone); opacity: 0.7; align-self: center; margin: 0 0 4rem; }

@keyframes unfurl { from { transform: scaleY(0.05); opacity: 0; } to { transform: none; opacity: 1; } }

.picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2.25rem; }
.picker p { width: 100%; color: var(--ash); margin-bottom: 0.5rem; }
.picker button {
  font: 500 1rem/1 var(--body);
  color: var(--bone);
  background: rgb(0 0 0 / 0.2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.75rem 1.3rem;
  cursor: pointer;
  transition: background-color 200ms, border-color 200ms;
}
.picker button[aria-pressed="true"] { background: var(--cloth); border-color: var(--trim); }
.picker button:hover { border-color: var(--trim); }

/* Creed */

.creed h2 { font-size: clamp(2.6rem, 7vw, 5rem); max-width: 14ch; margin-bottom: 2rem; }
.creed-body { display: grid; gap: 0 3rem; max-width: 60rem; margin-left: auto; }
.creed-body p { max-width: 38rem; }
@media (min-width: 56rem) { .creed-body { grid-template-columns: 1fr 1fr; } }

/* Split sections: heading beside content on wide screens */

.split { display: grid; gap: 1rem 4rem; }
.split-head p { color: var(--ash); max-width: 22rem; }
@media (min-width: 56rem) {
  .split { grid-template-columns: 20rem 1fr; }
  .split-head { position: sticky; top: 2rem; align-self: start; }
}

.loop { list-style: none; padding: 0; margin: 0; }
.loop li { padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.loop li:first-child { border-top: 0; padding-top: 0; }
.loop h3 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); }
.loop p { color: var(--ash); max-width: 38rem; margin: 0; }
.win { margin-top: 1.5rem; padding: 1.25rem 1.5rem; border-left: 3px solid var(--gold); background: var(--iron-raised); max-width: 40rem; font-size: var(--step-1); line-height: 1.45; }

/* Kingdoms */

.factions { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; }
.faction { position: relative; background: var(--iron-raised); border-top: 3px solid var(--cloth); padding: 1.5rem 1.5rem 1.75rem; }
.faction .standard { --pole: #8a6f3a; width: 3.5rem; height: auto; display: block; margin: -1.5rem 0 1.25rem; }
.faction h3 { color: var(--tone); font-size: 1.8rem; }
.faction .motto { font-style: italic; color: var(--trim); }
.faction dl { margin: 1.25rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1rem; }
.faction dt { color: var(--ash); font-size: 1rem; padding-top: 0.1rem; }
.faction dd { margin: 0; }

/* Roadmap: a real sequence, so it is numbered */

.road { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 0; }
.road li { counter-increment: step; position: relative; padding: 0 0 2.25rem 3.5rem; }
.road li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  font: 700 1.2rem/1 var(--display);
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--iron);
  color: var(--ash);
}
.road li::after { content: ""; position: absolute; left: 1.1rem; top: 2.5rem; bottom: 0.25rem; width: 1px; background: var(--rule); }
.road li:last-child::after { display: none; }
.road li.current::before { background: var(--gold); border-color: var(--gold); color: var(--iron); }
.road p { color: var(--ash); max-width: 30rem; }
.road .here { color: var(--gold); font-size: 1rem; margin-bottom: 0.25rem; }
.road li:not(.current) h3 { padding-top: 0.3rem; }

@media (min-width: 56rem) {
  .road { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .road li { padding: 3.5rem 0 0; }
  .road li::after { left: 2.75rem; right: -1.75rem; top: 1.1rem; bottom: auto; width: auto; height: 1px; }
  .road .here { position: absolute; top: 0.45rem; left: 3rem; }
  .road li:not(.current) h3 { padding-top: 0; }
}

/* Dev log */

.note { color: var(--ash); max-width: 38rem; margin-bottom: 2rem; }
.log article { display: grid; gap: 0.25rem 2rem; padding-block: 1.5rem; border-top: 1px solid var(--rule); max-width: 60rem; }
.log time { color: var(--gold); font-size: 1rem; padding-top: 0.3rem; }
.log p { color: var(--ash); margin: 0; max-width: 40rem; }
@media (min-width: 48rem) { .log article { grid-template-columns: 11rem 1fr; } }

/* Follow */

main > .follow { background: var(--iron-raised); }
.follow h2 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1rem; }
.follow p { color: var(--ash); max-width: 34rem; margin-bottom: 1.75rem; }
.follow .button { overflow-wrap: anywhere; }
.social { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }

footer { padding-block: 2rem 3rem; color: var(--ash); font-size: 1rem; }

@media (max-width: 40rem) {
  .top .wide { display: none; }
  .top ul { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .banner svg { animation: none; }
  .hero::before, .hero::after, .picker button { transition: none; }
}
