/* Projeto Interativo — App theme (2026-12-03), shared by the 3D page (style.css) and the plan page (planta.css).
   Same look as the sales site: near-black drawing board, dark glass panels, ipê-yellow accent, Manrope + JetBrains Mono. */
:root {
  --bg: #0e0f12; --panel: rgba(18, 19, 23, 0.84); --panel-solid: #15161a; --ink: #f2efec; --mute: #a39ea6; --line: #2c2d34; --line-2: #3d3e46;
  --accent: #f0b323; --accent-ink: #16140f; --accent-soft: rgba(240, 179, 35, 0.16);
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --hand: "Architects Daughter", cursive;
}
html, body { font: 15px/1.4 var(--ui); }
.mono { font-family: var(--mono); }

/* buttons: dark glass, yellow when on */
button, .btn { font: inherit; font-weight: 600; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s; -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { border-color: var(--line-2); }
button:active, .btn:active { transform: translateY(1px); }
button.on, .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button svg, .btn svg { display: block; flex: none; }
.ico-lbl { display: inline-flex; align-items: center; gap: 8px; }

/* checkboxes / sliders in panels */
input[type=checkbox], input[type=range] { accent-color: var(--accent); }

/* ---------- gate: loading + password, a drawing board where the plan gets drawn as the project loads ---------- */
#gate { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden;
  background: var(--bg); color: var(--ink); transition: opacity 0.5s ease; }
#gate.done { opacity: 0; pointer-events: none; }
#gate::before { content: ""; position: absolute; inset: 0; pointer-events: none;   /* CAD grid */
  background-image: linear-gradient(#ffffff10 1px, transparent 1px), linear-gradient(90deg, #ffffff10 1px, transparent 1px),
    linear-gradient(#ffffff06 1px, transparent 1px), linear-gradient(90deg, #ffffff06 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 100%); }
#gate::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; left: -20vmax; top: -30vmax; border-radius: 50%; pointer-events: none;   /* warm blob */
  background: radial-gradient(circle, rgba(107, 74, 12, 0.55), rgba(58, 40, 6, 0.25) 45%, transparent 70%); filter: blur(40px); animation: gate-drift 18s ease-in-out infinite alternate; }
@keyframes gate-drift { to { transform: translate(30vmax, 40vmax) scale(1.1); } }
.gate-box { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(420px, 100%); text-align: center; }
/* loading: the Projeto Interativo house (same animation as the landing logo) is scrubbed by loader.js in step with the real progress */
#gate-mark { width: 250px; height: 250px; max-width: 64vw; color: var(--ink); margin-bottom: -4px; }
#gate-mark * { animation-play-state: paused; }
.mark-build .d{stroke-dasharray:1 2;stroke-dashoffset:1.1}
.mark-build .plan-fp{animation:p-fp 6s linear both}
.mark-build .openings{animation:p-open 6s ease-out both}
.mark-build .roof{animation:p-roof 6s cubic-bezier(.2,.8,.2,1) both}
.mark-build .cone{transform-box:view-box;transform-origin:0 0;animation:p-cone 6s ease-in-out both}
.mark-build .under-roof{animation:p-under 6s linear both}
.mark-build .walls{animation:p-walls 6s linear both}
@keyframes p-fp{0%{stroke-dashoffset:1.1;opacity:1}16%{stroke-dashoffset:0;opacity:1}30%,100%{stroke-dashoffset:0;opacity:0}}
@keyframes p-under{0%,15%{opacity:0}17%,50%{opacity:1}56%,100%{opacity:0}}
@keyframes p-walls{0%,15%{opacity:0}17%,100%{opacity:1}}
@keyframes p-open{0%,40%{stroke-dashoffset:1.1}50%,100%{stroke-dashoffset:0}}
@keyframes p-roof{0%,46%{opacity:0;transform:translateY(-9px)}56%,100%{opacity:1;transform:none}}
@keyframes p-cone{0%,66%{transform:scale(0);opacity:0}71%{transform:rotate(-18deg) scale(1);opacity:1}80%{transform:rotate(14deg) scale(1)}88%{transform:rotate(-4deg) scale(1);opacity:1}100%{transform:rotate(0) scale(1);opacity:1}}
#gate h1 { margin: 6px 0 0; font: 800 30px/1.05 var(--ui); letter-spacing: -0.03em; color: var(--ink); }
.gate-cmd { margin: 0; font-size: 12px; color: var(--mute); letter-spacing: 0.06em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; }
.gate-cmd b { color: var(--accent); font-weight: 500; }
.gate-cmd .blink { width: 7px; height: 13px; background: var(--accent); animation: gate-blink 1s steps(2) infinite; }
@keyframes gate-blink { 50% { opacity: 0; } }
.gate-bar { width: 220px; height: 4px; border-radius: 4px; background: #24252b; overflow: hidden; }
.gate-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.25s; }
#gate p#gate-msg { margin: 0; min-height: 1.4em; color: var(--mute); font-size: 14px; }
#gate-row { display: flex; gap: 8px; margin-top: 4px; }
#gate-pw { font: 500 18px var(--mono); width: 160px; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; text-align: center;
  background: #18191e; color: var(--ink); -webkit-user-select: text; user-select: text; outline: none; }
#gate-pw:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#gate-row button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); padding: 10px 18px; min-height: 46px; }
#gate.bad #gate-pw { border-color: #ff5a4f; }
/* brand credit at the foot of the loading screen: mark + Space Grotesk wordmark (logo approved 2026-12-03, files in produto/marca/) */
.pi-credit { position: absolute; z-index: 1; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 7px;
  font: 700 14px "Space Grotesk", var(--ui); letter-spacing: -0.01em; color: var(--mute); text-decoration: none; white-space: nowrap; transition: color 0.2s; }
.pi-credit svg { width: 34px; height: 34px; margin: -6px -1px -6px 0; }
.pi-credit .wm{display:flex;flex-direction:column;align-items:flex-start;line-height:1;text-transform:uppercase}
.pi-credit .wm .p{font-family:"Architects Daughter",cursive;font-size:.8em;font-weight:400;letter-spacing:0;text-transform:none;color:#f0b323;margin-bottom:.02em}
.pi-credit .wm .i{font-weight:700;letter-spacing:.02em;margin-right:-.02em}

.pi-credit:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { #gate::after, .gate-cmd .blink { animation: none; } }

/* hover (user 2026-12-03): buttons lift a little, text/icon turn yellow, the icon does a small pop; the "options" sliders slide apart.
   Only on devices that really hover (no sticky hover on phones). */
button svg, .btn svg, #btn-3d svg { transition: transform 0.25s; }
button svg circle { transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
@media (hover: hover) {
  button:hover, .btn:hover, #btn-3d:hover { color: var(--accent); border-color: rgba(240, 179, 35, 0.45); transform: translateY(-1px); }
  button.on:hover, .btn.on:hover, #gate-row button:hover { color: var(--accent-ink); border-color: var(--accent); filter: brightness(1.08); }
  button:hover svg, .btn:hover svg, #btn-3d:hover svg { animation: ico-pop 0.45s ease; }
  #btn-menu:hover svg, #btn-opts:hover svg { animation: none; }
  #btn-menu:hover circle:nth-of-type(1), #btn-opts:hover circle:nth-of-type(1) { transform: translateX(-4px); }
  #btn-menu:hover circle:nth-of-type(2), #btn-opts:hover circle:nth-of-type(2) { transform: translateX(4px); }
}
@keyframes ico-pop { 40% { transform: scale(1.18) rotate(-6deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { button:hover svg, .btn:hover svg, #btn-3d:hover svg { animation: none !important; } }

/* ---------- "?" popup: Sobre este site (shared by the 3D and plan pages; behaviour in about.js) ---------- */
#btn-help { position: fixed; right: calc(12px + var(--sr, env(safe-area-inset-right))); bottom: calc(12px + var(--sb, env(safe-area-inset-bottom))); z-index: 3; width: 30px; height: 30px;
  min-width: 0; min-height: 0; padding: 0; border-radius: 50%; font: 700 14px/1 var(--mono); display: grid; place-items: center; opacity: 0.8; }
#btn-help:hover { opacity: 1; color: var(--accent); }
#help { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; width: min(580px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  overflow-y: auto; padding: 16px 18px; background: rgba(18, 19, 23, 0.94); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 14px; user-select: text; -webkit-user-select: text; }
#help .help-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
#help .help-head button { min-width: 36px; min-height: 36px; padding: 0; box-shadow: none; }
#help p { margin: 10px 0; line-height: 1.5; color: var(--mute); }
#help .help-copy { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
#help .help-copy button { padding: 8px 14px; min-height: 40px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#help .help-copy input { flex: 1; min-width: 200px; font: 12px var(--mono); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #18191e; color: var(--ink); }
#help table { width: 100%; border-collapse: collapse; }
#help td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
#help td:first-child { white-space: nowrap; }
#help code { font: 12px var(--mono); color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 5px; }
/* "Sobre este site" (user 2026-12-03): our brand on top, a short who-made-it note + link, then accordion sections (<details>) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#help .help-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 700 20px "Space Grotesk", var(--ui); }
#help .help-brand svg { width: 50px; height: 50px; margin: -8px -2px -8px -6px; }
#help .wm { display: flex; flex-direction: column; line-height: 1; }
#help .wm .p { font: 400 .8em "Architects Daughter", cursive; color: var(--accent); margin-bottom: .02em; }
#help .wm .i { text-transform: uppercase; letter-spacing: .02em; }
#help p.help-about { color: var(--ink); opacity: .86; margin: 14px 0 12px; }
#help .help-cta { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; margin-bottom: 14px; border-radius: 10px; border: 1px solid rgba(240, 179, 35, .45);
  color: var(--accent); text-decoration: none; font-weight: 700; font-size: 14px; transition: background .2s; }
#help .help-cta:hover { background: var(--accent-soft); }
#help .help-sec { border-top: 1px solid var(--line); }
#help .help-sec summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; font-weight: 700; font-size: 15px; }
#help .help-sec summary::-webkit-details-marker { display: none; }
#help .help-sec summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
#help .help-sec[open] summary::after { transform: translateY(2px) rotate(225deg); }
#help .help-sec summary:hover { color: var(--accent); }
#help .help-body { padding: 0 2px 12px; }
#help .help-body > p:first-child { margin-top: 0; }
#help p.help-foot { border-top: 1px solid var(--line); margin: 0; padding-top: 12px; font-size: 12px; }
#help .help-foot a { color: var(--mute); }
#help .help-ex { font-size: 13px; }
#help .help-ex code { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
/* how-to-navigate text: mouse or touch version */
.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: block; } .only-mouse { display: none; } }
body.touch .only-touch { display: block; } body.touch .only-mouse { display: none; }
