/* Backyard Masters storefront — styles. Written 2026-09-17. */

@font-face {
  font-family: "Host Grotesk";
  src: url("/assets/fonts/host-grotesk.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
/* Arial sized to Host Grotesk so the font swap does not move the page */
@font-face {
  font-family: "Host Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 101%;
  ascent-override: 100%;
  descent-override: 31%;
  line-gap-override: 0%;
}

:root {
  --paper: #fbfaf7;
  --sand: #f3f0eb;       /* product tiles: white product shots blend into it */
  --stone: #e5e1d9;
  --ink: #17191a;
  --soft: #5c6163;
  --lagoon: #0f3a40;     /* deep pool water: primary actions and dark sections */
  --lagoon-hover: #17505a;
  --on-dark: #f4f6f5;
  --on-dark-soft: #b3c2c2;
  --line: rgba(23, 25, 26, 0.1);
  --line-dark: rgba(244, 246, 245, 0.16);

  --font: "Host Grotesk", "Host Fallback", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --section: clamp(72px, 9vw, 136px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --header: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.62 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: normal; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 3px; }
.dark :focus-visible, .hero :focus-visible, .bar :focus-visible { outline-color: var(--on-dark); }

h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(2.625rem, 5.8vw, 5.75rem); line-height: 0.98; letter-spacing: -0.045em; font-weight: 340; }
h2 { font-size: clamp(1.875rem, 3.3vw, 3.125rem); line-height: 1.04; letter-spacing: -0.038em; font-weight: 360; }
h3 { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.012em; font-weight: 480; }
p { margin: 0 0 1em; max-width: 60ch; text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.muted { color: var(--soft); }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 90; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { top: 12px; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 30px; border-radius: 999px; border: 1px solid var(--lagoon);
  background: var(--lagoon); color: var(--on-dark); font-size: 0.9375rem; font-weight: 460; letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn:hover { background: var(--lagoon-hover); border-color: var(--lagoon-hover); }
.btn.light { background: var(--on-dark); border-color: var(--on-dark); color: var(--ink); }
.btn.light:hover { background: #fff; border-color: #fff; }
.btn.line { background: transparent; color: var(--ink); border-color: rgba(23, 25, 26, 0.35); }
.btn.line:hover { border-color: var(--ink); }
.btn.wide { width: 100%; }
.link { display: inline-block; padding: 10px 0; font-size: 0.9375rem; font-weight: 460; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; transition: text-underline-offset 0.25s; }
.link:hover { text-underline-offset: 3px; }

/* ---------- announcement and header ---------- */
.bar { background: var(--ink); color: rgba(244, 246, 245, 0.82); font-size: 0.75rem; letter-spacing: 0.015em; text-align: center; }
.bar .wrap { min-height: 30px; display: flex; align-items: center; justify-content: center; gap: 6px 12px; flex-wrap: wrap; padding: 5px 0; }
.bar .dot { width: 5px; height: 5px; border-radius: 999px; background: var(--bronze-light, #c9a27a); background: #7fb2a6; }
.bar a { color: var(--on-dark); text-underline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, 0.82); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
}
/* over a full-bleed photo the header is transparent white, and frosts only once the page scrolls */
.site-header.over {
  background: linear-gradient(180deg, rgba(8, 20, 22, 0.55) 0%, rgba(8, 20, 22, 0.28) 55%, rgba(8, 20, 22, 0) 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom-color: transparent; color: var(--on-dark);
}
.site-header.over .brand span { color: rgba(244, 246, 245, 0.72); }
.site-header.over .nav a { color: rgba(244, 246, 245, 0.92); }
.site-header.over .nav a:hover { color: #fff; }
.site-header.over .tools .phone { color: rgba(244, 246, 245, 0.8); }
.site-header.over .tools .phone:hover { color: #fff; }
.site-header.over .bag-count[data-empty] { color: rgba(244, 246, 245, 0.8); box-shadow: inset 0 0 0 1px rgba(244, 246, 245, 0.34); }
.site-header.over.stuck { background: rgba(251, 250, 247, 0.86); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); border-bottom-color: var(--line); color: var(--ink); }
.site-header.over.stuck .brand span { color: var(--soft); }
.site-header.over.stuck .nav a { color: rgba(23, 25, 26, 0.86); }
.site-header.over.stuck .nav a:hover { color: var(--ink); }
.site-header.over.stuck .tools .phone { color: var(--soft); }
.site-header.over.stuck .bag-count[data-empty] { color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
/* the hero starts under the header instead of below it */
.site-header.over + main .hero { margin-top: calc(-1 * var(--header)); }
.site-header.over + main .hero .wrap { padding-top: calc(120px + var(--header)); }
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--header); gap: 16px; }
.brand { justify-self: start; display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; font-weight: 560; font-size: 1.25rem; letter-spacing: -0.04em; white-space: nowrap; }
.brand span { font-weight: 400; font-size: 0.75rem; color: var(--soft); letter-spacing: 0.02em; }
.nav { display: flex; gap: 34px; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-block; padding: 10px 0; text-decoration: none; font-size: 0.90625rem; font-weight: 430; letter-spacing: -0.005em; color: rgba(23, 25, 26, 0.86); transition: color 0.2s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.tools { justify-self: end; display: flex; align-items: center; gap: 18px; }
.tools .phone { font-size: 0.875rem; text-decoration: none; color: var(--soft); }
.tools .phone:hover { color: var(--ink); }
.bag { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.bag svg { width: 21px; height: 21px; }
.bag-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--lagoon); color: var(--on-dark); font-size: 0.6875rem; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; transition: transform 0.35s var(--ease); }
.bag-count[data-empty] { background: transparent; color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.bag-count.bump { transform: scale(1.25); }
.menu-toggle { display: none; }
.nav .nav-extra { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(86svh, 860px); display: flex; align-items: flex-end; color: var(--on-dark); background: #33403d; overflow: hidden; }
.hero.short { min-height: min(64svh, 620px); }
.hero > img, .hero > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.hero > picture { position: absolute; inset: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(8, 20, 22, 0.66) 0%, rgba(8, 20, 22, 0.28) 38%, rgba(8, 20, 22, 0) 66%),
    linear-gradient(90deg, rgba(8, 20, 22, 0.22), rgba(8, 20, 22, 0) 55%);
}
.hero .wrap { position: relative; z-index: 1; padding: 120px 0 clamp(36px, 6vw, 72px); }
.hero h1 { max-width: 11ch; margin-bottom: 22px; }
.hero p { font-size: clamp(1.0625rem, 1.35vw, 1.1875rem); line-height: 1.55; color: rgba(244, 246, 245, 0.86); max-width: 42ch; margin-bottom: 32px; }
@media (prefers-reduced-motion: no-preference) {
  .hero .wrap > * { animation: rise 0.9s var(--ease) both; }
  .hero .wrap > :nth-child(2) { animation-delay: 0.08s; }
  .hero .wrap > :nth-child(3) { animation-delay: 0.16s; }
  @keyframes rise { from { opacity: 0.001; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* ---------- section heads ---------- */
.section { padding: var(--section) 0; }
.section.tight-top { padding-top: 0; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; margin-bottom: clamp(28px, 4vw, 48px); }
.head p { margin: 0; color: var(--soft); max-width: 42ch; font-size: 0.9375rem; }
.dark { background: var(--lagoon); color: var(--on-dark); }
.dark p, .dark .muted { color: var(--on-dark-soft); }
.sand { background: var(--sand); }

/* ---------- category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: block; overflow: hidden; color: var(--on-dark); text-decoration: none; background: #3a4644; aspect-ratio: 3 / 4; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 20, 22, 0.55), rgba(8, 20, 22, 0) 46%); }
.tile span { position: absolute; left: 22px; right: 22px; bottom: 20px; z-index: 1; font-size: 1.375rem; font-weight: 380; letter-spacing: -0.03em; line-height: 1.2; }
.tile small { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 400; color: rgba(244, 246, 245, 0.8); letter-spacing: 0; }
.tile:hover img { transform: scale(1.04); }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 20px; }
.card { position: relative; }
.card a { display: block; text-decoration: none; }
.card .frame { position: relative; aspect-ratio: 4 / 5; background: var(--sand); overflow: hidden; }
.card .frame img { width: 100%; height: 100%; object-fit: contain; padding: 12%; mix-blend-mode: multiply; transition: transform 1.1s var(--ease), opacity 0.6s var(--ease); }
/* second photo on hover: added by main.js the first time a mouse rests on the card */
.card .frame .alt { position: absolute; inset: 0; opacity: 0; }
.card .frame[data-alt-cover] .alt { object-fit: cover; padding: 0; mix-blend-mode: normal; }
.card a:hover .frame img { transform: scale(1.035); }
.card a:hover .frame.has-alt img:not(.alt) { opacity: 0; }
.card a:hover .frame.has-alt .alt { opacity: 1; }
.card h3 { margin-top: 16px; font-size: 0.90625rem; font-weight: 440; letter-spacing: -0.005em; line-height: 1.35; }
.card .price { margin-top: 3px; font-size: 0.875rem; color: rgba(23, 25, 26, 0.8); font-variant-numeric: tabular-nums; }
.card .meta { margin-top: 1px; font-size: 0.78125rem; color: var(--soft); }
.card a:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: rgba(23, 25, 26, 0.4); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }
.rail-nav { display: flex; gap: 8px; }
.rail-nav button { width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; transition: border-color 0.25s, background 0.25s; }
.rail-nav button:hover { background: var(--sand); }
.rail-nav button:hover { border-color: var(--ink); }
.rail-nav svg { width: 16px; height: 16px; }

/* ---------- editorial split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.split.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split.flip > :first-child { order: 2; }
.split figure { margin: 0; overflow: hidden; background: var(--stone); }
.split figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.split h2 { margin-bottom: 20px; }
.split .lede { font-size: 1.125rem; color: var(--soft); }
.dark .split .lede { color: var(--on-dark-soft); }

/* ---------- materials ---------- */
.materials { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.material { display: block; text-decoration: none; }
.material .frame { aspect-ratio: 1; background: var(--sand); }
.material img { width: 100%; height: 100%; object-fit: contain; padding: 16%; mix-blend-mode: multiply; transition: transform 1.1s var(--ease); }
.material:hover img { transform: scale(1.04); }
.material span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 12px; font-size: 0.90625rem; }
.material span small { color: var(--soft); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.material:hover span b { text-decoration: underline; text-underline-offset: 4px; }
.material b { font-weight: 440; }

/* ---------- pools and spas panels ---------- */
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { position: relative; display: flex; align-items: flex-end; min-height: clamp(420px, 44vw, 640px); overflow: hidden; color: var(--on-dark); text-decoration: none; background: #274247; }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 26, 29, 0.78), rgba(8, 26, 29, 0) 60%); }
.panel div { position: relative; z-index: 1; padding: clamp(24px, 3vw, 40px); }
.panel h3 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 350; letter-spacing: -0.04em; margin-bottom: 8px; }
.panel p { color: rgba(244, 246, 245, 0.86); margin: 0 0 14px; }
.panel .link { padding: 6px 0; }
.panel:hover img { transform: scale(1.03); }

/* ---------- promises ---------- */
.promises { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.promises li { border-top: 1px solid var(--line); padding-top: 22px; }
.promises h3 { margin-bottom: 6px; }
.promises p { margin: 0; color: var(--soft); font-size: 0.90625rem; line-height: 1.6; }

/* ---------- showrooms ---------- */
.stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.store { background: var(--sand); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.store figure { margin: 0; background: var(--stone); }
.store figure img { width: 100%; height: 100%; object-fit: cover; }
.store > div { padding: clamp(22px, 3vw, 36px); }
.store h3 { font-size: 1.625rem; font-weight: 360; letter-spacing: -0.035em; margin-bottom: 12px; }
.store address { font-style: normal; color: var(--soft); margin-bottom: 14px; }
.store dl { margin: 0 0 16px; font-size: 0.9375rem; }
.store dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.store dt { color: var(--soft); }
.store dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- shop listing ---------- */
.shop-head { padding: clamp(28px, 4vw, 48px) 0 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--soft); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--stone); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.shop-head .row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 40px; }
.shop-head p { margin: 0; color: var(--soft); max-width: 52ch; }
.filters { position: sticky; top: var(--header); z-index: 20; background: rgba(251, 250, 248, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-block: 1px solid var(--line); }
.filters .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 8px 0; margin: 0; list-style: none; }
.chips::-webkit-scrollbar { display: none; }
/* chips that run under the selects fade out instead of being cut mid-word */
.chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); padding-right: 40px; }
.chip { flex: none; min-height: 40px; padding: 0 17px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 0.84375rem; letter-spacing: -0.003em; transition: background 0.25s, border-color 0.25s, color 0.25s; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.chip:hover { border-color: rgba(23, 25, 26, 0.4); }
.chip[aria-pressed="true"] { background: var(--lagoon); border-color: var(--lagoon); color: var(--on-dark); }
.selects { display: flex; gap: 8px; flex: none; }
.select { position: relative; }
.select select { appearance: none; min-height: 40px; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 0.875rem; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; font-size: 0.875rem; color: var(--soft); }
.more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 0 0; }
.empty { padding: 56px 0; text-align: center; color: var(--soft); }

/* ---------- product page ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); padding: 24px 0 var(--section); align-items: start; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gallery figure { margin: 0; background: var(--sand); aspect-ratio: 1; overflow: hidden; }
.gallery figure:first-child { grid-column: 1 / -1; }
.gallery img { width: 100%; height: 100%; object-fit: contain; padding: 9%; mix-blend-mode: multiply; }
.buy { position: sticky; top: calc(var(--header) + 24px); }
.buy .collection { display: block; font-size: 0.875rem; color: var(--soft); margin-bottom: 10px; }
.buy .collection a { text-underline-offset: 3px; }
.buy h1 { font-size: clamp(2.125rem, 3.2vw, 3rem); font-weight: 350; letter-spacing: -0.042em; line-height: 1.02; margin-bottom: 16px; }
.buy .price { font-size: 1.25rem; font-weight: 380; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-bottom: 26px; }
.facts { margin: 0 0 24px; padding: 0; list-style: none; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts li span:first-child { color: var(--soft); }
.facts li span:last-child { text-align: right; }
.add { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-bottom: 14px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 48px; }
.qty button { width: 44px; height: 46px; border: 0; background: transparent; cursor: pointer; font-size: 1.125rem; }
.qty input { width: 34px; border: 0; background: transparent; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.note { font-size: 0.875rem; color: var(--soft); margin: 0 0 24px; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; position: relative; padding: 18px 32px 18px 0; font-size: 0.9375rem; font-weight: 460; }
summary::-webkit-details-marker { display: none; }
summary::before, summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 11px; height: 1px; background: currentColor; transition: transform 0.35s var(--ease); }
summary::after { transform: rotate(90deg); }
details[open] summary::after { transform: rotate(0); }
details .body { padding: 0 0 18px; color: var(--soft); font-size: 0.9375rem; }
details .body p { margin: 0 0 0.8em; }
details .body ul { margin: 0 0 0.8em; padding-left: 18px; }
.sticky-buy { display: none; }

/* ---------- toast after adding to the bag ---------- */
.toast {
  position: fixed; right: 16px; top: calc(var(--header) + 12px); z-index: 60; width: min(360px, calc(100% - 32px));
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 12px; background: var(--paper);
  border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(23, 25, 26, 0.14);
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast .thumb { background: var(--sand); aspect-ratio: 1; }
.toast .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; mix-blend-mode: multiply; }
.toast p { margin: 0; font-size: 0.875rem; }
.toast a { font-size: 0.875rem; font-weight: 500; }

/* ---------- cart ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 72px); align-items: start; padding-bottom: var(--section); }
.lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 112px 1fr auto; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line .thumb { background: var(--sand); aspect-ratio: 1; }
.line .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; mix-blend-mode: multiply; }
.line h3 a { text-decoration: none; }
.line h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.line .controls { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.line .qty { height: 40px; }
.line .qty button { height: 38px; width: 38px; }
.line .remove { border: 0; background: none; padding: 8px 0; cursor: pointer; font-size: 0.875rem; color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }
.line .total { font-variant-numeric: tabular-nums; }
.summary { position: sticky; top: calc(var(--header) + 24px); background: var(--sand); padding: clamp(22px, 3vw, 32px); }
.summary h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 16px; }
.summary dl { margin: 0 0 20px; }
.summary dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.summary dl div:last-child { font-weight: 600; font-size: 1.125rem; border-bottom: 0; }
.summary dd { margin: 0; }
.checkout-note { margin: 14px 0 0; font-size: 0.875rem; color: var(--soft); }

/* ---------- pools and hot tubs pages ---------- */
.types { display: grid; gap: clamp(56px, 8vw, 112px); }
.type { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
/* sections far down the page are not rendered, and their photos not fetched, until they come near the screen */
.type + .type, .brand-group + .brand-group { content-visibility: auto; contain-intrinsic-size: auto 720px; }
main > section:nth-of-type(n+3) { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.type:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.type:nth-child(even) > figure { order: 2; }
.type figure { margin: 0; overflow: hidden; background: var(--stone); }
.type figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.type .label { display: block; color: var(--soft); font-size: 0.875rem; margin-bottom: 10px; }
.type h2 { margin-bottom: 18px; }
.type ul { margin: 0 0 24px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.type ul li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.brands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.brands li { background: var(--sand); padding: 22px; min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; }
.brands b { font-size: 1.25rem; font-weight: 400; letter-spacing: -0.02em; }
.brands span { color: var(--soft); font-size: 0.875rem; }
.models { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
.model .frame { aspect-ratio: 4 / 3; background: var(--sand); }
.model img { width: 100%; height: 100%; object-fit: contain; padding: 6%; mix-blend-mode: multiply; }
.model h3 { margin-top: 12px; font-size: 0.9375rem; font-weight: 450; }
.model p { margin: 0; font-size: 0.8125rem; color: var(--soft); }
.brand-group { margin-top: clamp(40px, 5vw, 64px); }
.brand-group > h3 { font-size: 1.375rem; font-weight: 400; letter-spacing: -0.02em; padding-bottom: 14px; margin-bottom: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.brand-group > h3 small { font-size: 0.875rem; color: var(--soft); }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; color: var(--soft); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid rgba(23, 25, 26, 0.22); border-radius: 2px; background: #fff; font-size: 1rem; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 0; border-color: var(--lagoon); }
.form-status { grid-column: 1 / -1; margin: 0; padding: 14px 16px; background: var(--sand); font-size: 0.9375rem; }
.form-status:empty { display: none; }

.lenders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.lenders li { background: var(--sand); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.lenders h3 { font-size: 1.625rem; font-weight: 400; letter-spacing: -0.03em; }
.lenders p { color: var(--soft); margin: 0 0 auto; }
.lenders .btn { align-self: flex-start; margin-top: 16px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); padding: clamp(56px, 7vw, 96px) 0 28px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: 40px; padding-bottom: clamp(40px, 6vw, 72px); }
.site-footer .brand { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 400; letter-spacing: -0.045em; margin-bottom: 16px; }
.site-footer .brand span { color: #9aa3a4; }
.site-footer p, .site-footer address { font-style: normal; color: #aeb5b6; font-size: 0.9375rem; margin: 0 0 12px; }
.site-footer h2 { font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: #aeb5b6; margin-bottom: 12px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: inline-block; padding: 6px 0; text-decoration: none; font-size: 0.9375rem; }
.site-footer li a:hover { text-decoration: underline; text-underline-offset: 4px; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; border-top: 1px solid rgba(244, 246, 245, 0.14); font-size: 0.8125rem; color: #9aa3a4; }
.legal a { text-underline-offset: 3px; }
.site-footer :focus-visible { outline-color: var(--on-dark); }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .nav { gap: 22px; }
  .tools .phone { display: none; }
  .grid, .models { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
  .materials { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store { grid-template-columns: minmax(0, 1fr); }
  .store figure img { aspect-ratio: 16 / 9; }
  .brands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- phone ---------- */
@media (max-width: 820px) {
  :root { --header: 60px; }
  .site-header .wrap { grid-template-columns: auto 1fr auto; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px; border: 0; background: transparent; cursor: pointer; }
  .menu-toggle svg { width: 22px; height: 22px; }
  .site-header nav { display: contents; }
  .brand { justify-self: center; font-size: 1.0625rem; }
  .bar .long { display: none; }
  .brand span { display: none; }
  .bag .bag-label { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header); bottom: 0; z-index: 40; flex-direction: column; gap: 0;
    padding: 12px var(--gutter) 32px; background: var(--paper); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav.open { visibility: visible; opacity: 1; transform: none; }
  .nav a { display: block; padding: 16px 0; font-size: 1.625rem; letter-spacing: -0.02em; border-bottom: 1px solid var(--line); }
  .nav .nav-extra { display: block; }
  .nav .nav-extra a { font-size: 1rem; color: var(--soft); border: 0; padding: 12px 0 0; }
  body.menu-open { overflow: hidden; }

  .hero { min-height: 78svh; }
  .hero.short { min-height: 56svh; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile span { left: 14px; bottom: 12px; font-size: 1.0625rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 10px; }
  .rail { grid-auto-columns: 56%; gap: 10px; }
  .rail-nav { display: none; }
  .split, .split.flip, .type, .type:nth-child(even), .pdp, .cart { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child, .type:nth-child(even) > figure { order: 0; }
  .materials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .panels, .stores, .lenders { grid-template-columns: minmax(0, 1fr); }
  .panel { min-height: 420px; }
  .promises { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .promises li { padding: 18px 0; }
  .filters .wrap { flex-wrap: wrap; gap: 0 8px; padding-bottom: 10px; }
  .chips { flex-basis: 100%; }
  .selects { width: 100%; }
  .selects .select { flex: 1; }
  .selects select { width: 100%; }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 10px; }
  .brands { grid-template-columns: minmax(0, 1fr); }
  .brands li { min-height: 0; }

  /* product page on phones: swipe gallery, buy bar pinned to the bottom */
  .pdp { padding-top: 0; }
  .gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); gap: 0; }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery figure { flex: 0 0 100%; scroll-snap-align: start; }
  .buy { position: static; }
  .sticky-buy {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 250, 248, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); transform: translateY(110%); transition: transform 0.3s var(--ease);
  }
  .sticky-buy.show { transform: none; }
  .sticky-buy div { min-width: 0; font-size: 0.875rem; line-height: 1.3; }
  .sticky-buy b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sticky-buy .btn { flex: none; min-height: 44px; padding: 0 20px; }

  .line { grid-template-columns: 84px 1fr; }
  .line .total { grid-column: 2; }
  .summary { position: static; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .toast { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
