:root {
  --bg: #f5f7f3;
  --ink: #17211d;
  --muted: #52635c;
  --panel: #ffffff;
  --line: #d8ded6;
  --green: #2f7d57;
  --green-dark: #235d42;
  --red: #bb3e37;
  --red-dark: #8d2f2a;
  --blue: #2d6cdf;
  --yellow: #f6cb4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button {
  border: 1px solid var(--green-dark);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
}

button:hover,
button:focus {
  background: var(--green-dark);
}

code {
  background: #edf1ea;
  border-radius: 4px;
  padding: 0.08rem 0.22rem;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 2rem;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.page-nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

.page-nav a:hover,
.page-nav a:focus,
.page-nav a[aria-current="page"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.hero {
  margin-bottom: 1.5rem;
}

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

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

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 0.8rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.summary {
  color: var(--muted);
  max-width: 760px;
}

.demo-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

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

.link-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  text-decoration: none;
}

.link-card:hover,
.link-card:focus {
  border-color: var(--green);
}

.link-card strong {
  font-size: 1.25rem;
}

.link-card__eyebrow {
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.map-panel,
.status-panel,
.timeline-section,
.code-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-panel {
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem;
}

.map-surface {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.65) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.65) 1px, transparent 1px),
    #dfe9d9;
  background-size: 44px 44px;
  border-top: 1px solid var(--line);
  min-height: 320px;
  overflow: hidden;
  position: relative;
}

.map-road {
  background: #fff7dd;
  border: 2px solid #dfc97f;
  height: 70px;
  left: -8%;
  position: absolute;
  right: -8%;
  top: 48%;
  transform: rotate(-12deg);
}

.map-road-b {
  top: 20%;
  transform: rotate(28deg);
}

.map-water {
  background: #a7d5da;
  bottom: -12%;
  height: 36%;
  left: 0;
  position: absolute;
  right: 0;
  transform: skewY(-4deg);
}

.marker-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  left: 50%;
  position: absolute;
  top: 43%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.marker-card img {
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.32));
  height: 88px;
  width: 64px;
}

.marker-card p {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  margin: 0;
  padding: 0.25rem 0.55rem;
}

.status-panel {
  padding: 1rem;
}

.status-list {
  border-top: 1px solid var(--line);
  margin: 1rem 0 0;
}

.status-list div {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.status-list dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-list dd {
  margin: 0.2rem 0 0;
}

.timeline-section,
.code-section {
  margin-top: 1rem;
  padding: 1rem;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.section-heading h2 {
  margin-bottom: 0;
}

#clear-log {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.event-log {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.event-log li {
  border-left: 5px solid var(--line);
  background: #f8faf7;
  padding: 0.65rem 0.75rem;
}

.event-log li.module {
  border-left-color: var(--green);
}

.event-log li.site {
  border-left-color: var(--red);
}

.event-log li.event {
  border-left-color: var(--blue);
}

.event-log li.result.fail {
  border-left-color: var(--red);
}

.event-log li.result.pass {
  border-left-color: var(--green);
}

.event-time {
  color: var(--muted);
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 4.5rem;
}

pre {
  background: #101713;
  border-radius: 8px;
  color: #eef7ef;
  overflow-x: auto;
  padding: 1rem;
}

pre code {
  background: transparent;
  padding: 0;
}

@media (max-width: 820px) {
  .page {
    padding: 1rem;
  }

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

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

  .map-surface {
    min-height: 260px;
  }
}
