:root {
  --grit: #3a3530;
  --oxide: #b54a2a;
  --flag: #e4dfd6;
  --paper: #f3efe7;
  --mute: #6a6258;
  --line: #c9c2b6;
  --radius: 5px;
  --hold: 40rem;
  --wide: 70rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--grit);
  background: var(--grit);
  font-family: Figtree, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--grit); text-underline-offset: 0.18em; }
a:hover { color: var(--oxide); }

h1, h2, h3 {
  font-family: "Young Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.18;
  color: var(--grit);
}

h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); margin: 0 0 1rem; }
h2 { font-size: 1.28rem; margin: 0 0 0.55rem; }
p { margin: 0 0 1rem; }

.hgs-skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--paper);
  padding: 0.4rem 0.7rem;
}
.hgs-skip:focus { left: 0.5rem; z-index: 8; }

.hgs-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 72px 1fr;
}

.hgs-index {
  background: var(--grit);
  color: var(--flag);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 0.4rem 2rem;
  gap: 1.4rem;
}

.hgs-index-ring {
  width: 42px;
  color: var(--oxide);
}

.hgs-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #cfc7bb;
}

.hgs-index-list li { margin-block: 0.55rem; }

.hgs-sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--flag);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(58, 53, 48, 0.045) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 18%, rgba(181, 74, 42, 0.05) 0 70px, transparent 71px),
    radial-gradient(circle at 40% 70%, rgba(58, 53, 48, 0.03) 0 140px, transparent 141px);
}

.hgs-lintel {
  background: var(--grit);
  color: var(--flag);
}

.hgs-lintel-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.95rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hgs-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--flag);
}
.hgs-mark:hover { color: #f0e8dc; }
.hgs-mark-text { display: flex; flex-direction: column; }
.hgs-mark-name {
  font-family: "Young Serif", Georgia, serif;
  font-size: 1.22rem;
}
.hgs-mark-place {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cfc7bb;
}

.hgs-peglist {
  display: none;
  border: 1px solid var(--flag);
  background: transparent;
  color: var(--flag);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.hgs-lintel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.45rem;
}
.hgs-lintel-link {
  text-decoration: none;
  color: #ddd6cc;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}
.hgs-lintel-link:hover,
.hgs-lintel-on {
  color: var(--flag);
}
.hgs-lintel-on::after {
  content: "";
  position: absolute;
  right: -0.55rem;
  top: 0.35rem;
  width: 0.35rem;
  height: 0.08rem;
  background: var(--oxide);
}

.hgs-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.8rem 1.3rem 2.4rem;
}

.hgs-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oxide);
  margin-bottom: 0.35rem;
}

.hgs-lead { color: var(--mute); max-width: 38rem; }

.hgs-open { display: flex; flex-direction: column; }

address.hgs-lodge { font-style: normal; }

.hgs-plaque,
.hgs-pegs,
.hgs-clip,
.hgs-ticks,
.hgs-lane,
.hgs-lodge {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.hgs-main > :last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.hgs-plaque {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.6rem;
  align-items: stretch;
}

.hgs-stone {
  background: var(--grit);
  color: var(--flag);
  padding: 1.6rem 1.2rem 1.3rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 16rem;
  animation: stone-settle 0.8s ease both;
}

.hgs-stone-name {
  font-family: "Young Serif", Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.hgs-stone-chip {
  display: inline-block;
  align-self: flex-start;
  border: 1px solid var(--oxide);
  color: var(--flag);
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  border-radius: var(--radius);
}

.hgs-stone-ring {
  width: 92px;
  margin-top: 1.2rem;
  align-self: flex-end;
}

@keyframes stone-settle {
  from { opacity: 0; transform: translateY(1px); }
  to { opacity: 1; transform: translateY(0); }
}

.hgs-oxide {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.62rem 1.1rem;
  background: var(--oxide);
  color: var(--flag);
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.hgs-oxide:hover { background: #9e3d22; color: var(--paper); }

.hgs-ink {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--oxide);
}

.hgs-peg-row {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.hgs-peg-stack,
.hgs-clip-stack {
  list-style: none;
  margin: 0.8rem 0 1.2rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.hgs-peg-card,
.hgs-clip-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 1.15rem;
  border-left: 3px solid transparent;
  position: relative;
}

.hgs-peg-card[data-oxide-tick] { border-left-color: var(--line); }
.hgs-peg-card.is-cut { border-left-color: var(--oxide); }

.hgs-peg-mark {
  display: inline-block;
  font-family: "Young Serif", Georgia, serif;
  font-size: 0.85rem;
  color: var(--oxide);
  margin-bottom: 0.25rem;
}

.hgs-peg-meta {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.35rem;
}

.hgs-peg-card h2,
.hgs-clip-card h2 { font-size: 1.12rem; }
.hgs-peg-card h2 a,
.hgs-clip-card h2 a { text-decoration: none; }
.hgs-peg-card p,
.hgs-clip-card p { margin-bottom: 0; color: var(--mute); }

.hgs-tick-row {
  margin: 0.4rem 0 1rem;
  padding-left: 1.15rem;
}
.hgs-tick-row li { margin-bottom: 0.45rem; }
.hgs-tick-tall li { margin-bottom: 0.8rem; }

.hgs-hold {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.4rem;
  align-items: start;
}

.hgs-num {
  min-height: 8rem;
  border-left: 2px solid var(--oxide);
  padding-left: 0.45rem;
  font-family: "Young Serif", Georgia, serif;
  color: var(--oxide);
  font-size: 0.95rem;
}

.hgs-read { max-width: var(--hold); }

.hgs-plain { padding-left: 1.15rem; }
.hgs-plain li { margin-bottom: 0.4rem; }

.hgs-fields div,
.hgs-asks div {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.hgs-fields dt,
.hgs-asks dt { font-weight: 600; margin-bottom: 0.2rem; }
.hgs-fields dd,
.hgs-asks dd { margin: 0; color: var(--mute); }
.hgs-fields a { color: var(--grit); }

.hgs-slip {
  display: grid;
  gap: 0.85rem;
  max-width: 28rem;
  margin: 1.4rem 0;
}
.hgs-slip label { display: grid; gap: 0.3rem; font-size: 0.92rem; }
.hgs-slip input,
.hgs-slip textarea {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.hgs-kept {
  background: var(--paper);
  border-left: 3px solid var(--oxide);
  padding: 1rem 1.1rem;
}
.hgs-kept pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0;
}

.hgs-map {
  columns: 2;
  column-gap: 2rem;
  padding-left: 1.1rem;
}

.hgs-plate {
  background: var(--grit);
  color: #d8d1c6;
  margin-top: auto;
}

.hgs-plate-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.6rem 1.3rem 2rem;
}

.hgs-plate-brand {
  font-family: "Young Serif", Georgia, serif;
  color: var(--flag);
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

.hgs-plate-line,
.hgs-plate-bound,
.hgs-plate-addr,
.hgs-plate-reach,
.hgs-plate-duns { font-size: 0.92rem; color: #cfc7bb; }
.hgs-plate-reach a { color: #d8d1c6; }
.hgs-plate-reach a:hover { color: var(--flag); }

.hgs-plate-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.05rem;
  margin: 1rem 0 0.8rem;
}
.hgs-plate-stamps a {
  color: #d8d1c6;
  text-decoration: none;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--oxide);
}
.hgs-plate-stamps a:hover { color: var(--flag); }

.hgs-plate-year { font-size: 0.8rem; margin: 0; color: #b8b0a4; }

@media (max-width: 860px) {
  .hgs-plaque,
  .hgs-peg-row { grid-template-columns: 1fr; }
  .hgs-stone { min-height: 12rem; }
}

@media (max-width: 720px) {
  .hgs-shell { grid-template-columns: 1fr; }
  .hgs-index { display: none; }
  .hgs-hold { grid-template-columns: 1fr; }
  .hgs-num { min-height: 0; border-left: 0; border-top: 2px solid var(--oxide); padding: 0.35rem 0 0; }
  .hgs-peglist { display: inline-block; }
  .hgs-lintel-links {
    width: 100%;
    flex-direction: column;
    padding-top: 0.35rem;
  }
  .hgs-lintel-links[hidden] { display: none !important; }
  .hgs-map { columns: 1; }
}

@media (min-width: 721px) {
  .hgs-lintel-links[hidden] { display: flex !important; }
}
