/* ==========================================================================
   Elite Bathrooms & Plumbing — base layer
   Hand-authored stylesheet. Design tokens, reset, typography, utilities.
   Mobile-first: everything below is written for the small screen first.
   ========================================================================== */

/* ---------- Self-hosted typefaces (no third-party font requests) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "InterVariable";
  src: url("../fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* --------------------------------- Tokens -------------------------------- */
:root {
  /* Brand — sampled from Elite's own artwork: #5A9AD7 blue, #FD0000 red   */
  --brand: #5a9ad7;
  --brand-deep: #33689b; /* 5.37:1 on bone — passes AA for text */
  --brand-ink: #23405c;

  /* Neutrals — a warm gallery palette, not the usual cold slate            */
  --bone: #f7f5f1;
  --bone-2: #efebe4;
  --bone-3: #e4dfd6;
  --stone: #d3ccc0;
  --ink: #14161a;
  --ink-2: #1e2127;
  --ink-3: #2c3037;
  --muted: #6c6862;
  --muted-2: #6b6761; /* 5.16:1 on bone — small captions stay legible */
  --white: #ffffff;

  /* Chrome — the metal-on-metal reference that ties to the product world   */
  --chrome: linear-gradient(
    104deg,
    #ffffff 0%,
    #d9dde1 18%,
    #f4f6f8 34%,
    #a9b0b7 52%,
    #e9ecef 70%,
    #c2c8ce 86%,
    #ffffff 100%
  );

  /* Type scale — fluid, clamped, mobile-first anchors                      */
  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0: clamp(0.9375rem, 0.91rem + 0.14vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.28vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.26rem + 0.56vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.53rem + 1.1vw, 2.5rem);
  --step-4: clamp(2.125rem, 1.7rem + 2.1vw, 3.5rem);
  --step-5: clamp(2.625rem, 1.9rem + 3.6vw, 5rem);
  --step-6: clamp(3.25rem, 1.9rem + 6.7vw, 7.5rem);

  /* Space scale                                                           */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Layout                                                                */
  --gutter: clamp(1.125rem, 4vw, 3.5rem);
  --measure: 62ch;
  --max: 1440px;
  --radius: 2px;
  --radius-lg: 4px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --hair: color-mix(in oklab, var(--ink) 14%, transparent);
  --hair-light: color-mix(in oklab, var(--white) 22%, transparent);
}

/* --------------------------------- Reset --------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bone);
}

/* When the inertia scroller takes over we must switch native smoothing off */
html.has-smooth-scroll {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: "InterVariable", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.62;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  /* Fallback for browsers without overflow: clip. */
  overflow-x: hidden;
}

/* Reveal animations translate elements by a few px, which registers as real
   overflow and makes the page horizontally draggable on touch. `clip` cuts it
   off without creating a scroll container, so position: sticky keeps working. */
@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  /* keeps a graceful tone while the real photo paints */
  background-color: var(--bone-3);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 0;
}

::selection {
  background: var(--brand);
  color: var(--white);
}

/* Visible, on-brand focus for keyboard users only */
:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ------------------------------- Skip link ------------------------------- */
.skip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--bone);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(-120%);
  transition: transform 0.25s var(--ease-out);
}
.skip:focus-visible {
  transform: translateY(0);
}

/* ------------------------------- Structure ------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A grid or flex child defaults to min-width:auto, so a single intrinsically
   wide descendant (a map frame, a <select>, a long email) forces the track
   wider than the viewport and silently clips everything inside it. Every
   layout container opts out of that here, once. */
.contact-grid > *,
.split > *,
.visit > *,
.intro > *,
.section-head > *,
.contact-grid__aside,
.footer__top > *,
.footer__cols > *,
.credentials-band__head > *,
.field,
.field-row > * {
  min-width: 0;
}

.section {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 7.5rem);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.rule {
  height: 1px;
  background: var(--hair);
  border: 0;
}

/* ------------------------------ Typography ------------------------------ */
.display {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 0.94;
}

.serif {
  font-family: "Instrument Serif", "Times New Roman", serif;
  letter-spacing: -0.018em;
}

.italic {
  font-style: italic;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.eyebrow--bare::before {
  display: none;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-3);
  font-weight: 340;
  max-width: 52ch;
}

.prose > * + * {
  margin-top: 1.1em;
}
.prose p {
  max-width: var(--measure);
  color: var(--ink-3);
}

.phone-link {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------- Buttons -------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bone);
  --btn-bd: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.6em;
  min-height: 48px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease),
    transform 0.4s var(--ease-out);
}

.btn > span {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

/* the wipe */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bone);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: translateY(0);
}

.btn:active {
  transform: translateY(1px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: color-mix(in oklab, var(--ink) 26%, transparent);
}
.btn--ghost::after {
  background: var(--ink);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--bone);
  border-color: var(--ink);
}

.btn--light {
  --btn-bg: var(--bone);
  --btn-fg: var(--ink);
  --btn-bd: var(--bone);
}
.btn--light::after {
  background: var(--ink);
}
.btn--light:hover,
.btn--light:focus-visible {
  color: var(--bone);
  border-color: var(--bone);
}

.btn__arrow {
  width: 1em;
  height: 1em;
  flex: none;
  transition: transform 0.45s var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* A quiet text link with a rule that draws itself */
.tlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding-bottom: 0.2em;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.tlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.tlink:hover::after,
.tlink:focus-visible::after {
  transform: scaleX(1);
}

/* --------------------------- Accessibility prefs -------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* A styled scrollbar only on real pointing devices — declaring one on touch
   layouts reserves width and provokes a spurious horizontal overflow. */
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  html.native-scroll::-webkit-scrollbar {
    width: 12px;
  }
  html.native-scroll::-webkit-scrollbar-track {
    background: var(--bone-2);
  }
  html.native-scroll::-webkit-scrollbar-thumb {
    background: var(--stone);
    border: 3px solid var(--bone-2);
    border-radius: 99px;
  }
  html.native-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--muted-2);
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------ Utilities -------------------------------
   Deliberately small and semantic. Kept as classes so the site ships with a
   strict Content-Security-Policy and no inline style attributes anywhere.
   ---------------------------------------------------------------------- */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: 0.6rem; }
.mt-s { margin-top: 0.9rem; }
.mt-m { margin-top: 1.5rem; }
.mt-l { margin-top: 1.8rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-l { margin-bottom: 2.5rem; }
.text-sm { font-size: var(--step--1); }
.text-xs { font-size: 0.78rem; }
.lh-16 { line-height: 1.6; }
.lh-18 { line-height: 1.8; }
.lh-19 { line-height: 1.9; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.ink-3 { color: var(--ink-3); }
.underline { text-decoration: underline; text-underline-offset: 3px; }
.u-center { justify-content: center; }
.plain { font-style: normal; }
.address-note { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.eyebrow--brand { color: var(--brand) !important; }
.caption {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted-2);
}

/* stagger helpers for revealed groups */
[data-reveal].d1 { --d: 90ms; }
[data-reveal].d2 { --d: 180ms; }

/* a light outline button for dark panels — replaces the old inline overrides */
.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: var(--bone);
  --btn-bd: rgb(247 245 241 / 34%);
}
.btn--outline-light::after { background: var(--bone); }
.btn--outline-light:hover,
.btn--outline-light:focus-visible {
  color: var(--ink);
  border-color: var(--bone);
}

/* address elements should never render italic by default */
address { font-style: normal; }

/* a figure that wants a portrait crop */
.split__media--portrait { aspect-ratio: 4 / 5; }

/* ----------------------- Media wrappers -----------------------
   <picture> is display:inline by default, so an <img> sized to 100% height
   inside one collapses. Every figure that crops needs this. */
picture {
  display: block;
  height: 100%;
}
figure picture,
.intro__figure picture,
.split__media picture,
.shot picture,
.card__media picture,
.hero__media picture,
.page-hero__media picture,
.cta-band__media picture {
  height: 100%;
  width: 100%;
}
