:root {
  --bg-deep: #0b1320;
  --bg-page: #08111d;
  --surface: #111a27;
  --surface-soft: #162231;
  --surface-border: #263647;
  --gold: #d4af37;
  --gold-soft: #e0bd5a;
  --text-primary: #f3f6fa;
  --text-secondary: rgba(226, 232, 240, .82);
  --text-muted: rgba(203, 213, 225, .72);
  --green: #4caf50;
  --radius-card: 16px;
  --radius-button: 12px;
  --container: 1720px;
  --doc-container: 1040px;
  --shadow-card: 0 18px 46px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 50% -10%, rgba(212, 175, 55, .1), transparent 34rem),
    linear-gradient(180deg, rgba(8, 17, 29, .24), rgba(8, 17, 29, .4)),
    url("/assets/backgrounds/nordic-page-tile.png") center top / 100% auto repeat-y;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(8, 17, 29, .02) 0%, rgba(8, 17, 29, .08) 48%, rgba(4, 9, 15, .32) 100%),
    linear-gradient(90deg, rgba(3, 8, 14, .58), rgba(8, 17, 29, .04) 50%, rgba(3, 8, 14, .58));
  mix-blend-mode: multiply;
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

main .container {
  width: min(100% - 48px, var(--doc-container));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  background: rgba(8, 17, 29, .62);
  border-bottom: 1px solid rgba(212, 175, 55, .14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(20px) saturate(130%);
  transition: height 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-wordmark {
  color: var(--gold);
  font-size: clamp(.82rem, 1vw, .98rem);
  font-weight: 900;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(212, 175, 55, .2);
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2vw, 26px);
}

.desktop-nav a {
  position: relative;
  padding: 28px 0 25px;
  color: rgba(226, 232, 240, .78);
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, padding 180ms ease, font-size 180ms ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--text-primary);
}

.desktop-nav a.active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, .72);
  transform: translateX(-50%);
}

.desktop-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, .55);
}

.site-header.is-compact {
  height: 60px;
  background: rgba(8, 17, 29, .5);
  border-bottom-color: rgba(212, 175, 55, .2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.site-header.is-compact .brand-wordmark {
  font-size: clamp(.78rem, .86vw, .9rem);
}

.site-header.is-compact .desktop-nav a {
  padding: 21px 0 19px;
  font-size: .78rem;
}

.site-header.is-compact .desktop-nav a.active::after {
  bottom: 14px;
}

.site-header.is-compact .desktop-nav a.active::before {
  top: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu {
  position: relative;
  display: none;
}

.mobile-menu summary {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, .42);
  border-radius: 12px;
  color: var(--gold);
  background: rgba(17, 26, 39, .76);
  cursor: pointer;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

.mobile-nav {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 240px;
  padding: 14px;
  border: 1px solid rgba(212, 175, 55, .24);
  border-radius: 16px;
  background: rgba(8, 17, 29, .98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}

.mobile-nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible,
.mobile-nav a.active {
  color: var(--text-primary);
  background: rgba(212, 175, 55, .1);
}

.mobile-nav a.active {
  border-left: 2px solid var(--gold);
  box-shadow: inset 10px 0 18px rgba(212, 175, 55, .06);
}

.band {
  position: relative;
  padding: clamp(34px, 4vw, 52px) 0;
}

.hero {
  padding: clamp(54px, 6vw, 76px) 0 clamp(18px, 3vw, 28px);
}

.hero h1 {
  max-width: 16ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero p {
  max-width: 72ch;
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
}

.updated {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: .92rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

.legal-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid rgba(212, 175, 55, .34);
  border-radius: var(--radius-button);
  color: var(--gold-soft);
  background: rgba(8, 17, 29, .62);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}

.legal-nav a:hover,
.legal-nav a.active {
  color: #f1d77c;
  background: rgba(212, 175, 55, .12);
  border-color: rgba(218, 177, 62, .72);
}

.card {
  padding: clamp(22px, 2.6vw, 32px);
  margin-bottom: 18px;
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: var(--radius-card);
  background:
    linear-gradient(145deg, rgba(17, 26, 39, .9), rgba(10, 19, 31, .86)),
    url("/images/applications/application-card-bg-stone-norse-dark.png") center / cover no-repeat;
  box-shadow: var(--shadow-card);
}

.card h2 {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.1vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: .02em;
}

.card h3 {
  margin: 18px 0 8px;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.35;
}

.card h4 {
  margin: 16px 0 8px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.35;
}

.card p,
.card li {
  color: var(--text-secondary);
}

.card p {
  margin: 9px 0 0;
  line-height: 1.68;
}

.card a {
  color: var(--gold-soft);
  text-decoration-color: rgba(212, 175, 55, .54);
  text-underline-offset: 3px;
}

.card ul,
.card ol {
  margin: 12px 0 0 20px;
  padding: 0;
}

.card li {
  margin-top: 8px;
  line-height: 1.62;
}

.card code {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, .08);
}

.callout,
.notice,
.note {
  border-left: 4px solid var(--gold);
}

.card .callout {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(212, 175, 55, .28);
  border-left-width: 4px;
  border-radius: var(--radius-card);
  background: rgba(8, 17, 29, .58);
}

.card .callout a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--radius-button);
  color: #111720;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  font-weight: 800;
  text-decoration: none;
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px dashed rgba(212, 175, 55, .34);
  border-radius: var(--radius-card);
  background: rgba(8, 17, 29, .48);
}

.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.toc a {
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--gold-soft);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, .18);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

th {
  color: var(--gold-soft);
  background: rgba(17, 26, 39, .82);
}

td {
  color: var(--text-secondary);
}

.release-entry {
  padding: 18px;
  margin-top: 16px;
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: var(--radius-card);
  background: rgba(8, 17, 29, .58);
}

.release-entry.highlighted {
  border-color: rgba(212, 175, 55, .46);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .08);
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.release-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(203, 213, 225, .18);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .06);
  font-size: .75rem;
}

.badge.featured {
  color: var(--gold-soft);
  border-color: rgba(212, 175, 55, .36);
}

.markdown h3,
.markdown h4 {
  margin: 16px 0 8px;
}

.markdown hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid rgba(203, 213, 225, .14);
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(203, 213, 225, .18);
  border-radius: var(--radius-card);
  color: var(--text-muted);
  background: rgba(8, 17, 29, .48);
}

.site-footer {
  padding: 46px 0 34px;
  border-top: 1px solid rgba(212, 175, 55, .16);
  background: rgba(6, 13, 22, .92);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.footer-brand img {
  width: 118px;
  height: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px 24px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-links a:hover,
.footer-links a.active {
  color: var(--gold-soft);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(203, 213, 225, .12);
  color: var(--text-muted);
  font-size: .92rem;
}

@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }
}

@media (max-width: 680px) {
  .container,
  main .container {
    width: min(100% - 32px, var(--container));
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 3.55rem);
  }

  .legal-nav a {
    width: 100%;
  }

  .toc {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: flex-start;
    gap: 10px 16px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
}
