:root {
  --term-h: clamp(220px, 32vh, 360px);
  --mono: Consolas, "Cascadia Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fg: #E2E8F0; --muted: #8B98AB; --verde: #4ADE80; --azul: #60A5FA; --erro: #F87171; --linha: rgba(94, 234, 212, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: #05080F; color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }

/* fundo: vídeo a ocupar tudo, com escurecimento no topo (nome) e em baixo (terminal) */
#fundo { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; z-index: 0; pointer-events: none; }
.veu { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 8, 18, .72) 0%, rgba(4, 8, 18, .35) 24%, rgba(4, 8, 18, 0) 42%, rgba(4, 8, 18, 0) 60%, rgba(4, 8, 18, .45) 100%); }

/* nome */
.topo { position: fixed; z-index: 2; left: 0; right: 0; top: max(7vh, env(safe-area-inset-top)); text-align: center; padding: 0 16px; }
.nome { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.02; font-size: clamp(2.6rem, 8.5vw, 6.2rem);
  background: linear-gradient(100deg, #C4B5FD 0%, #FFFFFF 38%, #FFFFFF 58%, #7DD3FC 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(125, 211, 252, .35)) drop-shadow(0 2px 8px rgba(0, 0, 0, .55)); }
.sub { margin: 10px 0 0; font-family: var(--mono); font-size: clamp(.8rem, 2.4vw, 1rem); letter-spacing: .08em; color: rgba(226, 232, 240, .82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.sub span { color: var(--azul); }

/* terminal acoplado ao fundo do ecrã */
.terminal { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; height: var(--term-h);
  background: rgba(3, 7, 12, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid var(--linha); font-family: var(--mono); font-size: 14px; line-height: 1.6;
  padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; cursor: text; }
.saida { flex: 1; overflow-y: auto; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.saida .m { color: var(--muted); }
.saida .e { color: var(--erro); }
.saida .ok { color: var(--verde); }
.saida .a { color: var(--azul); }
.saida .arte { line-height: 1.15; white-space: pre; overflow-x: auto; }
.linha { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.prompt { white-space: nowrap; font-weight: 700; color: var(--fg); }
.prompt .u { color: var(--verde); } .prompt .d { color: var(--azul); }
#cmd { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; padding: 0; caret-color: var(--verde); }
.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--verde); animation: pisca 1s steps(1) infinite; }
@keyframes pisca { 50% { opacity: 0; } }

@media (max-width: 600px) {
  :root { --term-h: clamp(210px, 36vh, 320px); }
  .terminal { font-size: 13px; padding: 12px 12px calc(10px + env(safe-area-inset-bottom)); }
  #cmd { font-size: 16px; } /* 16px evita o zoom do iPhone ao escrever */
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
