:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #667085;
  --line: #d7dee8;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --accent: #1f7a6d;
  --accent-2: #b9503f;
  --focus: #234f9f;
  --shadow: 0 18px 48px rgba(28, 41, 61, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.9), rgba(255, 255, 255, 0.96) 36rem),
    #ffffff;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem clamp(1rem, 4vw, 3.5rem) 1.25rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1.02rem;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav a,
.chip,
.tag-button {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

.nav a:hover,
.tag-button:hover,
.card:hover,
.timeline-item:hover {
  border-color: rgba(31, 122, 109, 0.55);
}

.layout {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.5rem clamp(1rem, 4vw, 3.5rem) 3rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  height: fit-content;
  display: grid;
  gap: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.search {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.85rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

input:focus,
.nav a:focus,
.card:focus,
.timeline-item:focus,
.tag-button:focus {
  outline: 3px solid rgba(35, 79, 159, 0.18);
  border-color: var(--focus);
}

.sidebar h2 {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-button {
  cursor: pointer;
}

.tag-button.active {
  border-color: var(--accent);
  background: rgba(31, 122, 109, 0.11);
  color: #14584e;
}

.snapshot dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
}

.snapshot div {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
}

dd {
  margin: 0.15rem 0 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.content {
  min-width: 0;
}

.view {
  margin-bottom: 2rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 0.9rem;
}

.card,
.timeline-item,
.detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 26px rgba(28, 41, 61, 0.08);
}

.card {
  display: block;
  min-height: 12rem;
  padding: 1rem;
}

.card p,
.timeline-item p,
.detail p {
  color: var(--muted);
  line-height: 1.6;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.chip {
  min-height: 1.8rem;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline {
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
}

.timeline-date {
  color: var(--accent-2);
  font-weight: 800;
}

.detail {
  padding: clamp(1rem, 3vw, 2rem);
}

.detail header {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.detail h2 {
  font-size: clamp(1.65rem, 4vw, 3rem);
}

.detail-section {
  margin-top: 1.35rem;
}

.detail ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 780px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .sidebar {
    position: static;
  }
}
