/* Water Palaver Ltd
   Greys carried over from Show Off, single turquoise accent.
   Structure borrows from pipeline identification: a neutral distribution
   main across the top, a drop into each product. */

:root {
  --ink:        #121212;
  --panel:      #191919;
  --raise:      #1f1f1f;
  --rule:       #2c2c2c;
  --rule-soft:  #232323;

  --text:       #f0f0ef;
  --muted:      #9a9a98;

  --turq:       #3fd9c9;
  --turq-dim:   #2aa99c;
  --alert:      #e2705f;

  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --measure: 36rem;
  --gutter: 1.5rem;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* The stylesheet decides smooth or instant, not the scrollIntoView call,
     so the preference below can switch it off. */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  text-decoration: none;
}
.wordmark:hover { color: var(--turq); }

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--turq); }
.masthead nav a[aria-current="page"] { color: var(--text); }

/* ---------- Type ---------- */

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 5.5vw, 3.3rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.028em;
  max-width: 17ch;
}

h2 {
  margin: 3.5rem 0 1rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p, li { max-width: var(--measure); }

a { color: var(--turq); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--text); }

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

.lead {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text);
  max-width: 34rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Sections ---------- */

main { padding: 3.5rem 0 1rem; }
section + section { margin-top: 1rem; }

/* ---------- Product manifold ---------- */

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.product {
  position: relative;
  padding-top: 2.5rem;
}

.product::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 1.6rem;
  background: var(--turq);
}

.product p { font-size: 0.97rem; max-width: none; color: var(--muted); }
.product .site { display: inline-block; margin-top: 0.6rem; font-size: 0.92rem; }

@media (max-width: 46rem) {
  .products {
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
  .product { padding: 1.6rem 0 1.6rem 1.6rem; }
  .product::before { top: 2.1rem; left: 0; width: 1.1rem; height: 3px; }
}

/* ---------- Prose pages ---------- */

.prose h2 { margin-top: 2.75rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  margin: 1rem 0;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.prose th { font-weight: 700; }
.prose td { color: var(--muted); }
.updated { color: var(--muted); font-size: 0.9rem; margin-top: -0.4rem; }

/* ---------- Routing panel ---------- */

.routes {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  background: var(--panel);
  border-left: 3px solid var(--turq);
}
.routes ul { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.routes li { margin-bottom: 0.4rem; max-width: none; }

/* ---------- Form ---------- */

/* Two columns: the short fields on the left, what the reader is actually
   writing on the right, with the message box growing to match. */
.form {
  margin-top: 2rem;
  max-width: 52rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
}

.form .col { display: flex; flex-direction: column; min-width: 0; }

.col--message .field:last-child { flex: 1; display: flex; flex-direction: column; }
.col--message textarea { flex: 1; min-height: 12rem; }

.form .actions { grid-column: 1 / -1; margin-top: 0.6rem; }

@media (max-width: 46rem) {
  .form { grid-template-columns: 1fr; max-width: 34rem; }
}

.field { margin-bottom: 1.4rem; }

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.field .hint {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

input::placeholder, textarea::placeholder { color: #6a6a68; }

/* The closed control is drawn entirely by us: no system chevron, no
   platform background. */
select {
  appearance: none;
  padding-right: 2.6rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233fd9c9' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.65rem auto;
}
select:hover { border-color: var(--turq-dim); }

/* The open list is the operating system's, not ours. color-scheme: dark on
   :root is what keeps it dark; these two do something in Firefox and on
   Windows, and nothing in Safari. */
select option { background: var(--panel); color: var(--text); }
select option:checked { color: var(--turq); }

/* ---------- Custom select ----------
   Safari draws the native popup with AppKit in the system appearance, which
   no stylesheet reaches. assets/js/select.js replaces it with this, keeping
   the real <select> in the DOM as the source of truth. Touch devices keep
   the native wheel, so both sets of rules have to stand on their own. */

.combo { position: relative; }

.combo__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.combo__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  text-align: left;
  color: var(--text);
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}
.combo__button:hover { background: var(--raise); border-color: var(--turq-dim); }

.combo__icon {
  flex: none;
  width: 0.65rem;
  height: 0.4rem;
  background: var(--turq);
  clip-path: polygon(0 0, 50% 100%, 100% 0, 85% 0, 50% 70%, 15% 0);
}
.combo__button[aria-expanded="true"] .combo__icon { rotate: 180deg; }

.combo__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.combo__list:focus { outline: none; }

.combo__option {
  max-width: none;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 2px;
  cursor: pointer;
}
.combo__option.is-active { background: var(--raise); }
.combo__option[aria-selected="true"] { color: var(--turq); }

textarea { resize: vertical; min-height: 8rem; line-height: 1.55; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--turq);
  outline: 2px solid var(--turq);
  outline-offset: 0;
}

.req { color: var(--alert); font-weight: 400; }

/* Honeypot. Hidden with CSS, not type="hidden" — some bots skip hidden inputs. */
.honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--turq);
  border: 1px solid var(--turq);
  border-radius: 2px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
button:hover { background: var(--turq-dim); border-color: var(--turq-dim); }
button[disabled] { opacity: 0.45; cursor: progress; }

.status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--rule);
  background: var(--panel);
  font-size: 0.95rem;
}
.status:empty { display: none; }
.status.ok { border-left-color: var(--turq); }
.status.bad { border-left-color: var(--alert); }

noscript .status { border-left-color: var(--alert); display: block; }

/* ---------- Footer ---------- */

.colophon {
  margin-top: 5rem;
  padding: 1.75rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
.colophon p { max-width: 40rem; margin: 0 0 0.5rem; }
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--turq); }
.colophon nav { display: flex; gap: 1.25rem; margin-top: 0.9rem; }

/* ---------- Confirmation ---------- */

.sent {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  max-width: 34rem;
  background: var(--panel);
  border-left: 3px solid var(--turq);
}
.sent h3 { margin-top: 0; }
.sent p { margin-bottom: 0; color: var(--muted); }
.sent:focus { outline: none; }
.sent:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
