/* Modumod — dark, immersive theme (white modules pop on graphite) */
:root {
  --bg: #0e1115; --bg2: #13171c; --panel: #181d23; --panel2: #1f252d;
  --ink: #ece6da; --muted: #9da3a8; --dim: #6f767c;
  --gold: #cdbf8e; --olive: #a3aa78; --olive-d: #6a7148;
  --line: rgba(236, 230, 218, .1); --line2: rgba(236, 230, 218, .18);
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "DM Sans", system-ui, sans-serif;
  --r: 20px; --bar: 30px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--bg); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.02; letter-spacing: -.012em; }
h1 { font-size: clamp(48px, 6.6vw, 98px); }
h2 { font-size: clamp(40px, 4.8vw, 68px); }
h3 { font-size: 28px; }
em { font-style: italic; font-weight: 500; color: var(--gold); }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--olive); font-weight: 600; margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.wrap { width: min(1240px, 90vw); margin: 0 auto; }
.narrow { width: min(800px, 90vw); }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); text-decoration: none; padding: 15px 28px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid var(--ink); transition: transform .25s, background .25s, border-color .25s, color .25s; }
.btn:hover { transform: translateY(-2px); background: var(--gold); border-color: var(--gold); }
.btn-ghost { background: rgba(255, 255, 255, .05); color: var(--ink); border-color: var(--line2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: var(--ink); border-color: var(--ink); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* demo bar + nav */
.demo-bar { position: fixed; top: 0; left: 0; right: 0; height: var(--bar); z-index: 60; background: var(--olive-d); color: #f3efe7; font-size: 12.5px; line-height: var(--bar); text-align: center; letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.nav { position: fixed; top: calc(var(--bar) + 12px); left: 50%; transform: translateX(-50%); width: min(1240px, 94vw); z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 12px 10px 14px; background: rgba(16, 19, 24, .9); border: 1px solid var(--line); border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: .18em; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line2); }
.nav nav { display: flex; gap: 30px; }
.nav nav a { text-decoration: none; font-size: 14px; color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--ink); }

/* pinned 3D sections */
.pinned { position: relative; }
#montagem { height: 520vh; }
#por-dentro { height: 300vh; }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#montagem .sticky { background: radial-gradient(90% 80% at 64% 50%, #262d36 0%, #161a20 48%, #0b0d10 100%); }
#montagem .night { position: absolute; inset: 0; opacity: 0; background: radial-gradient(80% 70% at 64% 52%, #2a2420 0%, #120f0d 55%, #070606 100%); pointer-events: none; }
.sticky canvas, .config-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(11, 13, 16, .75) 0%, rgba(11, 13, 16, 0) 45%); z-index: 1; }

.intro { position: absolute; left: 5vw; top: calc(var(--bar) + 130px); max-width: 620px; z-index: 2; transition: opacity .2s; }
.intro .lead { font-size: 19px; color: var(--muted); margin: 24px 0 34px; max-width: 480px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions.center { justify-content: center; }
.scroll-cue { margin-top: 50px; display: flex; align-items: center; gap: 12px; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.scroll-cue span { width: 22px; height: 36px; border: 1.5px solid var(--dim); border-radius: 12px; position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 1.6s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }

.steps { list-style: none; position: absolute; right: 5vw; bottom: 12vh; width: min(380px, 88vw); z-index: 2; }
.steps li { position: absolute; bottom: 0; right: 0; width: 100%; padding: 24px 26px; border-radius: var(--r); background: rgba(19, 23, 28, .9); border: 1px solid var(--line); opacity: 0; transform: translateY(18px); transition: opacity .45s, transform .45s; pointer-events: none; }
.steps li.on { opacity: 1; transform: none; }
.steps b { font-family: var(--serif); font-size: 15px; color: var(--gold); letter-spacing: .12em; }
.steps span { display: block; font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; margin: 4px 0 6px; }
.steps small { font-size: 15px; color: var(--muted); }
.progress { position: absolute; left: 5vw; right: 5vw; bottom: 5vh; height: 1px; background: var(--line2); z-index: 2; }
.progress i { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* sections */
.section { padding: clamp(100px, 12vw, 160px) 0; position: relative; }
.section.soft { background: var(--bg2); }
.section.dark { background: radial-gradient(120% 80% at 30% 0%, #1a2028 0%, var(--bg) 60%); }
.head { max-width: 720px; margin-bottom: 60px; }
.head p:not(.eyebrow) { color: var(--muted); margin-top: 20px; font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--panel); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); transition: transform .4s, border-color .4s; }
.card:hover { transform: translateY(-6px); border-color: var(--line2); }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card > div { padding: 26px 26px 30px; }
.card h3 { margin: 10px 0 8px; }
.card p { color: var(--muted); font-size: 16px; }
.tag { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--olive); font-weight: 600; }

/* configurator */
.config { display: grid; grid-template-columns: 1.4fr 1fr; gap: 52px; align-items: center; }
.config-stage { position: relative; aspect-ratio: 5/4; border-radius: 26px; overflow: hidden; background: radial-gradient(80% 70% at 50% 45%, #2a313b 0%, #181d24 60%, #101317 100%); border: 1px solid var(--line); cursor: grab; touch-action: pan-y; }
.config-stage:active { cursor: grabbing; }
.hint { position: absolute; left: 18px; bottom: 16px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: rgba(14, 17, 21, .7); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; pointer-events: none; }
.config-panel h2 { margin-bottom: 34px; }
fieldset { border: 0; margin-bottom: 26px; }
legend { font-size: 13px; color: var(--dim); margin-bottom: 12px; letter-spacing: .05em; }
.seg, .swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button, .swatches button { font: 500 15px var(--sans); color: var(--ink); background: rgba(255, 255, 255, .02); border: 1px solid var(--line2); border-radius: 999px; padding: 11px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; transition: background .2s, border-color .2s, color .2s; }
.seg button:hover, .swatches button:hover { border-color: var(--ink); }
.seg button[aria-pressed="true"], .swatches button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; padding: 24px 0; margin: 6px 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary .wide { grid-column: 1 / -1; }
.summary dt { font-size: 12.5px; color: var(--dim); letter-spacing: .05em; }
.summary dd { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.2; }
.summary .wide dd { font-family: var(--sans); font-size: 17px; font-weight: 400; color: var(--muted); }
.note { margin-top: 18px; font-size: 13px; color: var(--dim); }

/* interior */
#por-dentro .sticky { background: radial-gradient(90% 80% at 60% 55%, #1f252d 0%, #12161b 55%, #0a0c0f 100%); }
.interior-copy { position: absolute; left: 5vw; top: calc(var(--bar) + 130px); max-width: 420px; z-index: 2; }
.interior-copy p:not(.eyebrow) { color: var(--muted); margin-top: 18px; font-size: 18px; }
.interior-copy .toggle { margin-top: 26px; opacity: 0; pointer-events: none; transition: opacity .5s; }
#por-dentro.labels-on .interior-copy .toggle { opacity: 1; pointer-events: auto; }
.labels span { position: absolute; left: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .5s; white-space: nowrap; pointer-events: none; }
.labels span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 5px rgba(255, 255, 255, .22), 0 4px 14px rgba(0, 0, 0, .4); flex: none; }
.labels span b { font-weight: 500; background: rgba(14, 17, 21, .85); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; }
.labels span.dim::before { display: none; }
.labels span.dim b { background: rgba(163, 170, 120, .25); color: var(--ink); }
#por-dentro.labels-on .labels span { opacity: 1; }

/* photoreal render (Blender) laid exactly over the live 3D at the end of the interior scroll */
.render { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 0; pointer-events: none; z-index: 1; will-change: transform, opacity; }
.render img { position: absolute; inset: 0; width: 100%; height: 100%; }
.render .r-night { opacity: 0; }
#por-dentro .labels span { z-index: 3; }

/* materials: free-floating objects */
.mat-grid, .proj-grid { position: relative; display: grid; }
.mat-grid { grid-template-columns: repeat(4, 1fr); gap: 34px; }
.mv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.mat { text-align: left; }
.mat-view { aspect-ratio: 1; margin-bottom: 6px; cursor: grab; touch-action: pan-y; position: relative; }
.mat-view::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 8%; height: 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(205, 191, 142, .14), transparent); pointer-events: none; }
.mat h3 { font-size: 26px; margin: 10px 0 8px; }
.mat p, .proj p { color: var(--muted); font-size: 15.5px; }
.mat .tag::before { content: "— "; }
.mat-note { margin-top: 44px; color: var(--muted); max-width: 760px; font-size: 15.5px; }

/* how */
.how { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how li { padding: 34px 30px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.how span { font-family: var(--serif); font-size: 56px; color: var(--gold); line-height: 1; }
.how h3 { margin: 18px 0 10px; }
.how p { color: var(--muted); font-size: 16px; }

/* 3D projects */
.proj-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
.proj { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .3s, transform .4s; }
.proj:hover { border-color: var(--line2); transform: translateY(-4px); }
.proj-view { aspect-ratio: 4/3; background: radial-gradient(75% 70% at 50% 42%, #343c47 0%, #1d232b 62%, #14181d 100%); cursor: grab; touch-action: pan-y; }
.night-card .proj-view { background: radial-gradient(75% 70% at 50% 42%, #2c2520 0%, #15110f 65%, #0b0908 100%); }
.proj-info { padding: 22px 24px 26px; }
.proj h3 { margin: 8px 0 6px; }
.proj a { display: inline-block; margin-top: 14px; color: var(--gold); font-weight: 600; font-size: 15px; text-decoration: none; }
.proj a:hover { text-decoration: underline; }

/* cta */
.cta { text-align: center; }
.cta .wrap { max-width: 840px; }
.cta p:not(.eyebrow) { color: var(--muted); margin: 22px auto 36px; max-width: 620px; font-size: 18px; }
.cta .eyebrow { justify-content: center; }
.facts { list-style: none; display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 44px; font-size: 14px; color: var(--dim); }

/* faq */
details { border-bottom: 1px solid var(--line); padding: 22px 0; }
summary { cursor: pointer; list-style: none; font-family: var(--serif); font-size: 27px; font-weight: 500; display: flex; justify-content: space-between; gap: 20px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--sans); font-weight: 300; color: var(--gold); transition: transform .3s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin-top: 12px; max-width: 640px; }

.footer { background: #0a0c0f; color: var(--dim); padding: 40px 0; font-size: 14px; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer .brand { color: var(--ink); font-size: 18px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.cards .reveal:nth-child(2), .how .reveal:nth-child(2), .mat-grid .reveal:nth-child(2), .proj-grid .reveal:nth-child(3n+2) { transition-delay: .1s; }
.cards .reveal:nth-child(3), .how .reveal:nth-child(3), .mat-grid .reveal:nth-child(3), .proj-grid .reveal:nth-child(3n) { transition-delay: .2s; }
.mat-grid .reveal:nth-child(4) { transition-delay: .3s; }

/* no WebGL fallback */
.no-webgl #montagem { height: auto; }
.no-webgl #montagem .sticky { height: auto; min-height: 90vh; background: url(../assets/hero.jpg) center/cover; }
.no-webgl .steps, .no-webgl .progress, .no-webgl #por-dentro, .no-webgl .config-stage, .no-webgl .mat-view, .no-webgl .proj-view { display: none; }

@media (max-width: 960px) {
  .nav nav { display: none; }
  .cards, .how, .proj-grid { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: 1fr 1fr; }
  .config { grid-template-columns: 1fr; gap: 36px; }
  .config-stage { aspect-ratio: 1; }
}
@media (max-width: 800px) {
  .mat-grid { grid-template-columns: 1fr; gap: 50px; }
  .mat-view { aspect-ratio: 4/3; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .nav { padding: 8px 8px 8px 10px; }
  .demo-bar { font-size: 10.5px; text-overflow: ellipsis; padding: 0 8px; }
  .intro { top: calc(var(--bar) + 96px); right: 5vw; }
  .intro .lead { font-size: 16.5px; margin: 16px 0 24px; }
  .vignette { background: linear-gradient(180deg, rgba(11, 13, 16, .8) 0%, rgba(11, 13, 16, 0) 55%); }
  .scroll-cue { display: none; }
  .steps { left: 5vw; right: 5vw; width: auto; bottom: 8vh; }
  .steps li { padding: 18px 20px; }
  .steps span { font-size: 27px; }
  .interior-copy { top: calc(var(--bar) + 90px); right: 5vw; }
  .interior-copy p:not(.eyebrow) { font-size: 16px; }
  .labels span { font-size: 12px; }
  summary { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span::after { animation: none; }
}
