/* ============================================
   lawandeconomics — Helvetica, sobre, design
   ============================================ */

   :root {
    --bg: #f1efe9;
    --bg-paper: #f6f4ee;
    --ink: #0a0a0a;
    --ink-2: #2a2a2a;
    --ink-muted: #8a857a;
    --ink-faint: #c4bfb3;
    --line: rgba(10, 10, 10, 0.14);
    --line-strong: rgba(10, 10, 10, 0.42);
    --white-line: rgba(255, 255, 255, 0.42);
    --white-line-soft: rgba(255, 255, 255, 0.22);
    --hero-bg: #161310;
  
    --gutter: clamp(20px, 3.5vw, 48px);
    --sidebar-w: 320px;
    --max-content: 1100px;
  
    --font-sans: "Helvetica Neue", "Helvetica", "Inter", system-ui, -apple-system,
      BlinkMacSystemFont, "Arial", sans-serif;
    --font-serif: "Times New Roman", "Times", "Georgia", serif;
  
    --easing: cubic-bezier(0.7, 0, 0.2, 1);
  
    --hp: 0;             /* hero-progress 0 → 1 */
    --hero-h: 100vh;     /* hauteur dynamique du hero */
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { background: var(--bg); color: var(--ink); }
  body {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }
  img, svg { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
  ul { list-style: none; }
  
  /* ============================================
     HERO — image plein écran
     ============================================ */
  
  .hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  
  .hero-bg {
    position: absolute;
    inset: 0;
    background-color: var(--hero-bg);
    background-image: url('hero.webp');
    background-size: cover;
    background-position: center;
  }

  .hero-veil {
    position: absolute;
    inset: 0;
    background: rgba(6, 4, 2, 0.48);
    pointer-events: none;
  }
  
  /* ============================================
     CADRE central (visible uniquement en état hero)
     ============================================ */
  
  .brand-frame {
    position: fixed;
    top: calc(50vh + 18px);
    left: 50vw;
    width: clamp(360px, 42vw, 400px);
    height: clamp(360px, 50vh, 440px);
    transform: translate(-50%, -50%);
    border: 1px solid var(--white-line);
    pointer-events: none;
    z-index: 20;
    opacity: calc(1 - var(--hp) * 1.4);
    transition: opacity 0.2s linear;
  }
  
  /* ============================================
     TITRE — morph centré → haut-gauche
     ============================================ */
  
  .brand-title-mount {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    pointer-events: none;
    transform-origin: top left;
    color: #fff;
    transition: color 0.5s ease;
    will-change: transform;
  }
  
  .brand-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 46px;
    line-height: 1.0;
    letter-spacing: -0.025em;
    white-space: nowrap;
  }

  .brand-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
  }

  .brand-ch {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 0.64em;
    letter-spacing: 0.01em;
    opacity: 0.65;
    vertical-align: 0.08em;
  }
  
  /* ============================================
     PLAN / TOC — morph centré → bas-gauche
     ============================================ */
  
  .brand-toc-mount {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    pointer-events: auto;
    transform-origin: top left;
    color: #fff;
    width: 320px;
    transition: color 0.5s ease;
    will-change: transform;
  }

  .brand-tagline {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
    opacity: calc(1 - var(--hp) * 0.5);
  }
  
  .toc-list {
    display: flex;
    flex-direction: column;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.01em;
  }

  .toc-list li {
    display: flex;
    align-items: flex-end;
    gap: 0;
    cursor: pointer;
    transition: opacity 0.25s ease;
    padding-bottom: 1px;
  }

  .toc-name {
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    padding-bottom: 3px;
  }

  .toc-dots {
    flex: 1;
    min-width: 8px;
    max-width: 36px;
    margin: 0 8px;
    margin-bottom: 6px;
    height: 1px;
    background: repeating-linear-gradient(
      to right,
      currentColor 0,
      currentColor 2px,
      transparent 2px,
      transparent 7px
    );
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }

  .toc-list li.is-active .toc-dots {
    opacity: 0.5;
    clip-path: inset(0 0 0 0);
    transition: opacity 0.3s ease;
  }

  .toc-list li:hover:not(.is-active) .toc-dots {
    animation: dotsReveal 0.45s ease forwards;
  }

  @keyframes dotsReveal {
    from { opacity: 0;    clip-path: inset(0 100% 0 0); }
    to   { opacity: 0.38; clip-path: inset(0 0 0 0); }
  }

  /* Stagger cascade : tagline → Arbitrage → … (délais qui se raccourcissent) */
  .brand-toc-mount.is-pinned .brand-tagline,
  .brand-toc-mount.is-pinned .toc-list li {
    animation: itemReveal 0.35s ease both;
  }
  .brand-toc-mount.is-pinned .brand-tagline          { animation-delay:   0ms; }
  .brand-toc-mount.is-pinned .toc-list li:nth-child(1) { animation-delay: 240ms; } /* +240 */
  .brand-toc-mount.is-pinned .toc-list li:nth-child(2) { animation-delay: 420ms; } /* +180 */
  .brand-toc-mount.is-pinned .toc-list li:nth-child(3) { animation-delay: 560ms; } /* +140 */
  .brand-toc-mount.is-pinned .toc-list li:nth-child(4) { animation-delay: 670ms; } /* +110 */
  .brand-toc-mount.is-pinned .toc-list li:nth-child(5) { animation-delay: 760ms; } /* +90  */
  .brand-toc-mount.is-pinned .toc-list li:nth-child(6) { animation-delay: 840ms; } /* +80  */

  @keyframes itemReveal {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0); }
  }

  .toc-num {
    flex-shrink: 0;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    font-family: var(--font-serif);
    font-style: italic;
    opacity: 0.65;
    padding-bottom: 4px;
    padding-right: 6px;
  }

  .toc-list li.is-faded {
    opacity: 0.35;
  }

  .toc-list li:hover {
    opacity: 1 !important;
  }

  .toc-list li.is-active {
    opacity: 1;
  }
  
  .brand-footer {
    margin-top: 24px;
    opacity: calc(0.35 + var(--hp) * 0.35);
  }

  .brand-footer-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.4;
  }

  .brand-footer-ch {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
  }

  .brand-footer-links {
    display: flex;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.02em;
    opacity: 0.65;
    margin-top: 2px;
  }

  .brand-footer-dot {
    opacity: 0.5;
  }
  
  .brand-footer > div { color: inherit; }
  
  /* ============================================
     ÉTATS — clair / sombre selon arrière-plan
     ============================================ */
  
  body.on-light .brand-title-mount,
  body.on-light .brand-toc-mount {
    color: var(--ink);
  }
  
  /* ============================================
     SCROLL HINT
     ============================================ */
  
  .scroll-hint {
    position: fixed;
    bottom: 36px;
    right: 36px;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    opacity: calc(1 - var(--hp) * 2);
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.5s ease;
  }
  
  .scroll-line {
    display: inline-block;
    width: 48px;
    height: 1px;
    background: currentColor;
    position: relative;
    overflow: hidden;
  }
  
  .scroll-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    animation: scrollDash 1.8s var(--easing) infinite;
  }
  
  @keyframes scrollDash {
    0%   { transform: translateX(0); }
    100% { transform: translateX(300%); }
  }
  
  /* ============================================
     CONTENU (panel clair qui monte)
     ============================================ */
  
  .content {
    position: relative;
    background: var(--bg);
    min-height: 100vh;
    z-index: 10;
    padding-left: var(--sidebar-w);
    padding-right: var(--gutter);
  }
  
  .content-inner {
    max-width: var(--max-content);
    padding-top: 18vh;
    padding-bottom: 20vh;
  }
  
  /* ============================================
     SECTIONS de domaine
     ============================================ */
  
  .domain {
    scroll-margin-top: 80px;
    padding-bottom: 16vh;
  }
  
  .domain + .domain {
    border-top: 1px solid var(--line);
    padding-top: 14vh;
  }
  
  .domain-eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  
  .domain-eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--ink-muted);
  }
  
  .domain-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(56px, 8vw, 112px);
    line-height: 0.94;
    letter-spacing: -0.035em;
    margin-bottom: 24px;
  }
  
  .domain-title .accent {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.015em;
  }
  
  .domain-subtitle {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.3;
    letter-spacing: -0.012em;
    color: var(--ink-2);
    max-width: 32em;
    margin-bottom: 12px;
  }
  
  .domain-description {
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 36em;
    margin-bottom: 80px;
  }
  
  /* ============================================
     SOUS-DOMAINES
     ============================================ */
  
  .subdomain {
    margin-top: 96px;
    scroll-margin-top: 80px;
  }
  
  .subdomain:first-of-type {
    margin-top: 0;
  }
  
  .subdomain-eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 16px;
  }
  
  .subdomain-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
  }
  
  .subdomain-subtitle {
    font-size: 18px;
    line-height: 1.45;
    color: var(--ink-2);
    max-width: 32em;
    margin-bottom: 40px;
  }
  
  /* ============================================
     SUJETS / TOPICS
     ============================================ */
  
  .topics {
    display: flex;
    flex-direction: column;
    gap: 80px;
  }
  
  .topic {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .topic-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  
  .topic-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.012em;
  }
  
  .topic-roman {
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--ink-muted);
    font-feature-settings: "tnum" 1;
  }
  
  .topic-description {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 36em;
  }
  
  /* ============================================
     CAROUSEL
     ============================================ */
  
  .carousel {
    position: relative;
    margin-top: 8px;
  }
  
  .carousel-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-paper);
    border: 1px solid var(--line);
    overflow: hidden;
  }
  
  .carousel-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    height: 100%;
    scrollbar-width: none;
  }
  
  .carousel-track::-webkit-scrollbar { display: none; }
  
  .carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
    position: relative;
    background: var(--bg-paper);
  }
  
  .carousel-slide img,
  .carousel-slide svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ink-faint);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  
  .carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  
  .carousel-arrows {
    display: flex;
    gap: 8px;
  }
  
  .carousel-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
    color: var(--ink-2);
  }
  
  .carousel-btn:hover {
    border-color: var(--line-strong);
    color: var(--ink);
  }
  
  .carousel-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
  }
  
  .carousel-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .carousel-count {
    font-feature-settings: "tnum" 1;
    color: var(--ink-muted);
  }
  
  .carousel-dots {
    display: flex;
    gap: 6px;
    margin-top: 12px;
  }
  
  .carousel-dot {
    flex: 1;
    height: 1px;
    background: var(--line);
    transition: background 0.3s ease;
  }
  
  .carousel-dot.is-active {
    background: var(--ink);
  }
  
  /* ============================================
     PAS-PAST-HERO : pointer events
     ============================================ */
  
  body.past-hero .brand-title-mount {
    pointer-events: auto;
  }
  
  /* ============================================
     RESPONSIVE
     ============================================ */
  
  @media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
  
    .brand-toc-mount {
      width: 280px;
    }
  
    .toc-list, .toc-roman { font-size: 18px; }
  
    .content {
      padding-left: var(--gutter);
      padding-top: 200px;
    }
  
    .content-inner { padding-top: 20px; }
  
    .brand-tagline { display: none; }
  
    .scroll-hint { display: none; }
  }
  
  @media (max-width: 600px) {
    .brand-title { font-size: 40px; }
    .toc-list, .toc-roman { font-size: 16px; }
    .brand-toc-mount { width: 220px; }
    .domain-title { font-size: 14vw; }
  }
  
  /* ============================================
     UTILS
     ============================================ */
  
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }