/* ============================================================
   ARCANEFLOW — Design System v4
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. CUSTOM PROPERTIES
   ──────────────────────────────────────────────────────────── */
:root {
  --color-navy:        #0A1628;
  --color-navy-mid:    #111f38;
  --color-ivory:       #F5F0E8;
  --color-ivory-dark:  #EDE7DC;
  --color-bg:          #FAFAF8;
  --color-white:       #FFFFFF;
  --color-text:        #0A1628;
  --color-muted:       #6B7280;
  --color-border:      #E4DED5;
  --color-border-inv:  rgba(245, 240, 232, 0.09);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Open Sans', system-ui, sans-serif;
  --font-label: 'Montserrat', sans-serif;

  --max-width:    1160px;
  --nav-h:        68px;
  --pad-section:  120px;
  --pad-h:        80px;
  --radius:       3px;
}

/* ────────────────────────────────────────────────────────────
   2. RESET & BASE
   ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Empêche display:flex/grid d'écraser l'attribut hidden */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

section[id], footer[id] { scroll-margin-top: var(--nav-h); }

/* ────────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.08; }

h1 { font-size: 66px; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 44px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 21px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }

h1 em, h2 em { font-style: italic; }

/* Section label */
.section-label {
  display: block;
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  margin-bottom: 12px;
}

/* On dark backgrounds */
.section-label--inv {
  color: rgba(245, 240, 232, 0.38);
}

/* Decorative underline */
.gold-underline::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--color-navy);
  margin-top: 22px;
}

.gold-underline--inv::after  { background: rgba(245,240,232,0.22); }
.gold-underline--center      { text-align: center; }
.gold-underline--center::after { margin-left: auto; margin-right: auto; }

.body-lg {
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-muted);
}

/* ────────────────────────────────────────────────────────────
   4. LAYOUT
   ──────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad-h);
}

.section       { padding: var(--pad-section) 0; }
.section--dark  { background: var(--color-navy); }
.section--ivory { background: var(--color-ivory); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Section intro block */
.section-intro {
  max-width: 560px;
  margin-bottom: 60px;
}

.section-intro__text {
  margin-top: 20px;
  font-size: 16px;
  color: var(--color-muted);
  line-height: 1.7;
}

.section-intro--center {
  max-width: 620px;
  margin: 0 auto 72px;
  text-align: center;
}

/* ────────────────────────────────────────────────────────────
   5. BUTTONS
   ──────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 15px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--color-navy);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #162240;
  border-color: #162240;
}

/* Inverted — on dark backgrounds */
.btn--inv {
  background: var(--color-white);
  color: var(--color-navy);
  border-color: var(--color-white);
}

.btn--inv:hover {
  background: var(--color-ivory);
  border-color: var(--color-ivory);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: rgba(245, 240, 232, 0.65);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 15px 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 240, 232, 0.25);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  color: var(--color-ivory);
  border-color: rgba(245, 240, 232, 0.50);
  background: rgba(255,255,255,0.04);
}

.btn--nav { padding: 10px 20px; font-size: 11px; }

/* ────────────────────────────────────────────────────────────
   6. CARDS
   ──────────────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 2px solid transparent;
  border-radius: var(--radius);
  padding: 36px 32px;
  transition: border-top-color 0.25s ease, transform 0.2s ease;
}

.card:hover {
  border-top-color: var(--color-navy);
  transform: translateY(-3px);
}

/* ────────────────────────────────────────────────────────────
   7. FORM
   ──────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 15px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(107, 114, 128, 0.45);
}

.form-group input:focus,
.form-group textarea:focus  { border-color: var(--color-navy); }
.form-group.is-error input,
.form-group.is-error textarea { border-color: #B91C1C; }

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-message {
  font-size: 14px;
  padding: 13px 16px;
  border-radius: var(--radius);
  line-height: 1.5;
}

.form-success {
  background: rgba(16,93,45,0.07);
  border: 1px solid rgba(16,93,45,0.18);
  color: #0D5A28;
}

.form-error-msg {
  background: rgba(185,28,28,0.06);
  border: 1px solid rgba(185,28,28,0.18);
  color: #991B1B;
}

:focus-visible { outline: 2px solid var(--color-navy); outline-offset: 3px; }

/* ────────────────────────────────────────────────────────────
   8. NAVBAR
   ──────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--color-navy);
  border-bottom: 1px solid rgba(245,240,232,0.06);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.navbar.nav-scrolled {
  box-shadow: 0 4px 40px rgba(10,22,40,0.40);
  border-bottom-color: rgba(245,240,232,0.11);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.navbar__logo img {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.navbar__links a {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.50);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}

.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(245,240,232,0.45);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.navbar__links a:hover,
.navbar__links a.is-active { color: var(--color-ivory); }

.navbar__links a:hover::after,
.navbar__links a.is-active::after { transform: scaleX(1); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  padding: 2px;
}

.hamburger span {
  display: block;
  height: 1.5px;
  background: rgba(245,240,232,0.65);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.mobile-menu {
  background: var(--color-navy);
  border-top: 1px solid rgba(245,240,232,0.08);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-menu a {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.60);
  transition: color 0.2s ease;
}

.mobile-menu a:hover { color: var(--color-ivory); }
.mobile-menu .btn--inv { align-self: flex-start; margin-top: 8px; }

/* ────────────────────────────────────────────────────────────
   9. HERO
   ──────────────────────────────────────────────────────────── */
#hero {
  background: var(--color-navy);
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hero__content {
  text-align: center;
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 0 100px;
  animation: fadeUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__h1 {
  color: var(--color-ivory);
  margin-bottom: 28px;
  line-height: 1.06;
}

.hero__h1 em { color: var(--color-white); }

.hero__sub {
  font-size: 17px;
  line-height: 1.75;
  color: rgba(245,240,232,0.58);
  max-width: 580px;
  margin: 0 auto 44px;
}

.hero__ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ────────────────────────────────────────────────────────────
   10. SERVICES
   ──────────────────────────────────────────────────────────── */
#services { background: var(--color-bg); }

.service-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: rgba(10,22,40,0.55);
}

.service-card h3 { color: var(--color-navy); line-height: 1.2; }

.service-card p {
  font-size: 14.5px;
  color: var(--color-muted);
  line-height: 1.75;
  flex: 1;
}

.card__link {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-navy);
  opacity: 0.40;
  margin-top: 4px;
  transition: opacity 0.2s ease;
}

.card__link:hover { opacity: 0.85; }

/* ────────────────────────────────────────────────────────────
   11. AVANTAGES — Pourquoi ArcaneFlow
   ──────────────────────────────────────────────────────────── */
#avantages .section-label { color: rgba(245,240,232,0.35); }

#avantages h2 {
  color: var(--color-ivory);
}

#avantages h2 em { color: var(--color-white); }

.avantages__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.avantage-item {
  padding: 0 48px 0 0;
  margin-right: 48px;
  border-right: 1px solid var(--color-border-inv);
}

.avantage-item:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.avantage-item__icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(245,240,232,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245,240,232,0.45);
  margin-bottom: 24px;
}

.avantage-item__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-ivory);
  margin-bottom: 14px;
  line-height: 1.2;
}

.avantage-item__desc {
  font-size: 14px;
  color: rgba(245,240,232,0.46);
  line-height: 1.75;
}

/* ────────────────────────────────────────────────────────────
   12. FAQ — accordion
   ──────────────────────────────────────────────────────────── */
#faq { background: var(--color-ivory); }

.faq__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}

.faq__header { position: sticky; top: calc(var(--nav-h) + 32px); }

.faq__header h2 { margin-bottom: 0; }

.faq__header-sub {
  margin-top: 20px;
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.65;
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--color-border);
}

/* FAQ item */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 22px 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-navy);
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-item__trigger:hover { color: rgba(10,22,40,0.65); }

.faq-item__arrow {
  flex-shrink: 0;
  color: var(--color-muted);
  transition: transform 0.25s ease;
}

.faq-item.is-open .faq-item__arrow {
  transform: rotate(180deg);
}

.faq-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.faq-item.is-open .faq-item__body {
  grid-template-rows: 1fr;
}

.faq-item__body > p {
  overflow: hidden;
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.75;
  padding-bottom: 24px;
  padding-right: 40px;
}

/* ────────────────────────────────────────────────────────────
   13. CONTACT
   ──────────────────────────────────────────────────────────── */
#contact { background: var(--color-bg); }

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 88px;
  align-items: start;
}

.contact__text h2 { margin-bottom: 0; }

.contact__text .body-lg { margin-top: 20px; }

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 40px;
}

.contact__info a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--color-navy);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.contact__info a:hover { opacity: 1; }

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ────────────────────────────────────────────────────────────
   14. FOOTER
   ──────────────────────────────────────────────────────────── */
#footer {
  background: var(--color-navy);
  padding: 72px 0;
  border-top: 1px solid rgba(245,240,232,0.06);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.footer__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: 0.80;
}

.footer__tagline {
  font-family: var(--font-label);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.24);
  margin-top: 14px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
}

.footer__links a {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: rgba(245,240,232,0.32);
  transition: color 0.2s ease;
}

.footer__links a:hover { color: rgba(245,240,232,0.65); }

.footer__copy {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: rgba(245,240,232,0.18);
  letter-spacing: 0.02em;
}

/* ────────────────────────────────────────────────────────────
   15. RESPONSIVE — ≤ 1024px
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --pad-h: 48px; }

  h1 { font-size: 54px; }
  h2 { font-size: 38px; }

  .faq__inner {
    grid-template-columns: 220px 1fr;
    gap: 56px;
  }

  .avantage-item {
    padding: 0 32px 0 0;
    margin-right: 32px;
  }
}

/* ────────────────────────────────────────────────────────────
   16. RESPONSIVE — ≤ 900px
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .faq__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .faq__header { position: static; }
}

/* ────────────────────────────────────────────────────────────
   17. RESPONSIVE — ≤ 768px
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --pad-h: 24px;
    --pad-section: 80px;
  }

  h1 { font-size: 38px; }
  h2 { font-size: 30px; }

  /* Navbar */
  .navbar__links, .btn--nav { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero__content { padding: 60px 0 80px; }
  .hero__sub { font-size: 15px; }

  /* Services */
  .cards-grid { grid-template-columns: 1fr; }
  .section-intro { margin-bottom: 40px; }

  /* Avantages */
  .avantages__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .avantage-item {
    border-right: none;
    border-bottom: 1px solid var(--color-border-inv);
    padding: 0 0 40px 0;
    margin-right: 0;
  }

  .avantage-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Contact */
  .contact__inner {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  /* FAQ */
  .faq-item__trigger { font-size: 15px; }

  /* Footer */
  .footer__links { gap: 8px 20px; }
}
