/* Solent Companion website. Tokens follow the app's design system (design/website-design.md, section 4). */

:root {
  --surface: #ffffff;
  --surface-alt: #f2f6f9;
  --text: #0b1d2a;
  --text-muted: #3d5566;
  --primary: #0b5cad;
  --primary-hover: #094c8f;
  --on-primary: #ffffff;
  --alert: #c21a1a;
  --caution: #b25e00;
  --ok: #0f6e4e;
  --stale: #6b7780;
  --notice: #6a3fb0;
  --line: #d3dee6;
  --sea: #dcebf5;
  --land: #eef0e6;
  --night-bg: #000000;
  --night-fg: #ff5a4e;
  --night-text: #e8473c;
  --night-dim: #7a1712;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --radius: 16px;
  --radius-chip: 8px;
  --max: 1120px;
  --shadow: 0 12px 32px rgb(11 29 42 / 0.16);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0b1d2a;
    --surface-alt: #102735;
    --text: #e6eef3;
    --text-muted: #a9bbc7;
    --primary: #6cb2f5;
    --primary-hover: #91c6f8;
    --on-primary: #0b1d2a;
    --alert: #ff6b60;
    --caution: #f2a541;
    --ok: #4cc79b;
    --stale: #93a1ab;
    --notice: #b79cf0;
    --line: #23404f;
    --sea: #12364d;
    --land: #1d2a24;
    --shadow: 0 12px 32px rgb(0 0 0 / 0.4);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(17px, 1rem + 0.15vw, 18px);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 var(--s4);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(36px, 1.6rem + 3vw, 56px);
  font-weight: 750;
}

h2 {
  font-size: clamp(28px, 1.3rem + 1.4vw, 36px);
  font-weight: 700;
}

h3 {
  font-size: 22px;
  font-weight: 650;
}

p {
  margin: 0 0 var(--s4);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--s4);
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 var(--s6);
  }
}

.skip {
  position: absolute;
  left: var(--s4);
  top: -100px;
  background: var(--primary);
  color: var(--on-primary);
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-chip);
  z-index: 10;
}

.skip:focus {
  top: var(--s4);
  color: var(--on-primary);
}

.muted {
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s3);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.nav a:not(.button) {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: var(--s3) 0;
}

.nav a:not(.button):hover {
  color: var(--primary);
  text-decoration: underline;
}

.nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  gap: var(--s5);
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--s3) var(--s4) var(--s5);
    gap: 0;
  }

  .js .nav-links.open a {
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line);
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: var(--s3) var(--s5);
  border-radius: 999px;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}

.button.secondary {
  background: transparent;
  color: var(--primary);
}

.button.secondary:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-hover);
}

.button.small {
  min-height: 44px;
  padding: var(--s2) var(--s4);
}

.nav-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--s3);
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  font: inherit;
  align-items: center;
  justify-content: center;
}

/* Sections */

section {
  padding: var(--s8) 0;
}

@media (min-width: 900px) {
  section {
    padding: var(--s9) 0;
  }
}

.band {
  background: var(--surface-alt);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--s7);
}

.section-head p {
  font-size: 1.1em;
  color: var(--text-muted);
}

/* Hero */

.hero {
  padding-top: var(--s7);
}

.hero .wrap {
  display: grid;
  gap: var(--s7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero .lede {
  font-size: clamp(19px, 1rem + 0.5vw, 21px);
  color: var(--text-muted);
  max-width: 34em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: var(--s5) 0 var(--s3);
}

.fine {
  font-size: 15px;
  color: var(--text-muted);
}

.phone {
  max-width: 340px;
  margin: 0 auto;
  border-radius: 36px;
  box-shadow: var(--shadow);
}

/* The three questions */

.questions {
  display: grid;
  gap: var(--s5);
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 800px) {
  .questions {
    grid-template-columns: repeat(3, 1fr);
  }
}

.questions li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
}

.questions .q {
  font-size: 20px;
  font-weight: 650;
  margin-bottom: var(--s3);
}

.questions .q::before {
  content: "";
  display: block;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: var(--s4);
  background: var(--accent, var(--primary));
}

.questions p:last-child {
  margin: 0;
  color: var(--text-muted);
}

/* Feature rows */

.feature {
  display: grid;
  gap: var(--s6);
  align-items: center;
  padding: var(--s7) 0;
  border-top: 1px solid var(--line);
}

.feature:first-of-type {
  border-top: 0;
  padding-top: 0;
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: var(--s8);
  }

  .feature.flip .feature-art {
    order: -1;
  }
}

.feature ul {
  padding-left: 1.2em;
  margin: 0 0 var(--s4);
}

.feature li {
  margin-bottom: var(--s2);
}

.feature-art {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: var(--s5);
}

.feature-art figcaption {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: var(--s3);
}

figure {
  margin: 0;
}

.working {
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  font-size: 16px;
}

.working table {
  width: 100%;
  border-collapse: collapse;
}

.working td {
  padding: var(--s1) 0;
  vertical-align: top;
}

.working td.n {
  text-align: right;
  white-space: nowrap;
  padding: var(--s1) var(--s3);
  font-weight: 600;
}

.working td.src {
  color: var(--text-muted);
  font-size: 14px;
}

.working tr.total td {
  border-top: 2px solid var(--text);
  padding-top: var(--s2);
  font-weight: 700;
}

.working .verdict {
  margin: var(--s3) 0 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ok);
  font-weight: 650;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: 14px;
  font-weight: 600;
  padding: 2px var(--s2);
  border-radius: var(--radius-chip);
  border: 1px solid currentColor;
}

.chip.advisory {
  color: var(--alert);
}

/* Night and privacy */

.pair {
  display: grid;
  gap: var(--s5);
}

@media (min-width: 800px) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  border-radius: var(--radius);
  padding: var(--s6);
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel.night {
  background: var(--night-bg);
  border-color: var(--night-dim);
  color: var(--night-fg);
}

.panel.night h3 {
  color: var(--night-fg);
}

.panel.night p {
  color: var(--night-text);
}

.panel .icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--s4);
}

/* What it isn't */

.aid {
  border-left: 6px solid var(--alert);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s6);
  max-width: 820px;
}

.aid h2 {
  font-size: clamp(24px, 1.1rem + 1vw, 30px);
}

.aid ul {
  padding-left: 1.2em;
  margin: 0 0 var(--s4);
}

.aid li {
  margin-bottom: var(--s2);
}

/* Join */

.join {
  display: grid;
  gap: var(--s6);
}

@media (min-width: 900px) {
  .join {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s5);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: var(--s4);
  min-height: 32px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s6);
}

.card ul {
  padding-left: 1.2em;
  margin: 0 0 var(--s4);
}

/* Join form */

.join-form {
  display: grid;
  gap: var(--s4);
  margin: var(--s5) 0 0;
  max-width: 34em;
}

.field {
  display: grid;
  gap: var(--s1);
}

.field label {
  font-weight: 600;
}

.field .req {
  font-weight: 400;
  color: var(--text-muted);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: var(--s3);
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--stale);
}

.field input:focus,
.field textarea:focus {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.join-form .actions {
  margin: var(--s2) 0 0;
}

/* Honeypot field: hidden from people, left for spam bots to fill in. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* FAQ */

.faq {
  max-width: 820px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 19px;
  padding: var(--s4) var(--s6) var(--s4) 0;
  list-style: none;
  position: relative;
  min-height: 44px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: var(--s2);
  top: var(--s4);
  font-size: 24px;
  line-height: 1;
  color: var(--primary);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > div {
  padding: 0 0 var(--s4);
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s7) 0;
  font-size: 15px;
  color: var(--text-muted);
}

.site-footer .wrap {
  display: grid;
  gap: var(--s5);
}

@media (min-width: 800px) {
  .site-footer .wrap {
    grid-template-columns: 1.4fr 1fr;
  }
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.site-footer a {
  color: var(--text-muted);
}

/* Long-form pages (privacy) */

.prose {
  max-width: 760px;
  padding-top: var(--s7);
  padding-bottom: var(--s8);
}

.prose h2 {
  margin-top: var(--s7);
  scroll-margin-top: 80px;
}

.prose h3 {
  margin-top: var(--s6);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: var(--s2);
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 var(--s5);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  min-width: 560px;
}

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

.prose th {
  font-weight: 650;
  background: var(--surface-alt);
}

.prose blockquote {
  margin: 0 0 var(--s5);
  padding: var(--s4) var(--s5);
  border-left: 6px solid var(--alert);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-chip) var(--radius-chip) 0;
}

.owner-note {
  border: 2px dashed var(--caution);
  border-radius: var(--radius-chip);
  padding: var(--s3) var(--s4);
  color: var(--text);
  font-size: 15px;
}

/* Narrow phones: the hero's own button is the first thing on screen, so the header keeps just the menu. */
.brand,
.button {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .nav .button.small {
    display: none;
  }
}

/* Join form additions */

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 600;
  margin: 0 0 var(--s3);
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
}

.explainer,
.more {
  max-width: 34em;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  background: var(--surface);
  padding: var(--s3) var(--s4);
  margin-top: var(--s4);
}

.more {
  margin-top: 0;
}

.explainer summary,
.more summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}

.more-fields {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s4);
}

.field select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: var(--s3);
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.field select:focus {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.field-error,
.form-status.bad {
  color: var(--alert);
  font-weight: 600;
  margin: 0;
}

.form-status {
  margin: var(--s2) 0 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-chip);
  max-width: 34em;
}

.form-status.good {
  background: var(--surface-alt);
  border-left: 4px solid var(--ok);
}

.form-status:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.join-form .button:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Sticky join bar, phones only */

.join-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgb(11 29 42 / 0.1);
}

.join-bar .button {
  display: block;
  text-align: center;
  min-height: 48px;
}

.join-bar[hidden] {
  display: none;
}

@media (min-width: 761px) {
  .join-bar {
    display: none !important;
  }
}

/* Phone frame around the app screens */

.device {
  max-width: 340px;
  margin: 0 auto;
  padding: 12px;
  background: #11202b;
  border-radius: 48px;
  box-shadow: var(--shadow), inset 0 0 0 2px #2a3c49;
  position: relative;
}

.device::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #05090d;
  z-index: 1;
}

.device .phone {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 36px;
  box-shadow: none;
}

.device.small {
  max-width: 250px;
  padding: 9px;
  border-radius: 38px;
}

.device.small::before {
  top: 15px;
  width: 9px;
  height: 9px;
  margin-left: -4px;
}

.device.small .phone {
  border-radius: 29px;
}
