/* Where's Gandhi — plain and functional. A form, some lists, a map.
   Denomination colors follow the Mahatma Gandhi New Series. */

:root {
  --bg: #FCFCFA;
  --ink: #1E1D1A;
  --ink-soft: #5B5850;
  --line: #D8D5CC;
  --accent: #4B3190;
  --accent-soft: #4b31904d;
  --d10: #96604C;
  --d20: #9AA13F;
  --d50: #3FA8C0;
  --d100: #8D7BA5;
  --d200: #D99A2B;
  --d500: #85826F;
  /* Badge pairs: dark ink on a light tint of each note color. Every pair
     clears 4.5:1 (WCAG 1.4.3) — the full-strength colors above stay for
     borders and the map, where contrast rules don't bind. */
  --d10-ink: #7A4A38;  --d10-bg: #F0E5E0;
  --d20-ink: #56601D;  --d20-bg: #EEF0DA;
  --d50-ink: #1E6B7E;  --d50-bg: #E0F1F5;
  --d100-ink: #5D4E78; --d100-bg: #E9E6F0;
  --d200-ink: #8A5E0F; --d200-bg: #F9EDD4;
  --d500-ink: #55523E; --d500-bg: #EAE9E2;
}

* { box-sizing: border-box; margin: 0; }

/* When mobile browsers auto-scroll a focused input above the virtual
   keyboard, keep it clear of the edges instead of flush against them. */
html { scroll-padding: 5rem 0 7rem; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.container { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

a { color: var(--accent); text-underline-offset: 3px; }

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

/* Hidden until keyboard focus lands on it — first tab stop on every page. */
.skip {
  position: fixed;
  top: -100px;
  left: 0.75rem;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}
.skip:focus { top: 0; }

h1, h2 { font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.15rem; margin-bottom: 0.6rem; }

/* ---- header / footer ---- */

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.25rem;
}
.wordmark {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--accent); }
.wordmark-hi {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 0.3rem;
}
header.site nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
/* Padding + negative margin: 24px hit targets (WCAG 2.5.8) with no layout shift. */
header.site nav a { color: var(--ink-soft); text-decoration: none; padding: 0.4rem 0.2rem; margin: -0.4rem -0.2rem; }
header.site nav a:hover { color: var(--accent); text-decoration: underline; }

footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  padding-bottom: 2.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.hero-title { font-size: 2.1rem; font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; max-width: 18ch; margin: 0.5rem 0 0.75rem; }
.intro { max-width: 42rem; color: var(--ink-soft); margin-bottom: 1.5rem; font-size: 1.05rem; }
.reunion {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 44rem;
}
.reunion strong { color: var(--ink); }

/* ---- form ---- */

.entry {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.1rem 1.25rem 1.25rem;
  border-radius: 4px;
}

.frow { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }

.entry label { display: block; padding-top: 0.75rem; min-width: 9rem; }
.entry .grow { flex: 1; min-width: 15rem; }

.entry label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}

.entry input, .entry select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #B9B5AA;
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
}
.entry input.mono { letter-spacing: 0.08em; }
.entry input:focus, .entry select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.entry input::placeholder { color: #7C766A; }

button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.4rem;
  margin-top: 0.75rem;
  cursor: pointer;
}
button:hover { background: #3a2573; }
button:active { transform: translateY(1px); }

.noteframe {
  margin: 0.9rem 0 0.2rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.6rem 0.75rem 0.5rem;
  max-width: 30rem;
  background: #FBFAF6;
}
.noteframe figcaption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.notepic { position: relative; }
.notepic img { display: block; width: 100%; height: auto; border-radius: 3px; }
/* the bottom-right number panel on the 2016 ₹500 obverse */
.callout-br {
  position: absolute;
  left: 58.5%;
  top: 82.5%;
  width: 35%;
  height: 15%;
  border: 3px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 0 1px #fff;
}
.callout-label {
  position: absolute;
  right: 42.5%;
  top: 84%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: #fffffff2;
  padding: 0 0.25rem;
  border-radius: 2px;
  white-space: nowrap;
}
.credit { display: block; margin-top: 0.35rem; font-size: 0.68rem; color: var(--ink-soft); }
.credit a { color: var(--ink-soft); }

.labelrow { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.labelrow .linkbtn { margin: -0.3rem -0.25rem; font-size: 0.74rem; text-transform: none; letter-spacing: 0; }

.fcol { padding-top: 0.75rem; }
.fcol label { padding-top: 0; }

button.linkbtn {
  display: inline-block;
  width: auto;
  background: none;
  color: var(--accent);
  border: none;
  /* Padding + negative margin: 24px hit target (WCAG 2.5.8), same visual spot. */
  padding: 0.3rem 0.25rem;
  margin: -0.05rem -0.25rem -0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}
button.linkbtn:hover { color: #3a2573; background: none; }
button.linkbtn:active { transform: none; }
/* The ⌖ glyph span is aria-hidden decoration — keep it inline even where
   the broad `.entry label span` caption rule would make it a block. */
button.linkbtn span { display: inline; font: inherit; color: inherit; margin: 0; }

.pinsuggest { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.4rem; font-size: 0.85rem; color: var(--ink-soft); }
.pinopt {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 400;
  padding: 0.3rem 0.55rem;
  margin: 0;
}
.pinopt:hover { border-color: var(--accent); color: var(--accent); background: #fff; }

.fieldhint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.onlyhand { color: #a03030; font-size: 0.82rem; margin-top: 0.6rem; }

.more { margin-top: 0.6rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.more summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}
.privline { color: var(--ink-soft); font-size: 0.78rem; margin-top: 0.4rem; }

.error {
  border: 1px solid #b05555;
  background: #b055550d;
  color: #7a2222;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}

.tally {
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 0.8rem 0.1rem;
  border-bottom: 1px solid var(--line);
}

/* ---- lists ---- */

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.75rem;
}

.feed, .board { list-style: none; padding: 0; }
.feed li, .board li {
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.board { counter-reset: rank; }
.board li { counter-increment: rank; }
.board li::before {
  content: counter(rank) ". ";
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.serial { font-weight: 600; }
.pin { color: var(--ink-soft); font-size: 0.82rem; }
.meta { display: block; color: var(--ink-soft); font-size: 0.82rem; }
.story { display: block; color: var(--ink-soft); font-style: italic; font-size: 0.9rem; }
.empty { color: var(--ink-soft); }

.denom {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
}
.d10 { background: var(--d10-bg); color: var(--d10-ink); }
.d20 { background: var(--d20-bg); color: var(--d20-ink); }
.d50 { background: var(--d50-bg); color: var(--d50-ink); }
.d100 { background: var(--d100-bg); color: var(--d100-ink); }
.d200 { background: var(--d200-bg); color: var(--d200-ink); }
.d500 { background: var(--d500-bg); color: var(--d500-ink); }

.pagetitle { font-size: 1.4rem; margin: 0.5rem 0 1rem; }

.loginbox { max-width: 28rem; margin-top: 1.5rem; }
.mehead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mehead form { margin: 0; }
.notelink { text-decoration: none; color: var(--ink); font-weight: 600; }
.notelink:hover .serial { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---- note page ---- */

.notehead { margin-top: 0.5rem; }
.notekind { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.serialpanel {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.05em;
  font-size: clamp(1.9rem, 6.5vw, 3.2rem);
  border-left: 7px solid var(--d100);
  padding-left: 0.35em;
  margin: 0.35rem 0 0.5rem;
}
.serialpanel.d10 { border-color: var(--d10); background: none; color: var(--ink); }
.serialpanel.d20 { border-color: var(--d20); background: none; color: var(--ink); }
.serialpanel.d50 { border-color: var(--d50); background: none; color: var(--ink); }
.serialpanel.d100 { border-color: var(--d100); background: none; color: var(--ink); }
.serialpanel.d200 { border-color: var(--d200); background: none; color: var(--ink); }
.serialpanel.d500 { border-color: var(--d500); background: none; color: var(--ink); }

.serialpanel span:nth-child(1)  { font-size: 0.62em; }
.serialpanel span:nth-child(2)  { font-size: 0.66em; }
.serialpanel span:nth-child(3)  { font-size: 0.70em; }
.serialpanel span:nth-child(4)  { font-size: 0.75em; }
.serialpanel span:nth-child(5)  { font-size: 0.80em; }
.serialpanel span:nth-child(6)  { font-size: 0.85em; }
.serialpanel span:nth-child(7)  { font-size: 0.90em; }
.serialpanel span:nth-child(8)  { font-size: 0.95em; }
.serialpanel span:nth-child(9)  { font-size: 1.0em; }
.serialpanel span:nth-child(10) { font-size: 1.06em; }
.serialpanel span:nth-child(11) { font-size: 1.12em; }

.bio { color: var(--ink-soft); font-style: italic; margin-bottom: 0.6rem; }

.badges { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.badges li { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.35rem; max-width: 42rem; }
.badges strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  padding: 0.02rem 0.35rem;
  margin-right: 0.4rem;
}

.notestats { color: var(--ink-soft); font-size: 0.92rem; }
.notestats strong { color: var(--ink); }

#map {
  /* Tall enough that a cross-country trail reads as a journey. */
  height: 24rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 1.25rem 0 1.75rem;
  background: #fff;
}

.trail h2 { margin-bottom: 0.4rem; }
.meta-inline { font-size: 0.8rem; font-weight: 400; color: var(--ink-soft); }

.trailtable { border-top: 2px solid var(--ink); }
.trow {
  display: grid;
  grid-template-columns: 10.5rem 1fr 8rem 4rem;
  gap: 0.2rem 1rem;
  align-items: baseline;
  padding: 0.55rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.trow.thead {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 0.35rem 0.1rem;
}
.tdate { font-size: 0.82rem; color: var(--ink-soft); }
.tplace { font-weight: 600; }
.tpin { font-weight: 400; font-size: 0.78rem; color: var(--ink-soft); }
.tgap { color: var(--ink-soft); font-size: 0.85rem; }
.tkm { text-align: right; }
.tnote { grid-column: 1 / -1; }
.trow.flagged { opacity: 0.55; }

@media (max-width: 44rem) {
  .trow { grid-template-columns: 1fr 4rem; }
  /* Visually hidden, not display:none — the ARIA table still needs its
     column headers in the accessibility tree. */
  .trow.thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    padding: 0;
  }
  .tdate { grid-column: 1 / -1; order: -1; }
  .tgap { grid-column: 1; }
}

.added {
  border: 1.5px dashed var(--accent);
  color: var(--accent);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0;
  font-weight: 500;
}

/* Post-add email ask — the reunion pitch at its most persuasive moment. */
.watchcard {
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  border-radius: 4px;
  padding: 0.9rem;
  margin: 0.75rem 0 1.25rem;
  max-width: 34rem;
}
.watchcard form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.watchcard label { flex: 1 1 16rem; display: block; }
.watchcard label span { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--ink-soft); }
.watchcard input { width: 100%; }
.watchcard button { flex: 0 0 auto; }

/* Homepage lookup reassurance + PIN-pick guidance. */
.trustline { color: var(--ink-soft); font-size: 0.82rem; margin-top: 0.6rem; }
.pinhelp { flex-basis: 100%; margin: 0 0 0.15rem; font-size: 0.85rem; color: var(--ink-soft); }
.addform { margin-top: 1.5rem; }

/* ---- about ---- */

.prose { max-width: 42rem; padding: 0.5rem 0; }
.prose h1 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.prose h2 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { color: var(--ink); }

/* ---- desktop ---- */

@media (min-width: 52rem) {
  .columns { grid-template-columns: 1.5fr 1fr; gap: 3rem; }
  #map { height: 28rem; }
}

/* wide screens: specimen guide sits beside the fields instead of leaving
   the right half of the card empty */
@media (min-width: 62rem) {
  /* :has scopes this to the sighting form — the login form is also
     .entry and must not grow a phantom second column */
  .entry form:has(.noteframe) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26rem;
    column-gap: 2.5rem;
    align-items: start;
  }
  .entry form:has(.noteframe) > * { grid-column: 1; }
  .entry form .noteframe { grid-column: 2; grid-row: 1 / span 5; margin-top: 0.75rem; }
}

/* ---- compact phone layout: required fields + button without scrolling ---- */

@media (max-width: 40rem) {
  body { font-size: 0.95rem; }
  .hero-title { font-size: 1.7rem; }
  .intro { font-size: 1rem; }
  header.site {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding-top: 0.9rem;
    padding-bottom: 0.6rem;
  }
  .wordmark { font-size: 1.2rem; white-space: nowrap; }
  header.site nav { gap: 1rem; font-size: 0.85rem; }
  header.site nav a { white-space: nowrap; }
  .intro { margin-bottom: 1rem; }
  .entry { padding: 0.8rem 0.9rem 1rem; }
  .entry h2 { font-size: 1.05rem; margin-bottom: 0.3rem; }
  .noteguide { max-width: 15rem; margin: 0.15rem 0 0.25rem; }
  .frow { gap: 0.35rem; }
  .entry label { padding-top: 0.45rem; min-width: 100%; }
  .fcol { padding-top: 0.45rem; min-width: 100%; }
  .fcol label { padding-top: 0; }
  .entry label span { font-size: 0.76rem; margin-bottom: 0.15rem; }
  /* 16px floor: iOS Safari zooms the page when focusing any input
     whose font-size is smaller. */
  .entry input, .entry select { padding: 0.45rem 0.55rem; font-size: 16px; }
  button { width: 100%; margin-top: 0.6rem; padding: 0.65rem; }
  button.linkbtn { width: auto; padding: 0.3rem 0.25rem; margin: -0.05rem -0.25rem -0.3rem; }
  .onlyhand { font-size: 0.76rem; margin-top: 0.45rem; }
  .more { margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Jump link to the add form — the holder's task shouldn't depend on how
   long the trail above it has grown. */
.addjump { font-size: 0.92rem; margin: 0.5rem 0 0; }
