:root {
  color-scheme: light;
  --ink: #171a17;
  --ink-soft: #3e453d;
  --paper: #f3efe4;
  --paper-strong: #fffaf0;
  --line: #d7cdbb;
  --line-dark: #354039;
  --field: #232a25;
  --field-strong: #111511;
  --rust: #b64234;
  --rust-dark: #7f2d27;
  --amber: #d6a534;
  --green: #4e9a72;
  --blue: #4c8ca5;
  --muted: #7b7568;
  --shadow: 0 18px 45px rgba(18, 20, 18, 0.18);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--rust);
}

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 30;
  padding: 8px 12px;
  color: var(--paper-strong);
  background: var(--rust);
  border-radius: 4px;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(243, 239, 228, 0.18);
  background: rgba(17, 21, 17, 0.95);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  width: min(100% - 32px, var(--max));
  min-height: 72px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 168px;
  color: var(--paper-strong);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--paper-strong);
  font-weight: 800;
  background: var(--rust);
  border: 1px solid rgba(255, 250, 240, 0.25);
  border-radius: 6px;
}

.brand-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-sub {
  display: block;
  color: #d7cdbb;
  font-size: 12px;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.site-nav a,
.header-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.site-nav a {
  color: #e6dece;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--paper-strong);
  background: rgba(214, 165, 52, 0.16);
  border-color: rgba(214, 165, 52, 0.35);
}

.header-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.header-action {
  color: var(--paper-strong);
  background: rgba(182, 66, 52, 0.18);
  border-color: rgba(182, 66, 52, 0.55);
}

.header-action:hover {
  color: var(--paper-strong);
  background: var(--rust);
}

.main {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 540px;
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(17, 21, 17, 0.96) 0%, rgba(17, 21, 17, 0.78) 42%, rgba(17, 21, 17, 0.25) 100%),
    url("../img/survival-panel.png") center / cover no-repeat;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: end;
  width: min(100% - 32px, var(--max));
  min-height: 540px;
  margin: 0 auto;
  padding: 64px 0 38px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: #fff2c6;
  background: rgba(214, 165, 52, 0.14);
  border: 1px solid rgba(214, 165, 52, 0.35);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 44px;
  line-height: 1.16;
}

h2 {
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.22;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.3;
}

.lead {
  max-width: 680px;
  margin-bottom: 24px;
  color: #e8dfce;
  font-size: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
}

.button {
  color: var(--paper-strong);
  background: var(--rust);
  border-color: var(--rust-dark);
}

.button:hover {
  color: var(--paper-strong);
  background: var(--rust-dark);
}

.button.secondary {
  color: var(--paper-strong);
  background: rgba(255, 250, 240, 0.09);
  border-color: rgba(255, 250, 240, 0.28);
}

.button.secondary:hover {
  background: rgba(214, 165, 52, 0.18);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  background: rgba(17, 21, 17, 0.76);
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-item {
  min-height: 78px;
  padding: 12px;
  background: rgba(255, 250, 240, 0.06);
  border: 1px solid rgba(255, 250, 240, 0.12);
  border-radius: 6px;
}

.status-label {
  display: block;
  color: #d7cdbb;
  font-size: 12px;
}

.status-value {
  display: block;
  margin-top: 4px;
  color: var(--paper-strong);
  font-size: 17px;
  font-weight: 800;
}

.section {
  padding: 56px 0;
}

.section.alt {
  background: #e8e1d3;
}

.section.dark {
  color: var(--paper-strong);
  background: var(--field);
}

.section-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--rust);
  font-size: 13px;
  font-weight: 800;
}

.section.dark .section-kicker {
  color: var(--amber);
}

.section-desc {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.section.dark .section-desc {
  color: #d7cdbb;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card,
.entry-card,
.resource-card,
.route-card {
  padding: 18px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 20, 18, 0.08);
}

.section.dark .task-card,
.section.dark .entry-card,
.section.dark .resource-card,
.section.dark .route-card {
  color: var(--paper-strong);
  background: #18201b;
  border-color: rgba(255, 250, 240, 0.12);
}

.task-card {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  justify-content: space-between;
}

.task-card p,
.entry-card p,
.resource-card p,
.route-card p {
  margin-bottom: 12px;
  color: var(--ink-soft);
}

.section.dark .task-card p,
.section.dark .entry-card p,
.section.dark .resource-card p,
.section.dark .route-card p {
  color: #d7cdbb;
}

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--rust);
  font-weight: 800;
}

.section.dark .card-link {
  color: var(--amber);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  color: var(--ink-soft);
  background: #eee5d6;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.tag.rust {
  color: #fff7ea;
  background: var(--rust);
  border-color: var(--rust-dark);
}

.tag.green {
  color: #f7fff9;
  background: var(--green);
  border-color: #3d775b;
}

.tag.blue {
  color: #f5fbff;
  background: var(--blue);
  border-color: #3b6d80;
}

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

.entry-card {
  min-height: 240px;
}

.meta-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.meta-list strong {
  color: var(--ink);
}

.section.dark .meta-list strong {
  color: var(--paper-strong);
}

.page-hero {
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(17, 21, 17, 0.95), rgba(35, 42, 37, 0.74)),
    url("../img/survival-panel.png") center / cover no-repeat;
}

.page-hero-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 72px 0 44px;
}

.page-hero h1 {
  margin-bottom: 12px;
}

.page-hero .lead {
  max-width: 790px;
  margin-bottom: 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.filter-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.filter-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.route-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.route-card {
  min-height: 180px;
}

.resource-card {
  min-height: 210px;
}

.notice {
  padding: 18px;
  background: #fff6df;
  border: 1px solid #e0c477;
  border-left: 6px solid var(--amber);
  border-radius: 6px;
}

.section.dark .notice {
  color: var(--paper-strong);
  background: rgba(214, 165, 52, 0.12);
  border-color: rgba(214, 165, 52, 0.42);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

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

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

th {
  color: var(--paper-strong);
  background: var(--field);
  font-size: 14px;
}

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

.site-footer {
  color: #d7cdbb;
  background: var(--field-strong);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 36px 0;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--paper-strong);
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }

  .brand,
  .header-tools {
    justify-content: center;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    align-items: center;
    min-height: auto;
    padding: 52px 0 34px;
  }

  .status-strip,
  .task-grid,
  .entry-grid,
  .route-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 36px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .site-header {
    position: static;
  }

  .site-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

  .header-tools {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner,
  .page-hero-inner {
    width: min(100% - 24px, var(--max));
  }

  .section-inner,
  .header-inner,
  .footer-inner {
    width: min(100% - 24px, var(--max));
  }

  .hero-inner {
    padding: 30px 0 18px;
  }

  .page-hero-inner {
    padding: 46px 0 34px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  .lead {
    font-size: 15px;
  }

  .section {
    padding: 42px 0;
  }

  .section-head,
  .filter-bar,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .task-grid,
  .entry-grid,
  .route-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .status-item {
    min-width: 0;
    min-height: 74px;
    padding: 10px;
  }

  .status-label {
    font-size: 10px;
    line-height: 1.25;
  }

  .status-value {
    font-size: 13px;
    line-height: 1.25;
  }

  .button,
  .header-action {
    width: 100%;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
}
