/* ==========================================================================
   Hawaii Web GIS Portfolio — "Field Survey" theme
   Warm survey-paper ground · teal lead accent · coral hover highlight only
   ========================================================================== */

:root {
  --paper:    #F7F4EC;   /* survey-paper page ground */
  --paper-2:  #FBF9F3;   /* raised card / panel */
  --ink:      #14232B;   /* headers, body text */
  --teal:     #2A7D8C;   /* LEAD accent — links, controls, polygons */
  --teal-dk:  #1D5F6E;   /* hover / emphasis */
  --coral:    #C6553E;   /* hover highlight only */
  --muted:    #52646D;   /* captions, margin notes — darkened for contrast on cream */
  --line:     #E0D9C7;   /* hairline rules */
  --line-ink: #14232B;   /* the single crisp header rule */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { font-size: 100%; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.15rem; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--coral); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1rem;
}

/* ---- Header / nav — single crisp ink rule under a paper bar ---- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--line-ink); }
.masthead-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: .95rem 1.25rem;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--teal); }
.brand:hover { color: var(--ink); }

.mainnav {
  display: flex; flex-wrap: wrap; gap: .1rem .2rem;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
}
.mainnav a {
  color: var(--muted); text-decoration: none;
  padding: .3rem .55rem; border-radius: 4px; white-space: nowrap;
}
.mainnav a:hover { color: var(--teal-dk); background: rgba(42,125,140,.08); }
.mainnav a.current { color: var(--paper); background: var(--teal); }

/* ---- Margin-note strip — the survey signature ---- */
.survey-strip {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: .8rem; margin-top: 1.6rem;
}
.survey-strip b { color: var(--teal-dk); font-weight: 500; }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.6rem 1.25rem 3rem; }
.lede { font-size: 1.15rem; color: #384850; max-width: 60ch; }

/* ---- Map frames (light canvas) ---- */
.map-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 0 #fff inset, 0 8px 26px rgba(20,35,43,.09);
  background: #eef1ec;
}
.map-canvas { width: 100%; height: 68vh; min-height: 420px; }

.panel {
  position: absolute; z-index: 500;
  background: rgba(251,249,243,.95);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
  border-radius: 6px; padding: .7rem .85rem;
  font-size: .82rem;
  box-shadow: 0 3px 14px rgba(20,35,43,.14);
  max-width: 262px;
}
.panel h3 {
  font-size: .72rem; font-family: var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 .4rem;
}
.panel.tl { top: 12px; left: 12px; }
.panel.tr { top: 12px; right: 12px; }
.panel.br { bottom: 22px; right: 12px; }

.legend-row { display: flex; align-items: center; gap: .5rem; margin: .18rem 0; }
.legend-swatch { width: 15px; height: 15px; border-radius: 3px; border: 1px solid rgba(0,0,0,.18); flex: none; }

.readout { font-family: var(--font-mono); font-size: .78rem; color: var(--ink); line-height: 1.5; }
.readout b { color: var(--teal-dk); }

/* ---- Controls ---- */
.control-label {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); display: block; margin: 0 0 .3rem;
}
select, button.btn {
  font-family: var(--font-body); font-size: .85rem;
  padding: .4rem .55rem; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer;
}
select:hover, button.btn:hover { border-color: var(--teal); color: var(--teal-dk); }
.toggle-list { list-style: none; margin: 0; padding: 0; }
.toggle-list li { margin: .28rem 0; }
.toggle-list label { display: flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .84rem; }
.toggle-list input { accent-color: var(--teal); }

/* ---- Hero split (index) ---- */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin-top: 1.4rem; background: var(--paper-2);
}
.hero-text { padding: 2rem 1.8rem; border-right: 1px solid var(--line); }

.purpose-banner {
  margin: .4rem 0 1.4rem; padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-ink);
}
.purpose-kicker {
  display: block;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 1.8rem); color: var(--ink);
  letter-spacing: -.01em; line-height: 1.1;
}
.purpose-def {
  display: block; margin-top: .3rem;
  font-family: var(--font-body); font-size: 1rem; color: var(--muted);
}

.hero-title { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.06; margin-bottom: .5rem; }
.hero-title .spark {
  color: var(--teal); position: relative; white-space: nowrap;
}
.hero-title .spark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .09em;
  background: var(--coral); transform: scaleX(0); transform-origin: left;
  animation: spark-draw 900ms ease-out 350ms forwards;
}
@keyframes spark-draw { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero-title .spark::after { animation: none; transform: scaleX(1); }
}
.hero-subtitle {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1.1rem;
}
.hero-map { position: relative; min-height: 340px; background: #eef1ec; }
.hero-map .panel { max-width: 210px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ---- Demo grid ---- */
.demo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: 1.5rem;
}
@media (max-width: 780px) { .demo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .demo-grid { grid-template-columns: 1fr; } }

.row-label {
  font-family: var(--font-body); font-size: .92rem; color: var(--muted);
  margin: 2rem 0 0; padding-bottom: .6rem;
  border-bottom: 1px dashed var(--line);
}
.row-label .row-eyebrow {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--teal); margin-right: .1rem;
}
.row-label + .demo-grid { margin-top: 1rem; }
.demo-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 1rem 1.1rem 1.15rem;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.demo-card:hover {
  transform: translateY(-3px); box-shadow: 0 10px 22px rgba(20,35,43,.11);
  border-color: var(--teal); color: var(--ink);
}
.demo-card .num { font-family: var(--font-mono); font-size: .72rem; color: var(--teal); letter-spacing: .12em; }
.demo-card h3 { margin: .3rem 0 .35rem; }
.demo-card p { margin: 0; font-size: .88rem; color: var(--muted); }

/* ---- Prose blocks ---- */
.note {
  border-left: 3px solid var(--teal);
  background: var(--paper-2);
  padding: .85rem 1rem; border-radius: 0 6px 6px 0;
  font-size: .92rem; margin: 1.3rem 0;
}
.data-source { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-top: .8rem; }

/* ---- Footer ---- */
.sitefoot { border-top: 1px solid var(--line-ink); background: var(--paper); margin-top: 2.4rem; }

/* Prominent return-to-TUP box */
.back-box {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.1rem 1.25rem;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  color: var(--teal); text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease, color .15s ease;
}
.back-box:hover { background: var(--teal); color: var(--paper); }
.back-box .back-arrow { font-size: 1.3rem; line-height: 1; }

/* Three-column row: email | copyright+stamp | logo */
.sitefoot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.3rem 1.25rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
}
.footer-left  { justify-self: start; }
.footer-right { justify-self: end; }
.footer-center { text-align: center; }
.footer-center .footer-copy {
  margin: 0; font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .04em; color: var(--muted);
}
.footer-center .footer-updated {
  margin: .25rem 0 0; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .04em; color: var(--muted);
}
.sitefoot a { color: var(--teal); }
.footer-left .social-icon { color: var(--teal); display: inline-flex; }
.footer-left .social-icon:hover { color: var(--coral); }
.tup-logo { height: 80px; display: block; }

/* Thin survey identity line */
.footer-survey {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem 1.3rem;
  text-align: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.footer-survey b { color: var(--teal-dk); font-weight: 500; }

@media (max-width: 560px) {
  .sitefoot-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-left, .footer-right { justify-self: center; }
}

/* ---- Leaflet tweaks ---- */
.leaflet-container { font-family: var(--font-body); background: #e6ebe4; }
.county-label {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600; color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
  background: none; border: none; box-shadow: none;
}

@media (max-width: 600px) {
  .map-canvas { height: 60vh; }
  .panel { max-width: 200px; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-card { transition: none; }
}
