:root {
  color-scheme: light;
  --bg: #f2e9d4;
  --deep: #ece1c8;
  --panel: rgba(251, 246, 234, 0.9);
  --panel-strong: #fbf6ea;
  --line: #d8cba8;
  --line-strong: #c9a24a;
  --gold: #b8902f;
  --gold-deep: #a9681c;
  --gold-strong: #9c7a1e;
  --jade: #2c8f6c;
  --sky: #3f8fb0;
  --ink: #2c2620;
  --soft: #4a4338;
  --muted: #7a6f5f;
  --shadow: rgba(44, 38, 32, 0.16);
  font-family: "Avenir Next", "Songti SC", "STKaiti", "PingFang SC", "Noto Sans SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background-color: var(--bg);
  color: var(--soft);
}

a {
  color: inherit;
}

.site-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.site-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(184, 144, 47, 0.28);
  border-radius: 18px;
  background: rgba(251, 246, 234, 0.9);
  box-shadow: 0 14px 38px rgba(44, 38, 32, 0.13);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(184, 144, 47, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 160, 87, 0.34), rgba(47, 163, 124, 0.09));
  color: var(--gold-strong);
  box-shadow: 0 0 22px rgba(201, 160, 87, 0.18);
  place-items: center;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.nav-links a,
.lang-links a,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.5rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(44, 38, 32, 0.86);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-links a:hover,
.lang-links a:hover,
.button-link:hover {
  border-color: rgba(184, 144, 47, 0.38);
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  border-color: rgba(184, 144, 47, 0.4);
  background: rgba(201, 160, 87, 0.16);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.button-link.primary {
  border-color: rgba(184, 144, 47, 0.66);
  background: linear-gradient(135deg, #c9a24a, #b87825);
  color: #17120b;
  box-shadow: 0 14px 30px rgba(106, 67, 11, 0.24);
}

.codex-page--treasures .button-link.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #3aac84, #2c8f6c);
  color: #fff;
  box-shadow: 0 12px 26px rgba(44, 120, 95, 0.26);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid rgba(184, 144, 47, 0.22);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a {
  color: rgba(44, 38, 32, 0.84);
  text-decoration: none;
}

.lang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a:focus-visible,
.footer a:focus-visible,
.button-link:focus-visible {
  outline: 3px solid rgba(63, 143, 176, 0.42);
  outline-offset: 2px;
}

h1 {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 24px, 680px);
    padding-top: 12px;
  }

  .site-nav {
    top: 8px;
    display: block;
    padding: 10px;
    border-radius: 14px;
  }

  .brand {
    margin-bottom: 9px;
  }

  .nav-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  h1 {
    font-size: 2.75rem;
    line-height: 1.04;
  }
}

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