/* ==========================================================================
   ETS GANA OUSMANE SARL — BASE
   Reset, element defaults, typography, layout primitives, utilities.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 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) + 1.5rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
  overflow-x: hidden;
}

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

img {
  height: auto;
  background-color: var(--n-200);
}

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

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

ul,
ol {
  list-style: none;
}

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

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

::selection {
  background-color: var(--ego-lime);
  color: var(--ego-green-900);
}

/* --------------------------------------------------------------------------
   2. FOCUS — always visible, never removed
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--ego-lime);
  outline-offset: 3px;
  border-radius: 1px;
}

.u-dark :focus-visible,
.u-green :focus-visible {
  outline-color: var(--ego-lime);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-snug);
  text-wrap: balance;
  /* Long French compounds (ASSAINISSEMENT, CONSTRUISONS) must never be able to
     push a grid or flex track wider than the viewport. */
  overflow-wrap: break-word;
}

/* Grid and flex children default to min-width:auto, which lets a long word
   force an overflow. Opt every layout track out of that. */
.shell,
.grid > *,
.split > *,
.svc-seq > *,
.hero__body,
.hero__rail,
.section-head > *,
.cta__inner > *,
.obj-grid > *,
.svc-intro > * {
  min-width: 0;
}

h1 {
  font-size: var(--fs-4xl);
  font-stretch: 118%;
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--fs-3xl);
  font-stretch: 112%;
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

h3 {
  font-size: var(--fs-xl);
  font-stretch: 106%;
}

h4 {
  font-size: var(--fs-lg);
  font-stretch: 104%;
}

p,
li,
dd,
figcaption {
  text-wrap: pretty;
  /* French compounds (« assainissement », « développement ») are long enough
     to overrun a 320px column; break as a last resort rather than overflow. */
  overflow-wrap: break-word;
}

strong,
b {
  font-weight: 600;
  color: var(--text);
}

/* Display headline — the site's signature voice */
.display {
  font-family: var(--ff-display);
  font-weight: 800;
  font-stretch: 122%;
  font-size: var(--fs-5xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* Narrow screens: pull in the variable width axis rather than shrinking the
   type. Long French words (CONSTRUISONS, ASSAINISSEMENT) set at 122% width
   overrun the line box on a 375px screen; at 100% they fit and the headline
   keeps its scale. */
@media (max-width: 34rem) {
  .display,
  h1,
  h2 {
    font-stretch: 100%;
    letter-spacing: -0.03em;
  }
}

/* Monospace technical label — the "title block" voice */
.label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
  font-family: var(--ff-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.35;
  overflow-wrap: break-word;
}

.label::before {
  content: '';
  width: clamp(1rem, 0.4rem + 2.5vw, 1.75rem);
  height: 1px;
  background-color: currentColor;
  opacity: 0.55;
  flex: none;
}

.label--plain::before {
  display: none;
}

.label--accent {
  color: var(--accent);
}

/* Section numeral, drawn from the 01–05 convention in the company's own copy */
.numeral {
  font-family: var(--ff-mono);
  font-weight: 500;
  font-size: var(--fs-2xs);
  letter-spacing: 0.1em;
  color: var(--laterite);
}

.u-dark .numeral,
.u-green .numeral {
  color: var(--laterite-bright);
}

.lede {
  font-size: var(--fs-lg);
  line-height: var(--lh-loose);
  color: var(--text-soft);
  max-width: var(--maxw-text);
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: opacity var(--dur-1) var(--ease-out);
}

.prose a:not(.btn):hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.section--tight {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
}

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

.grid {
  display: grid;
  gap: var(--sp-6);
}

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

/* Section heading block: label / title / lede */
.section-head {
  display: grid;
  gap: var(--sp-4);
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 1.8rem + 2.6vw, 4.5rem);
}

.section-head--wide {
  max-width: none;
}

.section-head--split {
  max-width: none;
  grid-template-columns: 1fr;
  align-items: end;
}

@media (min-width: 62rem) {
  .section-head--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
    gap: var(--sp-8);
  }
}

/* --------------------------------------------------------------------------
   5. ISOMETRIC MOTIF — the 30° system, shared by many components
   -------------------------------------------------------------------------- */

/* Faint technical grid, used behind hero and CTA bands */
.iso-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(
      30deg,
      transparent 0 76px,
      currentColor 76px 76.5px
    ),
    repeating-linear-gradient(
      150deg,
      transparent 0 76px,
      currentColor 76px 76.5px
    );
  color: rgba(255, 255, 255, 0.05);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}

.iso-grid--ink {
  color: rgba(17, 17, 16, 0.05);
}

/* 30° cut on the top or bottom edge of a band */
.iso-cut-b {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--iso-cut)), 0 100%);
}

.iso-cut-t {
  clip-path: polygon(0 var(--iso-cut), 100% 0, 100% 100%, 0 100%);
}

/* --------------------------------------------------------------------------
   6. MEDIA
   -------------------------------------------------------------------------- */

.media {
  position: relative;
  overflow: hidden;
  background-color: var(--n-200);
}

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

.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--3x4 { aspect-ratio: 3 / 4; }
.media--4x5 { aspect-ratio: 4 / 5; }
.media--16x9 { aspect-ratio: 16 / 9; }

/* Unified photographic treatment: slightly cooled shadows, lifted contrast.
   Keeps a set of phone photographs looking like one commissioned shoot. */
.media--graded img {
  filter: saturate(0.94) contrast(1.04);
}

/* Deep-green duotone wash for immersive bands */
.media--wash::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 50, 26, 0.15) 0%, rgba(4, 50, 26, 0.72) 100%),
    linear-gradient(0deg, rgba(10, 15, 12, 0.35), rgba(10, 15, 12, 0.35));
  pointer-events: none;
}

/* Engineering-log caption, set like a drawing title block */
.media-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  font-family: var(--ff-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--n-50);
  background-color: rgba(10, 15, 12, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.media-caption span {
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

.media-caption span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.media-caption span:last-child {
  color: var(--ego-lime);
}

@media (max-width: 30rem) {
  .media-caption span:nth-child(n + 3) {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   7. SCROLL REVEAL
   Set by JS: [data-reveal] starts hidden, .is-in plays it in.
   Without JS the .no-js rule below keeps everything visible.
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Image reveal: wipes in along a 30° edge, per the isometric system.
   The clip-path sits on the CHILD, never on the observed element itself —
   a zero-area clip-path makes IntersectionObserver report no intersection,
   which would leave the element permanently hidden. */
[data-reveal='wipe'] {
  opacity: 1;
  transform: none;
}

[data-reveal='wipe'] > * {
  clip-path: polygon(0 100%, 24% 100%, 0 100%, 0 100%);
  transition: clip-path var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal='wipe'].is-in > * {
  clip-path: polygon(0 -30%, 130% -30%, 100% 130%, 0 130%);
}

.no-js [data-reveal],
.no-js [data-reveal='wipe'] > * {
  opacity: 1;
  transform: none;
  clip-path: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal='wipe'],
  [data-reveal='wipe'] > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   8. UTILITIES
   -------------------------------------------------------------------------- */

.visually-hidden {
  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: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  padding: 0.85rem 1.5rem;
  background-color: var(--ego-green-800);
  color: var(--n-0);
  font-family: var(--ff-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.u-center { text-align: center; }
.u-mx-auto { margin-inline: auto; }
.u-nowrap { white-space: nowrap; }
.u-hide { display: none !important; }

@media (max-width: 47.99rem) {
  .u-hide\@sm { display: none !important; }
}

@media (min-width: 48rem) {
  .u-hide\@md\+ { display: none !important; }
}

.u-accent { color: var(--accent); }
.u-lime { color: var(--ego-lime); }
.u-laterite { color: var(--laterite); }
.u-soft { color: var(--text-soft); }

.u-bg-alt { background-color: var(--bg-alt); }
.u-bg-surface { background-color: var(--surface); }

/* A hairline rule that carries the 30° motif at its left end */
.rule {
  height: 1px;
  background-color: var(--border);
  border: 0;
  position: relative;
}

.rule::before {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  width: 12px;
  height: 7px;
  background-color: var(--ego-lime);
  clip-path: polygon(0 100%, 58% 0, 100% 0, 42% 100%);
}
