/* =========================================================
   Crinteck — Base, composants et layout global
   ========================================================= */

/* ---------- Utilitaires ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(48px, 6vw, 72px);
}

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

.section--soft {
  background: var(--paper-2);
}

.section--dark {
  background: var(--ink);
  color: var(--white);
}

.section--dark .section-head__text,
.section--dark .muted {
  color: rgba(255, 255, 255, 0.7);
}

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

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* ---------- Icônes ---------- */

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.2em;
}

/* ---------- Typographie ---------- */

.display {
  font-size: clamp(2.25rem, 5.1vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h1,
.h1 {
  font-size: clamp(2.05rem, 4.4vw, 3.6rem);
}

h2,
.h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
}

h3,
.h3 {
  font-size: clamp(1.18rem, 1.6vw, 1.42rem);
  line-height: 1.22;
}

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- Boutons (avec feedback tactile :active scale(0.97)) ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--white);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--btn-border);
  border-radius: var(--pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.btn .icon {
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  --btn-bg: var(--blue);
  --btn-fg: var(--white);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.22);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}

.section--dark .btn--outline,
.cta-band .btn--outline {
  --btn-fg: var(--white);
  --btn-border: rgba(255, 255, 255, 0.24);
}

.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  padding-inline: 0;
}

.btn--sm {
  min-height: 42px;
  padding-inline: 18px;
  font-size: 0.875rem;
}

.btn--lg {
  min-height: 54px;
  padding-inline: 28px;
  font-size: 0.98rem;
}

.btn--block {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover .icon {
    transform: translateX(3px);
  }

  .btn--primary:hover {
    --btn-bg: var(--blue-dark);
    box-shadow: 0 10px 26px rgba(29, 78, 216, 0.3);
  }

  .btn--outline:hover {
    --btn-border: var(--ink);
    background: rgba(13, 21, 38, 0.03);
  }

  .section--dark .btn--outline:hover,
  .cta-band .btn--outline:hover {
    --btn-border: var(--white);
    background: rgba(255, 255, 255, 0.06);
  }

  .btn--ghost:hover {
    color: var(--blue);
  }
}

/* ---------- Badges & tags ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.badge--blue {
  background: var(--blue-soft);
  border-color: transparent;
  color: var(--blue-dark);
}

.section--dark .badge,
.page-hero .badge {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-dark);
  color: rgba(255, 255, 255, 0.82);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--pill);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-chips li {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: border-color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tech-chips li:hover {
    border-color: var(--line-strong);
  }
}

/* ---------- En-tête de section ---------- */

.section-head {
  max-width: 680px;
  margin-bottom: clamp(32px, 4.5vw, 52px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head__title {
  margin-bottom: 14px;
}

.section-head__text {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 58ch;
}

.section-head--center .section-head__text {
  margin-inline: auto;
}

.section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  max-width: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(13, 21, 38, 0.05);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.brand img {
  width: auto;
  height: 44px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover {
    color: var(--ink);
    background: rgba(13, 21, 38, 0.04);
  }
}

.nav__link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}

.nav__cta {
  margin-left: 10px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  transition: transform var(--dur-press) var(--ease-out);
}

.nav-toggle:active {
  transform: scale(0.95);
}

.nav-toggle__close {
  display: none;
}

body.nav-open .nav-toggle__open {
  display: none;
}

body.nav-open .nav-toggle__close {
  display: block;
}

.nav-backdrop {
  display: none;
}

/* ---------- Hero de page interne ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(52px, 7.5vw, 96px);
  background: var(--ink);
  color: var(--white);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: -40% 35% auto auto;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.36) 0%, rgba(29, 78, 216, 0) 68%);
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.page-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.page-hero .btn--outline {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.24);
}

@media (hover: hover) and (pointer: fine) {
  .page-hero .btn--outline:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.06);
  }
}

.page-hero__title {
  margin-bottom: 16px;
}

.page-hero__text {
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  color: rgba(255, 255, 255, 0.72);
  max-width: 58ch;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

@media (hover: hover) and (pointer: fine) {
  .breadcrumb a:hover {
    color: var(--white);
  }
}

.breadcrumb span {
  opacity: 0.6;
}

/* ---------- Formulaires ---------- */

.field {
  display: grid;
  gap: 7px;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field__label span {
  color: var(--blue);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-light);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select {
  border-color: var(--danger);
}

.field__error {
  display: none;
  font-size: 0.78rem;
  color: var(--danger);
}

.field.has-error .field__error {
  display: block;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex: none;
}

.checkbox a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-status {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.form-status.is-success {
  display: block;
  background: var(--emerald-soft);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.form-status.is-error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Accordéon ---------- */

.accordion {
  display: grid;
  gap: 10px;
}

.accordion__item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.accordion__item.is-open {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 20px 22px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.accordion__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.accordion__item.is-open .accordion__icon {
  transform: rotate(180deg);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease-out);
}

.accordion__panel > div {
  overflow: hidden;
}

.accordion__panel p {
  padding: 0 22px 22px;
  font-size: 0.93rem;
  color: var(--muted);
  max-width: 68ch;
}

.accordion__item.is-open .accordion__panel {
  grid-template-rows: 1fr;
}

/* ---------- Stats ---------- */

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

.stat {
  padding: clamp(22px, 3vw, 34px);
  background: var(--white);
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat__label {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---------- CTA ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 6vw, 68px);
  border-radius: var(--radius-xl);
  background: var(--ink);
  color: var(--white);
}

.cta-band::before {
  content: '';
  position: absolute;
  right: -15%;
  bottom: -70%;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.45) 0%, rgba(29, 78, 216, 0) 68%);
  pointer-events: none;
}

.cta-band__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.cta-band h2 {
  max-width: 15ch;
}

.cta-band p {
  margin-top: 18px;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.72);
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: none;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid var(--line-dark);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr 1fr 1.2fr;
  gap: clamp(28px, 4vw, 56px);
  padding-block: clamp(48px, 6vw, 76px) clamp(36px, 4vw, 52px);
}

.footer__logo img {
  width: auto;
  height: 52px;
  margin-bottom: 18px;
}

.footer__brand p {
  max-width: 34ch;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.64);
}

.footer__socials {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.footer__socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.75);
  transition: background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

.footer__socials a:active {
  transform: scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
  .footer__socials a:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
  }
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer__col h2 {
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.footer__col a,
.footer__col p {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.74);
  transition: color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .footer__col a:hover {
    color: var(--white);
  }
}

.footer__contact .icon {
  margin-top: 3px;
  color: var(--blue-bright);
}

.footer__hours {
  margin-top: 4px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 22px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.62);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

@media (hover: hover) and (pointer: fine) {
  .footer__legal a:hover {
    color: var(--white);
  }
}

/* ---------- Retour en haut ---------- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(8px);
  transition: opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out),
    visibility var(--dur) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.to-top:active {
  transform: scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
  .to-top:hover {
    background: var(--blue);
  }
}

/* ---------- Responsive global ---------- */

@media (max-width: 760px) {
  .section-head--split {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 980px) {
  :root {
    --header-h: 68px;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) auto 0 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 24px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-top: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--dur) var(--ease-drawer),
      transform var(--dur) var(--ease-drawer),
      visibility var(--dur) var(--ease-drawer);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.nav-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__link {
    padding: 15px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 1.38rem;
    font-weight: 600;
    color: var(--ink);
  }

  .nav__link.is-active::after {
    display: none;
  }

  .nav__cta {
    margin: 22px 0 0;
    align-self: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  body.nav-open {
    overflow: hidden;
  }

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

  .footer__brand {
    grid-column: 1 / -1;
  }

  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .brand img {
    height: 38px;
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer__brand {
    grid-column: auto;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .to-top {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .cta-band {
    border-radius: var(--radius-lg);
  }
}
