/* VSN Solutions — Portal de entrada (estética terminal / sci-fi) */
:root {
  --bg: #050507;
  --ink: #f4f1ea;
  --dim: #8a8580;
  --line: rgba(244, 241, 234, 0.14);
  --orange: #f26a1b;
  --amber: #f5b93f;
  --green: #3ee67a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", "JetBrains Mono", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); }
body {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Fundo ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

.glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 50%) var(--my, 40%), rgba(242, 106, 27, 0.12), transparent 60%),
    radial-gradient(900px 500px at 50% 115%, rgba(242, 106, 27, 0.16), transparent 70%);
  transition: background 0.2s;
}

.crt {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- Barra superior ---------- */
.bar {
  position: relative;
  z-index: 60; /* acima das linhas CRT e da vinheta, para a marca manter o laranja exato */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(5, 5, 7, 0.85), rgba(5, 5, 7, 0.4));
  backdrop-filter: blur(6px);
  font-size: 12px;
  letter-spacing: 0.06em;
  animation: drop 0.7s var(--ease) both;
}
.bar-right { display: flex; align-items: center; gap: 14px; }
/* Marca — mesma do site institucional */
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; font-family: Inter, Arial, Helvetica, sans-serif; }
.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid #1f1b17;
  background: var(--orange);
  box-shadow: 5px 5px 0 #f4f1ea;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.brand:hover .brand-mark { transform: translate(2px, 2px) rotate(-3deg); box-shadow: 3px 3px 0 #f4f1ea; }
.brand-mark span { color: #fff; font-size: 1rem; font-weight: 900; letter-spacing: -0.06em; text-transform: uppercase; }
.brand-text { display: grid; min-width: 0; }
.brand-text { gap: 4px; }
.brand-text strong { font-family: Inter, Arial, Helvetica, sans-serif; font-size: 1.3rem; line-height: 1; font-weight: 900; letter-spacing: -0.03em; text-transform: uppercase; white-space: nowrap; color: #fff; -webkit-text-stroke: 0.4px currentColor; }
.brand-text small { color: var(--dim); font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.dim { color: var(--dim); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.8s ease-in-out infinite; display: inline-block; }
.dot.off { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.clock { color: var(--amber); font-variant-numeric: tabular-nums; }
.lang { display: inline-flex; border: 1px solid var(--line); }
.lang button { background: none; border: 0; padding: 5px 8px; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--dim); transition: color 0.2s, background 0.2s; }
.lang button:hover { color: var(--ink); }
.lang button.active { background: var(--orange); color: #fff; }

/* ---------- Conteúdo ---------- */
.stage {
  position: relative;
  z-index: 5;
  flex: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vh, 56px) var(--pad) 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 5vh, 52px);
}

.boot {
  min-height: 5.2em;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.3;
  white-space: pre-wrap;
}
.boot .ok { color: var(--green); }
.boot .warn { color: var(--amber); }

.prompt { margin-top: 10px; font-size: 14px; color: var(--dim); }
.prompt .user { color: var(--green); }
.prompt .path { color: #6cb6ff; }
.caret { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 4px; vertical-align: -0.18em; background: var(--orange); animation: blink 1s steps(1) infinite; }

.headline {
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.headline span { display: block; }
.headline .accent { color: var(--orange); text-shadow: 0 0 32px rgba(242, 106, 27, 0.35); }
.lead { margin-top: 18px; max-width: 560px; color: var(--dim); font-size: 14px; }

/* ---------- Cartões ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  perspective: 1200px;
}

.card {
  --c: var(--orange);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 330px;
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 55%),
    rgba(10, 10, 14, 0.72);
  backdrop-filter: blur(8px);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
  opacity: 0;
  animation: rise 0.8s var(--ease) both;
  animation-delay: calc(1.1s + var(--i) * 0.12s);
  overflow: hidden;
  isolation: isolate;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--c) 22%, transparent) 50%, transparent);
  background-size: 100% 220%;
  background-position: 0 -120%;
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover, .card:focus-visible {
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 20px 60px -20px color-mix(in srgb, var(--c) 60%, transparent);
  outline: none;
}
.card:hover::before, .card:focus-visible::before { opacity: 1; animation: sweep 1.6s linear infinite; }

.corner { position: absolute; width: 12px; height: 12px; border-color: var(--c); border-style: solid; opacity: 0.8; transition: all 0.3s var(--ease); }
.corner.tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.corner.tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.corner.bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.corner.br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }
.card:hover .corner { width: 22px; height: 22px; }

.card-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.tag { padding: 2px 8px; border: 1px solid var(--c); color: var(--c); font-weight: 700; letter-spacing: 0.1em; font-size: 10px; }

.icon { height: 96px; display: grid; place-items: center; margin: 4px 0; }
.icon svg { width: 96px; height: 96px; overflow: visible; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 70%, transparent)); }
.icon .core, .icon .stars circle, .icon .sat circle, .icon .bars rect { fill: var(--c); stroke: none; }
.icon .ring, .icon .orbit, .icon .frame { stroke-opacity: 0.55; }

/* animações dos ícones */
.meteors line { stroke-dasharray: 60; stroke-dashoffset: 60; animation: meteor 2.4s ease-in infinite; }
.meteors line:nth-child(2) { animation-delay: 0.7s; }
.meteors line:nth-child(3) { animation-delay: 1.3s; }
.ring { transform-origin: 78px 78px; animation: pulse-ring 2.4s ease-out infinite; }
.links { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 4s ease-in-out infinite; stroke-opacity: 0.7; }
.stars circle { animation: twinkle 2s ease-in-out infinite; }
.stars circle:nth-child(2n) { animation-delay: 0.6s; }
.stars circle:nth-child(3n) { animation-delay: 1.1s; }
.sat { transform-origin: 60px 60px; animation: orbit 5s linear infinite; }
.bubble { stroke: #050507; stroke-width: 3; }
.bars rect { transform-origin: bottom; transform-box: fill-box; animation: bars 1.8s ease-in-out infinite; }
.bars rect:nth-child(2) { animation-delay: 0.2s; }
.bars rect:nth-child(3) { animation-delay: 0.4s; }
.bars rect:nth-child(4) { animation-delay: 0.6s; }
.card:hover .icon svg { animation: jitter 0.35s steps(2) 1; }

.name {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.desc { color: var(--dim); font-size: 13px; flex: 1; }
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); }
.go { color: var(--c); font-weight: 700; }
.go b { display: inline-block; transition: transform 0.3s var(--ease); }
.card:hover .go b { transform: translateX(6px); }
.card.is-soon { cursor: not-allowed; }
.card.is-soon .go { color: var(--dim); }

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin: 0 2px;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  color: var(--ink);
}
.about { max-width: 820px; margin: 8px auto 0; padding: 22px 0 6px; border-top: 1px dashed var(--line); text-align: center; color: var(--dim); font-size: 13px; line-height: 1.7; }
.about h2 { font-family: var(--display); color: var(--ink); font-size: 1rem; letter-spacing: 0.02em; margin-bottom: 8px; }
.about-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 12px; }
.about-links a { color: var(--ink); border-bottom: 1px solid var(--line); transition: color 0.2s, border-color 0.2s; }
.about-links a:hover { color: var(--orange); border-color: var(--orange); }
.hint { text-align: center; color: var(--dim); font-size: 12px; opacity: 0; animation: fade 1s ease 2s both; }

/* ---------- Rodapé ---------- */
.foot {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px var(--pad) calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
}
.foot-links { display: flex; gap: 18px; }
.foot a { transition: color 0.2s; }
.foot a:hover { color: var(--orange); }

/* ---------- Transição de saída ---------- */
.warp {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--wc, #f26a1b) 30%, transparent), #050507 70%);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.warp.on { opacity: 1; pointer-events: auto; }
.warp span::after { content: "_"; animation: blink 0.6s steps(1) infinite; }

/* ---------- Keyframes ---------- */
@keyframes drop { from { opacity: 0; transform: translateY(-100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px) rotateX(18deg); } to { opacity: 1; } }
@keyframes fade { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes sweep { to { background-position: 0 220%; } }
@keyframes meteor { 0% { stroke-dashoffset: 60; opacity: 0; } 20% { opacity: 1; } 70%, 100% { stroke-dashoffset: -60; opacity: 0; } }
@keyframes pulse-ring { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes draw { 0% { stroke-dashoffset: 200; } 45%, 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -200; } }
@keyframes twinkle { 50% { opacity: 0.3; } }
@keyframes orbit {
  from { transform: rotate(0deg) scaleY(1); }
  to { transform: rotate(360deg); }
}
@keyframes bars { 50% { transform: scaleY(0.45); } }
.rays { transform-origin: 60px 60px; animation: spin 18s linear infinite; }
.wave line { stroke: #050507; stroke-width: 3; transform-origin: center; transform-box: fill-box; animation: bars 1.1s ease-in-out infinite; }
.wave line:nth-child(2) { animation-delay: 0.15s; }
.wave line:nth-child(3) { animation-delay: 0.3s; }
.wave line:nth-child(4) { animation-delay: 0.45s; }
.wave line:nth-child(5) { animation-delay: 0.6s; }
.card[data-key="solaris"] .ring { transform-origin: 60px 60px; }
/* Andromeda: braços da galáxia a girar + sinal de chamada */
.card[data-key="andromeda"] .arms { transform-origin: 60px 60px; animation: spin 16s linear infinite; stroke-opacity: 0.8; }
.card[data-key="andromeda"] .signal path { animation: pulse 1.6s ease-in-out infinite; }
.card[data-key="andromeda"] .signal path:nth-child(2) { animation-delay: 0.4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes jitter { 0% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 100% { transform: none; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .card { min-height: 290px; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 270px; }
}
@media (max-width: 640px) {
  .card { min-height: 0; }
  .clock { display: none; }
  .brand-text strong { font-size: 1.05rem; white-space: normal; }
  .brand-text small { font-size: 0.56rem; white-space: normal; letter-spacing: 0.03em; }
  body { font-size: 14px; }
  .status { display: none; }
  .brand-mark { width: 44px; height: 44px; box-shadow: 3px 3px 0 #f4f1ea; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 0; display: grid; grid-template-columns: 72px 1fr; grid-template-areas: "top top" "icon name" "icon desc" "foot foot"; grid-template-rows: auto auto 1fr auto; align-content: start; column-gap: 16px; row-gap: 6px; padding: 18px 16px 14px; }
  .card-top { grid-area: top; align-self: start; align-items: center; }
  .icon { grid-area: icon; height: 72px; margin: 0; }
  .icon svg { width: 64px; height: 64px; }
  .name { grid-area: name; align-self: end; }
  .desc { grid-area: desc; }
  .card-foot { grid-area: foot; margin-top: 8px; }
  .hint { display: none; }
  .boot { min-height: 4em; font-size: 11px; }
  .foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .card { opacity: 1; }
}
