/* monfort.me — feuille unique, sans framework */

:root {
  --bg:      #ffffff;
  --ink:     #0f1c1e;
  --ink-mid: #4a5a5c;
  --line:    rgba(15, 28, 30, 0.18);
  --deep:    #103c40;
  --accent:  #1e6b72;
  --ok:      #2d6a4f;
  --error:   #a4322e;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text:    "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 58ch;
  --gutter:  clamp(1.25rem, 4vw, 3.5rem);
  --shell:   60rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Masthead */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
  max-width: var(--shell); margin: 0 auto;
  padding: 1.5rem var(--gutter) 2.5rem;
}
.masthead__name { display: block; line-height: 0; }
.masthead__name img { display: block; width: 190px; max-width: 55vw; height: auto; }
.masthead__nav { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.masthead__nav a {
  color: var(--ink); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.masthead__nav a:hover { border-bottom-color: var(--accent); }

main { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }

/* Hero — le cadre du logo, porté en couleur, fente du bord bas comprise */
.hero {
  position: relative;
  padding: clamp(2.25rem, 5vw, 3.75rem) clamp(1.75rem, 4vw, 3.25rem) clamp(2.5rem, 5vw, 4rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
/* Le cadre est fait de cinq segments plutôt que d'une bordure : ils se déploient
   l'un après l'autre pour faire le tour une fois, en partant de la fente et en y
   revenant. Les durées suivent la longueur de chaque segment, pour une vitesse
   de tracé constante. */
.hero__frame { position: absolute; inset: 0; pointer-events: none; }
.hero__frame i { position: absolute; display: block; background: var(--accent); }

.hero__frame i:nth-child(1) { bottom: 0; left: 85%; right: 0; height: 6px; transform: scaleX(0); transform-origin: left;   animation: hero-x 0.10s linear 0.15s forwards; }
.hero__frame i:nth-child(2) { top: 0; bottom: 0; right: 0; width: 6px;     transform: scaleY(0); transform-origin: bottom; animation: hero-y 0.32s linear 0.25s forwards; }
.hero__frame i:nth-child(3) { top: 0; left: 0; right: 0; height: 6px;      transform: scaleX(0); transform-origin: right;  animation: hero-x 0.42s linear 0.57s forwards; }
.hero__frame i:nth-child(4) { top: 0; bottom: 0; left: 0; width: 6px;      transform: scaleY(0); transform-origin: top;    animation: hero-y 0.32s linear 0.99s forwards; }
.hero__frame i:nth-child(5) { bottom: 0; left: 0; width: 85%; height: 6px; transform: scaleX(0); transform-origin: left;   animation: hero-x 0.34s linear 1.31s forwards; }

@keyframes hero-x { to { transform: scaleX(1); } }
@keyframes hero-y { to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .hero__frame i { animation: none; transform: none; }
}
.hero::after {
  content: "";
  position: absolute;
  left: 83%; bottom: 0;
  width: 44px; height: 14px;
  background: var(--bg);
  transform: skewX(-22deg);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.9rem);
  max-width: 16ch;
  margin-bottom: 1.4rem;
  color: var(--deep);
}
.hero__lede {
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  max-width: 54ch;
  color: var(--ink-mid);
  margin: 0;
}

/* Sections */
.sheet { padding-block: clamp(2.5rem, 6vw, 4.25rem); }
.sheet > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: 0.85rem;
  border-bottom: 4px solid var(--ink);
  margin-bottom: 2.25rem;
}
.sheet__body { max-width: var(--measure); }
/* Le tableau et le formulaire portent leur propre largeur */
#stack .sheet__body, #contact .sheet__body { max-width: none; }

.service { padding-block: 1.75rem; border-top: 2px solid var(--line); }
.service:first-child { border-top: 0; padding-top: 0; }
.service h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin-bottom: 0.65rem; }
.service p { max-width: var(--measure); margin-bottom: 0.8em; }
.service p:last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.25em; }
.prose p:last-child { margin-bottom: 0; }

/* Stack : le tableau de données assumé */
.stack { margin: 0; border: 2px solid var(--ink); }
.stack > div {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 2.5vw, 1.6rem);
  border-top: 1px solid var(--line);
}
.stack > div:first-child { border-top: 0; }
.stack dt { font-weight: 600; color: var(--deep); }
.stack dd { margin: 0; }
@media (max-width: 34rem) {
  .stack > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* Formulaire */
.contact__intro { max-width: var(--measure); margin-bottom: 2rem; }
.form { display: grid; gap: 1.25rem; max-width: 36rem; }
.form__row { display: grid; gap: 0.4rem; }
.form label { font-weight: 600; font-size: 0.95rem; }
.form input, .form textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 2px solid var(--ink); border-radius: 0;
  padding: 0.7rem 0.85rem; width: 100%;
}
.form input:focus, .form textarea:focus {
  border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 0;
}
.form textarea { resize: vertical; min-height: 9rem; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__privacy { font-size: 0.92rem; color: var(--ink-mid); margin: 0; }
.form button {
  justify-self: start; font: inherit; font-weight: 600; font-size: 1.05rem;
  background: var(--deep); color: #fff; border: 2px solid var(--deep);
  border-radius: 0; padding: 0.8rem 1.75rem; cursor: pointer;
}
.form button:hover { background: var(--accent); border-color: var(--accent); }
.form button:disabled { opacity: 0.6; cursor: default; }
.form__status { margin: 0; min-height: 1.5em; font-size: 0.95rem; }
.form__status--ok { color: var(--ok); }
.form__status--error { color: var(--error); }

/* Pied de page */
.footer {
  max-width: var(--shell); margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--ink-mid); font-size: 0.92rem;
}
.footer::before {
  content: ""; display: block;
  border-top: 4px solid var(--ink);
  margin-bottom: 2rem;
}
.footer p { margin: 0 0 0.35em; }
.footer a { color: var(--ink-mid); }
.footer a:hover { color: var(--ink); }

/* Page mentions légales */
.legal { max-width: var(--measure); padding: 1rem 0 4rem; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin-bottom: 1.75rem; }
.legal h2 {
  font-size: 1.25rem; margin: 2.25rem 0 0.6rem;
  padding-bottom: 0.5rem; border-bottom: 2px solid var(--line);
}
