/* ANYSINFO — palette and type follow the ANYSINFO Brand Book (2012):
   ink #1D1E1C, blue #0197FD, green #397E20, orange #E56E00; Verdana body, bold Verdana titles.
   Blue and orange are below 4.5:1 on white, so they are used for accents and large type only. */

:root {
  --ink: #1d1e1c;
  --blue: #0197fd;
  --green: #397e20;
  --orange: #e56e00;
  --muted: #4d534f;
  --bg: #ffffff;
  --soft: #f4f8fa;
  --line: #dfe6ea;
  --radius: 14px;
  --wrap: 1240px;
  --font: Verdana, Geneva, "DejaVu Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin-bottom: .35em; }

.wrap { width: min(var(--wrap), 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Brand tri-colour rule, echoing the bar under the logo wordmark */
.tricolour { height: 5px; background: linear-gradient(90deg, var(--blue) 0 33.3%, var(--green) 33.3% 66.6%, var(--orange) 66.6% 100%); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 78px; }
.brand { flex-shrink: 0; }
.brand img { width: 275px; height: auto; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { white-space: nowrap; color: var(--ink); text-decoration: none; font-size: .86rem; padding: .55rem .6rem; border-radius: 8px; font-weight: 700; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--blue); border-radius: 0; }
.nav .btn { margin-left: .5rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }

/* Buttons */
.btn { display: inline-block; background: var(--ink); color: #fff !important; text-decoration: none; font-weight: 700; padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid var(--ink); font-size: .95rem; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--green); border-color: var(--green); }
.btn-ghost { background: transparent; color: var(--ink) !important; }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.nav .btn { padding: .55rem 1.1rem; font-size: .85rem; }
.nav .btn:hover { background: var(--green); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); background:
  radial-gradient(900px 380px at 88% -10%, rgba(1,151,253,.14), transparent 60%),
  radial-gradient(700px 320px at -5% 110%, rgba(57,126,32,.12), transparent 60%),
  var(--bg); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); margin-bottom: 1rem; }
.hero h1 { max-width: 17ch; }
.hero .lead { font-size: 1.12rem; max-width: 60ch; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 3rem; }
.fact { border-left: 4px solid var(--blue); padding: .2rem 0 .2rem 1rem; }
.fact:nth-child(2) { border-color: var(--green); }
.fact:nth-child(3) { border-color: var(--orange); }
.fact:nth-child(4) { border-color: var(--ink); }
.fact b { display: block; font-size: 1rem; }
.fact span { font-size: .88rem; color: var(--muted); }

.page-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); background: var(--soft); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 22ch; }
.page-hero .lead { color: var(--muted); max-width: 64ch; font-size: 1.05rem; margin: 0; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }

/* Sections */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.alt { background: var(--soft); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; position: relative; transition: transform .15s, box-shadow .15s; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(29,30,28,.09); color: inherit; }
.card::before { content: ""; position: absolute; left: 1.5rem; top: 0; width: 44px; height: 4px; border-radius: 0 0 4px 4px; background: var(--blue); }
.card.g::before { background: var(--green); }
.card.o::before { background: var(--orange); }
.card p { color: var(--muted); font-size: .94rem; margin-bottom: .6rem; }
.card .more { font-weight: 700; font-size: .88rem; color: var(--green); }
.icon { width: 40px; height: 40px; margin: .4rem 0 1rem; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.split { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr .9fr; } .split.even { grid-template-columns: 1fr 1fr; } }

.checks { list-style: none; padding: 0; }
.checks li { padding-left: 1.9rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 1.05rem; height: .6rem; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg) scale(.8); transform-origin: center; }

.steps { counter-reset: s; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding: 0; list-style: none; }
.steps li { counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font-weight: 700; font-size: 1.6rem; color: var(--blue); margin-bottom: .4rem; }
.steps li:nth-child(even)::before { color: var(--green); }
.steps li:nth-child(3n)::before { color: var(--orange); }
.steps h3 { margin-bottom: .3rem; }
.steps p { font-size: .92rem; color: var(--muted); margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.tags li { margin: 0; font-size: .82rem; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }

.cta-band { background: var(--ink); color: #fff; border-radius: 20px; padding: clamp(2rem, 5vw, 3.2rem); display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 800px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin-bottom: .4rem; }
.cta-band p { margin: 0; color: #d6dcd8; }
.cta-band .btn { background: #fff; color: var(--ink) !important; border-color: #fff; }
.cta-band .btn:hover { background: var(--blue); border-color: var(--blue); color: var(--ink) !important; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 560px; }
th, td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

/* Contact form */
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
label { display: block; font-weight: 700; font-size: .86rem; margin-bottom: .35rem; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; font-size: .95rem; color: var(--ink); padding: .75rem .9rem; border: 1.5px solid #b9c4ca; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(1,151,253,.35); border-color: var(--blue); }
textarea { min-height: 150px; resize: vertical; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .86rem; color: var(--muted); }
.consent input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .15rem; accent-color: var(--green); cursor: pointer; }
.consent { cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: .9rem 1.1rem; border-radius: 10px; font-size: .92rem; display: none; }
.form-status.ok { display: block; background: #eaf4e6; border: 1px solid var(--green); }
.form-status.err { display: block; background: #fdeee0; border: 1px solid var(--orange); }
.form button[disabled] { opacity: .6; cursor: progress; }

.office { border-top: 4px solid var(--blue); padding-top: .8rem; }
.office:nth-child(2) { border-color: var(--green); }
.office:nth-child(3) { border-color: var(--orange); }
.office h3 { margin-bottom: .3rem; }
.office address { font-style: normal; color: var(--muted); font-size: .94rem; }

.prose { max-width: 74ch; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.muted { color: var(--muted); }

/* Footer */
.site-footer { background: #151614; color: #cfd6d2; padding: 3.5rem 0 2rem; font-size: .9rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.site-footer h2 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer ul { list-style: none; padding: 0; }
.footer-logo { background: #fff; padding: .6rem .9rem; border-radius: 10px; display: inline-block; margin-bottom: 1rem; }
.footer-logo img { width: 200px; }
.legal { border-top: 1px solid #343733; margin-top: 2.5rem; padding-top: 1.2rem; font-size: .8rem; color: #9aa39e; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

@media (max-width: 1279px) {
  .nav-toggle { display: inline-block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: .75rem 1rem 1.2rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .5rem; }
  .nav .btn { margin: .5rem 0 0; text-align: center; }
}
@media (max-width: 520px) { .brand img { width: 220px; } } /* phones only; Brand Book web minimum is 275px */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .cta-band { display: none; } }

/* FAQ */
.faqs { max-width: 820px; display: grid; gap: .75rem; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 1.2rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--green); flex: none; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--muted); font-size: .95rem; margin: 0 0 1.1rem; }

/* Tables marked .stack become one card per row on phones (no sideways scrolling) */
@media (max-width: 640px) {
  .table-wrap:has(table.stack) { overflow: visible; border: 0; background: none; }
  table.stack { min-width: 0; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .9rem; position: relative; }
  table.stack tr::before { content: ""; position: absolute; left: 1.1rem; top: 0; width: 44px; height: 4px; border-radius: 0 0 4px 4px; background: var(--blue); }
  table.stack tr:nth-child(3n+2)::before { background: var(--green); }
  table.stack tr:nth-child(3n)::before { background: var(--orange); }
  table.stack td { border: 0; padding: .25rem 0; }
  table.stack td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
  table.stack td:first-child { font-size: 1.05rem; padding-top: .3rem; }
  table.stack td:first-child::before { display: none; }
}

/* ---- Count-aware grids: rows always fill evenly (no orphan cards) ---- */
.grid-2, .grid-3 { grid-template-columns: 1fr; }
.hero-facts { grid-template-columns: repeat(2, 1fr); }
.footer-grid { grid-template-columns: 1fr; }
.steps { grid-template-columns: 1fr; }

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); }               /* 6 cards: 2 + 2 + 2 */
  .grid-3:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); } /* 3 cards: one row */
}
@media (min-width: 900px) {
  .hero-facts { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }                         /* 6 cards: 3 + 3 */
  .grid-2:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .steps:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .steps:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); } /* 5 steps: one row */
}
/* Below one-row width, steps become a compact numbered list */
@media (max-width: 1199px) {
  .steps:has(> li:nth-child(5):last-child) li { display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 1rem; align-items: start; }
  .steps:has(> li:nth-child(5):last-child) li::before { grid-row: 1 / span 2; margin: 0; line-height: 1.2; }
  .steps:has(> li:nth-child(5):last-child) li > * { grid-column: 2; }
}
