:root {
  --bg: #050806;
  --panel: rgba(8, 14, 10, 0.86);
  --green: #62ff89;
  --green-2: #10d95a;
  --red: #ff3b52;
  --text: #e7f2e9;
  --muted: #76917c;
  --line: rgba(98, 255, 137, 0.18);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--mono);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 70% 22%, rgba(18, 151, 62, 0.11), transparent 30%),
    linear-gradient(rgba(98,255,137,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98,255,137,.035) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  opacity: .24;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.scanline {
  position: fixed;
  left: 0;
  right: 0;
  top: -20%;
  height: 15%;
  pointer-events: none;
  z-index: 19;
  background: linear-gradient(transparent, rgba(98,255,137,.035), transparent);
  animation: screen-scan 9s linear infinite;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #030504;
  transition: opacity .7s ease, visibility .7s ease;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot__box { width: min(620px, 100%); }
.boot__alert { color: var(--red); font-size: 10px; letter-spacing: .2em; animation: danger-pulse .55s steps(1) infinite; }
.boot__logo { color: var(--green); font-size: clamp(28px, 6vw, 60px); font-weight: 900; letter-spacing: -.08em; margin: 0 0 30px; }
.boot__logo small { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.boot__stream { min-height: 156px; color: #80a287; font-size: 12px; line-height: 1.75; text-transform: uppercase; }
.boot__stream p { margin: 0; }
.boot__stream b { color: var(--green); font-weight: 500; }
.boot__bar { height: 2px; background: #142018; overflow: hidden; }
.boot__bar span { display: block; width: 0; height: 100%; background: var(--green); box-shadow: 0 0 18px var(--green); transition: width .15s linear; }
.boot__status { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .15em; }
.boot__status b { color: var(--green); }

.topbar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  padding: 0 clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 6, .76);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .08em; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; color: #031006; background: var(--green); box-shadow: 0 0 25px rgba(98,255,137,.18); }
.topbar__status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.topbar__status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.4s infinite; }
.topbar__status--danger { color: var(--red); }
.topbar__status--danger i { background: var(--red); box-shadow: 0 0 12px var(--red); animation: danger-pulse .55s steps(1) infinite; }
.danger-text { color: var(--red) !important; text-shadow: 0 0 12px rgba(255,59,82,.45); }
.topbar__status span { color: var(--text); }

main { position: relative; }
.hero { min-height: 100svh; padding: 126px clamp(20px, 5vw, 80px) 32px; display: flex; flex-direction: column; justify-content: center; }
.hero__eyebrow, .hero__footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.hero__eyebrow { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: clamp(40px, 8vw, 130px); align-items: center; flex: 1; padding: 40px 0; }
.prompt { color: var(--muted); font-size: clamp(12px, 1vw, 15px); margin: 0 0 25px; }
.typed { color: var(--green); }
.cursor { color: var(--green); animation: cursor .85s steps(1) infinite; }
h1 { margin: 0; font-family: var(--sans); font-size: clamp(62px, 9.2vw, 162px); font-weight: 950; line-height: .77; letter-spacing: -.085em; }
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px var(--green); text-shadow: 0 0 45px rgba(98,255,137,.08); }
h1 { position: relative; animation: hero-glitch 6s infinite; }
h1::after { content: "PRIEIGA"; position: absolute; left: 3px; top: 0; color: rgba(255,59,82,.38); clip-path: inset(44% 0 38% 0); opacity: 0; animation: glitch-copy 6s infinite; pointer-events: none; }
.hero__lead { margin: clamp(35px, 5vw, 70px) 0 0; color: #a8b7ab; font-family: var(--sans); font-size: clamp(16px, 1.4vw, 21px); line-height: 1.6; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 35px; }
.button { min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 24px; border: 1px solid var(--line); color: #afc5b4; font-size: 11px; letter-spacing: .1em; transition: .25s ease; }
.button:hover { color: var(--green); border-color: var(--green); transform: translateY(-2px); }
.button--solid { color: #041008; background: var(--green); border-color: var(--green); font-weight: 800; }
.button--solid:hover { color: #041008; box-shadow: 0 0 30px rgba(98,255,137,.25); }

.scanner { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 25px 90px rgba(0,0,0,.35); }
.scanner__head, .scanner__stats { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .14em; padding: 14px 16px; }
.scanner__head { border-bottom: 1px solid var(--line); }
.scanner__core { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; }
.scanner__core::before { content: ""; position: absolute; width: 150%; height: 1px; background: linear-gradient(90deg, transparent, var(--green), transparent); box-shadow: 0 0 18px var(--green); animation: core-scan 3.5s ease-in-out infinite; }
.scanner__core::after { content: "01010110 01000001 01001100 01010011 01001011 01001001 01010011"; position: absolute; inset: 18px; color: rgba(98,255,137,.22); font-size: 9px; line-height: 2.5; overflow-wrap: anywhere; }
.scanner__rings, .scanner__rings i { position: absolute; border: 1px solid rgba(98,255,137,.26); border-radius: 50%; }
.scanner__rings { width: 68%; aspect-ratio: 1; animation: rotate 15s linear infinite; }
.scanner__rings i:nth-child(1) { inset: 14%; }
.scanner__rings i:nth-child(2) { inset: 27%; border-style: dashed; }
.scanner__rings i:nth-child(3) { inset: 40%; border-color: var(--green); box-shadow: 0 0 15px rgba(98,255,137,.25); }
.scanner__cross { position: absolute; background: rgba(98,255,137,.16); }
.scanner__cross--x { width: 100%; height: 1px; }
.scanner__cross--y { width: 1px; height: 100%; }
.scanner__core b { z-index: 2; color: var(--green); font-family: var(--sans); font-size: clamp(60px, 8vw, 120px); line-height: 1; text-shadow: 0 0 35px rgba(98,255,137,.3); }
.scanner__core small { position: absolute; z-index: 2; bottom: 25%; color: var(--green); font-size: 8px; letter-spacing: .22em; }
.scanner__stats { border-top: 1px solid var(--line); gap: 12px; }
.scanner__stats span { display: flex; flex-direction: column; gap: 6px; }
.scanner__stats b { color: var(--green); font-weight: 500; }
.hero__footer { align-items: center; }
.hero__footer i { height: 1px; flex: 1; margin: 0 20px; background: var(--line); }

.manifest, .terminal-section { padding: clamp(90px, 12vw, 180px) clamp(20px, 5vw, 80px); border-top: 1px solid var(--line); }
.section-label { color: var(--green); font-size: 11px; letter-spacing: .15em; margin-bottom: clamp(50px, 8vw, 110px); }
.manifest__content { display: grid; grid-template-columns: 1.45fr .55fr; gap: clamp(50px, 10vw, 160px); align-items: start; }
h2 { margin: 0; font-family: var(--sans); font-size: clamp(38px, 6vw, 96px); line-height: .95; letter-spacing: -.06em; }
h2 span { color: var(--green); }
.manifest__text { color: #9bae9f; font-family: var(--sans); line-height: 1.75; }
.manifest__text p { margin: 0 0 45px; }
.manifest__text ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.manifest__text li { display: flex; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.manifest__text li span { color: var(--green); }

.terminal-section { background: linear-gradient(180deg, transparent, rgba(9, 25, 13, .3)); }
.terminal { max-width: 1100px; margin: 0 auto; border: 1px solid rgba(98,255,137,.3); background: rgba(3, 8, 5, .94); box-shadow: 0 35px 100px rgba(0,0,0,.6), 0 0 80px rgba(30,255,90,.04); }
.terminal__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 18px; color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); }
.terminal__bar > div { display: flex; gap: 7px; }
.terminal__bar > span:last-child { justify-self: end; }
.terminal__bar i { display: block; width: 8px; height: 8px; border: 1px solid #4b6351; border-radius: 50%; }
.terminal__bar i:first-child { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(98,255,137,.5); }
.terminal__body { min-height: 340px; padding: clamp(22px, 4vw, 48px); font-size: clamp(12px, 1.2vw, 15px); line-height: 1.9; }
.terminal__body p { margin: 0 0 7px; }
.terminal__dim { color: #536b58; }
.terminal__user { color: var(--green); }
.terminal__path { color: #8ba6ff; }
.terminal__response { color: #b6c4b8; padding-left: 18px; border-left: 1px solid var(--line); white-space: pre-line; }
.terminal__keys { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.terminal__keys button { padding: 9px 12px; border: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; transition: .2s; }
.terminal__keys button:hover { color: var(--green); border-color: var(--green); }

footer { min-height: 100px; padding: 30px clamp(20px, 5vw, 80px); display: flex; justify-content: space-between; align-items: center; gap: 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .12em; }
footer a { color: var(--green); }
.reveal { opacity: 0; transform: translateY(35px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

@keyframes blink { 50% { opacity: .25; } }
@keyframes cursor { 50% { opacity: 0; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes screen-scan { to { transform: translateY(800%); } }
@keyframes core-scan { 0%,100% { transform: translateY(-160px); } 50% { transform: translateY(160px); } }
@keyframes danger-pulse { 50% { opacity: .25; } }
@keyframes hero-glitch {
  0%, 91%, 100% { transform: none; filter: none; }
  92% { transform: translateX(3px); filter: hue-rotate(80deg); }
  93% { transform: translateX(-4px); }
  94% { transform: none; }
}
@keyframes glitch-copy {
  0%, 91%, 95%, 100% { opacity: 0; transform: none; }
  92% { opacity: 1; transform: translateX(-9px); }
  93% { opacity: .7; transform: translateX(12px); }
  94% { opacity: 0; }
}

@media (max-width: 900px) {
  .hero { padding-top: 105px; }
  .hero__grid { grid-template-columns: 1fr; }
  .scanner { width: min(520px, 100%); }
  .manifest__content { grid-template-columns: 1fr; }
  .topbar__status { font-size: 0; }
  .topbar__status span { font-size: 10px; }
}

@media (max-width: 560px) {
  .topbar { height: 62px; }
  .brand { font-size: 13px; }
  .brand__mark { width: 30px; height: 30px; }
  .hero__eyebrow span:last-child, .hero__footer span:last-child { display: none; }
  .hero__footer i { margin-right: 0; }
  h1 { font-size: clamp(42px, 12vw, 50px); letter-spacing: -.065em; }
  .button { width: 100%; }
  .scanner__stats { font-size: 8px; }
  .terminal__bar { grid-template-columns: auto 1fr; }
  .terminal__bar > span:first-of-type { text-align: right; }
  .terminal__bar > span:last-child { display: none; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #matrix, .scanline { display: none; }
}
