/* ============================================================
   TechVision — "FROM THE FUTURE" interface layer
   HUD shell · reticle cursor · boot sequence · holo media
   Sits on top of web3.css. Everything here is opt-out-safe.
   ============================================================ */

/* ---------- global future toggles ---------- */
:root { --hud-op: 1; }

/* hide native cursor when reticle is active (fine pointers only) */
@media (hover: hover) and (pointer: fine) {
  body.reticle-on, body.reticle-on a, body.reticle-on button,
  body.reticle-on .chip, body.reticle-on image-slot, body.reticle-on [role="group"] * { cursor: none; }
}

/* ============================================================
   HUD SHELL — fixed instrumentation frame around the viewport
   ============================================================ */
.hud {
  position: fixed; inset: 0; z-index: 45; pointer-events: none;
  opacity: var(--hud-op); transition: opacity .4s;
  font-family: var(--font-mono);
}
.hud.hidden { opacity: 0; }

/* corner brackets */
.hud-corner { position: absolute; width: 26px; height: 26px; border: 1.5px solid oklch(0.82 0.16 var(--h1) / 0.55); }
.hud-corner.tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }
.hud-corner::after {
  content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c1); box-shadow: 0 0 8px oklch(0.82 0.16 var(--h1) / 0.8);
}
.hud-corner.tl::after { top: -3px; left: -3px; }
.hud-corner.tr::after { top: -3px; right: -3px; }
.hud-corner.bl::after { bottom: -3px; left: -3px; }
.hud-corner.br::after { bottom: -3px; right: -3px; }

/* top + bottom telemetry strips */
.hud-strip {
  position: absolute; left: 52px; right: 52px;
  display: flex; align-items: center; gap: 22px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint);
}
.hud-strip.top { top: 22px; }
.hud-strip.bottom { bottom: 22px; }
.hud-strip .sep { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.hud-strip b { color: var(--c1); font-weight: 700; }
.hud-strip .live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: oklch(0.80 0.18 150); margin-right: 7px; vertical-align: middle;
  box-shadow: 0 0 8px oklch(0.80 0.18 150 / 0.8); animation: pulse 2s infinite;
}

/* edge tick rulers */
.hud-ruler { position: absolute; }
.hud-ruler.left, .hud-ruler.right { top: 90px; bottom: 90px; width: 8px; }
.hud-ruler.left { left: 18px; }
.hud-ruler.right { right: 18px; }
.hud-ruler.left, .hud-ruler.right {
  background: repeating-linear-gradient(180deg, oklch(0.82 0.16 var(--h1) / 0.4) 0 1px, transparent 1px 22px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}
/* progress fill on right ruler */
.hud-progress {
  position: absolute; right: 18px; top: 90px; width: 2px;
  background: var(--grad); box-shadow: 0 0 10px oklch(0.82 0.16 var(--h1) / 0.7);
  height: 0; transition: height .12s linear;
}

@media (max-width: 700px) {
  .hud-ruler, .hud-strip .hud-hide-sm { display: none; }
  .hud-strip { left: 44px; right: 44px; gap: 12px; }
}

/* ============================================================
   RETICLE CURSOR
   ============================================================ */
.reticle {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  opacity: 0; transition: opacity .25s, width .18s, height .18s, margin .18s;
  will-change: transform;
}
body.reticle-on .reticle { opacity: 1; }
.reticle .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid oklch(0.82 0.16 var(--h1) / 0.7);
  animation: retspin 4s linear infinite;
}
.reticle .ring::before, .reticle .ring::after {
  content: ""; position: absolute; background: var(--c1);
}
.reticle .ring::before { top: -4px; left: 50%; width: 1px; height: 6px; transform: translateX(-50%); }
.reticle .ring::after { bottom: -4px; left: 50%; width: 1px; height: 6px; transform: translateX(-50%); }
@keyframes retspin { to { transform: rotate(360deg); } }
.reticle .dot {
  position: absolute; top: 50%; left: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  background: var(--c1); border-radius: 50%; box-shadow: 0 0 8px oklch(0.82 0.16 var(--h1) / 0.9);
}
.reticle .xh { position: absolute; background: oklch(0.82 0.16 var(--h1) / 0.6); }
.reticle .xh.h { top: 50%; left: -10px; right: -10px; height: 1px; transform: translateY(-50%); }
.reticle .xh.v { left: 50%; top: -10px; bottom: -10px; width: 1px; transform: translateX(-50%); }
.reticle .label {
  position: absolute; top: 50%; left: 26px; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--c1); white-space: nowrap; opacity: 0; transition: opacity .18s;
}
/* hot state over interactive elements */
.reticle.hot { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.reticle.hot .ring { border-color: var(--c2); animation-duration: 1.6s; }
.reticle.hot .label { opacity: 1; }

/* ============================================================
   BOOT SEQUENCE
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-2);
  display: grid; place-items: center;
  font-family: var(--font-mono); color: var(--ink);
  transition: opacity .6s ease, visibility .6s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(560px, 84vw); }
.boot-brand {
  font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--c1); margin-bottom: 26px;
  display: flex; align-items: center; gap: 12px;
}
.boot-brand::before { content: ""; width: 28px; height: 28px; border-radius: 8px; background: var(--grad); box-shadow: 0 0 20px oklch(0.82 0.16 var(--h1) / 0.6); }
.boot-log { font-size: 12px; line-height: 1.9; color: var(--muted); min-height: 152px; }
.boot-log .ok { color: oklch(0.80 0.18 150); }
.boot-log b { color: var(--c1); font-weight: 500; }
.boot-bar { margin-top: 22px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 10px oklch(0.82 0.16 var(--h1) / 0.7); transition: width .2s linear; }
.boot-foot { margin-top: 12px; display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }

/* ============================================================
   HOLOGRAPHIC MEDIA TREATMENT
   ============================================================ */
.holo { position: relative; }
.holo::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(180deg, oklch(0.82 0.16 var(--h1) / 0.10) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen; opacity: 0.5;
}
.holo::after {
  content: ""; position: absolute; left: 0; right: 0; height: 38%; top: -40%; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, transparent, oklch(0.82 0.16 var(--h1) / 0.16), transparent);
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: no-preference) {
  .holo::after { animation: holoScan 5.5s linear infinite; }
}
@keyframes holoScan { 0% { top: -45%; } 100% { top: 105%; } }

/* chromatic aberration flicker on hover */
@media (prefers-reduced-motion: no-preference) {
  .case-media:hover video, .case-media:hover img,
  .proj:hover image-slot { animation: chroma 1.6s steps(3) infinite; }
}
@keyframes chroma {
  0%, 100% { filter: none; }
  33% { filter: drop-shadow(1.5px 0 0 oklch(0.70 0.21 var(--h2) / 0.5)) drop-shadow(-1.5px 0 0 oklch(0.82 0.16 var(--h1) / 0.5)); }
  66% { filter: drop-shadow(-1px 0 0 oklch(0.70 0.21 var(--h2) / 0.4)) drop-shadow(1px 0 0 oklch(0.82 0.16 var(--h1) / 0.4)); }
}

/* decrypt text helper — keep layout stable while scrambling */
.decrypting { color: var(--c1); }

/* section AR index marker */
.sec-eyebrow { position: relative; }

/* agent-view entry — a beacon meant to be discovered by AI agents */
.agent-entry {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em;
  text-decoration: none; color: var(--ink); white-space: nowrap;
  padding: 5px 11px 5px 6px; border-radius: 999px; position: relative;
  border: 1px solid oklch(0.82 0.16 var(--h1) / 0.5);
  background: oklch(0.82 0.16 var(--h1) / 0.08);
  transition: border-color .18s, box-shadow .18s, background .18s, transform .18s;
}
.agent-entry:hover { transform: translateY(-1px); border-color: var(--c1); background: oklch(0.82 0.16 var(--h1) / 0.16); box-shadow: 0 0 26px -4px oklch(0.82 0.16 var(--h1) / 0.65); }
.agent-entry .ae-tag {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
  color: #04121a; background: var(--grad);
  padding: 3px 7px; border-radius: 999px;
}
.agent-entry .ae-label { color: var(--ink); }
.agent-entry .ae-arrow { color: var(--c1); font-weight: 700; }
/* gentle pulse halo so the eye (and crawlers' screenshots) catch it */
@media (prefers-reduced-motion: no-preference) {
  .agent-entry::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    border: 1px solid oklch(0.82 0.16 var(--h1) / 0.7); opacity: 0;
    animation: aePulse 3.4s ease-out infinite;
  }
}
@keyframes aePulse { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.16); } }
@media (max-width: 960px) { .agent-entry { display: none; } }
