/* Layout: concrete-grey ground, pool-tile teal accent, mosaic grid as the one recurring motif. */
:root {
  --bg: #f1f4f3;
  --surface: #ffffff;
  --ink: #142329;
  --muted: #3c4c52;
  --line: #d3dcdc;
  --tile: #0b6a7a;
  --tile-ink: #ffffff;
  --tile-soft: #dceef0;
  --sand: #e8dcc4;
  --todo: #fff1b8;
  --todo-ink: #5a4500;
  --f-display: "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 72rem;
  --radius: 6px;
  color-scheme: light;
}
/* Light by default; dark when the visitor picks it (button in the header, saved in localStorage). */
:root[data-theme="dark"] {
  --bg: #0f1a1e; --surface: #16252a; --ink: #e6efef; --muted: #bccacd; --line: #2a3d43;
  --tile: #47b6c7; --tile-ink: #062227; --tile-soft: #173a41; --sand: #3a3326;
  --todo: #4a3d0c; --todo-ink: #ffe9a3; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.125rem/1.7 var(--f-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tile); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--tile); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.18; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; font-family: var(--f-body); }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.topbar { background: var(--ink); color: var(--bg); font-size: .9rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-block: 6px; justify-content: flex-end; }
.topbar a { color: inherit; text-decoration: none; }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.theme-toggle { flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--tile-soft); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; display: block; line-height: 1; }
.brand small { color: var(--muted); font-size: .78rem; letter-spacing: .04em; }
nav.main ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
nav.main a { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; border-radius: var(--radius); font-weight: 500; font-size: .97rem; }
nav.main a:hover, nav.main a[aria-current="page"] { background: var(--tile-soft); }
nav.main .cta { background: var(--tile); color: var(--tile-ink); }
nav.main .cta:hover { background: var(--tile); filter: brightness(1.08); }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  nav.main { display: none; }
  .menu-toggle { display: block; }
  .menu-toggle summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; }
  .menu-toggle summary::-webkit-details-marker { display: none; }
  .menu-toggle[open] nav.mobile { display: block; }
  nav.mobile { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  nav.mobile a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
}
@media (min-width: 961px) { nav.mobile { display: none; } }

/* Breadcrumbs */
.crumbs { font-size: .88rem; color: var(--muted); padding-block: 14px 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }

/* Hero with mosaic tile grid */
.hero { position: relative; overflow: hidden; background: var(--tile); color: var(--tile-ink); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: linear-gradient(var(--tile-ink) 1px, transparent 1px), linear-gradient(90deg, var(--tile-ink) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(100deg, transparent 35%, #000 85%); -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%); }
.hero .wrap { position: relative; padding-block: clamp(40px, 7vw, 84px); display: grid; gap: 22px; }
.hero h1 { max-width: 22ch; }
.hero .lead { font-size: 1.25rem; max-width: 54ch; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: .95rem; }
.hero .facts b { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; display: block; line-height: 1.1; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font: 600 1rem var(--f-body); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn.tile { background: var(--tile); color: var(--tile-ink); }
.page-head { padding-block: 18px 34px; display: grid; gap: 14px; }
.page-head .lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

/* Content */
main { display: block; }
.section { padding-block: 40px; }
.section + .section { border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.prose { display: grid; gap: 16px; max-width: 68ch; min-width: 0; }
.prose h2 { margin-top: 18px; }
.prose h3 { margin-top: 6px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.table-scroll { overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--tile-soft); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { background: var(--tile-soft); padding: 14px 16px; border-radius: var(--radius); }
.todo { background: var(--todo); color: var(--todo-ink); padding: 0 4px; border-radius: 3px; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink); }
a.card:hover { border-color: var(--tile); }
.card .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tile); font-weight: 600; }
.card p { color: var(--muted); font-size: 1rem; }

.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.areas > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.areas h3 { margin: 0 0 8px; }
.areas p { color: var(--muted); line-height: 1.9; }
.prose p.links { line-height: 1.95; }
.prose h2 a { text-decoration: none; color: inherit; }
.prose h2 a:hover { color: var(--tile); }

.spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec div { padding: 14px; box-shadow: -1px -1px 0 var(--line); }
.spec b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.spec span { color: var(--muted); font-size: .9rem; }

.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 46px !important; min-height: 34px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--tile); color: var(--tile-ink); display: grid; place-items: center; font-weight: 700; font-size: .95rem; }

/* Photo figures: graceful fallback when the image is unavailable */
.photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--tile-soft); position: relative; aspect-ratio: 1 / 1; }
.photo::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(var(--tile) 1px, transparent 1px), linear-gradient(90deg, var(--tile) 1px, transparent 1px); background-size: 18px 18px; }
.photo img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: .9rem; }
.photo figcaption b { display: block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; }
.faq details > div { padding: 0 16px 16px; color: var(--muted); }

/* Sidebar + form */
aside.side { display: grid; gap: 16px; position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); min-width: 0; }
@media (max-width: 860px) { aside.side { position: static; } }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; }
.box h2, .box h3 { font-size: 1.15rem; font-family: var(--f-body); }
.box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
form.quote { display: grid; gap: 10px; }
form.quote label { display: grid; gap: 4px; font-size: .9rem; font-weight: 500; }
form.quote input, form.quote select, form.quote textarea { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); width: 100%; }
.form-result { background: var(--tile-soft); padding: 12px; border-radius: var(--radius); display: grid; gap: 8px; font-size: .95rem; }
.nap { font-style: normal; display: grid; gap: 4px; }

/* CTA band */
.band { background: var(--sand); }
.band .wrap { padding-block: 34px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.band p { max-width: 56ch; }

footer.site { background: var(--ink); color: var(--bg); font-size: .93rem; margin-top: 0; }
footer.site .wrap { padding-block: 40px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 28px; }
footer.site h2 { font-family: var(--f-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; margin-bottom: 10px; }
footer.site ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
footer.site a { color: inherit; }
footer.site .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px; opacity: .75; }

.fab { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: #1fa855; color: #fff; padding: 12px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 6; }
@media (prefers-reduced-motion: no-preference) { a.card, .btn { transition: border-color .15s, filter .15s; } }
