/*
 * Aquifer — project site.
 *
 * Dark only, deliberately: the audience is reading this next to a terminal.
 * The accent is water, not the default terminal green, because the project is
 * named for a shared water table and every other infrastructure site on this
 * network is green on black.
 */

/*
 * Fonts are served from this origin, not Google's. The site sits behind the
 * same `style-src 'self'; font-src 'self'` policy as every other host on this
 * box, which blocks a webfont CDN outright.
 *
 * One file per family covers every weight: Google serves these as variable
 * fonts, and the per-weight URLs it advertises are byte-identical. The ranges
 * below are the axes actually in each file's `fvar` table — IBM Plex Sans
 * carries no width axis, so no `font-stretch` descriptor is needed.
 */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  /* Near-black with a blue cast. Pure #000 makes text edges buzz on OLED. */
  --bg: #080b10;
  --bg-raised: #0e131a;
  --bg-sunken: #05070a;
  --line: #1c242f;
  --line-strong: #2b3644;

  --ink: #e8eef5;
  --ink-muted: #97a5b6;
  /* Measured, not eyeballed: #64748b came in at 4.14:1 against --bg, under the
     4.5:1 AA floor for the 12-14px text that uses it (notes, table headers). */
  --ink-faint: #7d8b9d;

  /* Aquifer. Contrast on --bg is ~13:1, comfortably past AAA. */
  --accent: #5eead4;
  --accent-dim: #2dd4bf;
  --accent-wash: rgba(94, 234, 212, 0.08);

  /* Reserved for caveats and measured losses. Never decorative. */
  --warn: #fbbf24;
  --warn-wash: rgba(251, 191, 36, 0.08);

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 68ch;
  --page: 1080px;
  --radius: 6px;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --step-3: clamp(1.8rem, 1.3rem + 2.2vw, 2.75rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4rem);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.65 var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font: 600 0.9rem var(--sans);
  border-radius: 0 0 var(--radius) 0;
}

.skip:focus {
  left: 0;
}

/* -------------------------------------------------------------------- shell */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--line);
}

section:first-of-type {
  border-top: 0;
}

/* --------------------------------------------------------------- typography */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.15em;
  max-width: var(--measure);
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(94, 234, 212, 0.35);
  text-underline-offset: 0.2em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: #99f6e4;
  text-decoration-color: currentColor;
}

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

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

:not(pre) > code {
  padding: 0.15em 0.4em;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 1rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.lede {
  font-size: var(--step-1);
  color: var(--ink-muted);
  max-width: 62ch;
}

.note {
  font-size: 0.875rem;
  color: var(--ink-faint);
  max-width: 72ch;
}

/*
 * Headings reset their margin above, so an h3 opening a subsection inside a
 * section that is already running has to earn back the separation the section
 * border would have given it. Card headings inside a grid do not — hence a
 * class rather than a sibling selector.
 */
.subsection {
  margin-top: 3rem;
}

caption {
  padding: 0.85rem 1rem;
  text-align: left;
}

/* A note closing a list comments on the whole list, not on its last item. */
ul + .note {
  margin-top: 1.75rem;
}

/* Introduces the block that follows it, so it sits nearer that than its own
   preceding paragraph. */
.lead-in {
  margin-top: 2rem;
}

/* --------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 11, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 600 1rem var(--sans);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.brand svg {
  flex: none;
  color: var(--accent);
}

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.masthead nav a {
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--ink);
}

@media (max-width: 720px) {
  .masthead nav .hide-sm {
    display: none;
  }
}

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

.hero {
  padding-block: clamp(4rem, 11vw, 8rem) clamp(3rem, 7vw, 5rem);
}

.hero h1 {
  max-width: 18ch;
}

.hero .lede {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem 0.75rem 0.35rem 0.6rem;
  background: var(--accent-wash);
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 100px;
  font: 500 0.8rem var(--mono);
  color: var(--accent);
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 500 0.925rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn--primary {
  background: var(--accent);
  color: #04211c;
}

.btn--primary:hover {
  background: #99f6e4;
  color: #04211c;
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink-faint);
  background: var(--bg-raised);
  color: var(--ink);
}

/* ------------------------------------------------------- the honest result */

.verdict {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 2.5rem 0 1.25rem;
}

/* Three stats, so pin three columns once they fit. auto-fit alone resolves to
   four at this container width and leaves a dead column beside them. */
@media (min-width: 860px) {
  .verdict {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  padding: 1.25rem 1.35rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat--loss {
  border-color: rgba(251, 191, 36, 0.28);
  background: var(--warn-wash);
}

.stat__value {
  display: block;
  font: 500 clamp(1.5rem, 1.2rem + 1.2vw, 2rem) / 1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat--loss .stat__value {
  color: var(--warn);
}

.stat--win .stat__value {
  color: var(--accent);
}

.stat__label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ tables */

.table-scroll {
  overflow-x: auto;
  margin: 2rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  margin-top: 2.5rem;
}

.card {
  padding: 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--accent-wash);
  color: var(--accent);
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.925rem;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------- findings */

.findings {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.findings li {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.35rem 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 800px) {
  .findings li {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

.findings dt,
.findings__what {
  font: 500 0.925rem var(--sans);
  color: var(--ink);
}

.findings__detail {
  margin: 0;
  max-width: var(--measure);
  font-size: 0.925rem;
  color: var(--ink-muted);
}

/* -------------------------------------------------------------------- code */

pre {
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: 400 0.875rem/1.7 var(--mono);
  color: var(--ink);
  tab-size: 2;
}

pre .c {
  color: var(--ink-faint);
}
pre .k {
  color: var(--accent);
}

/* ------------------------------------------------------------------ callout */

.callout {
  margin: 2rem 0 0;
  padding: 1.25rem 1.4rem;
  background: var(--warn-wash);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-left-width: 3px;
  border-radius: var(--radius);
}

.callout h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--warn);
}

.callout p {
  margin-bottom: 0;
  font-size: 0.925rem;
  color: var(--ink-muted);
}

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

footer {
  padding-block: 3rem 4rem;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
}

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: start;
}

footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
  max-width: 46ch;
}

/* The one line naming the project sits a step brighter than the fine print
   under it. */
.footer__brand {
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.footer__brand strong {
  color: var(--ink);
}

footer nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

footer nav a {
  font-size: 0.875rem;
}
