/* Sigil Empires: The Shattered Reach
   Kingdom hex values are not in the design document.
   These interpretations of the named colors are chosen for contrast. */

:root {
  --parchment: #f3e6cf;
  --parchment-raise: #f7f1e3;
  --ink: #241c15;
  --ink-soft: #4a3f34;
  --gold: #f0d48a;
  --gold-deep: #5c430e;
  --gold-line: #6e5010;
  --stone: #2c261f;
  --stone-mid: #3a3128;
  --wood: #3a281c;
  --line: #d7c4a0;
  --sheet: 1080px;
  --header: 4.6rem;
  --display: "Cinzel", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --blackletter: "UnifrakturMaguntia", "Cinzel", Palatino, serif;
  --body: "Source Serif 4", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;
}

.realm-argos { --realm: #0a4e55; --realm-deep: #063338; }
.realm-gladia { --realm: #3e1868; --realm-deep: #2a1048; }
.realm-jahara { --realm: #0c5138; --realm-deep: #083628; }
.realm-stormgard { --realm: #163e6e; --realm-deep: #0e2948; }
.realm-ferrum { --realm: #161513; --realm-deep: #12110f; }
.realm-florence { --realm: #0e3270; --realm-deep: #091f48; }
.realm-leon { --realm: #8b1c24; --realm-deep: #5e1016; }

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: #3c352e;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(120, 104, 84, 0.45), transparent 52%),
    url("../assets/grain.svg");
  background-size: auto, 180px 180px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.realm-banner :focus-visible,
.plaque :focus-visible,
.button:focus-visible {
  outline-color: var(--gold);
}

::selection {
  background: #e4c36a;
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--gold);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  z-index: 50;
  font-family: var(--display);
}

.skip:focus { transform: none; }

img, svg { max-width: 100%; }

.sigil { display: block; width: 4.5rem; height: 4.5rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--stone);
  color: #f6f0e4;
  border-top: 3px solid #a6843e;
  border-bottom: 1px solid rgba(240, 212, 138, 0.4);
}

.header-inner {
  width: min(var(--sheet), calc(100% - 1.5rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #f6f0e4;
  text-decoration: none;
  min-height: 44px;
  padding: 0.35rem 0;
}

.brand:hover { color: var(--gold); }

.brand .sigil {
  width: 2.45rem;
  height: 2.45rem;
  color: var(--gold);
  flex: none;
}

.brand-title {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.12rem;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.9rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(240, 212, 138, 0.7);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.nav-toggle:hover { color: #f6f0e4; border-color: var(--gold); }

#site-nav ul,
.footer-nav ul,
.onpage ul,
.sibling ul,
.realm-grid,
.vision,
.ranks {
  list-style: none;
  margin: 0;
  padding: 0;
}

#site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.1rem;
}

#site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

#site-nav a:hover { color: #f6f0e4; }

#site-nav a[aria-current="page"] {
  color: #f6f0e4;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* Sheet */

.sheet {
  width: min(var(--sheet), calc(100% - 1.25rem));
  margin: 1.25rem auto 2.25rem;
  background-color: var(--parchment);
  background-image: url("../assets/grain.svg");
  background-size: 240px 240px;
  background-blend-mode: multiply;
  border: 1px solid #c9b48a;
  box-shadow: 0 18px 44px rgba(20, 12, 6, 0.38);
}

.wrap { padding: 2.4rem 1.25rem 2.8rem; }

.measure, .prose p, .prose li { max-width: 68ch; }

h1, h2, h3 { text-wrap: balance; }

h1, h2, h3, .price, .realm-name, .brand-title, .button, .flag {
  font-family: var(--display);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin: 2.4rem 0 0.7rem;
}

h2::after {
  content: "";
  display: block;
  width: 4.25rem;
  height: 2px;
  margin-top: 0.45rem;
  background: linear-gradient(90deg, var(--gold-line), transparent);
}

h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.35rem;
  font-weight: 700;
}

p { margin: 0.75rem 0; text-wrap: pretty; }

a { color: var(--gold-deep); }

a:hover { color: #2e2208; }

.kicker {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-line);
}

.lede {
  font-size: 1.28rem;
  line-height: 1.5;
}

/* Hero */

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.wordmark-script {
  display: block;
  font-family: var(--blackletter);
  font-weight: 400;
  font-size: clamp(3.6rem, 14vw, 7rem);
  line-height: 0.82;
  color: #2a2118;
}

.wordmark-emp {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-sub {
  margin: 0.85rem 0 0;
  font-family: var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: var(--gold-line);
}

.page-title {
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.hero-medal {
  width: min(100%, 15rem);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 38%, #4e453c, #2c261f 70%);
  color: var(--gold);
  box-shadow:
    0 0 0 6px var(--parchment),
    0 0 0 8px var(--gold-line),
    0 14px 28px rgba(40, 24, 8, 0.28);
}

.hero-medal .sigil { width: 58%; height: 58%; }

blockquote {
  margin: 1rem 0 0;
  padding: 0.2rem 0 0.2rem 1.15rem;
  border-left: 3px solid var(--gold-line);
  font-size: 1.28rem;
  font-style: italic;
  line-height: 1.5;
}

blockquote p { margin: 0.4rem 0; }

/* Panels and grids */

.vision {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.vision li,
.panel {
  margin: 0;
  background: rgba(255, 252, 245, 0.42);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.15rem;
}

.vision li { border-top: 3px solid var(--gold-line); }

.vision h3,
.panel h2,
.plaque h2,
.soon h2,
.deferred h2 { margin-top: 0; }

.split {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}

.plaque {
  background: var(--stone);
  color: #f6f0e4;
  border: 1px solid #c4a15a;
  padding: 1.2rem 1.25rem 1.35rem;
}

.plaque h2,
.plaque .price { color: var(--gold); }

.plaque h2::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.plaque p { color: #f6f0e4; }

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0.4rem;
  padding: 0.45rem 1.1rem;
  background: var(--stone);
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.06em;
  border: 1px solid #c4a15a;
}

.button:hover,
.button:visited:hover { background: #3e3428; color: #f6f0e4; }

.button:visited { color: var(--gold); }

.plaque .button {
  background: transparent;
  color: var(--gold);
}

.plaque .button:hover { background: rgba(240, 212, 138, 0.12); color: #f6f0e4; }

.realm-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.realm-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--parchment-raise);
  border: 1px solid #c9b48a;
}

.realm-card a:hover,
.realm-card a:focus-visible {
  border-color: var(--gold-line);
  transform: translateY(-2px);
}

.realm-field,
.swatch,
.realm-banner {
  background-color: var(--realm);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 46%),
    linear-gradient(165deg, var(--realm), var(--realm-deep));
  color: var(--gold);
}

.realm-field {
  min-height: 8.75rem;
  display: grid;
  place-items: center;
}

.realm-copy { display: block; padding: 0.9rem 1rem 1.15rem; }

.realm-name {
  display: block;
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 700;
}

.realm-card a:hover .realm-name,
.realm-card a:focus-visible .realm-name { text-decoration: underline; text-underline-offset: 0.15em; }

.realm-theme,
.realm-charge {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.realm-banner {
  text-align: center;
  padding: 3rem 1.25rem 2.6rem;
  color: #f6f0e4;
}

.realm-banner .sigil {
  width: 7.25rem;
  height: 7.25rem;
  margin: 0 auto;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}

.realm-banner h1 {
  margin: 0.8rem 0 0.2rem;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: 0.04em;
  color: #f6f0e4;
}

.realm-banner .kicker { color: var(--gold); }

.realm-banner .theme {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  letter-spacing: 0.06em;
  color: var(--gold);
  font-size: 1.05rem;
}

.realm-banner .charge-line {
  margin: 0.85rem 0 0;
  color: #f6f0e4;
}

body[data-realm] .wrap h2,
body[data-realm] .wrap h3 { color: var(--realm-deep); }

body[data-realm] .wrap h2::after {
  background: linear-gradient(90deg, var(--realm), transparent);
}

.sibling { margin-top: 2.2rem; }

.sibling ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.45rem;
}

.sibling a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 4.75rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.swatch {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
}

.sibling .sigil { width: 1.65rem; height: 1.65rem; }

.sibling a[aria-current="page"] .swatch {
  box-shadow: 0 0 0 2px var(--parchment), 0 0 0 4px var(--gold-line);
}

.ranks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0 0.4rem;
}

.ranks li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.7rem;
  background: var(--parchment-raise);
  border: 1px solid var(--line);
  font-family: var(--display);
  letter-spacing: 0.02em;
}

body[data-realm] .ranks li {
  background: color-mix(in srgb, var(--realm) 12%, var(--parchment-raise));
  border-color: color-mix(in srgb, var(--realm) 42%, var(--line));
}

.ranks li:not(:last-child)::after {
  content: "→";
  color: var(--gold-line);
  font-family: var(--body);
}

/* Rules */

.notice {
  background: var(--stone-mid);
  color: #f6f0e4;
  padding: 1rem 1.25rem;
}

.notice p { margin: 0.35rem 0; max-width: 75ch; }

.notice strong { color: var(--gold); }

.onpage { margin: 1.1rem 0 0.2rem; }

.onpage ul { display: flex; flex-wrap: wrap; gap: 0.15rem 0.85rem; }

.onpage a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.table-wrap { overflow-x: auto; margin: 1rem 0 0.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 252, 245, 0.35);
}

caption {
  text-align: left;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.55rem;
  color: var(--ink);
}

th, td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #e0d0b4;
  vertical-align: top;
}

th {
  background: var(--stone-mid);
  color: #f6f0e4;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.03em;
}

tbody tr:nth-child(even) td { background: rgba(110, 80, 16, 0.06); }

.deferred {
  margin-top: 1.5rem;
  padding: 1.15rem 1.2rem 1.35rem;
  border: 2px solid var(--gold-line);
  background: rgba(110, 80, 16, 0.07);
}

.flag {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.3rem 0.55rem;
  background: #6e1218;
  color: #f6f0e4;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.price {
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 4.6rem);
  line-height: 0.95;
  margin: 0.3rem 0 0.6rem;
  letter-spacing: 0.02em;
}

.price span {
  font-size: 0.34em;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.soon {
  max-width: 68ch;
  margin-top: 0.4rem;
  padding: 1.35rem 1.3rem 1.45rem;
  border: 1px dashed var(--gold-line);
  background: rgba(255, 252, 245, 0.4);
}

.soon p {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  line-height: 1.3;
}

/* Footer */

.site-footer {
  background-color: var(--wood);
  background-image:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, rgba(255, 255, 255, 0.03) 2px 7px),
    linear-gradient(180deg, #4a3428, #3a281c 38%, #2e2018);
  color: #f6f0e4;
  padding: 2rem 0 2.2rem;
}

.footer-inner {
  width: min(var(--sheet), calc(100% - 1.5rem));
  margin: 0 auto;
  display: grid;
  gap: 0.8rem 1.5rem;
}

.footer-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.footer-sub,
.footer-meta { margin: 0.2rem 0 0; color: #f6f0e4; }

.footer-sub {
  font-family: var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold);
}

.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; }

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
  font-family: var(--display);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.footer-nav a:hover { color: #f6f0e4; }

.footer-meta { max-width: 70ch; font-size: 1rem; }

[id] { scroll-margin-top: 5.4rem; }

@media (min-width: 720px) {
  .wrap { padding: 3rem 2.5rem 3.4rem; }
  .vision { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1.25fr 0.85fr; align-items: stretch; }
  .hero { grid-template-columns: 1.35fr 0.75fr; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: end; }
  .footer-meta { grid-column: 1 / -1; }
}

@media (min-width: 980px) {
  .wrap { padding: 3.25rem 3rem 3.6rem; }
}

@media (max-width: 860px) {
  html.js .nav-toggle { display: inline-flex; }
  html.js #site-nav { display: none; width: 100%; }
  html.js #site-nav.is-open { display: block; }
  .header-inner { flex-wrap: wrap; padding: 0.45rem 0; }
  #site-nav { width: 100%; }
  #site-nav ul { flex-direction: column; align-items: stretch; padding-bottom: 0.5rem; }
  #site-nav a { width: 100%; }
  .hero-medal { width: 8.5rem; }
}

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .sheet { width: min(var(--sheet), calc(100% - 0.75rem)); margin-top: 0.6rem; }
  .lede, blockquote { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .realm-card a:hover { transform: none; }
}

@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .nav-toggle, .hero-medal, .sibling { display: none; }
  .sheet { box-shadow: none; border: 0; width: auto; margin: 0; background: white; }
  .notice, th { background: #eee; color: black; }
  .notice strong, .realm-banner, .plaque { color: black; background: white; }
  a { color: black; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
