/* ============================================================
   juris86 — "Sistema 86"  ·  core
   Preto + laranja · Space Grotesk · motivo blueprint/medição
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root{
  --ink:      #08080a;
  --ink-2:    #0c0d12;
  --panel:    #121319;
  --panel-2:  #191b23;
  --line:     rgba(255,255,255,.07);
  --line-2:   rgba(255,255,255,.14);

  --white:    #f4f2ee;
  --dim:      #9a9ca5;
  --faint:    #585b65;

  --orange:      #e8492a;
  --orange-2:    #ff6c45;
  --orange-deep: #c5371b;
  --on-orange:   #08080a;
  --glow:        rgba(232,73,42,.55);
  --glow-soft:   rgba(232,73,42,.16);

  --maxw: 1280px;
  --gutter: 40px;
  --ease:      cubic-bezier(.6,0,.15,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --sans: 'Space Grotesk',system-ui,-apple-system,sans-serif;
  --mono: 'Space Mono',ui-monospace,'SF Mono',monospace;
}

*{ box-sizing:border-box; }
html{ -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
html.lenis{ scroll-behavior:auto; }
body{
  margin:0; background:var(--ink); color:var(--white);
  font-family:var(--sans); font-size:16px; line-height:1.6; font-weight:400;
  overflow-x:hidden;
}
body.lock{ overflow:hidden; }
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--orange); color:var(--on-orange); }
button{ font-family:inherit; }

.wrap{ width:100%; max-width:var(--maxw); margin:0 auto; padding:0 var(--gutter); }
.wrap-wide{ width:100%; max-width:1480px; margin:0 auto; padding:0 var(--gutter); }
.section{ position:relative; padding:120px 0; }
.section.sm{ padding:80px 0; }

/* ---------------- Type ---------------- */
h1,h2,h3,h4{ margin:0; font-weight:700; letter-spacing:-.025em; line-height:1.04; }
.display{ font-weight:800; letter-spacing:-.035em; line-height:.96; }
.d-xl{ font-size:clamp(2.6rem,1.2rem + 5vw,6rem); }
.d-lg{ font-size:clamp(2.1rem,1.2rem + 3.4vw,4rem); }
.d-md{ font-size:clamp(1.7rem,1.1rem + 2.2vw,2.8rem); }
.h-card{ font-size:1.22rem; font-weight:600; letter-spacing:-.015em; }
.lead{ font-size:clamp(1rem,.95rem + .35vw,1.18rem); color:var(--dim); line-height:1.62; max-width:56ch; font-weight:400; }
.muted{ color:var(--dim); }
.ac{ color:var(--orange); }
.italic{ font-style:italic; }

/* monospace technical label */
.coord{ font-family:var(--mono); font-size:.72rem; letter-spacing:.04em; color:var(--faint); text-transform:uppercase; }
.coord .o{ color:var(--orange); }
.tag{ display:inline-flex; align-items:center; gap:10px; font-family:var(--mono); font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:var(--orange); }
.tag::before{ content:""; width:18px; height:1px; background:var(--orange); }
.tag.dim{ color:var(--dim); }
.tag.dim::before{ background:var(--dim); }

/* huge structural index numeral */
.indexnum{ font-family:var(--sans); font-weight:800; letter-spacing:-.05em; line-height:.7;
  color:transparent; -webkit-text-stroke:1.5px var(--line-2); }

/* ---------------- Scroll progress + cursor ---------------- */
.progress{ position:fixed; top:0; left:0; height:2px; width:100%; transform:scaleX(0); transform-origin:left; background:var(--orange); z-index:200; box-shadow:0 0 12px var(--glow); }
.cursor, .cursor-dot{ display:none; }
@media (hover:hover) and (pointer:fine){
  html.cursor-on{ cursor:none; }
  html.cursor-on a, html.cursor-on button, html.cursor-on input, html.cursor-on select, html.cursor-on textarea, html.cursor-on .magnetic{ cursor:none; }
  .cursor{ display:block; position:fixed; top:0; left:0; width:36px; height:36px; margin:-18px 0 0 -18px; border:1.5px solid var(--orange); border-radius:50%; pointer-events:none; z-index:9999; transition:width .28s var(--ease), height .28s var(--ease), background .28s, opacity .3s, border-color .28s; will-change:transform; }
  .cursor.hot{ width:58px; height:58px; margin:-29px 0 0 -29px; background:var(--glow-soft); border-color:var(--orange-2); }
  .cursor.press{ width:26px; height:26px; margin:-13px 0 0 -13px; }
  .cursor-dot{ display:block; position:fixed; top:0; left:0; width:5px; height:5px; margin:-2.5px 0 0 -2.5px; background:var(--orange); border-radius:50%; pointer-events:none; z-index:9999; will-change:transform; }
  .cursor.hide, .cursor-dot.hide{ opacity:0; }
}

/* ---------------- Buttons (glow-fill + magnetic) ---------------- */
.btn{
  position:relative; display:inline-flex; align-items:center; gap:.62em;
  font-weight:600; font-size:.92rem; letter-spacing:.005em;
  padding:15px 28px; border-radius:999px; cursor:pointer;
  border:1.5px solid var(--orange); color:var(--orange); background:transparent;
  overflow:hidden; isolation:isolate; will-change:transform;
  box-shadow:0 0 22px -14px var(--glow);
  transition:color .45s var(--ease), box-shadow .55s var(--ease), border-color .45s, transform .25s var(--ease);
}
.btn::before{ content:""; position:absolute; inset:0; z-index:-1; background:var(--orange); transform:translateY(102%); transition:transform .5s var(--ease); }
.btn:hover{ color:var(--on-orange); box-shadow:0 0 0 1px var(--orange), 0 0 34px -4px var(--glow), 0 0 70px -16px var(--glow); }
.btn:hover::before{ transform:translateY(0); }
.btn:active{ transform:scale(.97); }
.btn .arw{ width:15px; height:15px; transition:transform .4s var(--ease); }
.btn:hover .arw{ transform:translateX(4px); }
.btn.lg{ padding:18px 36px; font-size:.98rem; }
.btn.sm{ padding:11px 21px; font-size:.84rem; }
.btn.solid{ background:var(--orange); color:var(--on-orange); box-shadow:0 0 30px -8px var(--glow); }
.btn.solid::before{ background:var(--ink); }
.btn.solid:hover{ color:var(--white); box-shadow:0 0 0 1.5px var(--orange), 0 0 44px -6px var(--glow); }
.btn.ghost{ border-color:var(--line-2); color:var(--white); box-shadow:none; }
.btn.ghost::before{ background:var(--white); }
.btn.ghost:hover{ color:var(--ink); border-color:var(--white); }

.tlink{ display:inline-flex; align-items:center; gap:8px; font-weight:600; font-size:.92rem; color:var(--orange); position:relative; padding-bottom:3px; }
.tlink::after{ content:""; position:absolute; left:0; bottom:0; height:1.5px; width:100%; background:currentColor; transform:scaleX(0); transform-origin:right; transition:transform .4s var(--ease); }
.tlink:hover::after{ transform:scaleX(1); transform-origin:left; }
.tlink svg{ width:14px; height:14px; transition:transform .4s var(--ease); }
.tlink:hover svg{ transform:translate(3px,-3px); }

/* ---------------- Decorative ---------------- */
.shard{ position:absolute; z-index:0; pointer-events:none; background:var(--orange); clip-path:polygon(24% 0,100% 0,76% 100%,0 100%); }
.wm{ position:absolute; z-index:0; pointer-events:none; user-select:none; font-weight:800; line-height:.72; letter-spacing:-.05em; color:#fff; opacity:.04; }
.glowdot{ position:absolute; border-radius:50%; filter:blur(90px); background:var(--glow-soft); z-index:0; pointer-events:none; }
.rel{ position:relative; z-index:1; }
.ticks{ position:absolute; left:0; right:0; height:1px; background:var(--line); z-index:1; }
.ticks::before{ content:""; position:absolute; left:0; top:-3px; width:1px; height:7px; background:var(--orange); }
.ticks::after{ content:""; position:absolute; right:0; top:-3px; width:1px; height:7px; background:var(--line-2); }

/* ---------------- Header ---------------- */
header.nav{ position:fixed; inset:0 0 auto 0; z-index:120; padding:20px 0; transition:padding .4s var(--ease), background .4s, border-color .4s; border-bottom:1px solid transparent; }
header.nav.scrolled{ padding:12px 0; background:rgba(8,8,10,.74); backdrop-filter:blur(18px) saturate(1.2); border-bottom-color:var(--line); }
.nav-row{ display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand{ display:inline-flex; align-items:center; font-weight:800; font-size:1.42rem; letter-spacing:-.045em; line-height:1; }
.brand .o{ color:var(--orange); }
.nav-links{ display:flex; gap:8px; }
.nav-links a{ font-size:.86rem; font-weight:500; color:var(--dim); position:relative; padding:8px 14px; border-radius:999px; transition:color .3s, background .3s; }
.nav-links a .ix{ font-family:var(--mono); font-size:.62rem; color:var(--faint); margin-right:6px; transition:color .3s; }
.nav-links a:hover{ color:var(--white); }
.nav-links a.active{ color:var(--white); background:var(--panel); }
.nav-links a.active .ix{ color:var(--orange); }
.burger{ display:none; flex-direction:column; gap:5px; background:none; border:0; cursor:pointer; padding:8px; }
.burger span{ width:24px; height:2px; background:var(--white); transition:.3s; }

/* ---------------- Hero ---------------- */
.hero{ position:relative; min-height:100vh; display:flex; align-items:center; padding:150px 0 100px; overflow:hidden; }
.hero-glow{ position:absolute; width:60vw; height:60vw; right:-10vw; top:-10vw; }
.hero-86{ position:absolute; right:-6%; bottom:-12%; font-size:clamp(20rem,40vw,52rem); z-index:0; }
.hero-grid-lines{ position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:linear-gradient(90deg,var(--line) 1px,transparent 1px); background-size:calc((100% - 0px)/6) 100%;
  mask-image:linear-gradient(180deg,transparent,#000 30%,#000 70%,transparent); opacity:.5; }
.hero-inner{ position:relative; z-index:3; width:100%; }
.hero-top{ display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:40px; }
.hero h1{ position:relative; }
.hero h1 .ln{ display:block; overflow:hidden; }
.hero h1 .ln > span{ display:block; }
.hero h1 .bleed{ margin-left:-.04em; }
.hero-sub{ display:grid; grid-template-columns:1.3fr 1fr; gap:40px; align-items:end; margin-top:46px; }
.hero-actions{ display:flex; flex-wrap:wrap; gap:16px; margin-top:34px; }
.hero-card{ position:relative; }
.hero-card .frame{ position:relative; overflow:hidden; border-radius:4px; border:1px solid var(--line-2); }
.hero-card image-slot{ width:100%; height:300px; }
.hero-card .shard{ width:90px; height:130px; right:-16px; top:-18px; opacity:.9; }
.hero-card .meta{ display:flex; justify-content:space-between; margin-top:12px; }
.hero-scroll{ position:absolute; bottom:30px; left:var(--gutter); z-index:3; display:flex; align-items:center; gap:12px; color:var(--faint); }
.hero-scroll .ln{ width:46px; height:1px; background:var(--line-2); position:relative; overflow:hidden; }
.hero-scroll .ln::after{ content:""; position:absolute; inset:0; background:var(--orange); transform:translateX(-100%); animation:scrollLn 2.4s var(--ease) infinite; }
@keyframes scrollLn{ 0%{ transform:translateX(-100%); } 50%{ transform:translateX(0); } 100%{ transform:translateX(100%); } }

/* ---------------- Footer ---------------- */
footer.ft{ position:relative; background:var(--ink-2); border-top:1px solid var(--line); padding:80px 0 36px; overflow:hidden; }
.ft-cta{ display:grid; grid-template-columns:1.2fr .8fr; gap:50px; align-items:end; padding-bottom:64px; border-bottom:1px solid var(--line); }
.ft-word{ font-weight:800; font-size:clamp(5rem,18vw,17rem); line-height:.8; letter-spacing:-.05em; color:var(--panel); margin:40px 0 0; user-select:none; pointer-events:none; }
.ft-word .o{ color:var(--orange-deep); }
.ft-grid{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:40px; padding:54px 0 0; }
.ft .blurb{ color:var(--dim); font-size:.92rem; max-width:32ch; margin:16px 0 0; }
.ft h5{ font-family:var(--mono); font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; color:var(--faint); margin:0 0 16px; }
.ft a.ln{ display:flex; align-items:center; width:fit-content; color:var(--dim); font-size:.92rem; margin-bottom:11px; transition:color .25s, padding-left .25s var(--ease); }
.ft a.ln:hover{ color:var(--orange); padding-left:6px; }
.ft-bottom{ margin-top:54px; padding-top:24px; border-top:1px solid var(--line); display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.ft-bottom span{ font-family:var(--mono); font-size:.72rem; color:var(--faint); }

/* ---------------- Reveal / motion primitives ----------------
   Estratégia robusta: conteúdo VISÍVEL por padrão. A entrada é dirigida
   por scroll via CSS (animation-timeline:view()) — roda no compositor,
   imune a throttle de JS/timer/IntersectionObserver. Onde não houver
   suporte, o conteúdo simplesmente aparece (degradação graciosa). */
@keyframes revUp{ from{ opacity:0; transform:translateY(34px); } to{ opacity:1; transform:none; } }
@keyframes revLeft{ from{ opacity:0; transform:translateX(-40px); } to{ opacity:1; transform:none; } }
@keyframes revRight{ from{ opacity:0; transform:translateX(40px); } to{ opacity:1; transform:none; } }
@keyframes revScale{ from{ opacity:0; transform:scale(.94); } to{ opacity:1; transform:none; } }
@keyframes revClip{ from{ clip-path:inset(0 0 100% 0); } to{ clip-path:inset(0 0 0 0); } }

@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    [data-reveal]{ animation:revUp linear both; animation-timeline:view(); animation-range:entry 4% entry 38%; }
    [data-reveal="left"]{ animation-name:revLeft; }
    [data-reveal="right"]{ animation-name:revRight; }
    [data-reveal="scale"]{ animation-name:revScale; }
    [data-reveal="clip"]{ animation-name:revClip; }
    .stagger > *{ animation:revUp linear both; animation-timeline:view(); animation-range:entry 2% entry 42%; }
    .stagger > *:nth-child(2){ animation-range:entry 7% entry 47%; }
    .stagger > *:nth-child(3){ animation-range:entry 12% entry 52%; }
    .stagger > *:nth-child(4){ animation-range:entry 17% entry 57%; }
    .stagger > *:nth-child(5){ animation-range:entry 22% entry 62%; }
    .stagger > *:nth-child(6){ animation-range:entry 27% entry 67%; }
  }
}
html:not(.js) [data-reveal], html:not(.js) .stagger > *{ opacity:1 !important; transform:none !important; clip-path:none !important; }

/* hero entrance (CSS, immune to JS timing) */
@keyframes lnRise{ from{ transform:translateY(105%); } to{ transform:translateY(0); } }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(22px); } to{ opacity:1; transform:none; } }
.hero h1 .ln > span{ animation:lnRise 1s var(--ease-out) both; }
.hero h1 .ln:nth-child(1) > span{ animation-delay:.15s; }
.hero h1 .ln:nth-child(2) > span{ animation-delay:.28s; }
.hero h1 .ln:nth-child(3) > span{ animation-delay:.41s; }
.hero .hero-top{ animation:fadeUp .9s var(--ease-out) both .05s; }
.hero .hero-sub{ animation:fadeUp .9s var(--ease-out) both .56s; }
.hero .hero-scroll{ animation:fadeUp .9s var(--ease-out) both .8s; }
/* Safety: se o motor de animação estiver pausado (aba em 2º plano / throttle),
   garante que o hero nunca fique preso no estado oculto. */
html.anim-settled .hero h1 .ln > span,
html.anim-settled .hero .hero-top,
html.anim-settled .hero .hero-sub,
html.anim-settled .hero .hero-scroll{ animation:none !important; opacity:1 !important; transform:none !important; }

/* ---------------- Mobile chrome ---------------- */
.drawer{ position:fixed; inset:0; z-index:130; background:var(--ink); display:flex; flex-direction:column; padding:110px 32px 32px; transform:translateX(101%); transition:transform .55s var(--ease); }
.drawer.open{ transform:none; }
.drawer a{ font-size:1.7rem; font-weight:700; letter-spacing:-.02em; padding:16px 0; border-bottom:1px solid var(--line); display:flex; align-items:baseline; gap:14px; }
.drawer a .ix{ font-family:var(--mono); font-size:.8rem; color:var(--orange); }
.drawer .btn{ margin-top:26px; justify-content:center; }
.drawer-close{ position:absolute; top:28px; right:30px; background:none; border:0; color:var(--white); font-size:2.2rem; cursor:pointer; line-height:1; }

@media (max-width:1000px){
  :root{ --gutter:24px; }
  .nav-links{ display:none; }
  .burger{ display:flex; }
  .hero{ min-height:auto; padding:130px 0 80px; }
  .hero-sub{ grid-template-columns:1fr; gap:30px; }
  .ft-cta{ grid-template-columns:1fr; gap:30px; }
  .ft-grid{ grid-template-columns:1fr 1fr; }
  .section{ padding:84px 0; }
}
@media (max-width:600px){
  .ft-grid{ grid-template-columns:1fr; }
  .hero-actions{ flex-direction:column; align-items:stretch; }
  .hero-actions .btn{ justify-content:center; }
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.01ms !important; }
  [data-reveal], .stagger > *{ opacity:1 !important; transform:none !important; clip-path:none !important; }
}
