  :root {
    --bg: #03050a;
    --panel: rgba(11, 15, 26, 0.72);
    --fg: #f1eee7;
    --fg-dim: #8f96a8;
    --accent: #4169e1;
    --accent-bright: #7da4ff;
    --border: rgba(255, 255, 255, 0.09);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Sora', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }
  html[data-lang="pt"] .t-en { display: none !important; }
  html[data-lang="en"] .t-pt { display: none !important; }

  /* Fullscreen WebGL Liquid & Volumetric Light Shader Canvas */
  #gl-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }

  /* Top Cinema Progress Bar */
  .progress-track {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 40;
  }
  .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    box-shadow: 0 0 12px var(--accent);
  }

  /* Fixed Minimalist Header */
  header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 30;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(3, 5, 10, 0.85), rgba(3, 5, 10, 0));
    backdrop-filter: blur(8px);
  }
  .mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
  }
  .mark-sigil { font-size: 15px; font-weight: 500; }
  .mark-sigil b { color: var(--accent); font-weight: 600; }
  .mark-name { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
  .header-center {
    display: flex;
    align-items: center;
  }
  .proto-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #9cb4ff;
    background: rgba(65, 105, 225, 0.12);
    border: 1px solid rgba(65, 105, 225, 0.35);
    padding: 5px 12px;
    border-radius: 999px;
    text-decoration: none;
  }
  .nav-right { display: flex; align-items: center; gap: 18px; }
  .nav-right a { color: var(--fg-dim); text-decoration: none; font-size: 13px; }
  .nav-right a:hover { color: var(--fg); }
  .lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
  }

  /* Side Chapter Rail (Desktop) */
  .chapter-rail {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
  }
  .rail-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
  }
  .rail-item .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  }
  .rail-item.active { color: #b7cbff; }
  .rail-item.active .dot {
    background: var(--accent-bright);
    transform: scale(1.4);
    box-shadow: 0 0 12px var(--accent);
  }
  .rail-label { opacity: 0; transition: opacity 0.25s ease; }
  .chapter-rail:hover .rail-label, .rail-item.active .rail-label { opacity: 1; }

  /* Sticky Depth-Tunnel Hero */
  .hero-track {
    position: relative;
    z-index: 2;
    height: 112vh;
  }
  .hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
  }
  #tunnelCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 22%, rgba(3, 5, 10, 0.72) 88%);
    pointer-events: none;
  }
  .hero-content {
    position: relative;
    z-index: 2;
    max-width: 960px;
    text-align: center;
    will-change: transform, opacity;
  }
  .hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #93afff;
    margin-bottom: 24px;
  }
  .hero-content h1 {
    font-size: clamp(42px, 8.5vw, 108px);
    font-weight: 200;
    line-height: 0.96;
    letter-spacing: -0.035em;
    margin-bottom: 26px;
  }
  .hero-content h1 em {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    color: #9bb8ff;
  }
  .hero-content p {
    max-width: 560px;
    margin: 0 auto 38px;
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.65;
    color: var(--fg-dim);
  }
  .scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
  }
  .scroll-line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--accent-bright), transparent);
    animation: dropPulse 1.8s infinite;
  }
  @keyframes dropPulse {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
  }

  /* Chapters */
  .chapters-wrap {
    position: relative;
    z-index: 4;
    max-width: 1160px;
    margin: -12vh auto 0;
    padding: 0 28px;
  }
  .chapter {
    min-height: auto;
    padding: 72px 0;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: center;
    border-top: 1px solid var(--border);
    opacity: 0.25;
    transform: translateY(30px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }
  .chapter.in-view {
    opacity: 1;
    transform: translateY(0);
  }
  .chapter.reverse .chap-info { order: 2; }
  .chapter.reverse .chap-stage { order: 1; }

  .chap-num {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: clamp(64px, 8vw, 112px);
    line-height: 0.85;
    color: rgba(65, 105, 225, 0.24);
    margin-bottom: 12px;
    user-select: none;
  }
  .chap-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 14px;
  }
  .chap-info h2 {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 300;
    letter-spacing: -0.025em;
    margin-bottom: 18px;
  }
  .chap-info p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--fg-dim);
    margin-bottom: 26px;
    max-width: 440px;
  }
  .spec-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .spec-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #c5d4ff;
    background: rgba(65, 105, 225, 0.10);
    border: 1px solid rgba(65, 105, 225, 0.28);
    padding: 6px 12px;
    border-radius: 999px;
  }

  .chap-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 22px;
    background: radial-gradient(circle at 50% 45%, rgba(65, 105, 225, 0.14), rgba(7, 10, 19, 0.78) 74%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(65, 105, 225, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
  }
  .chap-stage canvas {
    width: 100%;
    height: 100%;
    display: block;
  }
  .stage-hud {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: rgba(190, 210, 255, 0.65);
    pointer-events: none;
  }

  /* Chapter 05: Stack & Contact */
  .stack-section {
    padding: 104px 0 64px;
    border-top: 1px solid var(--border);
  }
  .stack-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
  }
  .stack-head h2 {
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 300;
    letter-spacing: -0.02em;
  }
  .stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 88px;
  }
  .stack-item {
    padding: 22px 18px;
    border-radius: 14px;
    background: rgba(10, 14, 24, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: 14px;
    color: var(--fg-dim);
    transition: border-color 0.3s ease, color 0.3s ease, transform 0.35s var(--ease);
  }
  .stack-item:hover {
    color: var(--fg);
    border-color: rgba(65, 105, 225, 0.5);
    transform: translateY(-4px);
  }
  .stack-item span.idx {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--accent-bright);
    margin-bottom: 8px;
  }

  footer {
    text-align: center;
    padding: 64px 0 48px;
    border-top: 1px solid var(--border);
  }
  footer h2 {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 200;
    line-height: 1.12;
    margin-bottom: 32px;
  }
  footer h2 em {
    font-family: 'Fraunces', serif;
    font-style: italic;
    color: #9cb5ff;
  }
  .cta-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 42px;
  }
  .cta-btn {
    padding: 14px 26px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    color: var(--fg);
    background: rgba(65, 105, 225, 0.18);
    border: 1px solid rgba(65, 105, 225, 0.55);
    transition: transform 0.25s ease, background 0.25s ease;
  }
  .cta-btn:hover { transform: translateY(-2px); background: rgba(65, 105, 225, 0.32); }
  .cta-btn.ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
  .copy { font-size: 12px; color: #64748b; }

  @media (max-width: 920px) {
    .chapter-rail { display: none; }
    .chapter {
      grid-template-columns: 1fr;
      gap: 28px;
      min-height: auto;
      padding: 64px 0;
    }
    .chapter.reverse .chap-info { order: 1; }
    .chapter.reverse .chap-stage { order: 2; }
    .stack-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 600px) {
    header { padding: 14px 16px; }
    .header-center { display: none; }
    .chapters-wrap { padding: 0 18px; }
    .chap-stage { aspect-ratio: 16 / 11; }
  }

  /* Official Bruno Pompeo Signature & Security Bar */
  .bp-sig-bar {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #8a92a6;
    text-align: left;
  }
  .bp-sig-id {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .bp-sig-mark {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #f1eee7;
    letter-spacing: 0.04em;
  }
  .bp-sig-mark b { color: #4169e1; font-weight: 600; }
  .bp-sig-brand {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #f1eee7;
    font-weight: 400;
  }
  .bp-sig-brand span { color: #8a92a6; font-weight: 300; }
  .bp-sig-sep { color: rgba(255, 255, 255, 0.18); }
  .bp-sig-legal { color: #8a92a6; }
  .bp-sig-right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
  }
  .bp-sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(65, 105, 225, 0.10);
    border: 1px solid rgba(65, 105, 225, 0.30);
    color: #9cb5ff;
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 0.08em;
    transition: border-color 0.25s ease, color 0.25s ease;
  }
  .bp-sec-badge:hover {
    border-color: rgba(65, 105, 225, 0.65);
    color: #ffffff;
  }
  .bp-sec-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    display: inline-block;
  }
  kbd {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    color: #9ca3af;
  }
/* classes que substituem style= inline (CSP estrito) */
.mark-name-fg { color: var(--fg); }
.fg-dim-light { color: var(--fg-dim); font-weight: 300; }
.mono-accent { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #87a3ff; }
