/* Red Dune Solutions — sistema base dos 3 demos */
:root {
  --ink: #0A0A0C;
  --ink-2: #131317;
  --sand: #E9E1D5;
  --sand-dim: #9A9285;
  --red: #E2452B;
  --red-hot: #FF6A3D;
  --line: rgba(233, 225, 213, .12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  background: var(--ink);
  color: var(--sand);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }

/* --- palco 3D sticky ----------------------------------------------------- */
#shell { position: relative; }
#sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  width: 100%; overflow: hidden; z-index: 1;
  /* Não ocupa espaço no fluxo: os painéis de texto passam por cima do palco. */
  margin-bottom: -100vh; margin-bottom: -100svh;
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* véu de carregamento — sai quando o GLB entra */
#sticky::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  opacity: 1; transition: opacity .9s ease; pointer-events: none;
}
#shell.is-ready #sticky::after { opacity: 0; }
#stage { opacity: 0; transition: opacity .55s cubic-bezier(0.16, 1, 0.3, 1); }
#shell.is-ready #stage { opacity: 1; }

/* --- camada de texto ----------------------------------------------------- */
#track { position: relative; }
.panel {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 8vh clamp(24px, 6vw, 110px);
  pointer-events: none;
}
.panel > * { pointer-events: auto; }
.panel--right { justify-content: flex-end; text-align: right; }

.block { max-width: min(640px, 52vw); }
.block .lead, .block .list { max-width: 46ch; }
[data-reveal] { opacity: 1; transform: none; transition: opacity .55s cubic-bezier(.22,1,.36,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].is-off { opacity: 0; pointer-events: none; }

.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--red-hot); font-weight: 600; margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.panel--right .eyebrow { justify-content: flex-end; }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.panel--right .eyebrow::before { order: 2; }

h1, h2 { font-weight: 500; letter-spacing: -.03em; line-height: 1.02; }
h1 { font-size: clamp(44px, 6.6vw, 104px); }
h2 { font-size: clamp(32px, 4.6vw, 68px); }
.lead { margin-top: 26px; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.62; color: var(--sand-dim); }
.lead strong { color: var(--sand); font-weight: 500; }

.list { margin-top: 34px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.list div { background: var(--ink); padding: 18px 22px; font-size: 15px; display: flex; gap: 16px; align-items: baseline; }
.list span { color: var(--red); font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: .1em; }

.stats { margin-top: 40px; display: flex; gap: clamp(28px, 5vw, 64px); flex-wrap: wrap; }
.panel--right .stats { justify-content: flex-end; }
.stat b { display: block; font-size: clamp(38px, 4.6vw, 62px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.stat small { display: block; margin-top: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sand-dim); }

.cta {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 40px;
  padding: 17px 30px; background: var(--red); color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 500; border-radius: 2px;
  transition: background .3s ease, transform .3s ease;
}
.cta:hover { background: var(--red-hot); transform: translateY(-2px); }
.cta.ghost { background: transparent; border: 1px solid var(--line); color: var(--sand); }
.cta.ghost:hover { border-color: var(--sand); background: transparent; }

/* --- cromo --------------------------------------------------------------- */
.chrome {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px clamp(24px, 6vw, 110px);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; mix-blend-mode: difference;
  color: #f7eedb;
}
.chrome a { text-decoration: none; opacity: .85; }
.chrome a:hover { opacity: 1; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mark i { width: 9px; height: 9px; background: var(--red); border-radius: 50%; display: block; }

#bar { position: fixed; z-index: 21; left: 0; top: 0; height: 2px; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; }

.scrollhint {
  position: fixed; z-index: 22; bottom: 40px; left: 50%; transform: translateX(-50%);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(247,238,219,.55);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

/* fallback sem WebGL */
.no-webgl #sticky { background: linear-gradient(160deg, #141416, #0A0A0C 60%, #2a100a); }
.no-webgl #sticky::after { opacity: 0; }

@media (max-width: 900px) {
  .block { max-width: 100%; }
  .panel::before {
    content: ''; position: absolute; inset: auto 0 0 0; height: 82%;
    background: linear-gradient(to top, var(--ink) 26%, rgba(10,10,12,.82) 58%, transparent);
    z-index: -1; pointer-events: none;
  }
}
@media (max-width: 720px) {
  .panel, .panel--right { justify-content: flex-start; text-align: left; align-items: flex-end; padding-bottom: 14vh; }
  .panel--right .eyebrow { justify-content: flex-start; }
  .panel--right .eyebrow::before { order: 0; }
  .panel--right .stats { justify-content: flex-start; }
  .scrollhint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .scrollhint { animation: none; }
}
