/* ==========================
   ÆTERNEX — Minimal Premium CSS (FINAL, corrected)
   File: /assets/style.css
   ========================== */

/* Fonts (self-hosted) */
@import url("/assets/fonts/inter/inter.css");

/* ==========================
   Base tokens (LIGHT)
   ========================== */
:root{
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;

  --brand: #111827;
  --brand-2: #0b1220;
  --accent: #0f172a;

  --shadow: 0 10px 30px rgba(2, 6, 23, .08);
  --shadow-soft: 0 6px 18px rgba(2, 6, 23, .06);

  --radius: 18px;
  --radius-2: 24px;

  --max: 1120px;
  --pad: 22px;

  --focus: 0 0 0 4px rgba(15, 23, 42, .12);

  /* Form tokens */
  --field-bg: rgba(255,255,255,.92);
  --field-bg-2: rgba(248,250,252,.92);
  --field-text: var(--text);
  --field-border: var(--line);
  --field-border-strong: rgba(15,23,42,.28);
}

/* ==========================
   Base reset
   ========================== */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{ max-width:100%; height:auto; display:block; }
a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: none; }

p{ margin: 0 0 14px; }
h1,h2,h3{ margin:0 0 10px; line-height: 1.12; letter-spacing: -0.02em; }
h1{ font-size: clamp(2rem, 3.2vw, 3.1rem); }
h2{ font-size: clamp(1.55rem, 2.3vw, 2.1rem); }
h3{ font-size: 1.08rem; }
small{ color: var(--muted); }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Accessibility */
.skip-link{
  position:absolute;
  left:-999px;
  top: 16px;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left: 16px;
  width:auto;
  height:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
  z-index: 9999;
}

.visually-hidden{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================
   Header / Nav (stable)
   ========================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226,232,240,.65);
}
.header__inner{
  display:flex;
  align-items:center;
  gap: 18px;
  min-height: 72px;
  position: relative;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 0;
  flex: 0 0 auto;
}
.brand__mark{
  width: 34px; height: 34px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(2,6,23,.18);
}
.brand__name{
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: .95rem;
}

/* Desktop nav */
.nav{
  display:flex;
  align-items:center;
  gap: 16px;
  flex-wrap: wrap;
}
.nav a{
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  padding: 10px 8px;
  border-radius: 10px;
}
.nav a:hover{
  color: var(--text);
  background: rgba(241,245,249,.8);
}
.nav a:focus-visible{ outline: none; box-shadow: var(--focus); }

/* Keep nav pushed right, then language switch next to it */
.nav--desktop{ margin-left: auto; }

/* ==========================
   Language switch (FR / EN) — stable
   ========================== */
.lang-switch{
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex: 0 0 auto;
}

.lang-switch__link{
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(248,250,252,.85);
  line-height: 1;
}
.lang-switch__link:hover{
  color: var(--text);
  background: rgba(241,245,249,.95);
}
.lang-switch__link:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}
.lang-switch__link.is-active{
  color: var(--text);
  border-color: rgba(15,23,42,.35);
  background: #fff;
}

/* Mobile: pin language to top-right, leave room for burger */
@media (max-width: 980px){
  .lang-switch{
    position: absolute;
    top: 14px;
    right: 72px;
    z-index: 60;
    margin-left: 0;
  }
}

/* ==========================
   Buttons
   ========================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .08s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }
.btn:active{ transform: translateY(1px); }

.btn--primary{
  background: linear-gradient(180deg, #0f172a, #0b1220);
  color:#fff;
  box-shadow: 0 14px 30px rgba(2,6,23,.18);
  border-color: rgba(255,255,255,.06);
}
.btn--primary:hover{ box-shadow: 0 18px 38px rgba(2,6,23,.22); }

.btn--ghost{
  background: rgba(248,250,252,.8);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover{ background: rgba(241,245,249,.9); }

/* ==========================
   Hero (shared typography)
   ========================== */
.hero{ padding: 34px 0 26px; }
.kicker{
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .78rem;
  margin-bottom: 12px;
}
.lead{
  font-size: 1.05rem;
  color: var(--muted);
}
.hero__cta{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}
.hero__meta{
  list-style:none;
  padding:0;
  margin: 14px 0 0;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero__meta li{
  font-size: .92rem;
  color: var(--muted);
  padding: 8px 10px;
  background: rgba(248,250,252,.85);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.ae{ display:inline-block; letter-spacing: 0; font-weight: 700; }

/* ==========================
   HERO — Background image variant (EN + FR homes)
   ========================== */
.hero--image{
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding: 72px 0 62px;
  overflow: hidden;
}

/* SAME HERO for EN + FR (brand coherence) */
.hero--home-en,
.hero--home-fr{
  background-image: url("/img/hero/hero-work-aeternex.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 55% 45%;
}

/* Overlays */
.hero--image::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(10, 15, 18, 0.32);
  z-index: 1;
}
.hero--image::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    90deg,
    rgba(10, 15, 18, 0.60) 0%,
    rgba(10, 15, 18, 0.40) 42%,
    rgba(10, 15, 18, 0.16) 72%,
    rgba(10, 15, 18, 0.00) 100%
  );
  z-index: 2;
}

/* Content layer */
.hero--image .hero__inner{
  position: relative;
  z-index: 3;
  max-width: 780px;
}

/* Text colours on dark hero */
.hero--image .kicker{ color: rgba(255,255,255,.78); }
.hero--image h1{
  color: #fff;
  text-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.hero--image .lead{
  color: rgba(255,255,255,.82);
  max-width: 580px;
}

/* Meta pills on dark hero */
.hero--image .hero__meta li{
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}

/* Ghost button on dark hero */
.hero--image .btn--ghost{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}
.hero--image .btn--ghost:hover{
  background: rgba(255,255,255,.12);
}

/* ==========================
   Sections
   ========================== */
.section{ padding: 58px 0; }
.section--tone{
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,.65));
  border-top: 1px solid rgba(226,232,240,.55);
  border-bottom: 1px solid rgba(226,232,240,.55);
}
.section__head{ margin-bottom: 18px; max-width: 780px; }
.section__sub{ margin: 0; color: var(--muted); }

/* ==========================
   Cards (FIX: responsive + stable heights)
   ========================== */
.cards{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}
.card{
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.card p{ color: var(--muted); }
.card p:last-child{ margin-bottom: 0; }

/* 2 columns on medium screens (prevents narrow tall cards) */
@media (max-width: 1024px){
  .cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 1 column on small screens */
@media (max-width: 720px){
  .cards{ grid-template-columns: 1fr; }
}

/* ==========================
   CTA band
   ========================== */
.cta{
  padding: 50px 0;
  background: linear-gradient(180deg, rgba(15,23,42,1), rgba(11,18,32,1));
  color: #fff;
}
.cta__inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-2);
  padding: 22px;
  box-shadow: 0 18px 52px rgba(0,0,0,.25);
}
.cta p{ color: rgba(255,255,255,.78); margin: 0; }
.cta__actions{ display:flex; gap: 12px; flex-wrap: wrap; }
.cta .btn--ghost{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
  color: #fff;
}
.cta .btn--ghost:hover{ background: rgba(255,255,255,.12); }

/* ==========================
   Footer
   ========================== */
.site-footer{
  padding: 44px 0 24px;
  background: rgba(248,250,252,1);
  border-top: 1px solid rgba(226,232,240,.85);
}
.footer__grid{
  display: grid;
  grid-template-columns: minmax(320px, 520px) max-content max-content;
  column-gap: 64px;
  row-gap: 18px;
  align-items: start;
  justify-content: start;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.footer__grid > *{ min-width: 0; }
.muted{ color: var(--muted); }

.footer__links{
  list-style:none;
  padding:0;
  margin: 10px 0 0;
}
.footer__links li{ margin: 8px 0; }
.footer__links a{
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 10px;
}
.footer__links a:hover{
  background: rgba(241,245,249,.9);
  color: var(--text);
}

/* ==========================
   Mobile nav (no external JS) via <details>
   ========================== */
.nav--desktop{ display:flex; }
.navmobile{ display:none; }

.navmobile > summary{ list-style: none; }
.navmobile > summary::-webkit-details-marker{ display:none; }

@media (max-width: 980px){
  .nav--desktop{ display:none; }
  .navmobile{ display:block; position: relative; margin-left: auto; }

  .navmobile__btn{
    display:inline-flex;
    align-items:center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(248,250,252,.85);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
  }

  /* Stable hamburger icon (3 lines) */
  .navmobile__icon{
    width: 20px;
    height: 2px;
    position: relative;
    display:inline-block;
    background: currentColor;
    border-radius: 999px;
  }
  .navmobile__icon::before,
  .navmobile__icon::after{
    content:"";
    position:absolute;
    left:0; right:0;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }
  .navmobile__icon::before{ top:-6px; }
  .navmobile__icon::after{ top: 6px; }

  .navmobile__label{ font-size: .95rem; color: var(--muted); }

  .navmobile__panel{
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    z-index: 100;
  }

  .navmobile__panel a{
    padding: 12px 12px;
    border-radius: 14px;
    color: var(--text);
    font-weight: 600;
  }
  .navmobile__panel a:hover{ background: rgba(241,245,249,.9); }

  /* Homes: hero image tuning */
  .hero--image{
    min-height: 70vh;
    padding: 56px 0 46px;
  }

  /* Use mobile asset for BOTH EN + FR */
  .hero--home-en,
  .hero--home-fr{
    background-image: url("/img/hero/hero-work-aeternex-mobile.webp");
    background-position: 54% 55%;
  }
}

@media (max-width: 560px){
  :root{ --pad: 16px; }
  .btn{ width: 100%; }
  .hero__cta{ gap: 10px; }
  .hero__meta{ gap: 8px; }

  /* Small mobile focal point */
  .hero--home-en,
  .hero--home-fr{
    background-position: 54% 60%;
  }
}

/* ==========================
   Form status (success / error) — refined (less aggressive)
   ========================== */
.notice{
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.95);
  padding: 14px 16px;
  margin: 0 0 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 16px rgba(2,6,23,.06);
}

.notice strong{
  display:block;
  margin-bottom: 6px;
  color: var(--text);
}

/* Success: subtle */
.notice--success{
  border-color: rgba(16, 185, 129, .22);
  background: linear-gradient(180deg, rgba(16,185,129,.06), rgba(255,255,255,.94));
}

/* Error: subtle */
.notice--error{
  border-color: rgba(239, 68, 68, .22);
  background: linear-gradient(180deg, rgba(239,68,68,.06), rgba(255,255,255,.94));
}

/* ==========================
   Forms — Minimal premium (inputs/select/textarea)
   ========================== */
form p{ margin: 0 0 14px; }
label{ color: var(--text); }

/* Inputs / Select / Textarea */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea{
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--field-text);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 14px;
  padding: 12px 12px;
  line-height: 1.25;
  box-shadow: 0 2px 10px rgba(2,6,23,.04);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .08s ease;
}

textarea{
  resize: vertical;
  min-height: 140px;
}

/* Placeholder (limit to fields only) */
input::placeholder,
textarea::placeholder{
  color: rgba(71,85,105,.75);
}

/* Hover */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover{
  border-color: rgba(15,23,42,.22);
  background: #fff;
}

/* Focus-visible (keyboard-friendly) */
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="url"]:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline: none;
  border-color: var(--field-border-strong);
  box-shadow: var(--focus), 0 8px 22px rgba(2,6,23,.08);
  background: #fff;
}

/* Fallback focus (avoid double outlines) */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus{
  outline: none;
}

/* Disabled */
input:disabled,
select:disabled,
textarea:disabled{
  opacity: .7;
  cursor: not-allowed;
  background: var(--field-bg-2);
}

/* Select chevron (pure CSS) */
select{
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(15,23,42,.55) 50%),
    linear-gradient(135deg, rgba(15,23,42,.55) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 12px) 52%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

/* ==========================
   Validation (no red on load)
   - Best: :user-invalid (modern browsers)
   - Fallback: red only on focus when invalid
   ========================== */
input:user-invalid,
select:user-invalid,
textarea:user-invalid{
  border-color: rgba(239,68,68,.35);
  box-shadow: 0 0 0 4px rgba(239,68,68,.10), 0 8px 22px rgba(2,6,23,.08);
}

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid{
  border-color: rgba(239,68,68,.35);
}

/* Checkbox */
input[type="checkbox"]{
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: var(--text);
}

/* Checkbox label alignment */
label[for="consent"]{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
  color: var(--muted);
}

/* Form small notes */
form small{
  color: var(--muted);
}

@media (max-width: 980px){
  textarea{ min-height: 160px; }
}
