/*
  open:grounds — styles.css
  a citizen map of shared resources in davis, ca
  by zahra baxi
*/

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Design tokens — all colors and the global border live here
   so we only have to change them in one place */
:root {
  --paper:      #F7F4EC;   /* warm off-white, main background */
  --paper-dim:  #ECE6D9;   /* slightly darker for input fields */
  --ink:        #15130F;   /* near-black for text and borders */

  /* accent palette */
  --pink:       #FF3E86;
  --pink-tint:  #ECE6D9;
  --sky:        #2F9BD6;
  --sky-tint:   #DDF1FA;
  --grass:      #2F4D22;
  --grass-tint: #E6EEDF;
  --flame:      #FF5722;
  --flame-tint: #ECE6D9;
  --sun:        #FFC53D;
  --plum:       #8B5CF6;
  --teal:       #1F6B5C;
  --rust:       #B0431E;
  --indigo:     #4F6BFF;
  --rose:       #C2185B;
  --umber:      #9C6B30;
  --stone:      #75695A;

  --border: 3px solid var(--ink);
}

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden; /* map takes full viewport, no page scroll */
}


/* ============================================================
   HEADER
   ============================================================ */

header {
  border-bottom: var(--border);
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  background: var(--paper);
  position: relative;
  z-index: 10;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-title .punct { font-weight: 100; color: var(--flame); }
.brand-title .ital  { font-weight: 100; font-style: italic; color: var(--pink); }

.brand-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
}

.header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.55rem 1.1rem;
  border: var(--border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.1s, color 0.1s;
  white-space: nowrap;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover  { background: var(--ink); color: var(--paper); }
.btn:active { transform: translate(2px, 2px); }

/* slightly muted secondary button style */
.btn-secondary {
  border-width: 2px;
  font-size: 0.75rem;
  color: var(--stone);
  border-color: rgba(21,19,15,0.3);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* the prominent "add a place" CTA */
.btn-add {
  background: var(--flame);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-add:hover  { background: var(--ink); }
.btn-add:active { box-shadow: 1px 1px 0 var(--ink); }


/* ============================================================
   APP LAYOUT  (sidebar + drag handle + map)
   ============================================================ */

.app-body {
  display: grid;
  grid-template-columns: 300px 4px 1fr; /* sidebar | handle | map */
  height: calc(100vh - 64px);           /* fill below the header */
}

/* The thin draggable bar between the sidebar and the map */
.resize-handle {
  background: var(--ink);
  cursor: col-resize;
  position: relative;
  z-index: 5;
  transition: background 0.1s;
  flex-shrink: 0;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: var(--flame); /* turns orange while you drag */
}

/* little dotted grip indicator in the center of the handle */
.resize-handle::after {
  content: '⋮';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0;
  pointer-events: none;
}


/* ============================================================
   SIDEBAR & PANELS
   ============================================================ */

.sidebar {
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

.panel {
  border-bottom: 1px solid rgba(21,19,15,0.12);
  padding: 1rem 1.15rem;
  overflow: hidden;
  min-height: 60px;
  display: flex;
  flex-direction: column;
}

/* one quiet background for the whole sidebar — color is reserved
   for actual data (category swatches, listing numbers), not chrome */
.panel-tags,
.panel-filters,
.panel-index { background: var(--paper); }

/* sensible starting heights — all freely resizable via the drag
   handles between panels, with a 60px floor so none can be crushed
   away entirely. content scrolls inside a panel once it outgrows
   the height the user has given it. */
.panel-tags    { flex: 0 0 auto; }      /* sized to its own content */
.panel-filters { flex: 0 0 220px; }
.panel-index   { flex: 1 1 auto; }      /* takes remaining space */

.panel-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}
.panel-index .panel-label {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.72rem;
}
.panel-label .muted {
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--stone);
}

/* horizontal drag handle between panels — mirrors the vertical one on the sidebar */
.panel-resize-handle {
  height: 4px;
  background: rgba(21,19,15,0.15);
  cursor: row-resize;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  transition: background 0.1s;
}
.panel-resize-handle:hover,
.panel-resize-handle.dragging {
  background: var(--flame);
}
/* subtle grip dots in the center */
.panel-resize-handle::after {
  content: '···';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--stone);
  font-size: 10px;
  letter-spacing: 2px;
  pointer-events: none;
  line-height: 0;
}


/* ============================================================
   CATEGORY FILTER BUTTONS
   ============================================================ */

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  /* pull it edge-to-edge so scrollbar sits flush */
  margin: 0 -1.15rem -1rem;
  padding: 0 1.15rem 1rem;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.38rem 0.5rem;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.cat-btn:hover:not(.active) { background: rgba(21,19,15,0.06); }

.cat-btn.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* the little colored square next to each category label */
.cat-swatch {
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(21,19,15,0.4);
  background: var(--cat-color); /* set via inline CSS variable per button */
  flex-shrink: 0;
}
.cat-btn.active .cat-swatch { border-color: var(--paper); }

/* the small place-count on the right of each button */
.cat-count {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--stone);
  opacity: 0.7;
}


/* ============================================================
   DATA SOURCE LEGEND
   ============================================================ */

.source-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
}

.source-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}


/* ============================================================
   PLACE INDEX / LISTINGS (scrollable list in sidebar)
   ============================================================ */

#listings {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* negative margin pulls it edge-to-edge inside the panel padding */
  margin: 0 -1.15rem -1rem;
  padding: 0 1.15rem 1rem;
}

.listing-card {
  display: flex;
  gap: 0.7rem;
  border-bottom: 1.5px solid rgba(21,19,15,0.18);
  padding: 0.65rem 0;
  cursor: pointer;
}
.listing-card:last-child { border-bottom: none; }
.listing-card:hover .listing-name { text-decoration: underline; }

/* the numbered circle on the left of each card */
.listing-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--cat-color);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.listing-body { flex: 1; min-width: 0; }

.listing-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
}

.listing-addr {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--stone);
  margin-top: 0.15rem;
}

.listing-tags {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* pill-style tags for category, status, and website link */
.listing-tag {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(21,19,15,0.3);
  color: var(--stone);
  transition: clip-path 0.18s ease, transform 0.18s ease, padding 0.18s ease, border-radius 0.18s ease;
  transform-origin: center;
}

/* category tag — the one piece of color allowed in the tag row,
   echoing the listing-num circle so it doesn't add a new color */
.listing-tag.cat-tag {
  border-color: transparent;
  font-weight: 700;
}

/* starburst burst state — 12-point star via clip-path, like image 1 */
@keyframes burst-pop {
  0%   { transform: scale(0.7) rotate(-6deg); }
  55%  { transform: scale(1.18) rotate(3deg); }
  80%  { transform: scale(0.97) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.listing-tag.cat-tag.burst {
  clip-path: polygon(
    50% 0%, 56% 20%, 65% 7%, 65% 28%, 80% 20%, 73% 38%,
    93% 36%, 80% 50%, 93% 64%, 73% 62%, 80% 80%, 65% 72%,
    65% 93%, 56% 80%, 50% 100%, 44% 80%, 35% 93%, 35% 72%,
    20% 80%, 27% 62%, 7% 64%, 20% 50%, 7% 36%, 27% 38%,
    20% 20%, 35% 28%, 35% 7%, 44% 20%
  );
  padding: 0.65rem 0.65rem;
  border: none;
  border-radius: 0;
  animation: burst-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  z-index: 2;
}

.listing-tag.status {
  background: var(--flame);
  color: var(--paper);
  border-color: var(--flame);
}

.listing-link {
  background: transparent;
  color: var(--flame);
  text-decoration: none;
  border-color: transparent;
  font-weight: 700;
}
.listing-link:hover { text-decoration: underline; }

/* value tags (free, low-cost, indie, etc.) — muted outline style */
.listing-tag.value-tag {
  background: transparent;
  color: var(--stone);
  border-color: rgba(21,19,15,0.3);
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}


/* ============================================================
   COMMONS LINKS
   content shown inside the "davis commons" modal, opened from
   the floating map button
   ============================================================ */

.commons-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.commons-section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  padding-top: 0.6rem;
  padding-bottom: 0.2rem;
  border-top: 1.5px solid rgba(21,19,15,0.15);
  margin-top: 0.25rem;
  flex-shrink: 0;
}
.commons-section-label:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.commons-link {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.45rem 0.55rem;
  border: 1.5px solid transparent;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  flex-shrink: 0;
}
.commons-link:hover {
  background: rgba(21,19,15,0.07);
  border-color: var(--ink);
}

.commons-link-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--grass);
}
.commons-link:hover .commons-link-name { color: var(--ink); }

.commons-link-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--stone);
  line-height: 1.4;
}


/* ============================================================
   MAP
   ============================================================ */

#map {
  width: 100%;
  height: 100%;
}

/* tiny contrast boost on the stamen toner tiles */
.leaflet-tile-pane {
  filter: contrast(1.08) brightness(1.04);
}


/* ============================================================
   MAP POPUPS
   ============================================================ */

/* square corners, bold border — matches the overall aesthetic */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  border: var(--border);
  box-shadow: 5px 5px 0 rgba(21,19,15,0.25) !important;
  font-family: 'Space Mono', monospace;
  background: var(--paper);
  padding: 0;
  overflow: visible !important;
  position: relative;
}

/* hide the default leaflet triangle tip */
.leaflet-popup-tip           { display: none; }
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-content       { margin: 0 !important; min-width: 200px; }

.popup-inner { padding: 3.5rem 1.05rem 0.95rem; }

/* starburst badge — sibling before .popup-inner, breaks out of top-left corner */
.popup-cat {
  position: absolute;
  top: -68px;
  left: -60px;
  z-index: 10;
  pointer-events: none;
  transform: rotate(-15deg);

  clip-path: polygon(
    50.0% 0.0%,  59.3% 15.2%, 75.0% 6.7%,  75.5% 24.5%,
    93.3% 25.0%, 84.8% 40.7%, 100.0% 50.0%, 84.8% 59.3%,
    93.3% 75.0%, 75.5% 75.5%, 75.0% 93.3%, 59.3% 84.8%,
    50.0% 100.0%, 40.7% 84.8%, 25.0% 93.3%, 24.5% 75.5%,
    6.7% 75.0%,  15.2% 59.3%, 0.0% 50.0%,  15.2% 40.7%,
    6.7% 25.0%,  24.5% 24.5%, 25.0% 6.7%,  40.7% 15.2%
  );

  width: 126px;
  height: 126px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 30px;
  box-sizing: border-box;

  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--paper);
  background: var(--cat-color);
  border: none;
  margin: 0;
}

@keyframes popup-burst-pop {
  0%   { transform: scale(0.5) rotate(-20deg); opacity: 0.5; }
  65%  { transform: scale(1.12) rotate(-5deg); opacity: 1; }
  82%  { transform: scale(0.96) rotate(-9deg); }
  100% { transform: scale(1) rotate(-8deg); }
}

.popup-cat.burst {
  animation: popup-burst-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.popup-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.popup-addr {
  font-size: 0.62rem;
  font-style: italic;
  color: var(--stone);
  margin-bottom: 0.4rem;
}

.popup-desc {
  font-size: 0.66rem;
  line-height: 1.6;
}

/* status badge — shows things like "bridge closed for repairs" */
.popup-status {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--flame);
  border: 1.5px solid var(--ink);
  padding: 0.15rem 0.4rem;
}

/* value tags shown inside the popup (free, indie, etc.) */
.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.popup-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  padding: 0.12rem 0.4rem;
  border: 1.5px solid rgba(21,19,15,0.35);
  color: var(--stone);
  background: transparent;
}

.popup-source {
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
}

.popup-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--flame);
  text-decoration: none;
  text-transform: uppercase;
}
.popup-link:hover { text-decoration: underline; }

/* co-located sub-entries inside a popup */
.popup-colocated {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--stone);
}
.popup-co-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.popup-co-name .popup-cat {
  position: static;
  clip-path: none;
  width: auto;
  height: auto;
  transform: none;
  display: inline-block;
  padding: 0.1rem 0.3rem;
  border: 1.5px solid var(--ink);
  font-size: 0.52rem;
  margin-bottom: 0;
  animation: none;
  pointer-events: auto;
}

/* co-located sub-entries inside a sidebar listing card */
.listing-colocated {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.listing-co-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.listing-co-name {
  font-size: 0.62rem;
  color: var(--stone);
  font-family: 'Space Mono', monospace;
}

/* full-screen dimmed backdrop — hidden by default */
.modal-backdrop {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(21,19,15,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* outer wrapper provides the offset shadow effect */
.modal-outer {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  box-shadow: 7px 7px 0 var(--ink);
  display: flex;
  flex-direction: column;
}

.modal {
  background: var(--paper);
  border: var(--border);
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: var(--border);
  flex-shrink: 0;
}

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
  padding: 0;
}
.modal-close:hover { color: var(--flame); }


/* ============================================================
   FORM ELEMENTS  (used inside modals)
   ============================================================ */

.form-group { margin-bottom: 0.9rem; }

label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea,
select {
  width: 100%;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: var(--border);
  background: var(--paper-dim);
  color: var(--ink);
  appearance: none;
  outline: none;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--flame);
  outline-offset: 1px;
}

textarea { min-height: 72px; }

.form-hint {
  font-size: 0.6rem;
  font-style: italic;
  color: var(--stone);
  margin-top: 0.25rem;
}

.submit-note {
  font-size: 0.64rem;
  font-style: italic;
  color: var(--stone);
  margin-top: 0.75rem;
  line-height: 1.6;
  border-top: 1.5px solid rgba(21,19,15,0.2);
  padding-top: 0.75rem;
}

.about-text {
  font-size: 0.8rem;
  line-height: 1.8;
  margin-bottom: 0.9rem;
}
.about-text a { color: var(--flame); font-weight: 700; }

.about-note {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.6rem;
}


/* ============================================================
   LOADING OVERLAY
   shows while the three API fetches are in flight
   ============================================================ */

#loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.4s ease;
}

/* fades out when we add the .hidden class */
#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.loader-brand .punct { font-weight: 100; color: var(--flame); }
.loader-brand .ital  { font-weight: 100; font-style: italic; color: var(--pink); }

/* bouncing dots animation */
.loader-dots {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  height: 48px;
}

.loader-dot {
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
  background: var(--flame);
  animation: dotBounce 0.7s ease-in-out infinite;
}
.loader-dot:nth-child(2) { background: var(--sky);  animation-delay: 0.12s; }
.loader-dot:nth-child(3) { background: var(--pink); animation-delay: 0.24s; }
.loader-dot:nth-child(4) { background: var(--sun);  animation-delay: 0.36s; }

@keyframes dotBounce {
  0%, 100% { transform: translateY(0); }
  45%       { transform: translateY(-22px); }
}

/* the big percentage counter */
.loader-percent {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 4rem;
  line-height: 1;
  letter-spacing: -0.04em;
  border: 3px solid var(--ink);
  padding: 0.3rem 1.1rem;
  min-width: 160px;
  text-align: center;
  box-shadow: 5px 5px 0 var(--ink);
}

.loader-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}


/* pulsing ring animation for the user location dot */
@keyframes userLocPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47,155,214,0.3), 2px 2px 0 rgba(21,19,15,0.25); }
  50%       { box-shadow: 0 0 0 8px rgba(47,155,214,0.08), 2px 2px 0 rgba(21,19,15,0.25); }
}


/* ============================================================
   GEOCODING INDICATOR
   small non-blocking banner on the map while addresses resolve
   ============================================================ */

#commons-fab {
  position: absolute;
  bottom: 1.5rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 116px;
  background: var(--grass);
  color: var(--paper);
  border: none;
  padding: 0 26px;
  box-sizing: border-box;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  cursor: pointer;
  clip-path: polygon(
    50.0% 0.0%,  59.3% 15.2%, 75.0% 6.7%,  75.5% 24.5%,
    93.3% 25.0%, 84.8% 40.7%, 100.0% 50.0%, 84.8% 59.3%,
    93.3% 75.0%, 75.5% 75.5%, 75.0% 93.3%, 59.3% 84.8%,
    50.0% 100.0%, 40.7% 84.8%, 25.0% 93.3%, 24.5% 75.5%,
    6.7% 75.0%,  15.2% 59.3%, 0.0% 50.0%,  15.2% 40.7%,
    6.7% 25.0%,  24.5% 24.5%, 25.0% 6.7%,  40.7% 15.2%
  );
  transition: transform 0.15s ease, background 0.1s;
}
#commons-fab:hover {
  background: var(--ink);
  transform: scale(1.06) rotate(-4deg);
}
#commons-fab:active {
  transform: scale(0.97) rotate(-2deg);
}

#geo-indicator {
  position: absolute;
  bottom: 9.75rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 0.35rem 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 3px 3px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#geo-indicator.visible { opacity: 1; }

#geo-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky);
  flex-shrink: 0;
  animation: geoPulse 1.2s ease-in-out infinite;
}

@keyframes geoPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}


/* ============================================================
   TOAST NOTIFICATION
   pops up from the bottom to confirm actions
   ============================================================ */

#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px); /* hidden off-screen */
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(21,19,15,0.3);
  transition: transform 0.22s ease;
  z-index: 2000;
  pointer-events: none;
}

#toast.show { transform: translateX(-50%) translateY(0); }


/* ============================================================
   TAG PILL FILTERS  (free / low-cost / etc.)
   ============================================================ */

.tag-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  /* pull it edge-to-edge so scrollbar sits flush, matches cat-list/listings */
  margin: 0 -1.15rem -1rem;
  padding: 0 1.15rem 1rem;
  align-content: flex-start;
}

.tag-pill {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.55rem;
  border: 1.5px solid rgba(21,19,15,0.25);
  background: transparent;
  color: var(--stone);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.tag-pill:hover:not(.active) { background: rgba(21,19,15,0.07); border-color: rgba(21,19,15,0.4); color: var(--ink); }
.tag-pill.active {
  background: var(--grass);
  color: var(--paper);
  border-color: var(--grass);
}


/* ============================================================
   RESPONSIVE — mobile layout
   map fills screen; tab bar at bottom; sheet slides up
   ============================================================ */

/* hide mobile chrome on desktop */
.mobile-bar        { display: none; }
.mobile-sheet      { display: none; }
.mobile-more-tray  { display: none; }

@media (max-width: 640px) {

  /* ---- safe area / notch support ---- */
  :root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tab-h: calc(60px + var(--safe-bottom));
  }

  /* ---- header ---- */
  header {
    height: 52px;
    padding: 0 1rem;
  }
  .brand-title { font-size: 1.25rem; }
  .brand-mark  { width: 32px; height: 32px; }
  .brand-sub   { display: none; }
  .header-right { display: none; }

  /* ---- app body: map fills everything ---- */
  .app-body {
    display: block;
    height: calc(100dvh - 52px - var(--tab-h));
  }

  /* hide the desktop sidebar entirely */
  .sidebar       { display: none; }
  .resize-handle { display: none; }

  /* map stretches to fill the app-body block */
  #map {
    width: 100%;
    height: 100%;
  }

  /* push leaflet zoom controls above the tab bar */
  .leaflet-control-zoom {
    margin-bottom: calc(var(--tab-h) + 12px) !important;
  }

  /* push the commons fab and geo-indicator above the tab bar too —
     shrink the starburst a touch to keep it from crowding the map */
  #commons-fab {
    bottom: calc(var(--tab-h) + 1rem);
    width: 92px;
    height: 92px;
    padding: 0 20px;
    font-size: 0.64rem;
  }
  #geo-indicator { bottom: calc(var(--tab-h) + 7.5rem); }

  /* ---- popups on mobile ---- */
  .leaflet-popup-content {
    min-width: 240px !important;
    max-width: calc(100vw - 48px) !important;
  }

  /* shrink the starburst badge so it doesn't overflow on small screens */
  .popup-cat {
    width: 96px;
    height: 96px;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    top: -52px;
    left: -44px;
    padding: 0 24px;
  }

  .popup-inner { padding: 2.8rem 0.9rem 0.85rem; }

  .popup-name { font-size: 1rem; }
  .popup-addr { font-size: 0.72rem; }
  .popup-desc { font-size: 0.75rem; }

  .popup-tag    { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
  .popup-source { font-size: 0.65rem; }
  .popup-link   { font-size: 0.65rem; }

  /* ---- mobile bottom tab bar ---- */
  .mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-h);
    padding-bottom: var(--safe-bottom);
    background: var(--paper);
    border-top: var(--border);
    z-index: 500;
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    border-right: 2px solid var(--ink);
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    padding: 0;
    transition: background 0.1s;
    min-height: 44px;
  }
  .mobile-tab:last-child { border-right: none; }
  .mobile-tab:active     { background: rgba(21,19,15,0.12); }
  .mobile-tab.active     { background: var(--ink); }
  .mobile-tab.active .mobile-tab-icon,
  .mobile-tab.active .mobile-tab-label { color: var(--paper); }

  .mobile-tab-icon {
    font-size: 1.3rem;
    line-height: 1;
    color: var(--ink);
  }
  .mobile-tab-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--stone);
  }

  /* ---- mobile slide-up sheet ---- */
  .mobile-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tab-h);
    height: 0;
    max-height: calc(100dvh - 52px - var(--tab-h));
    background: var(--paper);
    border-top: var(--border);
    z-index: 400;
    overflow: hidden;
    transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .mobile-sheet.open {
    height: 70vh;
  }

  .mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(21,19,15,0.25);
    margin: 0.75rem auto 0;
    border-radius: 2px;
    flex-shrink: 0;
  }

  .mobile-sheet-content {
    height: calc(100% - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* ---- sheet: filter view ---- */
  .mobile-sheet-content .panel-label {
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
  }

  .mobile-sheet-content .tag-pill-list {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-sheet-content .tag-pill {
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
  }

  .mobile-sheet-content .cat-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .mobile-sheet-content .cat-btn {
    width: auto;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    border: 2px solid var(--ink);
  }

  /* ---- sheet: list view ---- */
  .mobile-listings .listing-card {
    padding: 0.85rem 0;
  }

  .mobile-listings .listing-name { font-size: 0.95rem; }
  .mobile-listings .listing-addr { font-size: 0.78rem; }
  .mobile-listings .listing-tag  { font-size: 0.7rem; padding: 0.2rem 0.5rem; }

  /* ---- mobile more tray ---- */
  .mobile-more-tray {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tab-h);
    background: var(--paper);
    border-top: var(--border);
    z-index: 450;
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }
  .mobile-more-tray.open {
    transform: translateY(0);
    pointer-events: auto;
  }

  .more-tray-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid rgba(21,19,15,0.12);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    width: 100%;
    min-height: 52px;
    transition: background 0.1s;
  }
  .more-tray-btn:last-child { border-bottom: none; }
  .more-tray-btn:active { background: rgba(21,19,15,0.08); }
  .more-tray-btn--add {
    background: var(--flame);
    color: var(--paper);
  }
  .more-tray-btn--add:active { background: var(--ink); color: var(--paper); }

  .more-tray-icon {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
  }

  /* ---- modal: full-screen bottom sheet on mobile ---- */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-outer {
    max-width: 100%;
    max-height: 92dvh;
    box-shadow: none;
    border-top: var(--border);
    padding-bottom: var(--safe-bottom);
  }

  /* prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
  }

  .modal-body label {
    font-size: 0.8rem;
  }
}

/* ============================================================
   INTERACTIVITY ADDITIONS
   ============================================================ */

/* popup ghost-up entry */
@keyframes popup-ghost-up {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* popup ghost-down exit */
@keyframes popup-ghost-down {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

.leaflet-popup-content-wrapper {
  animation: popup-ghost-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.leaflet-popup-content-wrapper.closing {
  animation: popup-ghost-down 0.2s ease-in both;
  pointer-events: none;
}

/* marker bounce on click */
@keyframes marker-bounce {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-9px) scale(1.18); }
  55%  { transform: translateY(2px) scale(0.94); }
  75%  { transform: translateY(-3px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

.marker-bouncing > div {
  animation: marker-bounce 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ============================================================
   MAP MARKER ICONS — hover interactivity
   ============================================================ */

/* Leaflet wraps divIcons in an <img>-less .leaflet-marker-icon div;
   make sure the cursor shows it's clickable */
.leaflet-marker-icon {
  cursor: pointer !important;
}

/* the inner circle */
.place-marker-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #15130F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: #F7F4EC;
  box-shadow: 2px 2px 0 rgba(21,19,15,0.35);
  line-height: 1;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.15s ease;
  will-change: transform;
}

.leaflet-marker-icon:hover .place-marker-icon {
  transform: scale(1.22) translateY(-2px);
  box-shadow: 3px 4px 0 rgba(21,19,15,0.45);
}

.leaflet-marker-icon:active .place-marker-icon {
  transform: scale(0.92) translateY(1px);
  box-shadow: 1px 1px 0 rgba(21,19,15,0.45);
  transition-duration: 0.08s;
}

/* listing card hover lift */
.listing-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 0 rgba(21,19,15,0.12);
}

/* ============================================================
   MODAL REDESIGN — add a place / correction / about
   ============================================================ */

/* wider max-width for the richer modals */
.modal-outer--add,
.modal-outer--correction { max-width: 520px; }
.modal-outer--about      { max-width: 480px; }

/* required field asterisk */
.form-req {
  color: var(--flame);
  font-weight: 700;
}

/* inline hint that sits after the label text */
.form-hint-inline {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  color: var(--stone);
}

/* side-by-side form row */
.form-row {
  display: flex;
  gap: 0.65rem;
}

/* full-width submit button */
.btn-submit {
  width: 100%;
  margin-top: 0.25rem;
  justify-content: center;
}

/* --- ADD A PLACE header --- */
.modal-header--add {
  background: var(--flame);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-bottom: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.modal-header--add .modal-title {
  color: var(--paper);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.modal-header--add .modal-close {
  color: var(--paper);
  opacity: 0.7;
  font-size: 1.1rem;
  margin-top: 2px;
}
.modal-header--add .modal-close:hover { opacity: 1; color: var(--paper); }

/* eyebrow line above the title */
.modal-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

/* --- Category select grid (replaces <select>) --- */
.cat-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.cat-select-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border: 2px solid rgba(21,19,15,0.2);
  background: var(--paper-dim);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
  position: relative;
}

/* colored left stripe using the CSS var --c set inline */
.cat-select-btn::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, #718096);
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.cat-select-btn:hover {
  border-color: var(--c, var(--ink));
  background: var(--paper);
}

.cat-select-btn.active {
  background: var(--c, var(--ink));
  border-color: var(--ink);
  color: var(--paper);
}
.cat-select-btn.active::before {
  background: var(--paper);
  border-color: var(--paper);
}

/* --- Value tag checkboxes --- */
.tag-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.tag-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border: 2px solid rgba(21,19,15,0.2);
  background: var(--paper-dim);
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  text-transform: none;
  letter-spacing: 0;
  /* override the global label styles */
  display: inline-flex;
  margin-bottom: 0;
}

.tag-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--grass);
  cursor: pointer;
}

.tag-check:has(input:checked) {
  border-color: var(--grass);
  background: var(--grass-tint);
}

/* --- CORRECTION header --- */
.modal-header--correction {
  background: var(--sky);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-bottom: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.modal-header--correction .modal-title {
  color: var(--paper);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.modal-header--correction .modal-close {
  color: var(--paper);
  opacity: 0.7;
  font-size: 1.1rem;
}
.modal-header--correction .modal-close:hover { opacity: 1; color: var(--paper); }

/* correction type picker */
.correction-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.corr-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  border: 2px solid rgba(21,19,15,0.2);
  background: var(--paper-dim);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.corr-type-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.corr-type-btn:hover  { border-color: var(--sky); background: var(--sky-tint); }
.corr-type-btn.active { background: var(--sky); border-color: var(--ink); color: var(--paper); }

/* sky-colored submit button for corrections */
.btn-correction {
  background: var(--sky);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-correction:hover  { background: var(--ink); }
.btn-correction:active { box-shadow: 1px 1px 0 var(--ink); }

/* --- COMMONS header --- */
.modal-header--commons {
  background: var(--grass);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-bottom: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.modal-header--commons .modal-title {
  color: var(--paper);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.modal-header--commons .modal-eyebrow {
  color: var(--paper);
}

.modal-header--commons .modal-close {
  color: var(--paper);
  opacity: 0.7;
  font-size: 1.1rem;
}
.modal-header--commons .modal-close:hover { opacity: 1; color: var(--paper); }

.modal-outer--commons { max-width: 480px; }

/* --- ABOUT header --- */
.modal-header--about {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 1.75rem 1.5rem;
  border-bottom: var(--border);
  position: relative;
  flex-shrink: 0;
}

.about-hero-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--paper);
}
.about-hero-wordmark .punct { font-weight: 100; color: var(--flame); }
.about-hero-wordmark .ital  { font-weight: 100; font-style: italic; color: var(--pink); }

.about-hero-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247,244,236,0.6);
  margin-top: 0.5rem;
}

.about-hero-loc {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--flame);
  margin-top: 0.25rem;
}

.modal-close--about {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  color: rgba(247,244,236,0.5);
  font-size: 1rem;
}
.modal-close--about:hover { color: var(--paper); }

/* about body */
.about-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
}
.about-divider::before,
.about-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: rgba(21,19,15,0.15);
}

.about-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.about-source-pill {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.about-source-pill:hover { background: var(--ink); color: var(--paper); }
.about-source-pill--you {
  background: var(--flame);
  color: var(--paper);
  border-color: var(--ink);
  cursor: default;
}
.about-source-pill--you:hover { background: var(--pink); }

.about-byline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.about-byline-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--flame);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.about-byline-name:hover { text-decoration: underline; }

.about-byline-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--stone);
}

/* --- Mobile adjustments for redesigned modals --- */
@media (max-width: 640px) {
  .cat-select-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .correction-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-hero-wordmark { font-size: 1.7rem; }
  .form-row { flex-direction: column; gap: 0; }
}


/* ============================================================
   MODAL ANIMATIONS & INTERACTIVITY
   ============================================================ */

/* --- Modal entrance --- */
@keyframes modal-pop-in {
  0%   { opacity: 0; transform: translateY(18px) scale(0.97); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop.open .modal-outer {
  animation: modal-pop-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Staggered cat-select-btn entrance --- */
@keyframes btn-slide-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.modal-backdrop.open .cat-select-btn {
  animation: btn-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* stagger each button using nth-child */
.modal-backdrop.open .cat-select-btn:nth-child(1)  { animation-delay: 0.04s; }
.modal-backdrop.open .cat-select-btn:nth-child(2)  { animation-delay: 0.07s; }
.modal-backdrop.open .cat-select-btn:nth-child(3)  { animation-delay: 0.10s; }
.modal-backdrop.open .cat-select-btn:nth-child(4)  { animation-delay: 0.13s; }
.modal-backdrop.open .cat-select-btn:nth-child(5)  { animation-delay: 0.16s; }
.modal-backdrop.open .cat-select-btn:nth-child(6)  { animation-delay: 0.19s; }
.modal-backdrop.open .cat-select-btn:nth-child(7)  { animation-delay: 0.22s; }
.modal-backdrop.open .cat-select-btn:nth-child(8)  { animation-delay: 0.25s; }
.modal-backdrop.open .cat-select-btn:nth-child(9)  { animation-delay: 0.28s; }
.modal-backdrop.open .cat-select-btn:nth-child(10) { animation-delay: 0.31s; }
.modal-backdrop.open .cat-select-btn:nth-child(11) { animation-delay: 0.34s; }
.modal-backdrop.open .cat-select-btn:nth-child(12) { animation-delay: 0.37s; }
.modal-backdrop.open .cat-select-btn:nth-child(13) { animation-delay: 0.40s; }
.modal-backdrop.open .cat-select-btn:nth-child(14) { animation-delay: 0.43s; }
.modal-backdrop.open .cat-select-btn:nth-child(15) { animation-delay: 0.46s; }
.modal-backdrop.open .cat-select-btn:nth-child(16) { animation-delay: 0.49s; }

/* cat button selected bounce */
@keyframes cat-btn-select {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.93); }
  70%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.cat-select-btn.just-selected {
  animation: cat-btn-select 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* tag checkbox: flip-in when checked */
@keyframes tag-check-pop {
  0%   { transform: scale(0.88); }
  55%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.tag-check:has(input:checked) {
  animation: tag-check-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Correction type buttons stagger in --- */
.modal-backdrop.open .corr-type-btn {
  animation: btn-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-backdrop.open .corr-type-btn:nth-child(1) { animation-delay: 0.05s; }
.modal-backdrop.open .corr-type-btn:nth-child(2) { animation-delay: 0.10s; }
.modal-backdrop.open .corr-type-btn:nth-child(3) { animation-delay: 0.15s; }
.modal-backdrop.open .corr-type-btn:nth-child(4) { animation-delay: 0.20s; }
.modal-backdrop.open .corr-type-btn:nth-child(5) { animation-delay: 0.25s; }

/* corr-type selected bounce */
@keyframes corr-btn-select {
  0%   { transform: scale(1) rotate(0deg); }
  35%  { transform: scale(0.9) rotate(-2deg); }
  70%  { transform: scale(1.07) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.corr-type-btn.just-selected {
  animation: corr-btn-select 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* coords row reveal when wrong-location is selected */
.c-coords-hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.25s ease,
              margin 0.3s ease;
  margin-bottom: 0 !important;
}
.c-coords-visible {
  max-height: 100px;
  opacity: 1;
  margin-bottom: 0.9rem;
}

/* icon wiggle on corr-type-btn hover */
.corr-type-btn:hover .corr-type-icon {
  display: inline-block;
  animation: icon-wiggle 0.35s ease both;
}
@keyframes icon-wiggle {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-12deg); }
  55%  { transform: rotate(10deg); }
  75%  { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

/* --- Submit button loading state --- */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  overflow: hidden;
}
.btn-submit.loading::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 60%;
  height: 100%;
  background: rgba(247,244,236,0.25);
  animation: btn-sweep 0.8s ease-in-out infinite;
}
@keyframes btn-sweep {
  0%   { left: -60%; }
  100% { left: 110%; }
}

/* --- About modal interactivity --- */

/* simple fade-in for source pills */
#about-modal.open .about-source-pill {
  animation: about-fade-in 0.25s ease both;
}
@keyframes about-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* close button spins on hover */
.modal-close--about {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.modal-close--about:hover {
  transform: rotate(90deg) !important;
  opacity: 1 !important;
}

/* about-text links */
.about-text a {
  text-decoration: underline;
  color: var(--flame);
  font-weight: 700;
}

/* byline meta links (open source, all projects) */
.about-byline-meta a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--stone);
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.about-byline-meta a:hover {
  color: var(--pink);
  text-decoration-color: var(--pink);
}

/* byline name */
.about-byline-name {
  display: inline-block;
  transition: color 0.15s;
}
.about-byline-name:hover {
  color: var(--pink) !important;
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop.open .modal-outer,
  .modal-backdrop.open .cat-select-btn,
  .modal-backdrop.open .corr-type-btn,
  .cat-select-btn.just-selected,
  .corr-type-btn.just-selected,
  .tag-check:has(input:checked) {
    animation: none !important;
    transition: none !important;
  }
}


/* ============================================================
   MODAL & FORM INTERACTIVITY — animations, hover, fun
   ============================================================ */

/* --- Modal entrance animation --- */
@keyframes modal-spring-up {
  0%   { transform: translateY(28px) scale(0.97); opacity: 0; }
  60%  { transform: translateY(-4px) scale(1.005); opacity: 1; }
  80%  { transform: translateY(2px) scale(0.999); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-backdrop.open .modal-outer {
  animation: modal-spring-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Close button spin on hover (all modals) --- */
.modal-close {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s, opacity 0.15s;
  display: inline-block;
}
.modal-close:hover {
  transform: rotate(90deg) scale(1.2);
}
.modal-header--add .modal-close:hover,
.modal-header--correction .modal-close:hover {
  color: var(--paper) !important;
  opacity: 1;
}

/* --- Category select buttons — richer hover --- */
@keyframes cat-btn-select {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.cat-select-btn {
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.cat-select-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.cat-select-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.cat-select-btn.active {
  box-shadow: 3px 3px 0 rgba(21,19,15,0.35);
  animation: cat-btn-select 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}





/* --- Submit button — satisfying press --- */
.btn-submit {
  transition: transform 0.1s, box-shadow 0.1s, background 0.12s, color 0.12s;
  position: relative;
  overflow: hidden;
}
.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-submit:hover::after { opacity: 1; }
.btn-submit:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 1px 1px 0 var(--ink) !important;
}

/* --- Input fields — colored focus ring per modal --- */
#submit-modal input:focus,
#submit-modal textarea:focus,
#submit-modal select:focus {
  outline: 3px solid var(--flame);
  outline-offset: 1px;
  transition: outline-color 0.15s;
}

#correction-modal input:focus,
#correction-modal textarea:focus {
  outline: 3px solid var(--sky);
  outline-offset: 1px;
}

/* Fix email autofill background on webkit */
input[type="email"]:-webkit-autofill,
input[type="email"]:-webkit-autofill:hover,
input[type="email"]:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--paper-dim) inset;
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}

/* --- Correction type buttons — hover lift + active flash --- */
.corr-type-btn {
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.corr-type-btn:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.corr-type-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--ink);
}

@keyframes corr-btn-select {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.93); }
  65%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.corr-type-btn.active {
  box-shadow: 3px 3px 0 rgba(21,19,15,0.35);
  animation: corr-btn-select 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* icon bounce on hover */
.corr-type-btn:hover .corr-type-icon {
  display: inline-block;
  animation: icon-bounce 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes icon-bounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-5px); }
  70%  { transform: translateY(2px); }
  100% { transform: translateY(0); }
}

/* stagger correction buttons in */
@keyframes corr-btn-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-backdrop.open .corr-type-btn {
  animation: corr-btn-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-backdrop.open .corr-type-btn:nth-child(1) { animation-delay: 0.06s; }
.modal-backdrop.open .corr-type-btn:nth-child(2) { animation-delay: 0.10s; }
.modal-backdrop.open .corr-type-btn:nth-child(3) { animation-delay: 0.14s; }
.modal-backdrop.open .corr-type-btn:nth-child(4) { animation-delay: 0.18s; }
.modal-backdrop.open .corr-type-btn:nth-child(5) { animation-delay: 0.22s; }

/* about source pills hover */
.about-source-pill {
  transition: background 0.12s, color 0.12s;
}
.about-source-pill:not(.about-source-pill--you):hover {
  background: var(--ink);
  color: var(--paper);
}

/* reduce motion — respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop.open .modal-outer,
  .modal-backdrop.open .cat-select-btn,
  .modal-backdrop.open .corr-type-btn,
  #about-modal.open .about-source-pill,
  .corr-type-btn.active,
  .cat-select-btn.active,
  .tag-check:has(input:checked) {
    animation: none !important;
    transition: none !important;
  }
}