/* ==========================================================================
   Maxime Cortes — Développeur mobile freelance
   Design system : tokens, reset, layout, navigation, pied de page.
   Aucune dépendance externe, aucune police distante.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --bg: #0f0f0f;
  --surface: #161616;
  --surface-hi: #1e1e1e;
  --border: #272727;
  --text: #fafafa;
  --muted: #a0a0a0;
  --muted-dim: #6f6f6f;
  --accent: #f97316;
  --accent-hi: #fb8c3c;

  --maxw: 1080px;
  --pad: 20px;
  --radius: 12px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --step-eyebrow: 0.72rem;
  --step-body: 1rem;
  --step-lead: clamp(1.02rem, 0.95rem + 0.35vw, 1.18rem);
  --step-h2: clamp(1.6rem, 1.25rem + 1.5vw, 2.3rem);
  --step-h1: clamp(2.1rem, 1.4rem + 3.4vw, 3.6rem);
}

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

html {
  scroll-behavior: smooth;
  /* compense la barre de nav collante lors du saut vers une ancre */
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--border);
}

.eyebrow {
  color: var(--accent);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: var(--step-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.lead {
  color: var(--muted);
  font-size: var(--step-lead);
  max-width: 56ch;
}

/* --- Accessibilité ------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #0f0f0f;
  padding: 10px 16px;
  font-weight: 600;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.97rem;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease;
}

.btn--primary {
  background: var(--accent);
  color: #0f0f0f;
}

.btn--primary:hover {
  background: var(--accent-hi);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--muted-dim);
  background: var(--surface);
}

/* --- Navigation --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.nav__brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.nav__brand span {
  color: var(--accent);
}

.nav__links {
  display: none;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Bascule de langue */
.lang {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.lang button {
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-dim);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.lang button:hover {
  color: var(--text);
}

.lang button[aria-pressed="true"] {
  background: var(--surface-hi);
  color: var(--text);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  padding-block: clamp(64px, 11vw, 132px);
  /* halo orange très discret, purement CSS (aucune image) */
  background:
    radial-gradient(
      70ch 40ch at 12% -10%,
      rgba(249, 115, 22, 0.09),
      transparent 70%
    ),
    var(--bg);
}

.hero__title {
  font-size: var(--step-h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 22px;
}

/* Le hero porte une phrase de positionnement entière, pas trois mots :
   on descend l'échelle et on borne la mesure pour garder des lignes lisibles. */
.hero__title--statement {
  font-size: clamp(1.62rem, 1.1rem + 2.1vw, 2.55rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  max-width: 26ch;
}

.hero__lead {
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.hero__actions .btn {
  flex: 1 1 auto;
}

@media (min-width: 560px) {
  .hero__actions .btn {
    flex: 0 0 auto;
  }
}

/* Bandeau de faits sous le hero : trois chiffres vérifiables */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.facts strong {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.facts span {
  font-size: 0.8rem;
  color: var(--muted-dim);
}

/* --- ChallengeTies ------------------------------------------------------ */
.section-title__sub {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.62em;
  letter-spacing: 0;
}

.ct__lead {
  margin-top: 18px;
}

.minor-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-top: 52px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Captures : rail horizontal sur mobile, grille de 5 sur desktop.
   On sort le rail des marges du .wrap pour un défilement bord à bord. */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: 14px;
  margin-top: 36px;
  margin-inline: calc(var(--pad) * -1);
  padding-inline: var(--pad);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overscroll-behavior-x: contain;
}

.shots li {
  scroll-snap-align: center;
}

.shots img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
}

/* 940px et non 768 : à cinq colonnes, en dessous, chaque capture tomberait
   sous ~140 px de large — le rail à défilement reste plus lisible. */
@media (min-width: 940px) {
  .shots {
    grid-auto-flow: initial;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-inline: 0;
    padding-inline: 0;
    overflow-x: visible;
  }
}

.ct__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* Étiquettes de stack */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
}

/* Engineering highlights */
.highlights {
  display: grid;
  gap: 8px;
  counter-reset: none;
}

.highlights li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.highlights li:last-child {
  border-bottom: none;
}

.highlights__num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.highlights h4 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 600;
}

.highlights p {
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 62ch;
}

@media (min-width: 768px) {
  .highlights__num {
    font-size: 2.1rem;
  }

  .highlights li {
    gap: 26px;
  }
}

/* --- Cartes numérotées (section « How I work ») -------------------------- */
.offers {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.offer {
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.offer:hover {
  border-color: var(--muted-dim);
}

.offer__num {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.offer h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.offer p {
  color: var(--muted);
  font-size: 0.94rem;
}

@media (min-width: 768px) {
  .offers {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  /* Quatre cartes : deux colonnes valent mieux que trois plus une orpheline. */
  .offers--pairs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Bandeau de chiffres (ordres de grandeur) */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 20px;
}

.metrics strong {
  display: block;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metrics span {
  font-size: 0.8rem;
  color: var(--muted-dim);
}

@media (min-width: 768px) {
  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Études de cas ------------------------------------------------------ */
/* Chaque étude réutilise la liste .highlights (numéro + bloc) ; seul le
   corps change : une définition par ligne, problème → contrainte →
   décision → résultat. */
.cases h4 {
  font-size: 1.06rem;
  line-height: 1.3;
  margin-bottom: 14px;
  max-width: 46ch;
}

.case {
  display: grid;
  gap: 12px;
}

.case dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 4px;
}

.case dd {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
  max-width: 68ch;
}

/* Le libellé passe en colonne dès qu'il y a la place : la lecture devient
   verticale (on balaie les quatre étapes) au lieu d'être un pavé. */
@media (min-width: 720px) {
  .case > div {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 20px;
    align-items: baseline;
  }

  .case dt {
    margin-bottom: 0;
    padding-top: 3px;
  }
}

/* La dernière étude expose un défaut non corrigé : son libellé de clôture
   se distingue des trois autres. L'attribut data-i18n survit à la bascule
   de langue (seul le texte change), donc le sélecteur tient en EN comme en FR. */
.case dt[data-i18n="case.hole"] {
  color: var(--accent);
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-hi);
  color: var(--text);
  white-space: nowrap;
}

/* --- Projets secondaires ------------------------------------------------ */
.projects {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}

.project {
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.project__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.project h3 {
  font-size: 1.14rem;
  font-weight: 600;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.1);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Un projet non publié ne porte pas la couleur d'accent : l'étiquette
   informe, elle ne félicite pas. */
.badge--wip {
  border-color: var(--border);
  background: var(--surface-hi);
  color: var(--muted);
}

.project p {
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 62ch;
  margin-bottom: 16px;
}

/* L'état de publication n'est pas de la prose : il se lit avant le reste. */
.project__status {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 12px;
}

.tags--sm li {
  padding: 5px 11px;
  font-size: 0.78rem;
}

.project__link {
  display: inline-block;
  margin-top: 20px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}

.project__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Captures d'un projet secondaire : deux vignettes, jamais pleine largeur. */
.project__shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 340px;
  margin: 4px 0 0;
}

.project__shots img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Ligne « Également livré » : une réalisation, une ligne. */
.shipped {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.shipped strong {
  color: var(--text);
  font-weight: 600;
}

.shipped a {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.shipped a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .projects {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Un seul projet : il occupe la largeur au lieu de laisser un trou —
     et son contenu se scinde, texte à gauche, captures à droite, sinon
     la moitié droite de la carte reste vide. */
  .projects--single {
    grid-template-columns: 1fr;
  }

  .project--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 34px;
    align-items: start;
  }

  .project--split .project__shots {
    margin-top: 0;
  }
}

/* --- Contact ------------------------------------------------------------ */
.contact .section-title {
  max-width: 24ch;
}

/* Disponibilité : une ligne, sous les canaux, sans tarif ni conditions. */
.avail {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 56ch;
}

.mailbox {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  margin-top: 36px;
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mailbox:hover {
  border-color: var(--accent);
  background: var(--surface-hi);
}

.mailbox__label {
  grid-column: 1;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.mailbox__value {
  grid-column: 1;
  font-size: clamp(1.05rem, 0.85rem + 1.1vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.mailbox__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 1.5rem;
  color: var(--accent);
}

/* Indication sous l'adresse : devient un accusé de copie au clic. */
.mailbox__hint {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted-dim);
  transition: color 0.2s ease;
}

.mailbox__hint.is-copied {
  color: var(--accent);
  font-weight: 600;
}

/* Autres canaux */
.channels {
  display: grid;
  gap: 20px;
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.channels__label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 5px;
}

.channels a {
  display: inline-block;
  margin-right: 16px;
  font-weight: 500;
}

.channels a:hover {
  color: var(--accent);
}

@media (min-width: 768px) {
  .channels {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* --- Pied de page ------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  color: var(--muted-dim);
  font-size: 0.85rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* --- Animations d'entrée ------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
