/* ==========================================================================
   MESH SOLUTIONS — Foundation Layer
   Design tokens, reset, typography, layout primitives, motion utilities.
   Palette is strictly two colours: #024562 (primary) and #FFFFFF.
   All depth is produced with opacity, gradients, shadow, blur and rules.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- Brand ----------------------------------------------------------- */
  --brand: #024562;
  --white: #ffffff;

  /* Tonal ramp — brand mixed toward white (tints) and toward its own depth.
     No new hues are introduced; these are opacity/darkness steps of #024562. */
  --brand-02: #f7fafb;
  --brand-04: #f1f6f8;
  --brand-06: #eaf1f4;
  --brand-10: #e0eaef;
  --brand-16: #cddce4;
  --brand-24: #b3c8d3;
  --brand-40: #8daebd;
  --brand-56: #6693a7;
  --brand-72: #3f7791;
  --brand-88: #175b76;
  --brand-100: #024562;
  --brand-deep: #023b53;
  --brand-deeper: #012f43;
  --brand-abyss: #011f2d;

  /* Alpha channels of the brand — the workhorses for glass and depth */
  --a02: rgba(2, 69, 98, 0.02);
  --a04: rgba(2, 69, 98, 0.04);
  --a06: rgba(2, 69, 98, 0.06);
  --a08: rgba(2, 69, 98, 0.08);
  --a12: rgba(2, 69, 98, 0.12);
  --a16: rgba(2, 69, 98, 0.16);
  --a24: rgba(2, 69, 98, 0.24);
  --a40: rgba(2, 69, 98, 0.4);
  --a60: rgba(2, 69, 98, 0.6);
  --a80: rgba(2, 69, 98, 0.8);
  --a92: rgba(2, 69, 98, 0.92);

  /* Alpha channels of white — for depth on dark surfaces */
  --w04: rgba(255, 255, 255, 0.04);
  --w06: rgba(255, 255, 255, 0.06);
  --w08: rgba(255, 255, 255, 0.08);
  --w12: rgba(255, 255, 255, 0.12);
  --w16: rgba(255, 255, 255, 0.16);
  --w24: rgba(255, 255, 255, 0.24);
  --w40: rgba(255, 255, 255, 0.4);
  --w56: rgba(255, 255, 255, 0.56);
  --w72: rgba(255, 255, 255, 0.72);
  --w88: rgba(255, 255, 255, 0.88);

  /* --- Semantic surfaces ----------------------------------------------- */
  --surface: var(--white);
  --surface-sunken: var(--brand-02);
  --surface-raised: var(--white);
  --surface-dark: var(--brand-100);
  --surface-darker: var(--brand-deeper);

  --text: var(--brand-100);
  --text-muted: rgba(2, 69, 98, 0.66);
  --text-faint: rgba(2, 69, 98, 0.45);
  --text-on-dark: var(--white);
  --text-on-dark-muted: rgba(255, 255, 255, 0.68);
  --text-on-dark-faint: rgba(255, 255, 255, 0.44);

  --line: rgba(2, 69, 98, 0.1);
  --line-strong: rgba(2, 69, 98, 0.18);
  --line-on-dark: rgba(255, 255, 255, 0.12);
  --line-on-dark-strong: rgba(255, 255, 255, 0.22);

  /* --- Typography ------------------------------------------------------- */
  --font-display: "Exo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-hero: clamp(2.9rem, 1.35rem + 5.1vw, 6.1rem);
  --fs-display: clamp(2.15rem, 1.25rem + 2.95vw, 4rem);
  --fs-h2: clamp(1.9rem, 1.2rem + 2.3vw, 3.25rem);
  --fs-h3: clamp(1.3rem, 1.05rem + 0.8vw, 1.85rem);
  --fs-h4: clamp(1.1rem, 1rem + 0.35vw, 1.3rem);
  --fs-lead: clamp(1.05rem, 0.98rem + 0.32vw, 1.28rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;

  --lh-tight: 1.02;
  --lh-snug: 1.14;
  --lh-heading: 1.2;
  --lh-body: 1.75;

  --ls-hero: -0.035em;
  --ls-display: -0.028em;
  --ls-heading: -0.018em;
  --ls-eyebrow: 0.3em;
  --ls-wide: 0.14em;

  /* --- Space ------------------------------------------------------------ */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5rem;
  --sp-11: 6.5rem;
  --sp-12: 8rem;

  --section-y: clamp(4rem, 2.5rem + 4.6vw, 6.75rem);
  --section-y-tight: clamp(2.75rem, 1.75rem + 3.1vw, 4.5rem);

  --container: 1320px;
  --container-narrow: 920px;
  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 3rem);

  /* --- Radii ------------------------------------------------------------ */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-2xl: 40px;
  --r-pill: 999px;

  /* --- Elevation (all tinted with the brand, never neutral grey) -------- */
  --sh-xs: 0 1px 2px rgba(2, 69, 98, 0.05);
  --sh-sm: 0 4px 14px -6px rgba(2, 69, 98, 0.14);
  --sh-md: 0 18px 42px -22px rgba(2, 69, 98, 0.28);
  --sh-lg: 0 38px 80px -40px rgba(2, 69, 98, 0.34);
  --sh-xl: 0 60px 130px -60px rgba(2, 69, 98, 0.45);
  --sh-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --sh-glow: 0 0 0 1px rgba(2, 69, 98, 0.06), 0 26px 60px -30px rgba(2, 69, 98, 0.4);

  /* --- Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 220ms;
  --dur: 420ms;
  --dur-slow: 720ms;
  --dur-slower: 1100ms;

  /* --- Signature textures ------------------------------------------------ */
  /* A woven-mesh rule grid — the brand's own product geometry used as ornament */
  --tex-mesh: repeating-linear-gradient(0deg, transparent 0 13px, var(--a06) 13px 14px),
    repeating-linear-gradient(90deg, transparent 0 13px, var(--a06) 13px 14px);
  --tex-mesh-fine: repeating-linear-gradient(0deg, transparent 0 6px, var(--a04) 6px 7px),
    repeating-linear-gradient(90deg, transparent 0 6px, var(--a04) 6px 7px);
  --tex-mesh-dark: repeating-linear-gradient(0deg, transparent 0 13px, var(--w06) 13px 14px),
    repeating-linear-gradient(90deg, transparent 0 13px, var(--w06) 13px 14px);
  /* Expanded-metal diagonal lattice */
  --tex-diag: repeating-linear-gradient(45deg, transparent 0 11px, var(--a04) 11px 12px),
    repeating-linear-gradient(-45deg, transparent 0 11px, var(--a04) 11px 12px);
  --tex-diag-dark: repeating-linear-gradient(45deg, transparent 0 11px, var(--w04) 11px 12px),
    repeating-linear-gradient(-45deg, transparent 0 11px, var(--w04) 11px 12px);

  --header-h: 92px;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

img,
video {
  height: auto;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

address {
  font-style: normal;
}

:target {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-hero);
  font-weight: 500;
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-display);
  font-weight: 500;
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 700;
}

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

/* Display / editorial helpers ------------------------------------------- */
.t-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-display);
  font-weight: 500;
}

.t-lead {
  font-size: var(--fs-lead);
  line-height: 1.7;
  color: var(--text-muted);
  font-weight: 400;
}

.t-sm {
  font-size: var(--fs-sm);
}

.t-xs {
  font-size: var(--fs-xs);
}

.t-muted {
  color: var(--text-muted);
}

.t-faint {
  color: var(--text-faint);
}

.t-mono-num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* The signature "thin-rule + letterspaced label" used above every heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--brand-72);
  margin-bottom: 1.35rem;
}

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

.eyebrow--center::after {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.on-dark .eyebrow,
.eyebrow--light {
  color: var(--w72);
}

/* Emphasised word inside a heading — hairline underline, never a new colour */
.t-accent {
  position: relative;
  font-weight: 300;
  font-style: italic;
}

.t-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 1px;
  background: currentColor;
  opacity: 0.28;
}

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: 1560px;
}

.section {
  position: relative;
  padding-block: var(--section-y);
  isolation: isolate;
}

.section--tight {
  padding-block: var(--section-y-tight);
}

.section--flush-top {
  padding-top: 0;
}

.section--flush-bottom {
  padding-bottom: 0;
}

.section--sunken {
  background: var(--surface-sunken);
}

.section--dark {
  background: var(--surface-dark);
  color: var(--text-on-dark);
}

.section--darker {
  background: var(--surface-darker);
  color: var(--text-on-dark);
}

.on-dark {
  color: var(--text-on-dark);
}

.on-dark .t-lead,
.on-dark .t-muted {
  color: var(--text-on-dark-muted);
}

.on-dark .t-faint {
  color: var(--text-on-dark-faint);
}

/* Section heading block ---------------------------------------------------*/
.section-head {
  max-width: 760px;
  margin-bottom: clamp(2.75rem, 1.5rem + 3.2vw, 5rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow {
  justify-content: center;
}

.section-head--split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: end;
}

.section-head p {
  margin-top: 1.35rem;
}

.section-head--split p {
  margin-top: 0;
  padding-bottom: 0.5rem;
}

/* Grids -------------------------------------------------------------------*/
.grid {
  display: grid;
  gap: var(--gap, clamp(1.25rem, 0.6rem + 1.9vw, 2.25rem));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6.5rem);
  align-items: center;
}

.stack > * + * {
  margin-top: var(--stack, 1.25rem);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, 1rem);
}

/* Decorative texture layers ----------------------------------------------*/
.tex {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.tex--mesh {
  background-image: var(--tex-mesh);
}

.tex--mesh-fine {
  background-image: var(--tex-mesh-fine);
}

.tex--mesh-dark {
  background-image: var(--tex-mesh-dark);
}

.tex--diag {
  background-image: var(--tex-diag);
}

.tex--diag-dark {
  background-image: var(--tex-diag-dark);
}

/* Fade a texture out toward the edges so it never looks like a flat tile */
.tex--fade {
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 20%, transparent 78%);
}

.tex--fade-top {
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.tex--fade-bottom {
  -webkit-mask-image: linear-gradient(to top, #000, transparent 70%);
  mask-image: linear-gradient(to top, #000, transparent 70%);
}

/* Ambient brand-tinted glow used behind hero + dark sections */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

.glow--light {
  background: radial-gradient(circle, var(--w24), transparent 68%);
}

.glow--brand {
  background: radial-gradient(circle, var(--a16), transparent 68%);
}

/* Hairline divider with a soft fade at both ends */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

.rule--dark {
  background: linear-gradient(90deg, transparent, var(--line-on-dark-strong) 18%, var(--line-on-dark-strong) 82%, transparent);
}

/* --------------------------------------------------------------------------
   5. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 999;
  padding: 0.9rem 1.5rem;
  background: var(--brand);
  color: var(--white);
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  top: 0;
}

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-dark :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible,
.section--dark :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline-color: var(--white);
}

.text-center {
  text-align: center;
}

.mx-auto {
  margin-inline: auto;
}

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mt-8 { margin-top: var(--sp-8); }
.mt-9 { margin-top: var(--sp-9); }
.mt-10 { margin-top: var(--sp-10); }

.measure {
  max-width: 62ch;
}

.measure-sm {
  max-width: 48ch;
}

.full-bleed-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.full-bleed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Duotone treatment: forces every photograph into the two-colour system */
.duotone {
  position: relative;
}

.duotone img {
  filter: grayscale(1) contrast(1.06) brightness(0.92);
}

.duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand);
  mix-blend-mode: color;
  pointer-events: none;
}

.duotone--soft img {
  filter: grayscale(0.72) contrast(1.03) saturate(0.5);
}

.duotone--soft::after {
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   6. MOTION — scroll reveal + shared keyframes
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal="left"] {
  transform: translate3d(-34px, 0, 0);
}

[data-reveal="right"] {
  transform: translate3d(34px, 0, 0);
}

[data-reveal="scale"] {
  transform: scale(0.94);
}

[data-reveal="clip"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-slower) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal="mask"] {
  opacity: 1;
  transform: none;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 0%, transparent 0%);
  mask-image: linear-gradient(to right, #000 0%, #000 0%, transparent 0%);
}

.is-revealed[data-reveal] {
  opacity: 1;
  transform: none;
}

.is-revealed[data-reveal="clip"] {
  clip-path: inset(0 0 0 0);
}

/* Word-by-word headline reveal (built by JS) */
.rw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.06em;
}

.rw > span {
  display: inline-block;
  transform: translate3d(0, 110%, 0);
  transition: transform 1s var(--ease-out);
  transition-delay: var(--rw-delay, 0ms);
}

.is-revealed .rw > span,
.rw.is-revealed > span {
  transform: none;
}

/* Shared keyframes --------------------------------------------------------*/
@keyframes float-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -16px, 0); }
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-28px, -28px, 0); }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.55; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes sheen {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(320%) skewX(-18deg); }
}

@keyframes scroll-cue {
  0% { transform: translateY(-100%); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

@keyframes marquee {
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.anim-float {
  animation: float-y 7s var(--ease-in-out) infinite;
}

/* --------------------------------------------------------------------------
   7. REDUCED MOTION
   -------------------------------------------------------------------------- */
@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;
  }

  [data-reveal],
  [data-reveal="left"],
  [data-reveal="right"],
  [data-reveal="scale"] {
    opacity: 1;
    transform: none;
  }

  [data-reveal="clip"] {
    clip-path: none;
  }

  .rw > span {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   8. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .preloader,
  .to-top,
  .hero__cue {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
