/* ========== Reset et base ========== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3, h4, p, figure, dl, dd, ol, ul { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* ========== Lien d'évitement ========== */
.skip {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: var(--r-xs);
  background: var(--text);
  color: var(--bg) !important;
  font-weight: 700;
}
.skip:focus { top: 16px; }

/* ========== Typographie ========== */
.hl {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.stroke { color: var(--muted); }

.kicker {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label {
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 66px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.h2--md { font-size: clamp(36px, 4.1vw, 59px); }

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

/* ========== Conteneurs et sections ========== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-alt + .section-alt { border-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.section-head__title {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.section-head__intro {
  margin: 0;
  max-width: 420px;
  color: var(--text-2);
}

/* Colonne titre à gauche + contenu à droite */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
}
.split__aside {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.split__aside p { color: var(--text-2); max-width: 340px; }
.split__main {
  flex: 999 1 640px;
  min-width: 0;
}

/* ========== Boutons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn svg { flex: 0 0 auto; }
.btn--lg { padding: 18px 30px; min-height: 56px; }
.btn--md { padding: 14px 26px; min-height: 52px; gap: 10px; }
.btn--sm { padding: 12px 22px; min-height: 44px; font-size: 14px; }
.btn--xs { padding: 10px 18px; min-height: 44px; font-size: 14px; gap: 8px; }

.btn-main {
  background: var(--accent);
  color: var(--on-accent) !important;
  font-weight: 700;
  border: 0;
}
a.btn-main:hover,
button.btn-main:hover { background: var(--text); }

.btn-ghost {
  border: 1px solid var(--line-7);
  background: transparent;
}
a.btn-ghost:hover,
button.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.link-arrow {
  align-self: flex-start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

/* ========== Chips ========== */
.chips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li,
.chip-tag {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-5);
  font-size: 13px;
}

.pill {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 12px;
  color: var(--text-3);
}

/* ========== Cartes ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  transition: border-color var(--t-base), background var(--t-base);
}
.card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.card .arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.card:hover .arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.value { transition: background var(--t-base); }
.value:hover { background: var(--surface); }
.vnum {
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1;
  color: var(--muted);
  transition: color var(--t-fast);
}
.value:hover .vnum { color: var(--accent); }

.serif-num {
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1;
  color: var(--accent);
}

/* ========== Fond quadrillé ========== */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(238, 240, 246, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 240, 246, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 30% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 65% at 30% 40%, #000 25%, transparent 75%);
  pointer-events: none;
}

/* ========== Fausse fenêtre de navigateur ========== */
.browser {
  position: relative;
  height: 100%;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line-5);
  border-bottom: 0;
  box-shadow: 0 -16px 60px rgba(0, 0, 0, .4);
  display: flex;
  flex-direction: column;
}
.browser__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-hover);
}
.browser__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-8);
}
.browser__url {
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.browser__view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.browser__view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
}

/* ========== Projets : survol ========== */
.proj { --scroll-t: 7s; }
.proj .browser,
.proj .phone { transition: transform .6s var(--ease); }
.proj:hover .browser { transform: translateY(-8px); }
.proj:hover .phone { transform: translateY(-14px); }
.proj .scrollshot { transition: object-position var(--scroll-t) var(--ease-scroll); }
.proj:hover .scrollshot,
.proj:focus-within .scrollshot { object-position: 50% 100% !important; }
.proj .title-line { transition: color var(--t-fast); }
.proj:hover .title-line { color: var(--accent); }

/* ========== FAQ ========== */
.faq summary { list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast); }
.faq[open] .plus {
  transform: rotate(45deg);
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ========== Animations ========== */
@keyframes jt-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes jt-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 168, 145, .55); }
  70% { box-shadow: 0 0 0 10px rgba(0, 168, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 168, 145, 0); }
}
@keyframes jt-pulse-ok {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@keyframes jt-marquee { to { transform: translateX(-50%); } }
@keyframes jt-step { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.rise { animation: jt-rise .9s var(--ease) both; }
.d1 { animation-delay: .05s; }
.d2 { animation-delay: .15s; }
.d3 { animation-delay: .25s; }
.d4 { animation-delay: .35s; }
.d5 { animation-delay: .45s; }
.pulse { animation: jt-pulse 2.4s infinite; }
.pulse-ok { animation: jt-pulse-ok 2.4s infinite; }
.work { animation: jt-step 2.4s ease-in-out infinite; }

/* Animations coupées : préférence système ou réglage du site */
body.still *,
body.still *::before,
body.still *::after { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ========== Placeholders légaux ========== */
.ph {
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px dashed var(--warn);
  color: var(--warn);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ========== Utilitaires ========== */
.jt-email { white-space: nowrap; }

@media (max-width: 860px) {
  .hide-sm { display: none !important; }
}
