/* Captain Elec — électricité générale */

: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);
  --ink: #1a2332;
  --ink-soft: #2d3a4d;
  --slate: #5a6578;
  --mist: #eef1f4;
  --paper: #f6f7f9;
  --white: #ffffff;
  --amber: #f0b429;
  --amber-dark: #d49a12;
  --amber-glow: rgba(240, 180, 41, 0.15);
  --line: #dde2e8;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --max-w: 72rem;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(26, 35, 50, 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(--ink);
  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(--ink-soft);
  text-underline-offset: 3px;
}

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

.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.94);
  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: 0.75rem;
  min-height: var(--header-h);
  padding: 0.5rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--amber-glow);
  border-radius: var(--radius);
  border: 1px solid rgba(240, 180, 41, 0.35);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.brand__sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.1rem;
}

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

.nav-desktop a {
  display: block;
  padding: 0.5rem 0.75rem;
  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(--ink);
  background: var(--mist);
}

.nav-cta {
  margin-left: 0.35rem;
  padding: 0.5rem 1rem !important;
  background: var(--amber) !important;
  color: var(--ink) !important;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--amber-dark) !important;
  color: var(--ink) !important;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--amber);
  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(--ink);
  cursor: pointer;
  border-radius: var(--radius);
  touch-action: manipulation;
  flex-shrink: 0;
  z-index: 1003;
}

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

#nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(26, 35, 50, 0.5);
}

#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(26, 35, 50, 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(--ink);
  border-bottom: 1px solid var(--line);
}

.nav-mobile-urgence {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem !important;
  background: var(--amber) !important;
  color: var(--ink) !important;
  border-radius: var(--radius) !important;
  border: none !important;
  text-align: center;
  font-weight: 600 !important;
}

body.nav-open {
  overflow: hidden;
}

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

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

/* Typography */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dark);
}

.eyebrow--light {
  color: var(--amber);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.25rem);
}

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

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

.section-lead--tight {
  margin-bottom: 1rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 3.5rem 0 4.5rem;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, var(--amber-glow), transparent 55%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

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

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

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

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

.hero__lead strong {
  color: var(--white);
}

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

.hero__trust {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

.hero__trust li::before {
  content: "✓ ";
  color: var(--amber);
}

/* 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(--amber);
  color: var(--ink);
  border-color: var(--amber);
}

.btn--primary:hover {
  background: var(--amber-dark);
  border-color: var(--amber-dark);
  color: var(--ink);
}

.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(--ink);
  border-color: var(--line);
}

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

.btn--urgence {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  font-size: 1.05rem;
  padding: 1rem 1.75rem;
  white-space: nowrap;
}

.btn--urgence:hover {
  background: var(--amber);
  border-color: var(--amber);
}

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

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

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

/* Split / info */
.split {
  display: grid;
  gap: 2rem;
  align-items: start;
}

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

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

.info-card {
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--amber);
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
}

.info-card__role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem !important;
}

.info-card a {
  font-weight: 600;
  text-decoration: none;
}

.info-card__loc {
  margin-top: 1rem !important;
  font-size: 0.9rem;
  color: var(--slate) !important;
}

/* Services grid */
.grid-services {
  display: grid;
  gap: 1.25rem;
}

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

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

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

.section--alt .card {
  background: var(--paper);
}

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

.card--highlight {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.card--highlight h3,
.card--highlight p {
  color: var(--white);
}

.card--highlight p {
  opacity: 0.85;
}

.card__icon {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.85rem;
  color: var(--amber-dark);
}

.card--highlight .card__icon {
  color: var(--amber);
}

.card__icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--slate);
  line-height: 1.55;
}

/* Urgence */
.urgence {
  background: linear-gradient(135deg, var(--amber-dark) 0%, var(--amber) 100%);
  color: var(--ink);
  padding: 2.5rem 0;
}

.urg-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.urg-inner h2 {
  margin-bottom: 0.35rem;
}

.urg-inner p {
  margin: 0;
  max-width: 32rem;
  font-size: 1rem;
}

/* Devis */
.devis-box {
  padding: 2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 4px solid var(--amber);
}

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

.devis-box__note {
  font-size: 0.92rem;
}

.devis-box__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

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

.gallery-item__placeholder {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, var(--ink-soft) 0%, var(--ink) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.35);
}

.gallery-item__placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
}

.gallery-item span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate);
}

.gallery-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--slate);
  font-style: italic;
}

/* 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(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

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

.contact-block a {
  font-weight: 600;
  text-decoration: none;
}

.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(--amber);
  outline-offset: 1px;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 max(2.5rem, var(--safe-bottom));
  background: var(--ink);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
}

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

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

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

.footer-legal {
  font-size: 0.78rem;
  opacity: 0.75;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    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 */
.legal-page {
  padding: 3rem 0 4rem;
  max-width: 42rem;
}

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

.legal-page h2 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
}

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

/* Responsive */
@media (max-width: 1023px) {
  .brand__name {
    font-size: 1.2rem;
  }

  .brand__sub {
    font-size: 0.6rem;
  }
}

@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__actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .hero__trust {
    flex-direction: column;
    gap: 0.35rem;
  }

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

  .urg-inner .btn--urgence {
    width: 100%;
    text-align: center;
  }

  .devis-box__actions {
    flex-direction: column;
  }

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

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

  .card {
    padding: 1.25rem;
  }
}

@media (max-width: 380px) {
  .brand__sub {
    letter-spacing: 0.06em;
  }
}

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

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