/* Kerusso Productions — design system
   Idée : les deux bandes translucides du K qui se croisent. Là où elles se rencontrent, la couleur
   s'intensifie. Les rencontres comme fil rouge : chaque superposition (image + bande, carte + survol)
   reprend cette logique de multiplication. */

:root {
  --coral: #ff5a4e;          /* teinte de base du logo */
  --coral-mid: #ff7f76;      /* zone de croisement */
  --coral-light: #ffaaa5;    /* bande seule sur blanc */
  --coral-on-dark: #ff8a80;
  --night: #121011;
  --night-2: #1c1819;
  --night-3: #272223;
  --paper: #f2f1ef;
  --paper-2: #e7e5e2;
  --ink: #151213;
  --ink-soft: #4a4446;
  --white: #ffffff;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  --max: 1440px;
  --section: clamp(96px, 13vw, 200px);

  --t-display: clamp(3rem, 8.4vw, 8.75rem);
  --t-h2: clamp(2.25rem, 5vw, 4.75rem);
  --t-h3: clamp(1.375rem, 2vw, 1.875rem);
  --t-lead: clamp(1.25rem, 1.7vw, 1.75rem);
  --t-body: clamp(1rem, 1.05vw, 1.125rem);
  --t-small: 0.9375rem;

  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.dark { color: var(--white); background: var(--night); }
img, video, iframe, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: .95; font-variation-settings: "wdth" 80; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--coral); color: var(--ink); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Logo ---------- */
.k-logo { width: auto; height: 100%; }
.k-logo path { fill: var(--coral); fill-opacity: .5; }
.dark .k-logo path, .on-dark .k-logo path { fill: #ff8178; fill-opacity: .62; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; height: 40px; }
.brand .k-logo { height: 40px; }
.brand span { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1; font-variation-settings: "wdth" 85; }
.brand small { display: block; font-weight: 500; font-size: .8125rem; letter-spacing: 0; opacity: .75; margin-top: 3px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.nav ul { display: flex; gap: clamp(16px, 2.4vw, 36px); list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a.link { text-decoration: none; font-weight: 500; font-size: .9875rem; position: relative; padding: 6px 0; }
.nav a.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a.link:hover::after, .nav a.link:focus-visible::after { transform: scaleX(1); }
.nav.solid { background: var(--paper); }
.dark .nav.solid { background: var(--night); }
.nav.hidden { transform: translateY(-100%); }
.nav .switch { font-weight: 600; }
.menu-btn { display: none; background: none; border: 0; color: inherit; font: inherit; font-weight: 600; padding: 10px 0; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 28px; border: 0; border-radius: 0;
  background: var(--coral); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--white); }
.dark .btn:hover, .on-dark .btn:hover { background: var(--white); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.ghost { background: transparent; color: inherit; padding-left: 0; padding-right: 0; }
.btn.ghost:hover { background: transparent; color: var(--coral); }

/* ---------- Sections ---------- */
section { position: relative; }
.sec { padding: var(--section) 0; }
.sec-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: clamp(48px, 6vw, 96px); align-items: end; }
.sec-head h2 { grid-column: 1 / span 7; font-size: var(--t-h2); }
.sec-head p { grid-column: 8 / span 5; font-size: var(--t-lead); line-height: 1.35; }
.lead { font-size: var(--t-lead); line-height: 1.35; }
.muted { color: var(--ink-soft); }
.dark .muted { color: #c9c1c2; }

/* ---------- Coral band (the K's crossing) ---------- */
.band {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--coral); opacity: .55; mix-blend-mode: multiply;
  transform: skewX(-37deg); transform-origin: bottom left;
}

/* ---------- Media frames ---------- */
.frame { position: relative; overflow: hidden; background: var(--night-3); }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s var(--ease); }
.frame::after {
  content: ""; position: absolute; inset: 0; background: var(--coral); mix-blend-mode: multiply;
  opacity: 0; transition: opacity .45s var(--ease);
}

/* ---------- Portfolio ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filters button {
  font: inherit; font-weight: 600; font-size: .9875rem; cursor: pointer;
  padding: 12px 20px; border: 0; border-radius: 0;
  background: var(--paper-2); color: var(--ink);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.dark .filters button { background: var(--night-3); color: var(--white); }
.filters button:hover { background: var(--coral-light); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--coral); color: var(--ink); }

.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 2.4vw, 36px) clamp(16px, 2vw, 28px); }
.work { grid-column: span 4; cursor: pointer; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; align-self: start; }
.work .frame { width: 100%; }
.work.big { grid-column: span 6; }
.work.hidden { display: none; }
.work .frame { aspect-ratio: 16 / 10; margin-bottom: 18px; }
.work.big .frame { aspect-ratio: 16 / 9.5; }
.work h3 { font-size: var(--t-h3); margin-bottom: 8px; }
.work .meta { font-size: var(--t-small); font-weight: 600; color: var(--coral); margin-bottom: 8px; }
.dark .work .meta { color: var(--coral-on-dark); }
.work p.desc { font-size: var(--t-small); line-height: 1.5; max-width: 52ch; }
.work:hover .frame img, .work:focus-visible .frame img { transform: scale(1.05); }
/* Visuel posé sur un fond qui prolonge son dégradé : on ne l'agrandit pas, sinon le raccord se voit. */
.work .frame.fit img, .work:hover .frame.fit img, .work:focus-visible .frame.fit img { transform: none; }
.work:hover .frame::after, .work:focus-visible .frame::after { opacity: .5; }
.play {
  position: absolute; z-index: 3; left: 20px; bottom: 20px; width: 64px; height: 64px;
  display: grid; place-items: center; background: var(--coral); color: var(--ink);
  transform: translateY(12px); opacity: 0; transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.work:hover .play, .work:focus-visible .play { transform: none; opacity: 1; }
.play svg { width: 22px; height: 22px; margin-left: 3px; }
.play-label { position: absolute; z-index: 3; left: 96px; bottom: 38px; color: var(--white); font-weight: 700; opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease) .05s, transform .4s var(--ease) .05s; }
.work:hover .play-label, .work:focus-visible .play-label { opacity: 1; transform: none; }

/* ---------- Video modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(12, 10, 11, .94); overflow-y: auto; }
.modal.open { display: block; }
.modal-inner { max-width: 1180px; margin: 0 auto; padding: 88px var(--gutter) 64px; color: var(--white); }
.modal-close {
  position: fixed; top: 20px; right: var(--gutter); z-index: 2;
  background: var(--coral); color: var(--ink); border: 0; font: inherit; font-weight: 700; padding: 12px 18px; cursor: pointer;
}
.modal-close:hover { background: var(--white); }
.modal .player { aspect-ratio: 16/9; background: #000; margin-bottom: 40px; }
.modal .player iframe { width: 100%; height: 100%; border: 0; }
.modal .player .external { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.modal .player .external img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; transition: opacity .4s var(--ease); }
.modal .player .external .btn { position: relative; }
.modal .player .external:hover img { opacity: .9; }
.modal .player.vertical { aspect-ratio: 9/16; height: min(78svh, 760px); width: auto; max-width: 100%; margin-left: auto; margin-right: auto; }
.modal h3 { font-size: var(--t-h2); margin-bottom: 16px; max-width: 18ch; }
.modal .meta { color: var(--coral-on-dark); font-weight: 600; margin-bottom: 14px; }
.modal .share { margin-bottom: 32px; font-size: .9375rem; }
.modal-share { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--white); cursor: pointer; text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 4px; }
.modal-share:hover, .modal-share:focus-visible { color: var(--coral-on-dark); }
.modal .share-status { color: var(--coral-on-dark); margin-left: 10px; word-break: break-all; }
.modal-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; }
.modal-cols h4 { font-size: 1.125rem; letter-spacing: -0.01em; font-variation-settings: "wdth" 100; margin-bottom: 8px; color: var(--coral-on-dark); }
.modal-cols p { margin-bottom: 24px; }
.modal-cols a { color: var(--coral-on-dark); }
.modal .episodes { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 4px; }
.modal .episodes a { display: block; padding: 12px 16px; background: var(--night-3); color: var(--white); text-decoration: none; font-weight: 600; transition: background .25s var(--ease), color .25s var(--ease); }
.modal .episodes a::after { content: " ↗"; color: var(--coral-on-dark); }
.modal .episodes a:hover, .modal .episodes a:focus-visible { background: var(--coral); color: var(--ink); }
.modal .episodes a:hover::after { color: var(--ink); }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: inherit;
  padding: 16px 18px; border: 0; border-radius: 0; background: var(--paper-2);
  border-bottom: 2px solid transparent; transition: border-color .25s, background .25s;
}
.on-dark .field input, .on-dark .field select, .on-dark .field textarea { background: var(--night-3); color: var(--white); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--coral); }
.field textarea { min-height: 160px; resize: vertical; }
.form-note { font-size: var(--t-small); }
.form-sent { display: none; font-weight: 600; }
.form.sent .form-sent { display: block; }
.form .btn:disabled { opacity: .6; cursor: progress; }
.form[data-state="ok"] .form-sent { font-size: 1.125rem; }

/* ---------- Contact block ---------- */
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 112px); }
.contact-lines { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 28px; }
.contact-lines span { display: block; font-size: var(--t-small); opacity: .75; margin-bottom: 2px; }
.contact-lines a, .contact-lines strong { font-size: var(--t-h3); font-weight: 700; letter-spacing: -0.02em; text-decoration: none; line-height: 1.15; font-variation-settings: "wdth" 85; }
.contact-lines a:hover { color: var(--coral); }

/* ---------- Footer ---------- */
.foot { padding: 96px 0 40px; }
.foot .wordmark { font-size: clamp(3.5rem, 15.5vw, 15rem); font-weight: 900; letter-spacing: -0.05em; line-height: .8; font-variation-settings: "wdth" 70; display: flex; align-items: flex-end; gap: .12em; }
.foot .wordmark .k-logo { height: .8em; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; margin-top: 48px; font-size: var(--t-small); }
.foot-row ul { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; margin: 0; padding: 0; }
.foot-row a { text-decoration: none; }
.foot-addr { display: grid; gap: 16px; font-size: 1.0625rem; line-height: 1.55; }
.foot-addr strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.foot-row .copy { opacity: .7; }
.foot-row { align-items: flex-start; }
.foot-row a:hover { color: var(--coral); }

/* ---------- Réseaux sociaux ---------- */
.social-icons { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.foot-row ul { align-items: center; }
.foot-row .social-icons { margin: -12px 0; }
.social-icon { display: grid; place-items: center; width: 44px; height: 44px; color: inherit; transition: color .25s var(--ease), transform .25s var(--ease); }
.social-icon svg { width: 22px; height: 22px; }
.social-icon:hover, .social-icon:focus-visible { color: var(--coral); transform: translateY(-2px); }
.dark .social-icon:hover, .on-dark .social-icon:hover { color: var(--coral-on-dark); }

/* ---------- Bandeau de consentement ---------- */
.consent {
  position: fixed; z-index: 90; left: var(--gutter); right: var(--gutter); bottom: 16px;
  max-width: 760px; margin: 0 auto; padding: 20px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
  background: var(--ink); color: var(--white);
}
.consent p { flex: 1 1 320px; font-size: 1rem; line-height: 1.45; }
.consent a { color: var(--coral-on-dark); }
.consent-acts { display: flex; gap: 8px; }
.consent .btn { padding: 14px 22px; font-size: 1rem; }
.consent .btn.alt { background: var(--night-3); color: var(--white); }
.consent .btn:hover { background: var(--white); color: var(--ink); }

/* ---------- Reveal motion ---------- */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .rv.in { opacity: 1; transform: none; }
/* Le masque s'applique aux enfants : l'élément observé garde sa surface visible pour l'IntersectionObserver. */
.js .rv-img > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .rv-img.in > * { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv, .js .rv-img > * { opacity: 1; transform: none; clip-path: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sec-head { grid-template-columns: 1fr; }
  .sec-head h2, .sec-head p { grid-column: 1 / -1; }
  .work, .work.big { grid-column: span 6; }
  .contact-grid, .modal-cols { grid-template-columns: 1fr; }
  .nav ul { display: none; }
  /* Menu ouvert : un panneau plein écran, opaque, sous la barre de navigation */
  .nav.open { background: var(--paper); position: fixed; }
  .dark .nav.open { background: var(--night); }
  .nav.open ul {
    display: flex; position: fixed; top: var(--nav-h, 76px); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 24px var(--gutter) 32px; overflow-y: auto;
    background: var(--paper); animation: menu-in .35s var(--ease) both;
  }
  .dark .nav.open ul { background: var(--night); }
  .nav.open ul a.link {
    display: block; padding: 10px 0;
    font-size: clamp(2.25rem, 11vw, 3.25rem); font-weight: 800; line-height: 1;
    letter-spacing: -0.03em; font-variation-settings: "wdth" 80;
  }
  .nav.open ul a.link::after { display: none; }
  .nav.open ul a.link:active, .nav.open ul a.link:focus-visible { color: var(--coral); }
  .dark .nav.open ul a.link:active, .dark .nav.open ul a.link:focus-visible { color: var(--coral-on-dark); }
  .nav.open ul li:has(.btn) { margin-top: auto; padding-top: 24px; }
  .nav.open ul .btn { width: 100%; justify-content: center; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
  .menu-btn { display: block; }
}
@media (max-width: 640px) {
  .work, .work.big { grid-column: 1 / -1; }
  .form { grid-template-columns: 1fr; }
  .play { opacity: 1; transform: none; width: 52px; height: 52px; left: 14px; bottom: 14px; }
  .play-label { display: none; }
  .brand small { display: none; }
}
