/* ============================================================
   KHIS — khis.fr · Système éditorial (charte sombre du deck)
   Navy/ardoise + argent + blanc. Playfair Display + Inter.
   Principes : typographie d'abord, filets fins, pas de boîtes,
   grain filmique, chorégraphie d'entrée + révélations au scroll.
   ============================================================ */

:root {
  --ink:        #eef1f6;
  --ink-soft:   #b7bfcc;
  --muted:      #7d8798;
  --hairline:   rgba(255,255,255,.1);
  --hairline-2: rgba(255,255,255,.06);

  --bg:         #0f131b;
  --silver:     #b9c1cd;
  --silver-lo:  #8b95a4;
  --silver-hi:  #e4e8ee;
  --steel-hi:   #9fb6d6;
  --danger:     #e09a8f;

  --wrap: 1200px;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.22,.9,.24,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fond flouté tiré des images */
body::before {
  content: ""; position: fixed; inset: -8%; z-index: -2;
  background: url("images/port.jpg") center/cover no-repeat;
  filter: blur(64px) saturate(.45) brightness(.38);
  transform: scale(1.15);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 18% 0%, rgba(26,33,48,.5), transparent 60%),
    linear-gradient(180deg, rgba(15,19,27,.88), rgba(15,19,27,.95));
}

/* Grain filmique global — unifie photos & surfaces */
.grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Fil de la preuve — filament vertical qui se remplit au scroll */
.filament {
  position: fixed; top: 0; bottom: 0; left: max(28px, 3.4vw); width: 1px; z-index: 40;
  background: var(--hairline-2); pointer-events: none;
}
.filament span {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--silver-lo), var(--silver-hi));
  transform-origin: top; transform: scaleY(0); will-change: transform;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82em; letter-spacing: .08em; text-transform: uppercase; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(24px, 6vw, 72px); }

::selection { background: var(--silver-hi); color: #10141c; }
:focus-visible { outline: 1px solid var(--steel-hi); outline-offset: 3px; }

/* ---------- Boutons & liens ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; letter-spacing: .01em;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .16s var(--ease), background .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-primary { background: var(--silver-hi); color: #10141c; }
.btn-primary:hover { background: #fff; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline); padding-bottom: 3px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.link-arrow:hover { color: var(--silver-hi); border-color: var(--silver-hi); }
.link-arrow span { transition: transform .25s var(--ease); }
.link-arrow:hover span { transform: translateY(2px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 22px;
  max-width: var(--wrap); margin: 0 auto; padding: 15px clamp(24px, 6vw, 72px);
  backdrop-filter: saturate(140%) blur(14px);
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(15,19,27,.5); border-bottom: 1px solid var(--hairline-2);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-emblem { width: 32px; height: 32px; border-radius: 50%; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: .08em; }
.nav-links { display: flex; gap: 28px; margin-left: 14px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav .btn { margin-left: auto; }

/* ---------- Hero ---------- */
.intro { position: relative; overflow: hidden; min-height: 92vh; display: flex; align-items: center; padding: 40px 0 64px; }
.hero-watermark {
  position: absolute; right: -10%; top: 50%; transform: translateY(-50%);
  width: min(58vw, 680px); opacity: .05; pointer-events: none; filter: grayscale(.4);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 34px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--silver);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--steel-hi); box-shadow: 0 0 12px rgba(159,182,214,.8); }
.hero-title {
  margin: 0 0 30px; font-family: var(--serif); font-weight: 500;
  font-size: clamp(56px, 10.5vw, 150px); line-height: .98; letter-spacing: -.02em;
}
.hero-title .hl { display: block; }
.hero-title em { font-style: italic; color: var(--silver-hi); }
.lede { font-size: clamp(16px, 1.8vw, 19px); color: var(--ink-soft); max-width: 540px; margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; }
.hero-meta { margin: 44px 0 0; color: var(--muted); }

/* Chorégraphie d'entrée */
[data-load] { opacity: 0; transform: translateY(26px); }
body.loaded [data-load] {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s);
}

/* Révélations au scroll */
[data-reveal] { opacity: 0; transform: translateY(30px); }
[data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--hairline-2); border-bottom: 1px solid var(--hairline-2); padding: 15px 0; }
.marquee-track { display: flex; width: max-content; }
.marquee-track span {
  font-size: 12.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; padding-right: 12px;
  animation: marquee 36s linear infinite;
}
@keyframes marquee { to { transform: translateX(-100%); } }

/* ============================================================
   PARCOURS
   ============================================================ */
.journey { position: relative; }
.jtrack { position: relative; height: 460vh; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #0c0f16; }
.scenes { position: absolute; inset: 0; }
.scene {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; will-change: opacity, transform, filter;
}
.scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, rgba(15,22,38,.5), rgba(24,32,48,.28) 55%, rgba(12,16,24,.62));
  mix-blend-mode: multiply;
}
.scrim {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(10,13,20,.5) 100%),
    linear-gradient(180deg, rgba(10,13,20,.55) 0%, rgba(10,13,20,0) 26%, rgba(10,13,20,0) 40%, rgba(10,13,20,.92) 100%);
}
.scanline {
  position: absolute; left: 0; right: 0; top: 8%; height: 1px; z-index: 6; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(207,224,242,.9) 45%, rgba(207,224,242,.9) 55%, transparent);
  box-shadow: 0 0 24px 6px rgba(159,182,214,.4);
}
.scanline.on { animation: sweep 2.6s ease-in-out infinite; }
@keyframes sweep { 0% { top: 10%; opacity: 0; } 16% { opacity: 1; } 84% { opacity: 1; } 100% { top: 84%; opacity: 0; } }

.jhud { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; padding: 88px 0 52px; pointer-events: none; color: #fff; }
.jhud-head { display: flex; justify-content: space-between; align-items: flex-start; }
.jnum {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(80px, 12vw, 170px); line-height: 1; color: rgba(255,255,255,.16);
  letter-spacing: -.02em;
}
.jstamps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 380px; padding-top: 18px; }
.jstamp {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--silver-hi); border: 1px solid rgba(228,232,238,.35);
  padding: 6px 12px; border-radius: 2px; backdrop-filter: blur(6px);
  background: rgba(12,16,24,.35); animation: stamp .4s var(--ease);
}
@keyframes stamp { from { opacity: 0; transform: scale(1.25) rotate(-3deg); } to { opacity: 1; transform: none; } }

.jkicker { margin: 0 0 10px; color: var(--silver); }
.jhud-foot h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.015em;
  margin: 0 0 14px; max-width: 860px; text-wrap: balance; text-shadow: 0 2px 44px rgba(0,0,0,.55);
}
.jhud-foot p { font-size: clamp(15px, 1.7vw, 18px); color: rgba(255,255,255,.88); max-width: 560px; margin: 0 0 30px; text-shadow: 0 1px 22px rgba(0,0,0,.55); }

.jprogress { display: flex; align-items: center; gap: 16px; max-width: 640px; }
.pg-code { color: rgba(255,255,255,.75); font-size: 11px; }
.pg-line { position: relative; flex: 1; height: 1px; background: rgba(255,255,255,.25); }
.pg-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--silver-hi); transition: width .12s linear; }
.pg-node {
  position: absolute; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(255,255,255,.35);
}

/* ============================================================
   SECTIONS ÉDITORIALES
   ============================================================ */
.section { padding: clamp(96px, 14vh, 150px) 0; position: relative; }
.section-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--silver); margin: 0 0 18px;
}
.section-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 5vw, 62px); line-height: 1.05; letter-spacing: -.015em;
  margin: 0 0 18px; max-width: 820px; text-wrap: balance;
}
.section-lede { font-size: 17px; color: var(--ink-soft); max-width: 560px; margin: 0 0 26px; }

/* Sécurité — registre numéroté */
.ledger { list-style: none; margin: 56px 0 0; padding: 0; }
.ledger li {
  display: grid; grid-template-columns: 90px 1fr; gap: 24px; align-items: baseline;
  padding: 30px 0; border-top: 1px solid var(--hairline);
}
.ledger li:last-child { border-bottom: 1px solid var(--hairline); }
.ledger-no { color: var(--muted); font-size: 12px; }
.ledger h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.ledger p { margin: 0; font-size: 15.5px; color: var(--ink-soft); max-width: 620px; }

/* Plateforme — index */
.index { list-style: none; margin: 56px 0 0; padding: 0; }
.index li {
  display: grid; grid-template-columns: 90px 1fr 1.1fr; gap: 24px; align-items: baseline;
  padding: 26px 0; border-top: 1px solid var(--hairline);
  transition: padding-left .3s var(--ease);
}
.index li:hover { padding-left: 12px; }
.index li:last-child { border-bottom: 1px solid var(--hairline); }
.idx-no { color: var(--muted); font-size: 12px; }
.idx-name { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.01em; transition: color .3s; }
.index li:hover .idx-name { color: var(--silver-hi); }
.idx-desc { font-size: 15px; color: var(--ink-soft); }

/* ============================================================
   VÉRIFICATION — carte passeport
   ============================================================ */
.section-verify { border-top: 1px solid var(--hairline-2); }
.verify-inner { max-width: 760px; }
.verify-form { display: flex; gap: 14px; margin-top: 36px; }
.verify-form input {
  flex: 1; min-width: 0; padding: 15px 4px; font-size: 16px; font-family: var(--sans);
  border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0;
  background: transparent; color: var(--ink); outline: none;
  transition: border-color .25s var(--ease);
}
.verify-form input::placeholder { color: var(--muted); }
.verify-form input:focus { border-color: var(--silver-hi); }

.verify-result { margin-top: 40px; }
.vr-pass {
  position: relative; overflow: hidden; border: 1px solid var(--hairline);
  border-radius: 6px; padding: 30px 32px; background: rgba(17,22,32,.72); backdrop-filter: blur(10px);
}
.vr-pass::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 300px; height: 300px;
  background: url("images/emblem.png") center/contain no-repeat; opacity: .05; pointer-events: none;
}
.vr-pass-kicker { margin: 0 0 6px; color: var(--muted); }
.vr-pass-name { margin: 0 0 22px; font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.01em; padding-right: 130px; }
.vr-stamp {
  position: absolute; top: 26px; right: 26px; transform: rotate(-7deg);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 2px; border: 1.5px solid currentColor;
}
.vr-stamp.ok { color: var(--steel-hi); }
.vr-stamp.bad { color: var(--danger); }
.vr-rows { margin: 0; }
.vr-rows > div {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 11px 0; border-top: 1px solid var(--hairline-2); font-size: 14.5px;
}
.vr-rows dt { color: var(--muted); }
.vr-rows dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.vr-note { margin: 20px 0 0; font-size: 13px; color: var(--muted); max-width: 560px; }
.vr-err {
  border-left: 2px solid var(--danger); padding: 6px 0 6px 18px;
  color: var(--ink-soft); font-size: 15px;
}
.vr-err b { color: var(--danger); display: block; margin-bottom: 4px; }
.vr-loading { color: var(--muted); font-size: 14px; }
.vr-loading::after { content: "…"; animation: ell 1.2s steps(4) infinite; }
@keyframes ell { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "…"; } }

/* ---------- CTA ---------- */
.cta-final { border-top: 1px solid var(--hairline-2); text-align: left; }
.cta-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 6.5vw, 84px); line-height: 1.02; letter-spacing: -.02em;
  margin: 0 0 36px; text-wrap: balance;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline-2); padding: 64px 0 28px; overflow: hidden; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { color: var(--ink-soft); font-size: 14.5px; margin: 0; max-width: 280px; }
.footer-cols h4 { font-size: 11px; color: var(--muted); margin: 0 0 14px; font-weight: 500; }
.footer-cols a { display: block; font-size: 14.5px; color: var(--ink-soft); margin-bottom: 10px; transition: color .2s; }
.footer-cols a:hover { color: var(--silver-hi); }
.footer-word {
  font-family: var(--serif); font-weight: 600; text-align: center;
  font-size: clamp(90px, 22vw, 300px); line-height: .9; letter-spacing: .04em;
  margin-top: 54px; color: rgba(228,232,238,.08); user-select: none;
}
.footer-legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--hairline-2);
  font-size: 12px; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .nav-links { display: none; }
  .filament { display: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .index li { grid-template-columns: 56px 1fr; }
  .idx-desc { grid-column: 2; }
  .ledger li { grid-template-columns: 56px 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .section { padding: 72px 0; }
  .verify-form { flex-direction: column; }
  .verify-form .btn { width: 100%; }
  .vr-pass { padding: 24px 20px; }
  .vr-pass-name { padding-right: 0; }
  .vr-stamp { position: static; display: inline-block; margin-bottom: 16px; }
  .jtrack { height: 470vh; }
  .jhud { padding: 80px 0 36px; }
  .jstamps { max-width: 170px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-load], [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee-track span { animation: none; }
  .scanline.on { animation: none; opacity: .8; top: 46%; }
  .scene { transition: none !important; }
}
