:root {
  --paper: #fff;
  --ink: #3e4a32;
  --card: #fffcf7;
  --space: 1rem;
  --stack: 0.5rem;
  --radius: 12px;
  --title: 1.5625rem;
  --body: 1rem;
  --green: #434f2f;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: var(--body);
  line-height: 1.45;
}

.layout {
  display: grid;
  align-items: start;
  padding-bottom: calc(var(--space) + var(--stack));
}

.map {
  position: relative;
  z-index: 0;
  width: 100%;
  min-width: 0;
  line-height: 0;
  background: var(--paper);
}

.map img {
  width: 100%;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ribbon {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  margin-top: calc(100% * -22 / 1024);
  pointer-events: none;
  user-select: none;
}

.spot { cursor: pointer; outline: none; }

.hit,
.wash,
.edge {
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hit { fill: transparent; stroke: transparent; }

.wash,
.edge { fill: none; stroke: none; pointer-events: none; }

.spot.is-selected .wash {
  fill: rgba(255, 255, 255, 0.48);
  stroke: #fff;
  stroke-width: 2;
}

.spot.is-selected .edge {
  stroke: #fff;
  stroke-width: 1.25;
}

.spot.is-hover .wash,
.spot:focus-visible .wash {
  fill: rgba(67, 79, 47, 0.34);
  stroke: var(--green);
  stroke-width: 2;
}

.spot.is-hover .edge,
.spot:focus-visible .edge {
  stroke: var(--green);
  stroke-width: 1.25;
}

.panel {
  display: none;
  margin: calc(var(--stack) * -1) 0 0;
  padding: var(--stack) var(--space) 0;
  background: var(--paper);
}

.panel .body { display: none; }

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .panel { display: block; }
  .panel .body { display: block; }
}

.title,
.body { margin: 0; }

.body {
  margin-top: var(--stack);
  white-space: pre-line;
}

.title.is-fresh,
.body.is-fresh {
  animation: note-in 0.4s ease;
}

@keyframes note-in {
  from { opacity: 0; transform: translateY(0.35rem); }
  to { opacity: 1; transform: none; }
}

.title {
  color: var(--green);
  font-size: var(--title);
  font-weight: 700;
  line-height: 1.2;
  scroll-margin-top: var(--space);
}

.tip {
  position: fixed;
  z-index: 5;
  display: none;
  max-width: 18rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  color: var(--ink);
  font-size: var(--body);
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(37, 32, 30, 0.18);
  pointer-events: none;
  transform: translateY(-50%);
}

.tip.is-on { display: block; }

.tip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

.tip.is-flip::before {
  left: auto;
  right: -6px;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #fff;
}

.fence-anchor {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  top: calc(100% * 1303 / 1563);
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--space);
  background: rgba(62, 74, 50, 0.45);
}

.lightbox[hidden] { display: none; }

.lightbox-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 28rem);
  max-height: min(28rem, calc(100% - var(--space)));
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius);
}

.lightbox-card.is-more::after {
  content: "";
  position: absolute;
  left: 0;
  right: var(--stack);
  bottom: 0;
  height: calc(var(--space) + var(--space));
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(transparent, var(--paper));
  pointer-events: none;
}

.lightbox-copy {
  position: relative;
  z-index: 0;
  min-height: 0;
  overflow: auto;
  padding: 0 var(--space) var(--space);
}

.lightbox-copy::-webkit-scrollbar {
  width: var(--space);
}

.lightbox-copy::-webkit-scrollbar-track { background: var(--card); }

.lightbox-copy::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: var(--radius);
}

.lightbox-close {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  flex: none;
  width: calc(var(--space) + var(--space));
  height: calc(var(--space) + var(--space));
  margin: var(--stack);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--title);
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.lightbox-card .title { font-size: calc(var(--title) * 0.92); }

.lightbox-card .body {
  margin-top: var(--stack);
  font-size: calc(var(--body) * 0.92);
}

.gate {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: var(--space);
}

.gate-card { width: min(100%, 40rem); }

.field {
  display: grid;
  gap: var(--stack);
  margin-top: var(--space);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: var(--stack) var(--space);
}

.field textarea { min-height: 6rem; }

.action {
  display: block;
  width: 100%;
  margin-top: var(--space);
  font: inherit;
  font-size: var(--body);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--paper);
  background: var(--green);
  border: 0;
  border-radius: var(--radius);
  padding: var(--stack) var(--space);
  cursor: pointer;
}

.copy-list { margin-top: var(--space); }

.copy-item {
  margin-top: var(--space);
  padding-top: var(--space);
  border-top: 1px solid var(--green);
}

@media (prefers-reduced-motion: reduce) {
  .spot { transition: none; }
  .title.is-fresh,
  .body.is-fresh { animation: none; }
}
