/* ==========================================================================
   Windrush Swimming Pools: base
   Tokens, reset, type, buttons, header and menu.
   Palette is taken from the photography: Bath-stone paper, willow-shadow ink,
   tile turquoise, paving sand.
   ========================================================================== */

:root {
  --paper: #ebe5d8;
  --paper-2: #e1d9c7;
  --paper-3: #d2c8b2;
  --ink: #0f2326;
  --ink-2: #324b50;
  --ink-3: #5d7175;
  --deep: #0c3034;
  --water: #62b4c0;
  --water-deep: #2c8493;
  --water-pale: #cfe5e2;
  --sand: #c9a67f;

  --f-display: 'Sentient', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --f-text: 'Jost', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 64px);
  --header-h: 72px;
  --strip-h: 8px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --tile-strip: none; /* set by js/main.js */
}

@media (max-width: 860px) {
  :root { --header-h: 60px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.menu-open { overflow: hidden; }
img, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--water-deep); outline-offset: 3px; }
::selection { background: var(--water); color: var(--ink); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.label {
  font: 500 0.6875rem/1.4 var(--f-text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label i { font-style: normal; padding: 0 0.5em; color: var(--water-deep); }

.display-xl,
.display-l,
.display-m {
  font-family: var(--f-display);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.9rem, 5.5vw, 6.2rem); line-height: 0.98; letter-spacing: -0.028em; }
.display-l  { font-size: clamp(2.3rem, 4vw, 4.3rem); line-height: 1.02; }
.display-m  { font-size: clamp(1.65rem, 2.5vw, 2.7rem); line-height: 1.12; }
.display-xl em, .display-l em, .display-m em {
  font-style: italic;
  font-weight: 300;
  color: var(--water-deep);
}
.on-dark .display-xl em, .on-dark .display-l em, .on-dark .display-m em { color: var(--water); }

.lead {
  font: 300 clamp(1.125rem, 1.45vw, 1.4rem)/1.5 var(--f-text);
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}

/* ---------- Links and buttons ---------- */

.textlink {
  display: inline-block;
  font: 500 0.78rem/1.2 var(--f-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 0.45em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s;
}
.textlink:hover { background-size: 0% 1px; background-position: 100% 100%; }
.textlink span { display: inline-block; transition: transform 0.4s var(--ease); }
.textlink:hover span { transform: translateY(3px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 1.1em;
  padding: 1.15em 1.9em;
  background: var(--ink);
  color: var(--paper);
  font: 500 0.78rem/1 var(--f-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn::after {
  content: '';
  width: 1.5em; height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}
.btn:hover { background: var(--water-deep); }
.btn:hover::after { width: 2.4em; }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: var(--water); color: var(--ink); }
.btn--line { background: transparent; color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.btn--line:hover { background: var(--paper); color: var(--ink); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
  padding: 0 var(--gutter);
  background: var(--paper);
  transition: transform 0.55s var(--ease);
}
.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: var(--strip-h);
  background: var(--tile-strip) 0 0 / auto var(--strip-h) repeat-x, var(--water);
}
.site-header.is-hidden { transform: translateY(calc(-100% - var(--strip-h))); }

.brand { display: flex; align-items: center; gap: 0.85rem; }
.brand__mark { width: 40px; height: 33px; color: var(--ink); }
.brand__name {
  display: flex; flex-direction: column;
  font: 400 1.4rem/1 var(--f-display);
  letter-spacing: -0.01em;
}
.brand__name span {
  margin-top: 0.4em;
  font: 500 0.625rem/1 var(--f-text);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav { display: flex; justify-content: center; gap: clamp(18px, 2.4vw, 40px); }
.nav a {
  position: relative;
  font: 500 0.75rem/1 var(--f-text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.6em 0;
  color: var(--ink-2);
  transition: color 0.3s;
}
.nav a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--water-deep);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }
.nav a.is-current { color: var(--ink); }

.header-cta {
  font: 500 0.75rem/1 var(--f-text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1.05em 1.5em;
  background: var(--ink);
  color: var(--paper);
  transition: background-color 0.35s var(--ease);
}
.header-cta:hover { background: var(--water-deep); }

.menu-btn {
  display: none;
  font: 500 0.75rem/1 var(--f-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.9em 0 0.9em 1.2em;
}

@media (max-width: 1080px) {
  .nav { display: none; }
  .site-header { grid-template-columns: 1fr auto auto; }
}
@media (max-width: 860px) {
  .brand__mark { width: 34px; height: 28px; }
  .brand__name { font-size: 1.2rem; }
  .header-cta { display: none; }
  .menu-btn { display: block; }
}

/* ---------- Menu (phones and tablets) ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 8vh) var(--gutter) 7vh;
  background: var(--deep);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
.menu.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.menu::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--strip-h);
  background: var(--tile-strip) 0 0 / auto var(--strip-h) repeat-x, var(--water);
}
.menu__close {
  position: absolute; top: calc((var(--header-h) - 1rem) / 2 + 2px); right: var(--gutter);
  font: 500 0.75rem/1 var(--f-text);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.9em 0 0.9em 1.2em;
}
.menu__list { display: grid; gap: 0.2rem; }
.menu__list a {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0;
  font: 300 clamp(2rem, 8.4vw, 3.4rem)/1.1 var(--f-display);
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(235, 229, 216, 0.14);
  transform: translateY(14px); opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
.menu__list a small { font: 500 0.625rem/1 var(--f-text); letter-spacing: 0.2em; color: var(--water); }
.menu.is-open .menu__list a { transform: none; opacity: 1; }
.menu.is-open .menu__list li:nth-child(2) a { transition-delay: 0.05s; }
.menu.is-open .menu__list li:nth-child(3) a { transition-delay: 0.1s; }
.menu.is-open .menu__list li:nth-child(4) a { transition-delay: 0.15s; }
.menu.is-open .menu__list li:nth-child(5) a { transition-delay: 0.2s; }
.menu.is-open .menu__list li:nth-child(6) a { transition-delay: 0.25s; }
.menu__foot { margin-top: auto; display: grid; gap: 0.5rem; }
.menu__foot p { font: 300 1.05rem/1.5 var(--f-text); color: rgba(235, 229, 216, 0.72); }

/* ---------- Reveal helpers ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js .plate__img img {
  transform: scale(1.09);
  transition: transform 1.8s var(--ease);
}
.js .plate.is-in .plate__img img { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js .plate__img img { opacity: 1; transform: none; transition: none; }
}

/* ---------- Tile cover: paper (or deep teal) held over a photograph until it is laid ---------- */

.js [data-tiles] .tile-cover { background: var(--paper); }
.js .on-dark [data-tiles] .tile-cover { background: var(--deep); }
.no-js .liners__switch { display: none; }
