/* =====================================================================
   Elphinston Wells — Global Design Tokens
   Single source for colour, type, grid and spacing.
   Update values here only; never hard-code these elsewhere.
   ===================================================================== */

:root {

  /* ---- Colour tokens (EW palette) ------------------------------------ */
  --c1: #363942;   /* EW Grey — primary text / charcoal */
  --c2: #B0B4BD;   /* Light Grey — quiet labels (updated from #7A7B80) */
  --c3: #212429;   /* Dark Grey — deepest tone (footer, etc.) */
  --c4: #B0B4BD;   /* Light Grey — placeholders (updated from #A3A3A6) */
  --c5: #B0B4BD;   /* Light Grey — soft text on dark */
  --c6: #FFFFFF;   /* White */
  --c-navy: #000B44;     /* R.E.O Blue — deep brand accent (craft hover box) */
  --c-action: #0046F4;   /* Action Blue — sparing interactive accent */
  --c-dark: #212429;     /* Dark Grey — footer ground */

  /* ---- Title-to-content rhythm --------------------------------------- */
  --title-gap: 30px;       /* uniform gap between a section title module and
                              the content beneath it (post-hero) */

  /* Semantic aliases */
  --text-on-light: var(--c1);
  --text-on-dark: var(--c6);
  --bar-fill: var(--c6);
  --cta-fill: var(--c1);   /* filled button uses Colour 1 (working default) */
  --accent: var(--c-action);   /* the one sparing accent */

  /* ---- Grid & spacing (Build Brief §3) ------------------------------- */
  --page-margin: 30px;     /* body section page margin */
  --gutter: 30px;          /* grid gutter + default block gap/padding */
  --grid-cols: 12;

  /* ---- Header-specific spacing (header is a deliberate exception) ----- */
  --hdr-pad: 60px;         /* top bar: 60px all round */
  --hdr-block-h: 100px;    /* top bar + hero spacer/meta blocks: 100px tall */
  --frost-pad: 30px;       /* frosted bar: 30px all round */
  --frost-block-h: 50px;   /* frosted bar blocks: 50px tall (matches logo) */
  --logo-h: 100px;         /* logo height in the white top bar */
  --logo-h-sm: 50px;       /* logo height in the frosted bar */

  /* ---- Type scale (Build Brief §5) ----------------------------------- */
  /* Roboto Flex carries the wdth axis that plain Roboto does not serve.   */
  --font-family: "Roboto Flex", "Roboto", system-ui, -apple-system, sans-serif;

  /* size / weight / width / line-height per named style */
  --large-title-size: 98px;  --large-title-wght: 400; --large-title-wdth: 85;  --large-title-lh: 1.00;
  --large-body-size: 24px;    --large-body-wght: 350;  --large-body-wdth: 100; --large-body-lh: 1.30;
  --medium-title-size: 52px;  --medium-title-wght: 400;--medium-title-wdth: 85; --medium-title-lh: 1.10;
  --default-title-size: 34px; --default-title-wght: 400;--default-title-wdth: 100;--default-title-lh: 1.10;
  --bold-body-size: 18px;     --bold-body-wght: 600;   --bold-body-wdth: 85;   --bold-body-lh: 1.00;
  --default-body-size: 18px;  --default-body-wght: 200;--default-body-wdth: 100;--default-body-lh: 1.30;
  --cta-size: 16px;           --cta-wght: 460;         --cta-wdth: 85;         --cta-lh: 1.30;

  /* ---- Motion (Build Brief §2) --------------------------------------- */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);  /* ease-in-out, for the transitions */
  --dur: 1600ms;
  --dur-reverse: 1600ms;   /* 3->1 reverse plays at the standard single-leg time */
}

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

html, body {
  margin: 0;
  padding: 0;
}
html { scrollbar-gutter: stable; }

body {
  font-family: var(--font-family);
  font-optical-sizing: auto;
  color: var(--text-on-light);
  background: var(--c6);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Zero border radius anywhere — brand DNA (Build Brief §3) */
* { border-radius: 0 !important; }

/* =====================================================================
   Type style utility classes — apply the named scale from §5.
   font-variation-settings drives wght + wdth axes (Roboto Flex).
   ===================================================================== */
.t-large-title {
  font-size: var(--large-title-size);
  line-height: var(--large-title-lh);
  font-variation-settings: "wght" var(--large-title-wght), "wdth" var(--large-title-wdth);
}
.t-large-body {
  font-size: var(--large-body-size);
  line-height: var(--large-body-lh);
  font-variation-settings: "wght" var(--large-body-wght), "wdth" var(--large-body-wdth);
}
.t-medium-title {
  font-size: var(--medium-title-size);
  line-height: var(--medium-title-lh);
  font-variation-settings: "wght" var(--medium-title-wght), "wdth" var(--medium-title-wdth);
}
.t-default-title {
  font-size: var(--default-title-size);
  line-height: var(--default-title-lh);
  font-variation-settings: "wght" var(--default-title-wght), "wdth" var(--default-title-wdth);
}
.t-bold-body {
  font-size: var(--bold-body-size);
  line-height: var(--bold-body-lh);
  font-variation-settings: "wght" var(--bold-body-wght), "wdth" var(--bold-body-wdth);
}
.t-default-body {
  font-size: var(--default-body-size);
  line-height: var(--default-body-lh);
  font-variation-settings: "wght" var(--default-body-wght), "wdth" var(--default-body-wdth);
}
.t-cta {
  font-size: var(--cta-size);
  line-height: var(--cta-lh);
  font-variation-settings: "wght" var(--cta-wght), "wdth" var(--cta-wdth);
}

/* =====================================================================
   Buttons / CTAs (Build Brief §6, updated)
   cta_text, centre-aligned, 10px vertical / 15px horizontal padding,
   1px stroke, no radius.
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 15px;
  border: 1px solid currentColor;
  background: none;
  white-space: nowrap;
  overflow: hidden;                     /* crop the label as it slides */
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
/* Label slide-swap on hover: the visible text moves up and out of the top,
   while an identical copy enters from the bottom. The button border crops
   both. Pure CSS transform — very light. */
.btn { position: relative; }
.btn__txt {
  display: inline-block;
  position: relative;
  z-index: 1;
  transition: transform 300ms cubic-bezier(0.9, 0, 0.1, 1);
}
/* Incoming copy: anchored to the button, sitting fully below the bottom
   edge (clipped) until hover. */
.btn::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;                            /* fully below the button's bottom */
  text-align: center;
  padding: 10px 15px;                   /* same as the button so it aligns */
  box-sizing: border-box;
  transition: transform 300ms cubic-bezier(0.9, 0, 0.1, 1);
  pointer-events: none;
}
.btn:hover .btn__txt,
.btn:focus-visible .btn__txt {
  /* Travel the full button height (line-box + vertical padding) so the
     outgoing text clears completely out of the top, matching the distance
     the incoming copy rises. */
  transform: translateY(calc(-100% - 20px));
}
.btn:hover::after,
.btn:focus-visible::after {
  transform: translateY(-100%);         /* copy rises into view from bottom */
}
@media (prefers-reduced-motion: reduce) {
  .btn__txt, .btn::after { transition: none; }
  .btn:hover .btn__txt, .btn:focus-visible .btn__txt { transform: none; }
  .btn:hover::after, .btn:focus-visible::after { transform: none; }
}
/* Type 1 — Outline: fill none, 1px stroke */
.btn--outline {
  background: none;
  border-color: currentColor;
  color: inherit;
}
/* Type 2 — Filled: solid fill, white text */
.btn--filled {
  background: var(--cta-fill);
  border-color: var(--cta-fill);
  color: var(--c6);
}

/* Hover / clicked states are TBC in the brief — left undefined on purpose. */

/* =====================================================================
   RESPONSIVE — token overrides
   Fluid display type (clamp) + breakpoint-driven margins/gutters/rhythm.
   Display sizes scale smoothly with the viewport; body sizes ease gently.
   Breakpoints: 820 (--bp-soft, tuning) · 600 (--bp-structural, in header.css/sections.css)
                481 (--bp-phone, in grid.css/header.css/sections.css) · 480 (--bp-small-phone, here only).
   ===================================================================== */
:root {
  /* Fluid display type — caps match the desktop scale, floors keep phones legible */
  --large-title-size:   clamp(36px, 8.6vw, 98px);
  --medium-title-size:  clamp(30px, 5.2vw, 52px);
  --default-title-size: clamp(25px, 3.2vw, 34px);
  --large-body-size:    clamp(19px, 1.9vw, 24px);

  /* Fluid BODY type — holds full size at the soft 820 breakpoint, then eases
     a touch further down before the true phone layout at 481. */
  --default-body-size:  clamp(15.5px, 11.95px + 0.74vw, 18px);
  --bold-body-size:     clamp(15.5px, 11.95px + 0.74vw, 18px);
  --cta-size:           clamp(14px, 10.67px + 0.69vw, 16px);
}

@media (max-width: 820px) { /* --bp-soft: tuning breakpoint */
  :root {
    --page-margin: 24px;     /* tighten page margin at soft breakpoint */
    --gutter: 20px;          /* tighten gutters / block gaps */
    --section-gap: 72px;     /* shorter vertical rhythm between modules */
  }
}
@media (max-width: 480px) { /* --bp-small-phone: token spacing only */
  :root {
    --page-margin: 20px;
    --gutter: 16px;
    --section-gap: 56px;
  }
}
