/* ============================================================
   HydroCouple — site.css
   Design system for the digital public water infrastructure site
   ============================================================ */

:root {
  --ink: #0a1c2e;          /* deep water ink */
  --ink-soft: #35516b;
  --paper: #fafcfd;
  --surface: #ffffff;
  --mist: #eef5fb;
  --line: #d7e5f0;
  --primary: #0071bf;      /* deep teal-blue */
  --primary-deep: #00518c;
  --accent: #0096ff;       /* bright water */
  --accent-soft: #d9edff;
  --flag: #f29f38;         /* SWMM highlight amber */
  --flag-soft: #fdf0dc;
  --ok: #2e8b57;
  --planned: #7a6ea8;
  --planned-soft: #ece8f6;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(11, 31, 42, 0.07);
  --shadow-lift: 0 10px 30px rgba(11, 31, 42, 0.12);
  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; letter-spacing: -0.015em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 880px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 252, 253, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; color: var(--ink);
}
.nav-brand img { height: 30px; width: auto; }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; align-items: center; }
.nav-links a {
  padding: 8px 13px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; color: var(--ink-soft);
}
.nav-links a:hover { background: var(--mist); color: var(--primary-deep); }
.nav-links a.active { color: var(--primary-deep); background: var(--accent-soft); }
.nav-links a.cta {
  background: var(--primary); color: #fff; font-weight: 600;
}
.nav-links a.cta:hover { background: var(--primary-deep); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 24px 18px; gap: 6px; align-items: stretch;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--primary-deep) 0%, var(--primary) 55%, #2ea8ff 100%);
  color: #f2fafd;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; padding-top: 84px; padding-bottom: 60px; }
.hero-kicker {
  display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #9ed1ff; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; max-width: 21ch; margin-bottom: 22px; color: #fff; }
.hero p.lede { font-size: 1.16rem; max-width: 62ch; color: #d6ebff; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 0.98rem; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: #fff; color: var(--primary-deep); }
.btn-solid:hover { color: var(--primary); box-shadow: var(--shadow-lift); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,0.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-quiet { border: 1.5px solid var(--line); color: var(--primary-deep); }
.hero-wave { display: block; width: 100%; margin-bottom: -1px; }

/* ---------- Hero two-column layout with showcase image ---------- */
.hero-stack { display: flex; flex-direction: column; align-items: center; gap: 44px; }
.hero-stack .hero-copy { width: 100%; text-align: center; }
.hero-stack .hero-copy h1 { max-width: none; }
.hero-stack .hero-copy .lede { font-size: 1.05rem; max-width: none; margin-bottom: 26px; }
.hero-stack .hero-actions { justify-content: center; }
.hero-media {
  margin: 0; width: 100%; max-width: 1040px;
  background: rgba(255, 255, 255, 0.14);
  padding: 12px; border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 20, 45, 0.4);
}
.hero-media img {
  display: block; width: 100%; border-radius: 10px;
}
.hero-pill {
  background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); color: #d6ebff;
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt { background: var(--mist); }
.section-kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
section h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 750; margin-bottom: 16px; max-width: 30ch; }
.section-intro { max-width: 68ch; color: var(--ink-soft); font-size: 1.06rem; margin-bottom: 36px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 0.96rem; }
.card .card-icon { font-size: 1.6rem; margin-bottom: 12px; display: block; }
.card.flagship { border: 2px solid var(--flag); background: linear-gradient(180deg, var(--flag-soft), var(--surface) 45%); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.badge.available { background: #dff2e7; color: var(--ok); }
.badge.flagship-badge { background: var(--flag); color: #4a2c00; }
.badge.planned { background: var(--planned-soft); color: var(--planned); }
.badge.standard { background: var(--accent-soft); color: var(--primary-deep); }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.stat { text-align: center; padding: 22px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .num { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }
.stat .lbl { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Figure blocks ---------- */
.figure-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.figure-block figcaption { margin-top: 16px; font-size: 0.9rem; color: var(--ink-soft); text-align: center; }
.figure-block svg { display: block; width: 100%; height: auto; }

/* ---------- Code / interface listings ---------- */
.code-tag {
  font-family: var(--font-mono); font-size: 0.85em; background: var(--mist);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.iface-list { list-style: none; display: grid; gap: 10px; }
.iface-list li {
  display: flex; gap: 12px; align-items: baseline; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem;
}
.iface-list .code-tag { flex-shrink: 0; }
.iface-list span.desc { color: var(--ink-soft); }

/* ---------- Timeline / phases ---------- */
.phases { display: grid; gap: 0; border-left: 3px solid var(--accent); }
.phase { padding: 8px 0 26px 26px; position: relative; }
.phase::before {
  content: ""; position: absolute; left: -9px; top: 14px; width: 15px; height: 15px;
  background: var(--accent); border: 3px solid var(--paper); border-radius: 50%;
}
.phase h4 { font-size: 1.02rem; margin-bottom: 6px; }
.phase p { color: var(--ink-soft); font-size: 0.94rem; max-width: 70ch; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; display: grid; gap: 16px; }
.pub-list li {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 18px 22px; font-size: 0.96rem; color: var(--ink-soft);
}
.pub-list li strong { color: var(--ink); font-weight: 600; }
.pub-list .doi { font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink); color: #b7c9da; padding: 48px 0 36px; margin-top: 40px;
}
footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 30px; }
footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
footer a { color: #9ccdf5; }
footer a:hover { color: #fff; }
footer ul { list-style: none; display: grid; gap: 7px; font-size: 0.92rem; }
footer .footer-note { border-top: 1px solid #1c3a55; padding-top: 22px; font-size: 0.85rem; color: #7e97ac; }
@media (max-width: 720px) { footer .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 30px; }
.mb-2 { margin-bottom: 18px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  font-size: 0.86rem; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
