/* BE SIGMA — bureau d'études · ingénierie */

:root {
  --header-h: 4.5rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --container-pad: clamp(1rem, 4vw, 2rem);
  --navy: #152238;
  --navy-soft: #1e3354;
  --steel: #3d5a80;
  --slate: #5c6b7a;
  --mist: #eef1f5;
  --paper: #f7f8fa;
  --white: #ffffff;
  --gold: #b8954a;
  --gold-soft: #d4b978;
  --line: #dde3eb;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, serif;
  --max-w: 72rem;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(21, 34, 56, 0.08);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--paper);
  overflow-x: clip;
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--steel);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy);
}

.container {
  width: min(100% - 2 * var(--container-pad), var(--max-w));
  margin-inline: auto;
  padding-inline: max(0px, var(--safe-left)) max(0px, var(--safe-right));
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.65rem 0;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--navy);
  line-height: 1.15;
}

.brand__sigma {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.brand__sub {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.15rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--slate);
  border-radius: var(--radius);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-desktop a:hover {
  color: var(--navy);
  background: var(--mist);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  border-radius: var(--radius);
  touch-action: manipulation;
}

.nav-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

#nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(21, 34, 56, 0.45);
}

#nav-backdrop.is-open {
  display: block;
}

#nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(18rem, 88vw);
  z-index: 1002;
  padding: calc(var(--header-h) + var(--safe-top) + 0.75rem) max(1.25rem, var(--safe-right)) max(1.5rem, var(--safe-bottom)) 1.25rem;
  background: var(--white);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(21, 34, 56, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

#nav-mobile.is-open {
  transform: translateX(0);
}

#nav-mobile a {
  display: block;
  padding: 0.85rem 0;
  font-weight: 500;
  text-decoration: none;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
}

body.nav-open {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 52rem;
  }

  .nav-toggle,
  #nav-mobile,
  #nav-backdrop {
    display: none !important;
  }
}

/* Typography */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  margin: 0 0 1rem;
}

.section-lead {
  font-size: 1.125rem;
  color: var(--slate);
  max-width: 42rem;
  margin: 0 0 2rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0%, rgba(184, 149, 74, 0.08) 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.04'%3E%3Cpath d='M0 30h60M30 0v60'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  color: var(--gold-soft);
}

.hero h1 {
  color: var(--white);
  max-width: 16ch;
  margin: 0.75rem 0 1.25rem;
}

.hero__lead {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.82);
  max-width: 36rem;
  margin: 0 0 2rem;
  line-height: 1.6;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.hero__meta strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-serif);
  color: var(--white);
  margin-bottom: 0.15rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.btn--primary:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: var(--navy);
}

.btn--outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}

.btn--outline:hover {
  border-color: var(--steel);
  background: var(--mist);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section--alt {
  background: var(--white);
  border-block: 1px solid var(--line);
}

.section--mist {
  background: var(--mist);
}

/* Cards grid */
.grid-2 {
  display: grid;
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
}

.card--accent {
  border-top: 3px solid var(--gold);
}

.card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.65rem;
}

.card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--slate);
}

/* Lists */
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  color: var(--slate);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 1px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: var(--white);
  padding: 1.5rem 1rem;
  text-align: center;
}

.stat__value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
  display: block;
}

.stat__label {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* Heritage block */
.heritage {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .heritage {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.heritage__text p {
  color: var(--slate);
  margin: 0 0 1rem;
}

/* Team */
.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.team-list li {
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--slate);
}

.team-list strong {
  color: var(--navy);
  font-weight: 600;
}

/* References */
.ref-group {
  margin-bottom: 2rem;
}

.ref-group h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ref-tag {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--slate);
}

/* Project */
.project-card {
  display: grid;
  gap: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 768px) {
  .project-card {
    grid-template-columns: 1fr 1.2fr;
  }
}

.project-card__media {
  position: relative;
  min-height: 14rem;
  background: linear-gradient(145deg, var(--navy-soft) 0%, var(--steel) 100%);
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  min-height: 14rem;
  object-fit: cover;
  object-position: center;
}

.project-card__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(21, 34, 56, 0.65);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
}

.project-card__body {
  padding: 1.5rem 1.5rem 1.5rem 0;
}

@media (max-width: 767px) {
  .project-card__body {
    padding: 0 1.5rem 1.5rem;
  }
}

.project-card__meta {
  font-size: 0.85rem;
  color: var(--slate);
  margin: 0 0 1rem;
}

.project-card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--slate);
  font-size: 0.95rem;
}

/* Certifications */
.cert-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cert {
  display: block;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cert:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  color: inherit;
}

.cert h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.cert p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--slate);
}

.cert__detail {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
  }
}

.contact-block {
  padding: 1.5rem;
  background: var(--mist);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.contact-block p {
  margin: 0 0 0.5rem;
  color: var(--slate);
}

.form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 1rem;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: 2px solid var(--steel);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  gap: 0;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .form-row > * {
    margin-bottom: 0;
  }
}

/* Footer */
.site-footer {
  padding: 2.5rem 0;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--gold-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Legal page */
.legal-page {
  padding: 3rem 0 4rem;
  max-width: 42rem;
}

.legal-page h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
}

.legal-page p,
.legal-page li {
  color: var(--slate);
}

/* ——— Responsive ——— */
@media (max-width: 1023px) {
  .brand__sigma {
    font-size: 1.2rem;
    letter-spacing: 0.14em;
  }

  .brand__sub {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .nav-toggle {
    flex-shrink: 0;
    z-index: 1003;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero {
    padding: 2.5rem 0 3.25rem;
  }

  .hero h1 {
    max-width: none;
  }

  .hero__meta {
    flex-direction: column;
    gap: 1rem;
  }

  .hero__meta strong {
    font-size: 1.35rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
    min-height: 2.75rem;
  }

  .section-lead {
    font-size: 1.02rem;
    margin-bottom: 1.5rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 1.15rem 0.75rem;
  }

  .stat__value {
    font-size: 1.5rem;
  }

  .stat__label {
    font-size: 0.72rem;
  }

  .card {
    padding: 1.25rem;
  }

  .contact-block {
    padding: 1.25rem;
  }

  .form .btn {
    width: 100%;
    min-height: 2.75rem;
  }

  .project-card__media,
  .project-card__media img {
    min-height: 11rem;
  }

  .site-footer {
    padding-bottom: max(2.5rem, var(--safe-bottom));
  }
}

@media (max-width: 380px) {
  .brand__sub {
    max-width: 9.5rem;
    line-height: 1.25;
  }

  .ref-tag {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-desktop a {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
