/* ============================================================
   AEGISOS — FX layer
   grain · scanlines · cursor labels · pillar reveal · orbit
   · pinned UI · gallery · wipes · velocity marquee hooks
   ============================================================ */

/* ---------- film grain + scanlines ---------- */
.grain, .scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.6s ease;
}
body.grain-on .grain { opacity: 0.05; }
body.grain-on .scanlines { opacity: 0.5; }

.grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}
@media (prefers-reduced-motion: no-preference) {
  body.grain-on .grain { animation: grain-shift 0.6s steps(4) infinite; }
  @keyframes grain-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-6%, 3%); }
    50% { transform: translate(4%, -5%); }
    75% { transform: translate(-3%, 6%); }
    100% { transform: translate(5%, -2%); }
  }
}
.scanlines {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0px,
    rgba(0, 0, 0, 0.5) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* ---------- cursor label ---------- */
.cursor-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a0a0a;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.cursor.labeled { width: 64px; height: 64px; }
.cursor.labeled .cursor-label { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- decrypt scramble ---------- */
.scramble .sc-on { color: var(--accent); }

/* ---------- hero media (full-bleed phone) ---------- */
.hero-media {
  position: absolute;
  top: 0;
  right: 0;
  width: 42vw;
  max-width: 560px;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 92%);
  mask-image: linear-gradient(to left, #000 35%, transparent 92%);
  opacity: 0.55;
}
.hero-media image-slot { width: 100%; height: 100%; }
.hero > * { position: relative; z-index: 1; }
.hero > .hero-media { z-index: 0; }
@media (max-width: 820px) { .hero-media { display: none; } }

/* ---------- pillar cursor-follow preview ---------- */
.pillar-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 320px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.pillar-preview.show { opacity: 1; }
.pillar-preview .pp-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
  border-radius: 4px;
}
.pillar-preview .pp-item.active { opacity: 1; }
.pillar-preview image-slot { width: 100%; height: 100%; }
@media (hover: none) { .pillar-preview { display: none; } }

/* ---------- connectivity / orbit ---------- */
.connect {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 16vh 4vw;
  overflow: hidden;
  background: #060606;
  border-block: 1px solid var(--faint);
}
.orbit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.connect-inner { position: relative; z-index: 1; max-width: 1100px; }
.connect-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.4rem, 7vw, 7rem);
  line-height: 0.98;
  margin: 3vh 0 6vh;
}
.connect-rows { display: grid; gap: 0; max-width: 640px; }
.connect-row {
  padding: 24px 0;
  border-top: 1px solid var(--faint);
}
.connect-row:last-child { border-bottom: 1px solid var(--faint); }
.connect-row .ci {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding-top: 4px;
}
.connect-row h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1;
}
.connect-row p { color: var(--muted); font-size: 14.5px; margin-top: 8px; text-wrap: pretty; }

/* ---------- pinned AegisOS UI showcase ---------- */
.ui-showcase { position: relative; }
.ui-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4vw;
  padding: 0 4vw;
  will-change: transform;
}
@media (max-width: 860px) { .ui-pin { grid-template-columns: 1fr; justify-items: center; } }
.ui-cap {
  max-width: 30ch;
}
.ui-cap .ui-step {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.ui-cap h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1;
  margin: 14px 0 12px;
}
.ui-cap p { color: var(--muted); font-size: 15px; text-wrap: pretty; }
.ui-cap.right { justify-self: end; text-align: right; }
@media (max-width: 860px) { .ui-cap { display: none; } }

.ui-phone {
  position: relative;
  width: min(300px, 74vw);
  aspect-ratio: 9 / 19.3;
  border-radius: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: #07090c;
  padding: 9px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ui-phone::after {
  content: "";
  position: absolute;
  top: 14px; left: 50%;
  width: 92px; height: 6px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(-50%);
  z-index: 5;
}
.ui-glass {
  position: absolute;
  inset: 9px;
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(180deg, #0c1018, #05070a);
}
.ui-screen {
  position: absolute;
  inset: 0;
  padding: 44px 18px 18px;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  flex-direction: column;
}
.ui-screen.active { opacity: 1; }
.ui-screen .scr-top {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ui-screen .scr-top b { color: var(--accent); font-weight: 600; }

/* chat screen */
.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 10px;
}
.bubble.them { background: rgba(255, 255, 255, 0.08); border-bottom-left-radius: 4px; }
.bubble.me { background: var(--accent); color: #07090c; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .enc { display: block; font-size: 9px; letter-spacing: 0.1em; opacity: 0.6; margin-top: 4px; text-transform: uppercase; }

/* wallet screen */
.wallet-bal { margin-top: 8px; }
.wallet-bal .lab { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.wallet-bal .amt { font-family: var(--font-display); font-size: 40px; line-height: 1; margin-top: 6px; }
.wallet-bal .fiat { color: var(--accent); font-size: 13px; margin-top: 4px; }
.wallet-actions { display: flex; gap: 8px; margin-top: 18px; }
.wallet-actions span {
  flex: 1;
  text-align: center;
  border: 1px solid var(--faint);
  border-radius: 100px;
  padding: 9px 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wallet-actions span.fill { background: var(--accent); color: #07090c; border-color: var(--accent); }
.wallet-tx { margin-top: 20px; display: grid; gap: 12px; }
.wallet-tx .tx { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.wallet-tx .tx b { color: var(--ink); font-weight: 500; }

/* kill-switch screen */
.kill-list { margin-top: 6px; display: grid; gap: 12px; }
.kill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--faint);
  border-radius: 12px;
  padding: 13px 14px;
}
.kill .kn { font-size: 13px; }
.kill .kn small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.kill .sw { width: 40px; height: 22px; border-radius: 100px; background: rgba(255,255,255,0.12); position: relative; flex: none; transition: background 0.3s ease; }
.kill .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.3s ease; }
.kill.on .sw { background: var(--accent); }
.kill.on .sw::after { transform: translateX(18px); }


/* ---------- section wipe ---------- */
.has-wipe { position: relative; }
.wipe {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--accent);
  transform: scaleY(1);
  transform-origin: bottom;
  pointer-events: none;
}
.wipe.run {
  animation: wipe-clear 0.9s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes wipe-clear {
  0% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: top; }
}
@media (prefers-reduced-motion: reduce) { .wipe { display: none; } }

/* ---------- velocity marquee hook ---------- */
body.vel-on .mq-track,
body.vel-on .pay-track { animation: none !important; }
