/* ===========================================================
   SGH Maroc — modern rebuild 2026
   Brand: #0272B9 · Fonts: Poppins (display) / Inter (text)
   =========================================================== */

:root {
  --blue: #0272B9;
  --blue-dark: #015a93;
  --ink: #0f1b26;
  --slate: #46566a;
  --muted: #7587a0;
  --line: #e6ecf3;
  --bg: #ffffff;
  --bg-alt: #f4f8fc;
  --navy: #0c1a28;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(2, 41, 73, .10);
  --shadow-sm: 0 4px 18px rgba(2, 41, 73, .08);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { font-family: "Poppins", sans-serif; line-height: 1.12; margin: 0; color: var(--ink); letter-spacing: -.02em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.thin { font-weight: 500; color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s; cursor: pointer; border: 0;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 24px rgba(2,114,185,.35); }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.55); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: #fff; color: var(--blue-dark); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav a { color: var(--slate); font-weight: 500; font-size: .96rem; position: relative; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--blue); transition: width .25s;
}
.nav a:not(.nav-cta):hover { color: var(--ink); }
.nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta { background: var(--blue); color: #fff !important; padding: .55rem 1.2rem; border-radius: 999px; }
.nav-cta:hover { background: var(--blue-dark); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 86vh; display: flex; align-items: center; color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(105deg, rgba(8,26,42,.86) 0%, rgba(2,74,120,.66) 48%, rgba(2,114,185,.30) 100%); }
.hero-content { position: relative; z-index: 1; padding-top: 4rem; padding-bottom: 4rem; max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 600; color: #bfe0f7; margin: 0 0 1rem; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5.4vw, 4rem); font-weight: 800; }
.hero h1 span { color: #7ec4ee; }
.hero-lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: #e8f2fb; max-width: 600px; margin: 1.4rem 0 0; }
.hero-lead strong { color: #fff; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; }
.hero-tags span { font-size: .8rem; font-weight: 600; letter-spacing: .04em; padding: .4rem .9rem; border-radius: 999px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1; color: #fff; font-size: 1.6rem; opacity: .8; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,8px);} }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto clamp(2rem,5vw,3.2rem); text-align: center; }
.kicker { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--blue); margin-bottom: .8rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
.section-sub { color: var(--slate); margin-top: 1rem; }

/* ---------- Project ---------- */
.project-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.project-copy .lead { font-size: 1.25rem; font-weight: 500; color: var(--ink); margin: 0 0 1rem; }
.project-copy p { color: var(--slate); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 2rem; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow-sm); }
.stats strong { display: block; font-family: "Poppins"; font-size: 1.15rem; color: var(--blue); }
.stats span { font-size: .82rem; color: var(--muted); }
.project-media { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.project-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.project-media figcaption { position: absolute; left: 0; bottom: 0; right: 0; padding: 1.4rem 1.2rem .9rem; color: #fff; font-size: .9rem; font-weight: 500; background: linear-gradient(transparent, rgba(8,26,42,.8)); }

.video-wrap { margin-top: clamp(2rem,5vw,3.5rem); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-wrap video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.g-item { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 4/3; cursor: zoom-in; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.g-item:hover img { transform: scale(1.07); }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem .9rem .8rem; color: #fff; font-size: .85rem; font-weight: 600; background: linear-gradient(transparent, rgba(8,26,42,.82)); opacity: 0; transform: translateY(8px); transition: .3s; }
.g-item:hover .g-cap { opacity: 1; transform: none; }

/* ---------- Features ---------- */
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.features li { display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem 1rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; }
.features li:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.f-ic { font-size: 1.8rem; line-height: 1; }

/* ---------- Map ---------- */
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.map-wrap iframe { width: 100%; height: 440px; border: 0; display: block; filter: saturate(1.05); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c7d4e2; padding-top: clamp(3rem,6vw,4.5rem); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.f-brand img { margin-bottom: 1rem; }
.f-brand p { color: #9fb2c6; font-size: .95rem; }
.socials { display: flex; gap: .7rem; margin-top: 1.2rem; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: #cfe0f0; transition: .25s; }
.socials a:hover { background: var(--blue); color: #fff; transform: translateY(-2px); }
.f-info h3 { color: #fff; font-size: 1.2rem; margin-bottom: 1.2rem; }
.f-line { margin: 0 0 1rem; color: #cdd9e6; }
.f-line span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); margin-bottom: .2rem; font-weight: 700; }
.f-line a { color: #cdd9e6; }
.f-line a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; padding: 1.4rem 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; color: #8499ad; }
.to-top { color: #8499ad; }
.to-top:hover { color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,16,24,.92); display: grid; place-items: center; padding: 4vw; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 18px; right: 26px; background: none; border: 0; color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer; }

/* ---------- Reveal animation (progressive enhancement: only hides when JS active) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 0;
    transform: translateY(-130%); transition: transform .35s ease; box-shadow: var(--shadow);
  }
  .nav.open { transform: none; }
  .nav a { width: 100%; padding: .9rem 24px; }
  .nav a:not(.nav-cta)::after { display: none; }
  .nav-cta { margin: .5rem 24px; text-align: center; }
  .nav-toggle { display: flex; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 80vh; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
  html { scroll-behavior: auto; }
}
