/*
 * AYP Connect — the public site.
 *
 * Five pages, no build step, one stylesheet. The audience is a care home manager who has been sold
 * to before and a relative who has found the page by accident, so the tone is plain and the claims
 * are checkable. Nothing here should feel like a brochure for software.
 */

:root {
  --ink: #17242b;
  --ink-soft: #55676f;
  --page: #f6f5f2;
  --card: #ffffff;
  --line: #dae0e2;
  --brand: #0b4f6c;
  --brand-ink: #ffffff;
  --soft: #e6f1f6;
  --warm: #fdf6ec;
  --warm-line: #e6d4b8;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8eef1;
    --ink-soft: #9fb0b8;
    --page: #101a1f;
    --card: #17242b;
    --line: #2d3d46;
    --brand: #7fc4e0;
    --brand-ink: #06222e;
    --soft: #1b3440;
    --warm: #241d12;
    --warm-line: #4a3a22;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.65 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 900px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ---------- Header and navigation ---------- */

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-name { font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-sub { color: var(--ink-soft); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; }

nav.main { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
nav.main a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.97rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--ink); }
nav.main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Buttons ---------- */

.btn, .btn-quiet {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  min-height: 48px;
  line-height: 24px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
}
.btn { background: var(--brand); color: var(--brand-ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:focus-visible, .btn-quiet:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 0; }

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

h1 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 16px;
  text-wrap: balance;
  max-width: 20ch;
}
h2 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 600;
  font-size: 1.7rem;
  margin: 44px 0 10px;
  text-wrap: balance;
}
h3 { margin: 26px 0 6px; font-size: 1.06rem; }
p { max-width: 64ch; margin: 0 0 14px; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 58ch; }
.eyebrow {
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 10px;
}
.small { font-size: 0.92rem; }
.muted { color: var(--ink-soft); }

section.hero { padding-block: 40px 44px; border-bottom: 1px solid var(--line); }
section { padding-block: 8px; }

ul.plain { margin: 16px 0; padding-left: 22px; max-width: 64ch; }
ul.plain li { margin: 8px 0; }

/* ---------- Cards ---------- */

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 22px 0; }
.point {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.point h3 { margin: 0 0 6px; font-size: 1.02rem; }
.point p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; max-width: none; }

/* The one thing that is actually different gets the one piece of colour. */
.keystone {
  background: var(--soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 28px 0;
}
.keystone h2 { margin-top: 0; }
.keystone p:last-child { margin-bottom: 0; }

/* Where the page has to be honest about something. */
.plainly {
  background: var(--warm);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 28px 0;
}
.plainly h2, .plainly h3 { margin-top: 0; }
.plainly p:last-child { margin-bottom: 0; }

/* ---------- Numbered facts ---------- */

.facts { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 14px; max-width: 64ch; }
.facts li {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.facts li:last-child { border-bottom: 0; }
.facts b {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.9rem;
  color: var(--brand);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.facts span { color: var(--ink-soft); }
.facts cite { display: block; font-size: 0.86rem; font-style: normal; margin-top: 4px; opacity: 0.85; }

/* ---------- Forms ---------- */

form.enquiry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 24px 0; }
form.enquiry h2 { margin-top: 0; }
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field .hint { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-top: 5px; }
.two-up { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .two-up { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

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

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-block: 26px 52px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
footer.site p { max-width: 72ch; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
footer.site a { color: var(--ink-soft); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
