:root {
  --bg: #d6d0c4;
  --ink: #1a1714;
  --muted: #5c564d;
  --accent: #9a3412;
  --accent-hover: #7c2d12;
  --card: #f6f2ea;
  --line: #c3baab;
  --steel: #24282c;
  --pill-bg: #efe0d0;
  --ok-bg: #dde6d8;
  color-scheme: light;
}

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

html {
  font-size: 100%;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  background: var(--accent);
}

.topbar {
  background: var(--steel);
  color: #f6f2ea;
  border-bottom: 4px solid var(--accent);
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(70rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mark {
  display: grid;
  grid-template-columns: 0.55rem 0.55rem;
  gap: 0.22rem;
  width: 1.5rem;
  height: 1.5rem;
}

.mark span {
  display: block;
  background: var(--accent);
}

.mark span:last-child {
  background: #e8c39e;
  margin-top: 0.35rem;
}

.brand-name,
.brand-tag,
.wiki-label {
  margin: 0;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.brand-tag {
  color: #c9c3b8;
  font-size: 0.8rem;
}

.wiki-label {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: #e8c39e;
}

.wiki {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

nav {
  overflow: auto;
  padding: 1.35rem 0 2rem;
  background: var(--accent);
  color: #fff;
}

nav h4 {
  margin: 1.25rem 1.1rem 0.45rem;
  color: #e8c39e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

nav h4:first-child {
  margin-top: 0.25rem;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: block;
  padding: 0.7rem 1.1rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
nav a.is-active {
  background: var(--accent-hover);
}

nav a:focus-visible {
  outline: 2px solid #e8c39e;
  outline-offset: -2px;
}

main {
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 2.25rem 2rem 2.5rem;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(36, 40, 44, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 40, 44, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

main > * {
  max-width: 44rem;
}

h1,
h2,
h3,
h4 {
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

h4 {
  margin: 1.1rem 0 0.55rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

section {
  margin: 2rem 0 0;
  scroll-margin-top: 1.25rem;
}

section:target h2 {
  color: var(--accent);
}

p,
ol,
ul {
  margin: 0 0 0.9rem;
  color: var(--ink);
}

a {
  color: var(--accent);
  font-weight: 650;
}

.table-wrap {
  max-width: 54rem;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  box-shadow: 0 1px 0 rgba(26, 23, 20, 0.04);
}

table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--pill-bg);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:nth-child(even) {
  background: rgba(239, 224, 208, 0.35);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--accent);
}

td:nth-child(3) {
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td:nth-child(4) {
  color: var(--muted);
}

.issue {
  max-width: 44rem;
  margin: 0 0 1rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  box-shadow: 0 1px 0 rgba(26, 23, 20, 0.04);
}

.issue h5 {
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: var(--pill-bg);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.issue p {
  margin: 0;
  padding: 0.85rem 0.9rem 0;
}

.issue p:last-child {
  padding-bottom: 1rem;
}

.issue p:first-of-type::before,
.issue p:last-of-type::before {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .wiki {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  nav {
    max-height: 40vh;
  }
}
