/* Direction 2 · PAPIER. Éditorial clair : papier chaud, encre, vermillon. Instrument Serif + Inter Tight + JetBrains Mono.
   Idée : un magazine d'agence. Couverture avec repères d'impression, index de services avec aperçu qui suit
   le curseur, cartes qui s'empilent comme des feuilles, notes d'atelier. */

:root {
  --paper: #f2ede3;
  --paper-2: #e9e2d3;
  --ink: #14110f;
  --accent: #e5482a;
  --accent-rgb: 229, 72, 42;
  --bg: #f2ede3;
  --bg-rgb: 242, 237, 227;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(20px, 4.4vw, 76px);
  --nav-h: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.45; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
em { font-style: italic; }

/* ---------- barre ---------- */

.nav { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--nav-h); display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px; padding: 0 var(--pad); transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(242, 237, 227, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: rgba(20, 17, 15, 0.12); }
.nav__logo { width: clamp(112px, 9.6vw, 146px); color: var(--ink); }
.nav__logo svg { width: 100%; height: auto; }
.nav__links { display: flex; justify-content: center; gap: clamp(18px, 3vw, 44px); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease-out); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { display: inline-flex; gap: 10px; align-items: center; padding: 12px 20px; border: 1px solid var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; transition: background 0.3s, color 0.3s; }
.nav__cta:hover { background: var(--ink); color: var(--paper); }
.nav__burger { display: none; position: relative; width: 48px; height: 36px; }
.nav__burger i { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out); }
.nav__burger i:nth-child(1) { top: 12px; } .nav__burger i:nth-child(2) { top: 22px; }
.menu-open .nav__burger i:nth-child(1) { top: 17px; transform: rotate(16deg); }
.menu-open .nav__burger i:nth-child(2) { top: 17px; transform: rotate(-16deg); }
.menu { position: fixed; inset: 0; z-index: 55; display: grid; align-content: center; padding: 0 var(--pad); background: var(--paper); visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease-io), visibility 0s linear 0.7s; }
.menu-open .menu { visibility: visible; clip-path: inset(0); transition: clip-path 0.7s var(--ease-io), visibility 0s; }
.menu a { font-family: var(--display); font-size: clamp(3rem, 13vw, 8rem); line-height: 1; }
.menu a:hover { color: var(--accent); font-style: italic; }

/* ---------- couverture ---------- */

.cover { --dock: 1; --rx: 30deg; --rz: 14deg; --zoom: 1.15; --tilt-x: 3deg; --tilt-y: -2deg; --persp: 1900px; --stage-h: 100svh; background: var(--paper); }
.cover .card__body { background: #e4dccb; box-shadow: 0 36px 60px -30px rgba(70, 45, 10, 0.5); }
.cover .card.is-pop .card__body { box-shadow: 0 0 0 3px var(--accent), 0 70px 110px -40px rgba(70, 45, 10, 0.6); }
.cover .rail__band { background: rgba(20, 17, 15, 0.045); }
.cover .rail.is-active .rail__band { background: rgba(var(--accent-rgb), 0.1); }
.cover .fade { background: radial-gradient(90% 100% at 0% 100%, var(--paper) 22%, rgba(242, 237, 227, 0.82) 42%, rgba(242, 237, 227, 0) 70%), linear-gradient(180deg, rgba(242, 237, 227, 0.92), rgba(242, 237, 227, 0) 22%); }
.cover .fade::after { opacity: 0.12; }
.cover .copy { display: none; }
.cover .chapters { left: var(--pad); bottom: 28px; width: min(860px, calc(100vw - 2 * var(--pad))); z-index: 10; }
.cover .chapter { color: rgba(20, 17, 15, 0.5); font-family: var(--mono); font-weight: 500; }
.cover .chapter.is-active, .cover .chapter:hover { color: var(--ink); }
.cover .chapter__bar { background: rgba(20, 17, 15, 0.18); }

.cover__meta { position: absolute; z-index: 8; left: var(--pad); right: var(--pad); top: calc(var(--nav-h) + 6px); display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(20, 17, 15, 0.7); font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.reg { position: absolute; z-index: 8; width: 16px; height: 16px; opacity: 0.8; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--ink); }
.reg::before { left: 7px; top: 0; width: 1px; height: 16px; } .reg::after { top: 7px; left: 0; height: 1px; width: 16px; }
.reg--tl { left: 14px; top: 86px; } .reg--tr { right: 14px; top: 86px; } .reg--bl { left: 14px; bottom: 14px; } .reg--br { right: 14px; bottom: 14px; }

.cover__title { position: absolute; z-index: 7; left: var(--pad); bottom: clamp(70px, 14vh, 150px); font-family: var(--display); font-size: clamp(5.4rem, 19vw, 21rem); line-height: 0.82; letter-spacing: -0.035em; color: var(--ink); pointer-events: none; }
.cover__title .ln { display: block; overflow: hidden; padding: 0.04em 0.04em 0.12em; margin: -0.04em 0 -0.12em; }
.cover__title .wd { display: inline-block; transform: translateY(110%); animation: rise 1.2s var(--ease-out) forwards; }
.cover__title .ln:nth-child(1) .wd:nth-child(1) { animation-delay: 0.15s; } .cover__title .ln:nth-child(1) .wd:nth-child(2) { animation-delay: 0.27s; } .cover__title .ln:nth-child(2) .wd { animation-delay: 0.42s; }
.cover__title em { color: var(--accent); }
@keyframes rise { to { transform: none; } }

.stamp { position: absolute; z-index: 8; right: var(--pad); bottom: clamp(110px, 24vh, 240px); width: clamp(120px, 11vw, 170px); aspect-ratio: 1; display: grid; place-items: center; color: var(--ink); }
.stamp svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 26s linear infinite; }
.stamp text { fill: currentColor; font-family: var(--mono); font-size: 13.4px; letter-spacing: 0.18em; text-transform: uppercase; }
.stamp i { width: 28%; display: block; }
.stamp i svg { position: static; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.caption { position: absolute; z-index: 9; right: var(--pad); bottom: 72px; display: flex; gap: 12px; align-items: baseline; max-width: min(520px, 46vw); font-size: 14px; }
.caption b { font-family: var(--mono); font-weight: 500; color: #b3341a; } /* vermillon assombri : texte de 14 px, 4,5:1 minimum */
.caption span { font-weight: 600; }
.caption em { font-family: var(--display); font-size: 1.15em; color: rgba(20, 17, 15, 0.7); }

/* ---------- sections ---------- */

.head { display: grid; gap: 18px; max-width: 1100px; }
.head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 7vw, 7.4rem); line-height: 0.96; letter-spacing: -0.025em; }
.head em { color: var(--accent); }

.index { position: relative; padding: clamp(80px, 14vh, 170px) var(--pad) clamp(70px, 12vh, 150px); }
.rows { margin-top: clamp(34px, 7vh, 80px); border-top: 1px solid var(--ink); }
.row { position: relative; border-bottom: 1px solid rgba(20, 17, 15, 0.22); overflow: hidden; }
.row a { position: relative; z-index: 1; display: grid; grid-template-columns: 70px minmax(0, 1.3fr) minmax(0, 1fr) 40px; align-items: center; gap: 20px; padding: clamp(16px, 3vh, 30px) 0; transition: color 0.35s, padding 0.5s var(--ease-out); }
.row::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform 0.55s var(--ease-out); }
.row__name { font-family: var(--display); font-size: clamp(2.2rem, 5.6vw, 6rem); line-height: 1; letter-spacing: -0.02em; }
.row__desc { font-size: clamp(0.95rem, 1.3vw, 1.15rem); color: rgba(20, 17, 15, 0.7); transition: color 0.35s; }
.row__go { justify-self: end; font-size: 1.8rem; transition: transform 0.5s var(--ease-out); }
@media (hover: hover) {
  .row:hover::before { transform: scaleY(1); transform-origin: top; }
  .row:hover a { color: var(--paper); padding-left: 22px; }
  .row:hover .row__desc { color: rgba(242, 237, 227, 0.9); }
  .row:hover .row__go { transform: translate(6px, -6px) rotate(0deg); }
}

.peek { position: fixed; z-index: 45; left: 0; top: 0; width: clamp(200px, 19vw, 300px); aspect-ratio: 558 / 718; pointer-events: none; opacity: 0; transition: opacity 0.3s; will-change: transform; border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(40, 20, 0, 0.6); overflow: hidden; background: #15181d; }
.peek.on { opacity: 1; }
.peek__f { position: absolute; inset: 0; opacity: 0; transform: scale(1.12); transition: opacity 0.35s, transform 0.6s var(--ease-out); aspect-ratio: auto; }
.peek__f.on { opacity: 1; transform: none; }

/* cartes empilées */
.disciplines { padding: clamp(10px, 4vh, 40px) var(--pad) clamp(60px, 12vh, 140px); }
.card-d { position: sticky; top: calc(var(--nav-h) + 8px + var(--k) * 26px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(20px, 4vw, 70px); align-content: center; min-height: min(80vh, 720px); margin-bottom: 12vh; padding: clamp(26px, 4vw, 64px); border-radius: clamp(20px, 2.4vw, 36px); transform-origin: 50% 0; will-change: transform; box-shadow: 0 30px 60px -36px rgba(20, 17, 15, 0.5); }
.card-d--paper { background: var(--paper-2); }
.card-d--red { background: var(--accent); color: var(--paper); }
.card-d--ink { background: var(--ink); color: var(--paper); }
.card-d > .mono, .card-d > h3, .card-d > .card-d__p, .card-d > .tags { grid-column: 1; }
.card-d h3 { font-family: var(--display); font-weight: 400; font-size: clamp(3.4rem, 9.4vw, 10.5rem); line-height: 0.86; letter-spacing: -0.035em; margin: 18px 0 20px; }
.card-d--paper h3 em { color: var(--accent); }
.card-d__p { max-width: 30em; font-size: clamp(1rem, 1.5vw, 1.3rem); line-height: 1.5; opacity: 0.86; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags li { padding: 8px 14px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.card-d__art { grid-column: 2; grid-row: 1 / span 4; position: relative; display: grid; place-items: center; min-height: 0; }
.card-d__art .fit-frame { width: min(62%, 300px); border-radius: clamp(14px, 1.6vw, 24px); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.6); background: #15181d; }
.card-d__art .fit-frame:nth-child(1) { grid-area: 1 / 1; transform: translate(-30%, -4%) rotate(-5deg); }
.card-d__art .fit-frame:nth-child(2) { grid-area: 1 / 1; transform: translate(30%, 8%) rotate(4deg); }

/* la phrase */
.quote { padding: clamp(80px, 16vh, 200px) 0 0; border-top: 1px solid rgba(20, 17, 15, 0.22); overflow: hidden; }
.quote__big { max-width: 14em; margin: 0 auto clamp(60px, 12vh, 150px); padding: 0 var(--pad); text-align: center; font-family: var(--display); font-size: clamp(2.8rem, 8vw, 9rem); line-height: 0.98; letter-spacing: -0.03em; text-wrap: balance; }
.quote__big em { color: var(--accent); }
.strip { padding: clamp(14px, 2.4vh, 26px) 0; background: var(--ink); color: var(--paper); font-family: var(--display); font-style: italic; font-size: clamp(2rem, 5vw, 5.4rem); line-height: 1.1; white-space: nowrap; }
.strip i { width: 0.7em; flex: none; }
.strip i svg { width: 100%; height: auto; }

/* notes */
.notes { padding: clamp(80px, 14vh, 170px) var(--pad); }
.notes__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 30px); margin-top: clamp(30px, 6vh, 70px); }
.note__img { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 14px; margin-bottom: 18px; background: var(--paper-2); }
.note__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.note:hover .note__img img { transform: scale(1.06); }
.note h3 { margin: 6px 0 8px; font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.2vw, 2.2rem); line-height: 1.05; }
.note p:last-child { font-size: 15px; color: rgba(20, 17, 15, 0.72); }

/* contact */
.contact { display: grid; justify-items: start; gap: clamp(16px, 3vh, 28px); padding: clamp(90px, 16vh, 200px) var(--pad); border-top: 1px solid var(--ink); }
.contact__title { font-family: var(--display); font-weight: 400; font-size: clamp(4rem, 15vw, 17rem); line-height: 0.84; letter-spacing: -0.04em; }
.contact__title em { color: var(--accent); }
.contact__mail { position: relative; display: inline-flex; align-items: center; gap: 16px; font-family: var(--display); font-size: clamp(1.6rem, 5vw, 5.2rem); line-height: 1.1; }
.contact__mail span { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size 0.7s var(--ease-out); padding-bottom: 4px; }
.contact__mail:hover span { background-size: 100% 3px; }
.contact__mail i { font-style: normal; color: var(--accent); transition: transform 0.5s var(--ease-out); }
.contact__mail:hover i { transform: translate(6px, -6px); }
.contact__lead { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2.2rem); color: rgba(20, 17, 15, 0.7); }

.foot { display: grid; gap: 28px; padding: clamp(50px, 8vw, 110px) var(--pad) 30px; background: var(--ink); color: var(--paper); }
.foot__word { display: block; width: 100%; color: var(--paper); }
.foot__word svg { width: 100%; height: auto; }

/* ---------- tablette et téléphone ---------- */

@media (max-width: 900px) {
  :root { --nav-h: 62px; }
  .nav { grid-template-columns: auto 1fr auto; }
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; justify-self: end; }
  .cover { --rx: 28deg; --rz: 10deg; }
  .cover__meta span:nth-child(2), .cover__meta span:nth-child(3), .cover__meta-end { display: none; }
  .cover__title { font-size: 26vw; bottom: 14vh; }
  .stamp { width: 96px; bottom: auto; top: calc(var(--nav-h) + 70px); }
  .caption { display: none; }
  .chapter__n, .chapter__full { display: none; }
  .chapter__short { display: inline; }
  .row a { grid-template-columns: 36px minmax(0, 1fr) 30px; }
  .row__desc { display: none; }
  .peek { display: none; }
  .card-d { grid-template-columns: 1fr; min-height: 0; top: calc(var(--nav-h) + 6px + var(--k) * 14px); }
  .card-d > .mono, .card-d > h3, .card-d > .card-d__p, .card-d > .tags, .card-d__art { grid-column: 1; }
  .card-d__art { grid-row: auto; margin-top: 24px; min-height: 280px; }
  .card-d__art .fit-frame { width: min(46%, 190px); }
  .notes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .cover__title .wd { animation: none; transform: none; }
  .stamp svg { animation: none; }
  .card-d { position: relative; top: 0; }
}

/* citation avec l'animation du bureau */
.garage { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 6vw, 110px); padding: clamp(70px, 12vw, 170px) var(--pad); background: var(--paper-2); border-top: 1px solid rgba(20, 17, 15, 0.22); }
.garage__media { overflow: hidden; border-radius: clamp(18px, 2.4vw, 34px); background: #000; aspect-ratio: 16 / 9; box-shadow: 0 50px 90px -40px rgba(20, 17, 15, 0.55); }
.garage__media video { width: 100%; height: 100%; object-fit: cover; }
.garage__text p { font-family: var(--display); font-size: clamp(2.4rem, 5.6vw, 6rem); line-height: 0.98; letter-spacing: -0.03em; text-wrap: balance; }
.garage__text em { color: var(--accent); }
.garage__text footer { margin-top: clamp(18px, 3vw, 36px); color: rgba(20, 17, 15, 0.7); }
@media (max-width: 900px) { .garage { grid-template-columns: minmax(0, 1fr); } }

/* scène d'automatisation dans la carte « Make it run » */
.card-d__art--auto { display: grid; align-items: center; }
.auto { position: relative; width: 100%; max-width: 560px; aspect-ratio: 700 / 450; overflow: hidden; border-radius: clamp(16px, 2vw, 26px); background: #0b0c0f; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1); justify-self: center; }
.auto .fit { width: 700px; height: 450px; }
