/* Wellwater.fyi — design system.
   Enterprise product-site structure: a dark header bar and a dark footer
   block bracket a cream content field. Sharp-cornered bordered panels, not
   soft rounded cards. Monospace for data. No gradients, no glassmorphism,
   no icon-in-circle triads, no illustration where a real photo belongs. */

:root {
  --paper: #FAF7F1;
  --paper-2: #F1ECE0;
  --card: #FFFFFF;
  --ink: #191F1B;
  --ink-2: #4B564F;
  --muted: #6E7871;
  --line: #DCD5C4;
  --line-strong: #C6BCA3;

  --header-bg: #191F1B;
  --header-line: #33403A;
  --header-text: #E9E4D6;
  --header-text-dim: #9AA69D;

  --footer-bg: #16302E;
  --footer-line: #294B47;
  --footer-text: #D8E4E0;
  --footer-text-dim: #8FA9A4;

  --teal: #2E5B5E;
  --teal-deep: #203F41;
  --clay: #B0502B;
  --clay-bg: #FBEDE5;
  --amber: #93691A;
  --amber-bg: #FBF1DC;
  --moss: #3D6B4C;
  --moss-bg: #E9F1E9;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --radius: 3px;
  --radius-sm: 3px;
  --shadow-card: 0 1px 2px rgba(25, 31, 27, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--clay); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--ink-2); }
.lede { font-size: 1.15rem; color: var(--ink-2); }

/* ---- Header: distinct dark bar, radically brief nav ---- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--header-line); position: sticky; top: 0; z-index: 50; }
.site-header-row { display: flex; align-items: center; gap: 32px; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; color: var(--header-text); text-decoration: none; }
.wordmark-mark { color: #D98A5E; flex-shrink: 0; }
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a { color: var(--header-text-dim); text-decoration: none; font-size: 0.88rem; font-weight: 500; letter-spacing: 0.01em; }
.site-nav a:hover { color: var(--header-text); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px; margin-left: auto; cursor: pointer; }
.nav-toggle span { width: 20px; height: 2px; background: var(--header-text); border-radius: 2px; }
.mobile-nav { display: none; flex-direction: column; gap: 2px; padding: 8px 24px 20px; border-top: 1px solid var(--header-line); background: var(--header-bg); }
.mobile-nav a, .mobile-nav .btn { padding: 10px 0; text-decoration: none; color: var(--header-text-dim); }
body.nav-open .mobile-nav { display: flex; }

@media (max-width: 860px) {
  .site-nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background 0.15s ease; }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: #954422; color: #fff; }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.site-header .btn-secondary { border-color: var(--header-line); color: var(--header-text); }
.site-header .btn-secondary:hover { border-color: var(--header-text-dim); }
.hero .btn-secondary { border-color: #465049; color: var(--header-text); }
.hero .btn-secondary:hover { border-color: var(--header-text-dim); }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- Hero: asymmetric, photo not illustration, brief h1 ---- */
.hero { background: var(--ink); color: var(--header-text); padding: 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; min-height: 480px; }
.hero-copy { padding: 64px 48px 64px 24px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; margin-left: auto; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.hero .lede { color: var(--header-text-dim); font-size: 1.05rem; }
.stat-inline { font-family: var(--font-mono); color: #D98A5E; font-weight: 700; font-size: 1.05em; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-note { font-size: 0.82rem; color: var(--header-text-dim); margin-top: 16px; }
.hero-figure { position: relative; overflow: hidden; background: #000; }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.92) contrast(1.03); }
.hero-figure-tag { position: absolute; left: 20px; bottom: 20px; background: rgba(25,31,27,0.82); color: var(--header-text); font-family: var(--font-mono); font-size: 0.72rem; padding: 7px 12px; letter-spacing: 0.02em; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 44px 24px; max-width: none; margin-left: 0; }
  .hero-figure { height: 260px; }
}

/* ---- Sections / panels ---- */
section { padding: 52px 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head .lede { margin-bottom: 0; }
.section-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); margin-bottom: 10px; display: block; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Enterprise spec panel: bordered rectangle, panels in a grid share
   adjoining borders (no gap) like a spec sheet, not floating soft cards. */
.panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-grid .panel { padding: 28px; border-left: 1px solid var(--line); background: var(--card); }
.panel-grid .panel:first-child { border-left: none; }
@media (max-width: 860px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-grid .panel { border-left: none; border-top: 1px solid var(--line); }
  .panel-grid .panel:first-child { border-top: none; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

/* Method section: a vertical annotated trace, not a card grid. A single
   connecting rule runs down the left with a marker per step, closer to a
   commit log or a debugger trace than a stock 01/02/03 feature-card row. */
.method-wrap { max-width: 720px; }
.flow { margin-top: 8px; }
.flow-step { position: relative; margin-left: 7px; padding: 0 0 34px 32px; border-left: 1px solid var(--line-strong); }
.flow-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.flow-step::before { content: ""; position: absolute; left: -6px; top: 3px; width: 11px; height: 11px; border: 2px solid var(--teal); background: var(--paper-2); border-radius: 50%; }
.flow-tag { display: block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--clay); margin-bottom: 8px; }
.flow-step h3 { margin-bottom: 6px; }
.flow-step p:last-child { margin-bottom: 0; }

/* Full-width photo band between sections */
.photo-band { position: relative; height: 220px; overflow: hidden; }
.photo-band img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.photo-band-caption { position: absolute; right: 20px; bottom: 16px; color: #fff; font-family: var(--font-mono); font-size: 0.72rem; background: rgba(22,48,46,0.75); padding: 6px 10px; }

/* ---- Reading table (the core product surface) ---- */
.reading-table { width: 100%; border-collapse: collapse; margin: 0; }
.reading-table th { text-align: left; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line-strong); }
.reading-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reading-table tr:last-child td { border-bottom: none; }
.reading-name { font-weight: 600; }
.reading-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.reading-value { font-family: var(--font-mono); font-size: 1rem; white-space: nowrap; }
.reading-threshold { font-family: var(--font-mono); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 2px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill-exceeds { background: var(--clay-bg); color: var(--clay); }
.pill-caution { background: var(--amber-bg); color: var(--amber); }
.pill-ok { background: var(--moss-bg); color: var(--moss); }
.pill-neutral { background: var(--paper-2); color: var(--ink-2); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.summary-banner { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 20px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); margin-bottom: 26px; }
.summary-banner.is-exceeds { border-color: #E3B29D; background: var(--clay-bg); }
.summary-banner.is-ok { border-color: #B9D3BE; background: var(--moss-bg); }
.summary-stat { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.summary-stat-label { font-size: 0.8rem; color: var(--ink-2); margin-top: 4px; }

/* ---- Upload dropzone ---- */
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--card); padding: 48px 28px; text-align: center; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--teal); background: var(--moss-bg); }
.dropzone input[type="file"] { display: none; }
.dropzone-icon { color: var(--teal); margin: 0 auto 14px; }
.progress-bar { height: 6px; border-radius: 4px; background: var(--paper-2); overflow: hidden; margin-top: 14px; }
.progress-bar-fill { height: 100%; background: var(--teal); width: 0%; transition: width 0.2s ease; }
.upload-status { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

textarea.paste-area { width: 100%; min-height: 180px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px; font-family: var(--font-mono); font-size: 0.9rem; background: var(--card); color: var(--ink); resize: vertical; }
label.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"] { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 0.95rem; background: var(--card); color: var(--ink); }

/* ---- Map ---- */
#state-map { height: 440px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--paper-2); }
.leaflet-container { font-family: var(--font-sans); background: var(--paper-2) !important; }
.ww-map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 0.85rem; color: var(--ink-2); }
.ww-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ww-map-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- Prose pages ---- */
.prose { max-width: 700px; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { color: var(--ink-2); padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.prose table th, .prose table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose table th { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
blockquote { border-left: 3px solid var(--clay); margin: 1.4em 0; padding: 4px 0 4px 18px; color: var(--ink-2); font-style: italic; }
.notice { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 0.9rem; margin: 1.4em 0; }
.notice-warn { background: var(--clay-bg); color: #7A3A20; }
.notice-info { background: var(--moss-bg); color: #2A4A34; }

/* ---- State directory ---- */
.state-list { columns: 4; column-gap: 24px; }
.state-list a { display: block; padding: 6px 0; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid transparent; }
.state-list a:hover { color: var(--teal-deep); }
@media (max-width: 720px) { .state-list { columns: 2; } }

/* ---- Footer: distinct dark teal block, brief columns ---- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 48px 0 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--footer-line); }
.footer-brand .wordmark { color: var(--footer-text); }
.footer-brand p { font-size: 0.86rem; color: var(--footer-text-dim); margin-top: 10px; max-width: 260px; }
.footer-col h3 { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--footer-text-dim); margin-bottom: 12px; }
.footer-col a { display: block; padding: 4px 0; color: var(--footer-text); text-decoration: none; font-size: 0.9rem; opacity: 0.9; }
.footer-col a:hover { opacity: 1; color: #7FBFAE; }
.footer-bottom { padding: 20px 0 28px; }
.footer-bottom p { font-size: 0.76rem; color: var(--footer-text-dim); margin-bottom: 8px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---- Misc ---- */
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.divider { height: 1px; background: var(--line); margin: 40px 0; border: 0; }
.kbd { font-family: var(--font-mono); background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 6px; font-size: 0.85em; }
@media print {
  .site-header, .site-footer, .nav-toggle, .no-print { display: none !important; }
  body { background: #fff; }
}
