/* Studio Web Visible — site styles. Load after tokens.css. Every value comes from a token.
   Components follow the Studio Design system (class names sd-*). Page layouts are written inline in the HTML
   with the same tokens; this file holds what inline styles can't do: fonts, states, motion and breakpoints. */

/* ---------- Fonts (self-hosted, latin subset: French accents, « », ’ and non-breaking spaces included) ---------- */
@font-face { font-family: Poppins; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-style: normal; font-weight: 300 900; font-display: swap; src: url(/assets/fonts/figtree-latin-wght-normal.woff2) format("woff2"); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--color-link); text-underline-offset: 0.15em; }
a:hover { color: var(--color-action-hover); }
:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
main:focus { outline: none; }
.sd-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -120px; z-index: 50; padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--brand-navy); color: var(--brand-white); font-family: var(--font-display); font-size: 16px; font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 16px; color: var(--brand-white); outline: 2px solid var(--brand-turquoise); outline-offset: 2px; }

/* Desktop and phone versions of the same block: one shows at a time */
.v-desk { display: contents; }
.v-mob { display: none; }
@media (max-width: 640px) {
  .v-desk { display: none; }
  .v-mob { display: contents; }
}

/* ---------- Button ---------- */
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-6);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.25;
  text-decoration: none; text-align: center; text-wrap: balance; cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 100ms ease-out;
}
.sd-btn--sm { min-height: var(--touch-target); padding: 0 var(--space-4); }
.sd-btn--block { display: flex; width: 100%; }
.sd-btn--primary { background: var(--color-action); color: var(--color-on-action); }
.sd-btn--primary:hover { background: var(--color-action-hover); color: var(--color-on-action); }
.sd-btn--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.sd-btn--secondary:hover { background: var(--color-surface); border-color: var(--color-text); color: var(--color-text); }
.sd-btn--quiet {
  background: transparent; color: var(--color-link); padding: 0 var(--space-2); text-align: left;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em;
}
.sd-btn--quiet:hover { text-decoration-thickness: 2px; }
.sd-btn:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
.sd-btn:active { transform: translateY(1px); }
.sd-btn[aria-disabled="true"], .sd-btn:disabled {
  background: var(--color-surface); color: var(--color-text-muted); border-color: var(--color-border); cursor: not-allowed; transform: none;
}
.sd-btn[aria-busy="true"] { cursor: progress; }
.sd-btn__spinner {
  width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: sd-spin 800ms linear infinite;
}
@keyframes sd-spin { to { transform: rotate(360deg); } }
.cta-arrow { flex: none; display: inline-block; vertical-align: -0.2em; margin-left: 2px; }

/* ---------- Text field ---------- */
.sd-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.sd-field__label { font-family: var(--font-text); font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--color-text); }
.sd-field__req { font-weight: 400; color: var(--color-text-muted); }
.sd-field__hint { margin: 0; font-size: 16px; line-height: 1.55; color: var(--color-text-muted); }
.sd-field__control {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  font-family: var(--font-text); font-size: 18px; line-height: 1.4; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
textarea.sd-field__control { min-height: 144px; resize: vertical; line-height: 1.55; }
.sd-field__control:hover { border-color: var(--color-text); }
.sd-field__control:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
.sd-field__control[aria-invalid="true"] { border-color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.sd-field__error, .field-error {
  display: flex; gap: var(--space-2); align-items: flex-start; margin: 0;
  font-size: 16px; line-height: 1.45; font-weight: 600; color: var(--color-error);
}
.sd-field__error:empty { display: none; }
.sd-field__error svg, .field-error svg { flex: none; margin-top: 2px; }

/* Project type choices (radio buttons styled as chips) */
.choice {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg);
  font-family: var(--font-text); font-size: 16px; line-height: 1.3; color: var(--color-text); cursor: pointer;
}
.choice input { margin: 0; width: 18px; height: 18px; flex: none; accent-color: var(--color-action); }
.choice:hover { border-color: var(--color-text); }
.choice:has(input:checked) { border-color: var(--color-action); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-action); }
.choice:has(input:focus-visible) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
.choice input:focus-visible { outline: none; }

/* The form sends only with JavaScript; reCAPTCHA's notice is written under the form instead of its badge */
html:not(.js) .form button[type="submit"] { display: none; }
.grecaptcha-badge { visibility: hidden; }

/* ---------- Language switch ---------- */
.sd-lang { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); align-items: center; }
.sd-lang__link {
  display: inline-flex; align-items: center; min-height: var(--touch-target); padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.2;
  color: var(--color-text); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.3em;
  transition: text-decoration-color 150ms ease-out, background-color 150ms ease-out;
}
.sd-lang__link:hover { text-decoration-color: currentColor; color: var(--color-text); }
.sd-lang__link[aria-current="true"] {
  background: var(--color-surface-raised); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px;
}

/* ---------- Site header ---------- */
.sd-header { container-type: inline-size; container-name: sd-header; position: relative; z-index: 20; background: var(--color-bg); border-bottom: 1px solid var(--color-border); }
.sd-header__bar {
  display: flex; align-items: center; gap: var(--space-6);
  max-width: var(--container-max); margin: 0 auto; min-height: var(--header-height); padding: 0 var(--space-6);
}
.sd-header__brand {
  display: inline-flex; align-items: center; gap: var(--space-2); flex: none; min-height: var(--touch-target);
  color: var(--color-text); text-decoration: none;
  font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2;
}
.sd-header__brand:hover { color: var(--color-text); }
.sd-header__brand img { display: block; height: 40px; width: auto; }
.sd-header__panel { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: var(--space-6); min-width: 0; }
.sd-header__list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.sd-header__link {
  display: inline-flex; align-items: center; min-height: var(--touch-target); padding: 0 var(--space-3);
  font-family: var(--font-display); font-size: 16px; font-weight: 500; line-height: 1.2;
  color: var(--color-text); text-decoration: underline; text-decoration-color: transparent;
  text-decoration-thickness: 2px; text-underline-offset: 0.45em;
  transition: text-decoration-color 150ms ease-out;
}
.sd-header__link:hover { text-decoration-color: var(--color-border-strong); color: var(--color-text); }
.sd-header__link[aria-current="page"] { font-weight: 600; text-decoration-color: var(--color-accent); }
.sd-header .sd-btn, .sd-header__link { white-space: nowrap; }
.sd-header__end { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.sd-header__toggle {
  display: none; margin-left: auto; align-items: center; gap: var(--space-2);
  min-height: var(--touch-target); padding: 0 var(--space-4);
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: pointer;
}
.sd-header__bars { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.sd-header__bars span { display: block; height: 2px; background: currentColor; border-radius: 1px; transition: transform 200ms ease-out, opacity 200ms ease-out; }
.sd-header__toggle[aria-expanded="true"] .sd-header__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sd-header__toggle[aria-expanded="true"] .sd-header__bars span:nth-child(2) { opacity: 0; }
.sd-header__toggle[aria-expanded="true"] .sd-header__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@container sd-header (max-width: 1259px) {
  .sd-header__bar { padding: 0 var(--space-4); min-height: 64px; }
  .js .sd-header__toggle { display: inline-flex; }
  .js .sd-header__panel {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    flex-direction: column; align-items: stretch; gap: var(--space-6);
    padding: var(--space-4) var(--space-4) var(--space-6);
    background: var(--color-surface-raised); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-2);
  }
  .js .sd-header__panel[data-open="true"] { display: flex; }
  .js .sd-header__list { flex-direction: column; }
  .js .sd-header__link { display: flex; font-size: 18px; }
  .js .sd-header__end { flex-direction: column; align-items: stretch; }
  .js .sd-header__end .sd-btn { width: 100%; }
  /* Without JavaScript the menu stays open, under the name */
  html:not(.js) .sd-header__bar { flex-wrap: wrap; padding-block: var(--space-2); }
  html:not(.js) .sd-header__panel { flex-wrap: wrap; flex-basis: 100%; }
  html:not(.js) .sd-header__list { flex-wrap: wrap; }
}
@container sd-header (max-width: 479px) {
  .sd-header__bar { gap: var(--space-4); }
  .sd-header__brand { font-size: 16px; }
  .sd-header__brand img { height: 32px; }
  .sd-header__toggle { padding: 0; width: var(--touch-target); justify-content: center; }
  .sd-header__toggle-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Card ---------- */
.sd-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); transition: border-color 150ms ease-out;
}
.sd-card__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--color-surface-raised); }
.sd-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); flex: 1; }
.sd-card__eyebrow {
  margin: 0; font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: 1.4;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--color-accent);
}
.sd-card__title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--color-text); text-wrap: balance; }
.sd-card__link { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.sd-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sd-card__link:focus-visible { outline: none; }
.sd-card:has(.sd-card__link:hover) { border-color: var(--color-border-strong); }
.sd-card:has(.sd-card__link:hover) .sd-card__link { text-decoration-color: var(--color-accent); color: inherit; }
.sd-card:has(.sd-card__link:focus-visible) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
.sd-card__text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--color-text-muted); text-wrap: pretty; }
.sd-card__footer { margin-top: auto; padding-top: var(--space-2); font-size: 16px; color: var(--color-text); }

/* ---------- Notice ---------- */
.sd-notice {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4);
  background: var(--color-surface-raised); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
}
.sd-notice[hidden] { display: none; }
.sd-notice__icon { flex: none; display: inline-flex; margin-top: 2px; }
.sd-notice--info .sd-notice__icon { color: var(--color-accent); }
.sd-notice--success { border-color: var(--color-success); }
.sd-notice--success .sd-notice__icon { color: var(--color-success); }
.sd-notice--error { border-color: var(--color-error); }
.sd-notice--error .sd-notice__icon { color: var(--color-error); }
.sd-notice__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.sd-notice__title { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.4; }
.sd-notice__text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--color-text-muted); }

/* ---------- Questions (details / summary) ---------- */
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  min-height: var(--touch-target); padding: 20px 0;
  font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--color-text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(225deg); }
.faq summary:hover { color: var(--color-link); }
.faq summary:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: no-preference) { .faq summary::after { transition: transform 150ms ease-out; } }

/* ---------- Case studies ---------- */
.cmp-range { width: 100%; height: 44px; margin: 0; accent-color: var(--color-action); cursor: ew-resize; }
.cmp-range:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }
.seg {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 6px; background: transparent; color: var(--color-text);
  font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.seg:hover { background: var(--color-surface); }
.seg[aria-pressed="true"] { background: var(--color-action); color: var(--color-on-action); }
.shot { opacity: 1; transition: opacity 300ms ease-out; }
.shot-off { opacity: 0; }

/* ---------- About: on phones the photo sits between the title and the text ---------- */
@media (max-width: 700px) {
  .about-intro { flex-direction: column; align-items: stretch !important; gap: 24px !important; }
  .about-text { display: contents; }
  .about-intro .about-photo { order: 1; flex: none !important; max-width: none !important; }
  .about-intro .about-after { order: 2; }
  .about-photo img { aspect-ratio: 4 / 3 !important; object-position: 25% 0 !important; }
  .portrait-img { aspect-ratio: 1 / 1 !important; }
}

/* ---------- Motion (the six micro-interactions and the photo fade-in) ---------- */
@keyframes v-in { from { opacity: 0; transform: translate(-10px, 14px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes line-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: no-preference) {
  .v-in { animation: v-in 600ms cubic-bezier(.2, .7, .2, 1) both; }
  .rise-in { animation: rise-in 500ms cubic-bezier(.2, .7, .2, 1) both; }
  .reveal-pending { opacity: 0; transform: translateY(8px); }
  .reveal-in { opacity: 1; transform: none; transition: opacity 450ms ease-out, transform 450ms ease-out; }
  @supports (animation-timeline: view()) {
    .step-line { animation: line-draw linear both; animation-timeline: view(); animation-range: cover 4% cover 20%; }
    .steps > li:nth-child(2) .step-line { animation-range: cover 8% cover 24%; }
    .steps > li:nth-child(3) .step-line { animation-range: cover 12% cover 28%; }
    .steps > li:nth-child(4) .step-line { animation-range: cover 16% cover 32%; }
  }
  .cta-arrow { transition: transform 150ms ease-out; }
  .proj-after, .proj-before { transition: transform 200ms ease-out; }
  .sd-btn:focus-visible .cta-arrow { transform: translateX(3px); }
  .proj:focus-within .proj-after { transform: translateY(-4px); }
  .proj:focus-within .before-l { transform: translateX(-8px); }
  .proj:focus-within .before-r { transform: translateX(8px); }
  @media (hover: hover) and (pointer: fine) {
    .sd-btn:hover .cta-arrow { transform: translateX(3px); }
    .proj:hover .proj-after { transform: translateY(-4px); }
    .proj:hover .before-l { transform: translateX(-8px); }
    .proj:hover .before-r { transform: translateX(8px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .sd-btn, .sd-field__control, .sd-lang__link, .sd-header__link, .sd-card, .sd-header__bars span, .seg, .shot { transition: none; }
  .sd-btn:active { transform: none; }
  .sd-btn__spinner { animation: none; border-right-color: currentColor; border-bottom-color: transparent; }
}

/* ---------- Print ---------- */
@media print {
  .sd-header, footer, .skip { display: none; }
  body { font-size: 12pt; }
}

/* ---------- Services page: on phones the example or note follows the details ---------- */
@media (max-width: 640px) {
  .pillar { flex-direction: column; align-items: stretch !important; gap: 16px !important; }
  .pillar > * { flex: none !important; }
  .pillar-head { display: contents !important; }
  .pillar-body { margin-top: 16px; }
  .pillar-aside { order: 1; margin-top: 24px !important; }
}
