/* ArtifiQ — site.css
 * Phase A: the pages keep the artboards' inline styles (the wireframe is the
 * visual spec). This file only carries what the artboards cannot: tokens, fonts,
 * the shared header behaviours (menus, mobile panel), annotations, focus states,
 * anchors, and a responsive safety net below 1280 px.
 */
@import url("fonts.css");

:root {
  --ink: #18181B;
  --ink-2: #3F3F46;
  --ink-3: #52525B;
  --line-strong: #A1A1AA;
  --line: #D4D4D8;
  --line-soft: #E4E4E7;
  --bg-2: #F4F4F5;
  --bg-1: #FAFAFA;
  --bg: #FFFFFF;
  --note-ink: #9A3F12; --note-bg: #FDF1E7; --note-line: #F3CBA9;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-pill: 999px;
  --gutter: 120px; --section-y: 64px; --section-y-lg: 96px; --header-h: 80px;
}

html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); font-family: var(--font); color: var(--ink); }
a { color: var(--ink); }
a:hover { color: var(--ink-2); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* The artboard root: 1440 px canvas → centred, fluid below */
.page { width: 100%; max-width: 1440px; margin-inline: auto; box-sizing: border-box; display: flex; flex-direction: column; background: var(--bg); font-family: var(--font); color: var(--ink); overflow-x: clip; }
.page > * { flex-shrink: 0; }
[id] { scroll-margin-top: 96px; }

/* Skip link */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* Focus */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Annotations (orange design notes): hidden unless ?annotations=1 */
.annotation { display: none; }
html[data-annotations="on"] .annotation { display: inline-flex; }
html[data-annotations="on"] .annotation--block { display: flex; }
.annotation-toggle { box-sizing: border-box; position: fixed; left: 16px; bottom: 16px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; font: 500 12px/1 var(--mono); color: var(--note-ink); background: var(--note-bg); border: 1px solid var(--note-line); border-radius: var(--r); cursor: pointer; }
html:not([data-annotations="on"]) .annotation-toggle { display: none; }

/* Header: dropdown panels */
.site-header { position: relative; z-index: 20; }
.site-header nav[aria-label] > a[aria-expanded="true"] { font-weight: 600; background: var(--bg-2); border-radius: var(--r); }
.site-header nav[aria-label] > a[aria-expanded="true"] > svg { transform: rotate(180deg); }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; box-sizing: border-box; }
.menu-panel[hidden] { display: none !important; }
form[aria-disabled="true"] :is(input, select, textarea, button)[disabled] { opacity: .5; cursor: not-allowed; }
.menu-panel--expertise { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 3fr); gap: 48px; }
.menu-panel--list { left: auto; right: auto; min-width: 280px; padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 0; background: var(--bg); border: 1px solid var(--line-soft); border-top: 0; box-shadow: 0 16px 32px rgba(24, 24, 27, 0.08); border-radius: 0 0 8px 8px; }
.menu-panel--list ul { list-style: none; margin: 0; padding: 0; }
.menu-panel--list li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink); }
.menu-panel--list li a:hover { color: var(--ink-2); }
.menu-panel--list li a[aria-current="page"] { font-weight: 600; }
.menu-item { position: relative; }
.menu-item > .menu-panel--list { top: 100%; margin-top: 18px; }

/* Mobile header controls (hidden on desktop) */
.nav-burger { display: none; }
.mobile-panel { display: none; }

/* Forms feedback */
.field-error { display: block; margin-top: 6px; font-size: 13px; color: #9A1D1D; }
.is-invalid { border-color: #9A1D1D !important; }
.form-success { box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-1); }
.form-success p { margin: 0; }
[hidden] { display: none !important; }

/* Copy button feedback / carousel motion */
@media (prefers-reduced-motion: no-preference) {
  .carousel-track { transition: transform .3s ease; }
}

/* ------------------------------------------------------------------ */
/* Responsive safety net. The artboards are desktop-only (1440). Below   */
/* 1280 px the gutters shrink and multi-column grids collapse; the       */
/* inline styles of the artboards are overridden with !important on     */
/* purpose (Phase B replaces them with classes).                        */
/* ------------------------------------------------------------------ */
@media (max-width: 1279px) {
  .site-header > header, .page > main > *, .page > footer, .site-header .menu-panel--expertise, .page > .lp-header { padding-left: 64px !important; padding-right: 64px !important; }
  .page [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page [style*="grid-template-columns: repeat(6"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .page [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .page [style*="grid-template-columns: minmax(0, 7fr) minmax(0, 5fr)"], .page [style*="grid-template-columns: minmax(0, 8fr) minmax(0, 4fr)"], .page [style*="grid-template-columns: minmax(0, 5fr) minmax(0, 7fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  .page [style*="width: 640px"] { width: 100% !important; max-width: 640px; }
  .page h1[style*="font-size: 64px"] { font-size: clamp(40px, 5vw, 64px) !important; }
  .page h1[style*="font-size: 56px"] { font-size: clamp(36px, 4.5vw, 56px) !important; }
  /* three-column article layouts (notes · body · aside) keep their side columns, the body becomes fluid */
  .page [style*="grid-template-columns: 160px 720px 240px"] { grid-template-columns: 160px minmax(0, 1fr) 240px !important; }
  .page [style*="grid-template-columns: 200px 720px 200px"] { grid-template-columns: 200px minmax(0, 1fr) 200px !important; }
  .page > main [style*="width:"][style*="px"] { max-width: 100%; }
  .page > main [style*="display: flex"]:not([style*="flex-direction: column"]) { flex-wrap: wrap; }
  /* header: tighter nav so it fits between 1024 and 1279 */
  .site-header nav[aria-label] > a, .site-header .menu-item > a { padding-left: 8px !important; padding-right: 8px !important; }
  .site-header .header-cta { padding-left: 14px !important; padding-right: 14px !important; }
  .site-header > header { gap: 12px; }
}
@media (max-width: 1023px) {
  .site-header > header, .page > main > *, .page > footer, .site-header .menu-panel--expertise, .page > .lp-header { padding-left: 40px !important; padding-right: 40px !important; }
  .page [style*="grid-template-columns: repeat(3"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page [style*="grid-template-columns: minmax(0, 4fr) minmax(0, 8fr)"], .page [style*="grid-template-columns: minmax(0, 3fr) minmax(0, 9fr)"], .page [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"], .page [style*="grid-template-columns: repeat(2, minmax(0, 1fr))"] { grid-template-columns: minmax(0, 1fr) !important; }
  .page [style*="grid-template-columns: 180px minmax(0, 1fr) 220px 24px"] { grid-template-columns: minmax(0, 1fr) 24px !important; }
  /* article layouts stack: notes, body, aside */
  .page [style*="grid-template-columns: 160px 720px 240px"], .page [style*="grid-template-columns: 200px 720px 200px"], .page [style*="grid-template-columns: 480px minmax(0, 1fr)"], .page [style*="grid-template-columns: 540px minmax(0, 1fr)"], .page [style*="grid-template-columns: minmax(0, 1fr) 480px"], .page [style*="grid-template-columns: minmax(0, 1fr) 440px"], .page [style*="grid-template-columns: minmax(0, 1fr) 360px"], .page [style*="grid-template-columns: 360px minmax(0, 1fr)"], .page [style*="grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 3fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  .page [style*="grid-template-columns: 160px 720px 240px"] > *, .page [style*="grid-template-columns: 200px 720px 200px"] > * { grid-column: 1 !important; }
  .page [style*="position: sticky"][style*="top: 24px"] { position: static !important; }
  /* flex rows wrap instead of overflowing (columns are untouched) */
  .page [style*="display: flex"]:not([style*="flex-direction: column"]) { flex-wrap: wrap; }
  .page [style*="position: sticky"][style*="height: 64px"], .page [style*="position: sticky"][style*="height: 72px"] { height: auto !important; min-height: 64px; padding-top: 12px !important; padding-bottom: 12px !important; flex-wrap: wrap; row-gap: 12px; }
  .page [style*="position: sticky"] > [style*="display: flex"] { flex-wrap: wrap; }
  .page table { display: block; overflow-x: auto; }
  /* Mobile header */
  .site-header > header { position: relative; }
  .site-header nav[aria-label="Navigation principale"], .site-header nav[aria-label="Main navigation"] { display: none !important; }
  .site-header .header-cta { display: none !important; }
  .nav-burger { display: inline-flex; box-sizing: border-box; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
  .mobile-panel { display: none; box-sizing: border-box; position: fixed; inset: 80px 0 0 0; z-index: 40; overflow-y: auto; background: var(--bg); padding: 16px 40px 32px; flex-direction: column; gap: 4px; }
  .mobile-panel.is-open { display: flex; }
  .mobile-panel details { border-bottom: 1px solid var(--line-soft); }
  .mobile-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 17px; font-weight: 500; cursor: pointer; }
  .mobile-panel summary::-webkit-details-marker { display: none; }
  .mobile-panel details[open] summary svg { transform: rotate(180deg); }
  .mobile-panel ul { list-style: none; margin: 0; padding: 0 0 12px 12px; }
  .mobile-panel li a, .mobile-panel > a { display: flex; align-items: center; min-height: 44px; font-size: 16px; text-decoration: none; color: var(--ink); }
  .mobile-panel > a { border-bottom: 1px solid var(--line-soft); min-height: 52px; font-size: 17px; font-weight: 500; }
  .mobile-panel .mobile-cta { margin-top: auto; padding-top: 24px; }
  .mobile-panel .mobile-cta a { display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 24px; background: var(--ink); color: #fff; border-radius: var(--r); font-size: 16px; font-weight: 600; text-decoration: none; }
  .mobile-panel .group-label { padding: 12px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 767px) {
  .site-header > header, .page > main > *, .page > footer, .site-header .menu-panel--expertise, .page > .lp-header { padding-left: 24px !important; padding-right: 24px !important; }
  .page [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .page [style*="grid-template-columns: 180px minmax(0, 1fr) 220px 24px"] { grid-template-columns: minmax(0, 1fr) 24px !important; row-gap: 8px !important; }
  .page [style*="grid-template-columns: 180px minmax(0, 1fr) 220px 24px"] > :first-child { grid-column: 1 / -1; }
  .page [style*="grid-template-columns: 180px minmax(0, 1fr) 220px 24px"] > :nth-child(3) { grid-column: 1 / -1; text-align: left !important; }
  .page [style*="grid-template-columns: 180px minmax(0, 1fr) 220px 24px"] > svg { grid-row: 2; grid-column: 2; }
  .page [style*="padding: 0 60px 24px 196px"] { padding: 0 0 24px 0 !important; }
  .page h1 { font-size: clamp(32px, 8vw, 48px) !important; line-height: 1.1 !important; }
  .page [style*="font-size: 32px"] { font-size: 26px !important; }
  .page [style*="font-size: 28px"] { font-size: 24px !important; }
  .page [style*="width: 360px"], .page [style*="width: 320px"], .page [style*="width: 240px"] { max-width: 100%; }
  .page > footer [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-panel { padding: 16px 24px 32px; }
  .page [style*="display: flex"]:not([style*="flex-direction: column"]) { flex-wrap: wrap; }
  .page input[type="search"], .page input[type="text"], .page input[type="email"], .page select, .page textarea { min-width: 0; max-width: 100%; }
  .page > main [style*="display: flex"] > [style*="flex-direction: column"] { flex: 1 1 100%; min-width: 0; }
  .page > main input[style*="width: 520px"], .page > main input[style*="width: 640px"] { width: 100% !important; }
  .page h1, .page h2, .page h3, .page p, .page a, .page span { overflow-wrap: anywhere; }
  .page [style*="white-space: nowrap"]:not(.annotation) { white-space: normal !important; }
  /* table-like grids (models, sub-contractors, comparisons) scroll instead of stacking */
  .page [style*="grid-template-columns: 1.2fr 1fr 1.3fr 1fr 0.8fr"], .page [style*="grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1.3fr"], .page [style*="grid-template-columns: 150px 120px minmax(0, 1fr) 110px 32px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
