/* Landing : hero, bibliothèque avec formulaire, projets, piliers de la chaîne. */
html { scroll-behavior: smooth; }
body {
  font-size: 1.0625rem; line-height: 1.6;
  padding-block: 0 48px; overflow-x: hidden;
}
.wrap { max-width: 72rem; margin-inline: auto; }

/* NAV */
nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  margin-inline: -16px; padding: 14px 16px; border-bottom: 2px solid var(--outline);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 1.5rem; }
.nav-links { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--sand); text-decoration: none; font-weight: 600; font-size: .95rem;
  background: linear-gradient(var(--terra), var(--terra)) left bottom / 0 2px no-repeat;
  transition: background-size .25s ease; padding-bottom: 2px;
}
.nav-links a:hover { background-size: 100% 2px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: var(--f-body); font-weight: 700; font-size: 1rem; text-decoration: none;
  padding: 13px 20px; border: 3px solid var(--outline); color: var(--sand);
  background: var(--terra); box-shadow: 5px 5px 0 var(--outline);
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--outline); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--outline); }
.btn.ghost { background: var(--ink-raise); }

/* HERO */
.hero {
  position: relative; isolation: isolate;
  min-height: calc(100svh - 60px); padding-block: 48px 96px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center;
}
/* Quadrillage pleine largeur, estompé vers les bords */
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
  opacity: .4;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 50%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 72% 50%, #000 10%, transparent 75%);
}
h1 {
  font-size: clamp(2.9rem, 7vw, 7rem); line-height: .95; margin: 0 0 28px;
  -webkit-text-stroke: 2px var(--outline); paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--outline); text-wrap: balance;
}
h1 .line { display: block; animation: rise .7s var(--bounce) both; }
h1 .line:nth-child(2) { animation-delay: .08s; }
h1 .line:nth-child(3) { animation-delay: .16s; }
h1 .block {
  display: inline-block; background: var(--terra); color: var(--sand);
  padding: 0 .12em; border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline);
  transform: rotate(-2deg); animation: slam .8s var(--bounce) .35s both;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  padding: 7px 14px; border: 2px solid var(--outline); background: var(--ink-raise);
  box-shadow: 3px 3px 0 var(--outline); font-weight: 700; font-size: .9rem; color: var(--sand);
  animation: rise .6s var(--bounce) both;
}
.kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent); }
.lead { font-size: 1.2rem; max-width: 34rem; margin: 0 0 30px; }
.lead strong { color: var(--terra-soft); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }

/* Terminal qui tape l'histoire du slogan */
.hero-visual { position: relative; padding: 40px 12px; animation: rise .8s var(--bounce) .25s both; }
.term {
  background: var(--ink-deep); border: 3px solid var(--outline); box-shadow: 12px 12px 0 var(--outline);
  transform: rotate(1.5deg);
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: var(--ink-raise); border-bottom: 3px solid var(--outline);
}
.term-bar i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--outline); background: var(--terra); }
.term-bar i:nth-child(2) { background: var(--wip); }
.term-bar i:nth-child(3) { background: var(--ok); }
.term-bar b { margin-left: auto; font: 600 .8rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--sand-dim); }
.term-body {
  margin: 0; padding: 20px 20px 24px; min-height: 15.5em;
  font: 500 clamp(.82rem, 1.3vw, 1rem)/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--sand);
}
.ln { display: block; min-height: 1.75em; }
.ln.cmd::before { content: "$ "; color: var(--terra); font-weight: 700; }
.ln.ok { color: var(--ok); }
.ln.err { color: var(--terra-soft); }
.ln.wip { color: var(--wip); }
.ln.typing::after {
  content: ""; display: inline-block; width: .55em; height: 1.1em; margin-left: 2px;
  vertical-align: -.2em; background: var(--sand); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.sticker {
  position: absolute; z-index: 1; border: 3px solid var(--outline); box-shadow: 5px 5px 0 var(--outline);
  padding: 8px 14px; line-height: 1;
}
.sticker.s1 {
  top: 0; right: -8px; font-size: 1.5rem; background: var(--terra); color: var(--sand);
  transform: rotate(5deg); animation: slam .8s var(--bounce) .9s both;
}
.sticker.s2 {
  bottom: 4px; left: -10px; display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .9rem; background: var(--sand); color: var(--outline);
  transform: rotate(-4deg); animation: rise .7s var(--bounce) 1.1s both;
}
.rec { width: 10px; height: 10px; border-radius: 50%; background: #E5383B; animation: blink 1.4s steps(1) infinite; }

.scroll-cue {
  position: absolute; bottom: 28px; left: 0; display: inline-flex; gap: 8px; align-items: center;
  color: var(--sand-dim); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.scroll-cue span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
.scroll-cue:hover { color: var(--sand); }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* SECTIONS */
section { padding-block: 40px; scroll-margin-top: 80px; }
.sec-head { display: grid; gap: 10px; margin-bottom: 30px; max-width: 40rem; }
.sec-head p { color: var(--sand-dim); margin: 0; }
h2 {
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; margin: 0; text-wrap: balance;
  -webkit-text-stroke: 1.5px var(--outline); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--outline);
}
h2 .hl { color: var(--terra); }

/* LIBRARY */
.library { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.items { display: grid; gap: 16px; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--ink-raise); border: 3px solid var(--outline); padding: 18px;
  box-shadow: 5px 5px 0 var(--outline); text-decoration: none; color: var(--sand);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.item:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--outline); }
.item h3 { margin: 0 0 2px; font-size: 1.1rem; }
.item p { margin: 0; color: var(--sand-dim); font-size: .95rem; }
.badge {
  font-size: .8rem; font-weight: 700; white-space: nowrap;
  padding: 5px 8px; border: 2px solid var(--outline); background: var(--ok); color: var(--outline);
}
.item.soon { background: transparent; box-shadow: none; border-color: var(--line); color: var(--sand-dim); }
.item.soon .badge { background: transparent; color: var(--sand-dim); border-color: var(--line); }

/* FORMULAIRE D'ACCÈS */
.gate {
  scroll-margin-top: 90px;
  background: var(--ink-deep); border: 3px solid var(--terra); box-shadow: 10px 10px 0 var(--outline);
  padding: 26px 24px 24px; display: grid; gap: 16px;
}
.gate h3 { font-size: clamp(1.8rem, 4vw, 2.3rem); line-height: 1; margin: 6px 0 0; }
.gate-intro { margin: 10px 0 18px; color: var(--sand-dim); }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
label { font-weight: 600; font-size: .95rem; }
input[type="email"] {
  font: inherit; color: var(--sand); background: var(--ink); width: 100%;
  border: 3px solid var(--outline); padding: 13px 14px; box-shadow: inset 3px 3px 0 var(--outline);
  transition: border-color .2s, box-shadow .2s;
}
input[type="email"]:focus {
  outline: none; border-color: var(--terra);
  box-shadow: inset 3px 3px 0 var(--outline), 0 0 0 3px color-mix(in srgb, var(--terra) 30%, transparent);
}
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 400; color: var(--sand-dim); cursor: pointer; }
.check input {
  appearance: none; width: 22px; height: 22px; margin: 2px 0 0; cursor: pointer;
  border: 3px solid var(--outline); background: var(--ink); display: grid; place-items: center; transition: background .2s;
}
.check input:checked { background: var(--terra); }
.check input:checked::after {
  content: ""; width: 6px; height: 11px; border: solid var(--sand); border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px); animation: pop .3s var(--bounce);
}
@keyframes pop { from { transform: rotate(45deg) scale(0); } }
.error { color: var(--terra-soft); font-size: .9rem; margin: 0; min-height: 1.4em; }
.fine { font-size: .82rem; color: var(--sand-dim); margin: 0; }
form .btn { justify-content: center; width: 100%; font-size: 1.05rem; }
form .btn:disabled { opacity: .7; cursor: wait; transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.success { display: grid; gap: 12px; justify-items: start; animation: rise .6s var(--bounce) both; }
.success svg { width: 64px; height: 64px; }
.success circle { fill: var(--ok); stroke: var(--outline); stroke-width: 4; }
.success path {
  fill: none; stroke: var(--outline); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s ease .25s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h4 { margin: 0; font-size: 1.9rem; line-height: 1; }
.success p { margin: 0; color: var(--sand-dim); }
.shake { animation: shake .4s ease; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* PROJECTS */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; perspective: 900px; }
.proj {
  background: var(--ink-raise); border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline);
  padding: 22px; display: grid; gap: 12px; align-content: start;
  transition: transform .2s ease, box-shadow .2s ease; transform-style: preserve-3d; will-change: transform;
}
.proj:hover { box-shadow: 10px 10px 0 var(--outline); }
.proj .kind { font-size: .9rem; font-weight: 600; color: var(--terra-soft); }
.proj h3 { font-size: 1.9rem; line-height: 1; margin: 0; }
.proj h3 a { color: var(--sand); text-decoration: none; }
.proj h3 a:hover { color: var(--terra); }
.proj p { margin: 0; color: var(--sand-dim); }
.proj .foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.proj .foot a { font-weight: 700; text-decoration: none; }
.proj .foot a:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--sand-dim); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--wip); }
.status.ok::before { background: var(--ok); }

/* PILLARS */
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline); }
.pillar {
  padding: 22px 20px; display: grid; gap: 8px; align-content: start;
  border-right: 3px solid var(--outline); background: var(--ink-deep); transition: background .25s;
}
.pillar:last-child { border-right: none; }
.pillar:hover { background: var(--ink-raise); }
.pillar:hover h3 { color: var(--terra); }
.pillar h3 { font-size: 1.45rem; line-height: 1; margin: 0; transition: color .25s; }
.pillar p { margin: 0; color: var(--sand-dim); font-size: .95rem; }

/* FOOTER */
footer { margin-top: 56px; padding-top: 26px; border-top: 3px solid var(--outline); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; }
footer p { margin: 0; color: var(--sand-dim); font-size: .95rem; max-width: 34rem; }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer .links a { color: var(--sand); font-weight: 600; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; min-height: 0; padding-block: 40px 48px; }
  .hero::before { -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 75%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 80% 50% at 50% 75%, #000 10%, transparent 75%); }
  .hero-visual { max-width: 30rem; padding: 32px 8px 36px; }
  .sticker.s1 { font-size: 1.2rem; right: 0; }
  .sticker.s2 { left: 0; }
  .scroll-cue { display: none; }
  .library, .projects { grid-template-columns: minmax(0, 1fr); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:nth-child(2) { border-right: none; }
  .pillar:nth-child(-n+2) { border-bottom: 3px solid var(--outline); }
}
@media (max-width: 480px) {
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar { border-right: none; border-bottom: 3px solid var(--outline); }
  .pillar:last-child { border-bottom: none; }
  .nav-links a.hide-sm { display: none; }
  .item { grid-template-columns: minmax(0, 1fr); }
  .item .badge { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .success path { stroke-dashoffset: 0; }
}
