/* Where's My Water: styles
 *
 * Water-themed: blues, white, light grays. The interface should feel calm
 * and get out of the way, because people arrive here with a problem rather
 * than curiosity. One type family at a few weights; colour carries meaning
 * (blue = action, gray = supporting, red = a real warning) and is never
 * decorative.
 */

:root {
  --white: #ffffff;
  --surface: #f4f8fc;
  --surface-2: #e9f1f9;
  --line: #dbe4ee;
  --line-soft: #eaf0f7;

  --ink: #0f1e2e;
  --ink-soft: #55677d;
  --ink-faint: #8494a7;

  --blue: #1268c3;
  --blue-dark: #0b4d95;
  --blue-tint: #e8f2fd;
  --blue-deep: #0a2942;

  --ok: #0d7a5f;
  --warn: #9a5b00;
  --alert: #b3261e;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 70rem;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 30, 46, .05), 0 6px 20px rgba(15, 30, 46, .06);
  --shadow-lift: 0 2px 4px rgba(15, 30, 46, .06), 0 12px 32px rgba(15, 30, 46, .10);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.125rem, 5.5vw, 3.25rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; z-index: 100;
  background: var(--blue); color: #fff; padding: .75rem 1.25rem; text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; top: 0; }

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

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding: .875rem 1.5rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: .5625rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #5aa9f0 0%, var(--blue) 45%, var(--blue-dark) 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55);
}
.brand-name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }
.site-header nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-header nav a {
  font-size: .9375rem; color: var(--ink-soft); text-decoration: none;
  padding: .4375rem .6875rem; border-radius: var(--radius-sm);
}
.site-header nav a:hover { color: var(--blue-dark); background: var(--blue-tint); }

/* ---------- hero ---------- */

.hero {
  position: relative; padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem 0;
  background: linear-gradient(180deg, var(--blue-tint) 0%, rgba(232, 242, 253, 0) 100%);
}
.hero-inner { max-width: 44rem; margin: 0 auto; }
.lede { font-size: 1.125rem; color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.75rem; }

.lookup label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; }
.lookup-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.lookup input {
  width: 100%; padding: .875rem 1rem; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.lookup input::placeholder { color: var(--ink-faint); }
.lookup input:focus-visible { border-color: var(--blue); }

button { font: 600 1rem/1 var(--sans); cursor: pointer; border-radius: var(--radius); border: 1.5px solid transparent; }
.lookup button[type="submit"] {
  padding: .875rem 1.5rem; background: var(--blue); color: #fff; flex: none; box-shadow: var(--shadow);
}
.lookup button[type="submit"]:hover { background: var(--blue-dark); }
.lookup button[type="submit"]:disabled { opacity: .55; cursor: progress; }

.help { font-size: .875rem; color: var(--ink-soft); margin-top: .75rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--blue-dark); }

.or-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .75rem 0 0; }
.btn-location {
  padding: .625rem 1rem; background: var(--white); color: var(--blue);
  border: 1.5px solid var(--line); font-size: .9375rem;
}
.btn-location:hover { border-color: var(--blue); background: var(--blue-tint); }
.or-note { font-size: .875rem; color: var(--ink-soft); }

/* a calm suggestion of water depth under the hero */
.strata { max-width: var(--wrap); margin: 2.5rem auto 0; padding: 0 1.5rem; display: grid; gap: 2px; }
.strata span {
  display: block; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--blue) calc(38% - var(--d) * 5%), var(--white));
}

/* ---------- autocomplete ---------- */

.combo { position: relative; flex: 1 1 20rem; min-width: 0; }
.suggestions {
  position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; right: 0;
  margin: 0; padding: .3125rem; list-style: none;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  max-height: 19rem; overflow-y: auto;
}
.suggestions li { padding: .5rem .625rem; border-radius: var(--radius-sm); cursor: pointer; display: grid; gap: .0625rem; }
.suggestions li:hover, .suggestions li.active { background: var(--blue-tint); }
.sug-1 { font-weight: 600; font-size: .9375rem; }
.sug-2 { font-size: .8125rem; color: var(--ink-soft); }

/* ---------- results ---------- */

.results { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.results:not(:empty) { padding-top: 2.5rem; padding-bottom: 1rem; }

.status { padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface); font-size: .9375rem; }
.status.error { background: #fdeceb; border-left: 4px solid var(--alert); }

.matched { font: 500 .8125rem/1.4 var(--mono); color: var(--ink-soft); margin-bottom: 1.5rem; }

.tier { margin-bottom: 2.75rem; }
.tier-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tier-num {
  font: 500 .6875rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--blue-dark); background: var(--blue-tint); padding: .375rem .5rem; border-radius: 5px;
}
.tier h2 { margin: 0; }
.tier-note { font-size: .9375rem; color: var(--ink-soft); margin: 0 0 1.25rem; }

/* tier 1: places */
.places { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.place {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.375rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.place-top { display: flex; justify-content: space-between; align-items: start; gap: .75rem; margin-bottom: .5rem; }
.place h3 { margin: 0; }
.badge {
  flex: none; font: 500 .6875rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: .375rem .5rem; border-radius: 5px; background: var(--surface-2); color: var(--ink-soft);
}
.badge.standpipe { background: var(--blue); color: #fff; }
.badge.hauler { background: var(--blue-tint); color: var(--blue-dark); }
.place .what { font-size: .9375rem; color: var(--ink-soft); margin-bottom: 1rem; }
.place dl { display: grid; grid-template-columns: auto 1fr; gap: .375rem .75rem; margin: 0 0 1rem; font-size: .9375rem; }
.place dt { font: 500 .6875rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.place dd { margin: 0; }
.dist { font: 500 .8125rem/1 var(--mono); color: var(--blue); }
.place-foot { margin-top: auto; padding-top: .875rem; border-top: 1px solid var(--line-soft); }
.provenance { font-size: .8125rem; color: var(--ink-faint); margin: 0; }

/* tier 1a: haulers */
.haulers { margin-top: 1.75rem; }
.haulers h3 { margin-bottom: .375rem; }
.haulers > .caveat { margin-bottom: 1rem; }
.hauler-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.hauler { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.125rem; box-shadow: var(--shadow); }
.hauler-top { display: flex; justify-content: space-between; align-items: start; gap: .5rem; margin-bottom: .375rem; }
.hauler-top strong { font-size: 1rem; }
.badge-conf {
  flex: none; font: 500 .6875rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .03em;
  padding: .3125rem .4375rem; border-radius: 5px; background: var(--surface-2); color: var(--ink-soft);
}
.badge-conf.high { background: var(--blue-tint); color: var(--blue-dark); }
.hauler-meta { font-size: .875rem; color: var(--ink-soft); margin: 0 0 .75rem; }
.hauler-call { margin: 0; }
.btn-call {
  display: inline-block; padding: .5rem .875rem; border-radius: var(--radius-sm);
  background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; font-size: .9375rem;
}
.btn-call:hover { background: var(--blue-dark); color: #fff; }

/* tier 1b: community-mapped points */
.osm { margin-top: 1.75rem; padding: 1.25rem; background: var(--surface); border-radius: var(--radius); }
.osm h3 { margin-bottom: .375rem; }
.osm .caveat { margin-bottom: 1rem; }
.osm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.osm-list li { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .625rem .875rem; font-size: .9375rem; }
.osm-row { display: flex; align-items: baseline; gap: .625rem; flex-wrap: wrap; }
.osm-kind {
  font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--surface-2); padding: .3125rem .4375rem; border-radius: 5px;
}

/* map embeds */
.mapwrap { margin-top: .5rem; }
.mapwrap summary { cursor: pointer; font-size: .875rem; color: var(--blue); list-style: none; display: inline-block; }
.mapwrap summary::-webkit-details-marker { display: none; }
.mapwrap summary::before { content: "▸ "; }
.mapwrap[open] summary::before { content: "▾ "; }
.mapslot { margin-top: .5rem; }
.mapslot iframe { width: 100%; height: 15rem; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
.mapwrap .provenance { margin-top: .5rem; }

/* tier 2: provider */
.provider { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.provider-name { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 .25rem; }
.no-provider { border-left: 4px solid var(--blue); background: var(--surface); }
.no-provider .provider-name { color: var(--blue-dark); }
.viol-row { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.25rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line-soft); }
.stat { min-width: 8rem; }
.stat .n { font-size: 2rem; font-weight: 600; line-height: 1; display: block; letter-spacing: -.02em; }
.stat .n.clean { color: var(--ok); }
.stat .n.flag { color: var(--alert); }
.stat .l { font-size: .8125rem; color: var(--ink-soft); }

/* tier 3: context */
.context { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.context summary { padding: 1.125rem 1.375rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.context summary::-webkit-details-marker { display: none; }
.context summary::after { content: "+"; font: 400 1.25rem/1 var(--mono); color: var(--ink-faint); }
.context[open] summary::after { content: "−"; }
.context-body { padding: 0 1.375rem 1.375rem; }
.facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1rem; }
.fact { background: var(--white); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--line-soft); }
.fact dt { font: 500 .6875rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: .25rem; }
.fact dd { margin: 0; font-weight: 600; font-size: 1.0625rem; }
.caveat { font-size: .8125rem; color: var(--ink-soft); margin: 0; }

/* nearest wells list inside tier 3 */
.wells-list { list-style: none; margin: .75rem 0 1rem; padding: 0; display: grid; gap: .375rem; }
.wells-list li {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: baseline;
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .875rem;
}
.wells-list .w-dist { font: 500 .8125rem/1 var(--mono); color: var(--blue); min-width: 4rem; }
.wells-list .w-meta { color: var(--ink-soft); }

/* ---------- content bands ---------- */

.band { max-width: var(--wrap); margin: 0 auto; padding: clamp(2.75rem, 6vw, 4.5rem) 1.5rem; }
.band-alt { max-width: none; background: var(--surface); }
.band-alt > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.band-lede { color: var(--ink-soft); max-width: 42rem; margin-bottom: 2rem; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.steps li { counter-increment: s; }
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 1.875rem; height: 1.875rem; margin-bottom: .75rem;
  font: 500 .8125rem/1 var(--mono); color: #fff; background: var(--blue); border-radius: 50%;
}
.steps p { font-size: .9375rem; color: var(--ink-soft); margin: 0; }

.why-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.why-grid p { color: var(--ink-soft); }
.callout { background: var(--blue-tint); border-radius: var(--radius); padding: 1.5rem; }
.callout p { font-size: .9375rem; }
.btn-outline {
  display: inline-block; padding: .6875rem 1.25rem; border-radius: var(--radius);
  border: 1.5px solid var(--blue); color: var(--blue); background: var(--white);
  font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer;
}
.btn-outline:hover { background: var(--blue); color: #fff; }

.sources { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.sources article { border-top: 3px solid var(--blue); padding-top: 1rem; }
.sources h3 { margin-bottom: .25rem; }
.sources .src { font: 500 .8125rem/1.4 var(--mono); color: var(--blue); margin-bottom: .5rem; }
.sources p:last-child { font-size: .9375rem; color: var(--ink-soft); margin: 0; }

/* ---------- stakes ---------- */

.stats { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat-n {
  display: block; font-weight: 600; font-size: clamp(2.25rem, 5vw, 3rem);
  line-height: 1; color: var(--blue); margin-bottom: .625rem; letter-spacing: -.03em;
}
.stat-l { font-size: 1rem; margin-bottom: .75rem; }
.stat-src { font-size: .8125rem; color: var(--ink-faint); margin: 0; }

/* ---------- guide ---------- */

.guide-grid { display: grid; gap: .625rem; }
.guide-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.guide-item summary { padding: 1.0625rem 1.375rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; font-size: 1.0625rem; }
.guide-item summary::-webkit-details-marker { display: none; }
.guide-item summary::after { content: "+"; font: 400 1.25rem/1 var(--mono); color: var(--ink-faint); }
.guide-item[open] summary::after { content: "−"; }
.guide-item[open] summary { border-bottom: 1px solid var(--line-soft); }
.guide-body { padding: 1.0625rem 1.375rem; }
.guide-body ol { margin: 0; padding-left: 1.25rem; display: grid; gap: .625rem; }
.guide-body li { color: var(--ink-soft); }
.guide-body li strong { color: var(--ink); }

/* ---------- browse ---------- */

.browse-controls {
  display: flex; align-items: center; gap: .625rem 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; padding: 1rem; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.browse-controls label { font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.browse-controls select, .browse-controls input {
  padding: .5rem .625rem; font: inherit; font-size: .9375rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.browse-count { margin-left: auto; font: 500 .8125rem/1 var(--mono); color: var(--ink-soft); }
.browse-results { overflow-x: auto; }
.browse-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.browse-table th, .browse-table td { padding: .75rem .875rem; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .9375rem; }
.browse-table th { font: 500 .6875rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--surface); }
.browse-table tr:last-child td { border-bottom: 0; }
.browse-table tbody tr:hover { background: var(--blue-tint); }

.browse-more { margin-top: .625rem; }
.browse-more summary {
  cursor: pointer; list-style: none; display: inline-block;
  padding: .5rem .875rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--blue); font-weight: 600; font-size: .9375rem;
}
.browse-more summary::-webkit-details-marker { display: none; }
.browse-more summary:hover { border-color: var(--blue); background: var(--blue-tint); }
.browse-more[open] summary { margin-bottom: .625rem; }
.browse-more .browse-table thead { display: none; }

.byline {
  font: 500 .875rem/1 var(--mono); color: var(--ink-faint);
  margin-top: 1.5rem;
}

/* ---------- feedback ---------- */

.feedback-form {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line);
}
.field { display: grid; gap: .375rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9375rem; }
.field .opt { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: .625rem .75rem; font: inherit; font-size: .9375rem; width: 100%;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.field textarea { resize: vertical; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-actions button[type="submit"] { padding: .75rem 1.5rem; background: var(--blue); color: #fff; }
.form-actions button[type="submit"]:hover { background: var(--blue-dark); }
.feedback-form .caveat { grid-column: 1 / -1; }

/* ---------- sub-pages ---------- */

.backlink {
  display: inline-block; margin-bottom: 1.25rem;
  font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--blue);
}
.backlink::before { content: "\2190  "; }
.backlink:hover { text-decoration: underline; }

.datasrc { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.datasrc:first-of-type { border-top: 0; padding-top: 0; }
.datasrc h2 { font-size: 1.375rem; margin-bottom: .25rem; }
.datasrc .src { font: 500 .8125rem/1.5 var(--mono); color: var(--blue); margin-bottom: .75rem; }
.datasrc p { color: var(--ink-soft); max-width: 46rem; }
.datasrc .limits {
  background: var(--surface); border-left: 3px solid var(--line);
  padding: .875rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .9375rem; margin-bottom: 0;
}
.datasrc .limits strong { color: var(--ink); }

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

.site-footer { background: var(--blue-deep); color: #c3d4e4; margin-top: 3rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 2.75rem 1.5rem; }
.disclaimer { font-size: .9375rem; max-width: 46rem; }
.disclaimer strong { color: #fff; }
.colophon { font-size: .875rem; color: #8fa6bd; margin: 1.5rem 0 0; }
.site-footer a { color: #7fb8f0; }
.site-footer a:hover { color: #fff; }

/* ---------- responsive ---------- */

@media (max-width: 46rem) {
  .why-grid { grid-template-columns: 1fr; }
  .site-header { justify-content: center; padding: .75rem 1rem; }
  .site-header nav { justify-content: center; }
  .lookup button[type="submit"] { flex: 1 1 100%; }
  .viol-row { gap: 1.25rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .tier { animation: rise .3s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}
