/* ============================================================
   CHA.T.EAU — Engineering & Contracting
   Styling follows the printed company profile.
   Colours are defined once, in :root below.
   ============================================================ */

:root{
  --blue:      #0E72B6;   /* exact brand blue, sampled from the profile logo */
  --blue-dark: #0A5A90;
  --blue-soft: #4E96D1;   /* ripple / secondary */
  --link:      #2E86D0;   /* "Project Types" blue in the profile */
  --ink:       #1A1A1A;
  --body:      #46525C;
  --paper:     #FFFFFF;
  --pale:      #F3F7FA;
  --line:      #DCE5EC;
  --line-inv:  rgba(255,255,255,.28);

  --wrap: 1140px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation:none !important; transition:none !important; }
}

body{
  margin:0;
  font-family:var(--font);
  font-size:17px;
  line-height:1.65;
  color:var(--body);
  background:var(--paper);
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; display:block; }
a{ color:var(--link); }

.wrap{ max-width:var(--wrap); margin:0 auto; padding-inline:var(--gutter); }
.narrow{ max-width:62ch; }

.sr,.skip{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip:focus{ width:auto; height:auto; clip:auto; z-index:999; top:.5rem; left:.5rem;
  padding:.6rem 1rem; background:var(--blue); color:#fff; }
:focus-visible{ outline:3px solid var(--link); outline-offset:3px; }

/* ---------- Type ---------- */
h1,h2,h3,h4{ color:var(--ink); margin:0 0 .5em; line-height:1.15; }
h1{ font-weight:300; font-size:clamp(2.3rem,5.2vw,4rem); letter-spacing:-.015em; }

/* Large light display headings, as used throughout the printed profile */
.display{
  font-weight:300;
  font-size:clamp(2.2rem,4.6vw,3.6rem);
  letter-spacing:-.015em;
  margin:0 0 1.4rem;
}
h3{ font-weight:700; font-size:1.12rem; }
h4{ font-weight:700; font-size:.95rem; color:var(--link); margin-bottom:.6em; }
p{ margin:0 0 1.1em; max-width:70ch; }
.lead{ font-size:1.16rem; color:var(--ink); font-weight:400; }

/* ---------- Running header (mirrors the printed page header) ---------- */
.runhead{
  display:flex; justify-content:space-between; gap:1rem;
  font-size:.82rem; color:#8C9AA6;
  padding-bottom:.7rem; margin-bottom:2.6rem;
  border-bottom:1px solid var(--line);
}
.runhead span:nth-child(2){ color:var(--body); }
.runhead.invert{ color:rgba(255,255,255,.65); border-color:var(--line-inv); }
.runhead.invert span:nth-child(2){ color:#fff; }

/* ---------- Header ---------- */
.masthead{
  position:sticky; top:0; z-index:60;
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.7rem var(--gutter);
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.brand img{ height:40px; width:auto; }
#nav ul{ display:flex; gap:1.6rem; list-style:none; margin:0; padding:0; }
#nav a{ text-decoration:none; color:var(--ink); font-weight:600; font-size:.95rem; padding:.3rem 0; position:relative; }
#nav a::after{ content:""; position:absolute; left:0; right:100%; bottom:0; height:2px; background:var(--blue); transition:right .22s ease; }
#nav a:hover::after,#nav a:focus-visible::after{ right:0; }

.nav-toggle{ display:none; flex-direction:column; gap:5px; background:none; border:0; cursor:pointer; padding:.5rem; }
.nav-toggle .bar{ width:26px; height:2px; background:var(--ink); }

/* ---------- Cover ---------- */
.cover{
  position:relative; overflow:hidden;
  background:var(--blue); color:#fff;
  padding:clamp(4rem,10vw,8rem) 0 clamp(4rem,9vw,7rem);
}
.cover .ripple{
  position:absolute; right:-14%; bottom:-32%;
  width:min(90vw,900px); height:auto; pointer-events:none;
}
.cover-inner{ position:relative; z-index:2; max-width:var(--wrap); margin:0 auto; padding-inline:var(--gutter); }
.cover-logo{ height:52px; width:auto; margin-bottom:2rem; }
.cover h1{ color:#fff; max-width:18ch; }
.eyebrow{ font-weight:700; letter-spacing:.06em; color:rgba(255,255,255,.85); margin-bottom:1.4rem; }
.cover-lede{ font-size:1.2rem; max-width:52ch; color:rgba(255,255,255,.92); }

.cover-stats{
  display:flex; flex-wrap:wrap; gap:2.5rem;
  list-style:none; margin:2.8rem 0 0; padding:2rem 0 0;
  border-top:1px solid var(--line-inv);
}
.cover-stats strong{ display:block; font-size:2.1rem; font-weight:300; line-height:1; color:#fff; }
.cover-stats span{ font-size:.9rem; color:rgba(255,255,255,.8); }

.cover-actions{ display:flex; flex-wrap:wrap; gap:.8rem; margin-top:2.6rem; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-block; text-decoration:none; cursor:pointer;
  font-family:inherit; font-size:1rem; font-weight:700;
  padding:.75rem 1.6rem; border-radius:3px;
  background:var(--blue); color:#fff; border:2px solid var(--blue);
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.btn:hover{ background:var(--blue-dark); border-color:var(--blue-dark); }
.btn-invert{ background:#fff; color:var(--blue); border-color:#fff; }
.btn-invert:hover{ background:rgba(255,255,255,.86); border-color:rgba(255,255,255,.86); color:var(--blue-dark); }
.btn-ghost{ background:transparent; color:#fff; border-color:rgba(255,255,255,.65); }
.btn-ghost:hover{ background:rgba(255,255,255,.14); border-color:#fff; }

/* ---------- Bands ---------- */
.band{ padding:clamp(3.5rem,8vw,6.5rem) 0; }
.band-pale{ background:var(--pale); }
.band-blue{ background:var(--blue); color:rgba(255,255,255,.92); }
.band-blue h2,.band-blue h3,.band-blue .display,.band-blue .lead{ color:#fff; }
.band-blue a{ color:#fff; }

/* ---------- About ---------- */
.two-col{ display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); gap:clamp(2rem,5vw,4rem); align-items:start; }
.ungc{ border-left:3px solid var(--blue); padding-left:1.1rem; color:var(--ink); }

.factsheet{ background:var(--pale); padding:1.8rem; border-top:4px solid var(--blue); }
.factsheet dl{ margin:0; }
.factsheet div{ padding:.75rem 0; border-bottom:1px solid var(--line); }
.factsheet div:last-child{ border-bottom:0; }
.factsheet dt{ font-size:.82rem; color:#8C9AA6; }
.factsheet dd{ margin:0; font-weight:700; color:var(--ink); }

/* ---------- Execution model ---------- */
.model{ list-style:none; margin:2.5rem 0 0; padding:0;
  display:grid; gap:2rem; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
.model li{ border-top:3px solid var(--blue); padding-top:1.1rem; }
.model .num{ display:block; font-weight:800; font-size:.9rem; color:var(--blue); margin-bottom:.4rem; }
.model p{ margin:0; }

/* ---------- Mission / Vision ---------- */
.mv{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:clamp(2rem,5vw,4rem); }
.mv h2{ font-weight:300; font-size:clamp(1.9rem,3.4vw,2.6rem); }
.mv p{ color:rgba(255,255,255,.92); }

/* ---------- Icon lists (values, services) ---------- */
.iconlist{ list-style:none; margin:0; padding:0; }
.iconlist li{
  display:grid; grid-template-columns:64px 1fr; gap:1.6rem;
  padding:1.8rem 0; border-top:1px solid var(--line); align-items:start;
}
.iconlist li:last-child{ border-bottom:1px solid var(--line); }
.iconlist.invert li{ border-color:var(--line-inv); }
.iconlist p{ margin:0; }
.iconlist.invert p{ color:rgba(255,255,255,.88); }

.ico{ width:48px; height:48px; fill:none; stroke:var(--ink); stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round; }
.iconlist.invert .ico{ stroke:#fff; }

/* ---------- Tabs ---------- */
.tabs{ display:flex; flex-wrap:wrap; gap:.4rem; border-bottom:1px solid var(--line); margin-bottom:2.4rem; }
.tabs button{
  font:inherit; font-weight:700; font-size:1rem; cursor:pointer;
  background:none; border:0; border-bottom:3px solid transparent;
  padding:.8rem 1.1rem; color:#8C9AA6; margin-bottom:-1px;
}
.tabs button[aria-selected="true"]{ color:var(--blue); border-bottom-color:var(--blue); }
.tabs button:hover{ color:var(--ink); }

.panel{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:clamp(2rem,5vw,3.5rem); }
.panel[hidden]{ display:none; }
.panel ul{ margin:0; padding-left:1.1rem; color:var(--link); }
.panel li{ margin-bottom:.3rem; }

/* ---------- Projects ---------- */
.projectlist{ display:grid; gap:3.5rem; }
.project header{ margin-bottom:1.1rem; }
.project .cat{ font-size:.8rem; font-weight:800; color:var(--link); margin:0 0 .2rem; }
.project h3{ font-size:1.3rem; font-weight:600; margin-bottom:.7rem; }
.project .meta{ display:flex; flex-wrap:wrap; gap:.4rem 2.2rem; margin:0; }
.project .meta div{ display:flex; gap:.5rem; align-items:baseline; }
.project .meta dt{ font-size:.78rem; color:#8C9AA6; }
.project .meta dd{ margin:0; font-size:.92rem; font-weight:700; color:var(--ink); }

.shots{ display:grid; gap:.5rem; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); }
.shots a{ display:block; overflow:hidden; background:#DDE5EB; aspect-ratio:4/3; border-radius:2px; }
.shots img{ width:100%; height:100%; object-fit:cover; transition:transform .4s ease, opacity .25s ease; }
.shots a:hover img{ transform:scale(1.05); opacity:.9; }

/* ---------- Lightbox ---------- */
.lightbox{ position:fixed; inset:0; z-index:200; background:rgba(8,30,48,.96);
  display:flex; align-items:center; justify-content:center; }
.lightbox[hidden]{ display:none; }
.lightbox img{ max-width:88vw; max-height:82vh; object-fit:contain; }
.lightbox button{ position:absolute; background:none; border:0; color:#fff;
  font-size:2.6rem; line-height:1; cursor:pointer; padding:.4rem 1rem; }
.lb-close{ top:.8rem; right:1rem; font-size:2.2rem; }
.lb-prev{ left:.3rem; } .lb-next{ right:.3rem; }
.lb-cap{ position:absolute; bottom:1.2rem; left:50%; transform:translateX(-50%);
  color:rgba(255,255,255,.85); font-size:.9rem; margin:0; max-width:80vw; text-align:center; }

/* ---------- Grids ---------- */
.grid-4{ display:grid; gap:1.8rem 2.4rem; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); margin-top:2.4rem; }
.grid-4 article{ border-top:3px solid var(--blue); padding-top:1rem; }
.grid-4.invert article{ border-top-color:rgba(255,255,255,.85); }
.grid-4 p{ margin:0; font-size:.97rem; }
.grid-4.invert p{ color:rgba(255,255,255,.88); }

.note{ margin-top:2.4rem; padding:1.2rem 1.4rem; background:var(--pale); border-left:3px solid var(--blue); max-width:80ch; }
.subhead{ margin-top:3.5rem; font-size:1.5rem; font-weight:300; }

.policies{ display:grid; gap:2rem; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); margin-top:2rem; }
.policies ul{ margin:0; padding-left:1.1rem; }
.policies li{ margin-bottom:.7rem; font-size:.96rem; }
.policies strong{ color:var(--ink); }

/* ---------- Why ---------- */
.why{ margin:2.4rem 0 0; display:grid; gap:0; }
.why div{ padding:1.4rem 0; border-top:1px solid var(--line); display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:2rem; }
.why div:last-child{ border-bottom:1px solid var(--line); }
.why dt{ font-weight:700; color:var(--ink); }
.why dd{ margin:0; }

/* ---------- Organisation ---------- */
.org{ margin-top:2.4rem; }
.org-top{ display:flex; flex-wrap:wrap; gap:1rem; margin-bottom:2rem; }
.org-node{ background:var(--blue); color:#fff; font-weight:700; padding:.7rem 1.4rem; border-radius:3px; }
.org-divisions{ display:grid; gap:1.6rem; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
.org-divisions section{ background:#fff; border-top:4px solid var(--blue); padding:1.4rem 1.5rem; }
.org-divisions h3{ font-size:1rem; }
.org-divisions ul{ margin:0; padding-left:1.1rem; font-size:.95rem; }
.org-divisions li{ margin-bottom:.25rem; }

/* ---------- Contact ---------- */
.contact-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:clamp(2rem,5vw,4rem); }
.offices{ display:grid; gap:1.6rem; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); align-content:start; }
.offices article{ border-top:1px solid var(--line-inv); padding-top:1rem; }
.offices p{ margin:0 0 .6em; font-size:.96rem; color:rgba(255,255,255,.9); }
.offices a{ text-decoration:none; }
.offices a:hover{ text-decoration:underline; }

.field{ margin-bottom:1rem; }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
label{ display:block; font-size:.86rem; margin-bottom:.3rem; color:rgba(255,255,255,.85); }
input,textarea{
  width:100%; font:inherit; font-size:1rem; padding:.7rem .85rem;
  color:#fff; background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.3); border-radius:3px;
}
input:focus,textarea:focus{ background:rgba(255,255,255,.18); border-color:#fff; outline:none; }
textarea{ resize:vertical; }
.form-actions{ display:flex; align-items:center; gap:1.2rem; flex-wrap:wrap; margin-top:1.3rem; }
#formstatus{ margin:0; font-size:.94rem; }
#formstatus.ok{ color:#BFF0C8; }
#formstatus.err{ color:#FFD0C6; }

/* ---------- Footer ---------- */
.colophon{ background:#0F3F63; color:rgba(255,255,255,.75); padding:1.8rem 0; font-size:.9rem; }
.colophon-inner{ display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.colophon p{ margin:0; max-width:none; }
.colophon a{ color:#fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .two-col,.contact-grid{ grid-template-columns:1fr; }
  .why div{ grid-template-columns:1fr; gap:.3rem; }
}
@media (max-width: 860px){
  .nav-toggle{ display:flex; }
  #nav{ position:absolute; top:100%; left:0; right:0; background:#fff;
    border-bottom:1px solid var(--line); max-height:0; overflow:hidden; transition:max-height .3s ease; }
  #nav.open{ max-height:400px; }
  #nav ul{ flex-direction:column; gap:0; padding:.5rem var(--gutter) 1rem; }
  #nav li{ border-top:1px solid var(--line); }
  #nav a{ display:block; padding:.85rem 0; }

  .field-row{ grid-template-columns:1fr; }
  .cover-stats{ gap:1.6rem 2rem; }
  .cover-logo{ height:40px; }
  .brand img{ height:32px; }
  .iconlist li{ grid-template-columns:44px 1fr; gap:1rem; }
  .ico{ width:36px; height:36px; }

  .shots{ grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
}

section[id]{ scroll-margin-top:74px; }
