/* ============================================================
   SIX SIGHT — TACTICAL INTERACTION LAYER
   Shared motion, HUD effects & interactive tool styles.
   No dependencies. Respects prefers-reduced-motion.
============================================================ */

/* ─── Scroll progress bar (desktop) ─── */
#t-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent, #00B7FF);
    z-index: 9999;
    box-shadow: 0 0 8px rgba(0,183,255,0.6);
    pointer-events: none;
}

/* ─── Reveal system ─── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Staggered children */
[data-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-stagger].revealed > * { opacity: 1; transform: translateY(0); }
[data-stagger].revealed > *:nth-child(1) { transition-delay: 0.00s; }
[data-stagger].revealed > *:nth-child(2) { transition-delay: 0.10s; }
[data-stagger].revealed > *:nth-child(3) { transition-delay: 0.20s; }
[data-stagger].revealed > *:nth-child(4) { transition-delay: 0.30s; }
[data-stagger].revealed > *:nth-child(5) { transition-delay: 0.40s; }
[data-stagger].revealed > *:nth-child(6) { transition-delay: 0.50s; }

/* ─── Decode text ─── */
[data-decode] { --decode-done: 0; }
[data-decode] .t-scramble { color: var(--accent, #00B7FF); opacity: 0.7; }

/* ─── HUD cursor readout ─── */
.t-hud-coords {
    position: absolute;
    pointer-events: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: rgba(0,183,255,0.55);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 5;
    transform: translate(14px, 14px);
    transition: opacity 0.2s;
}
.t-hud-cross {
    position: absolute;
    pointer-events: none;
    width: 18px; height: 18px;
    z-index: 5;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s;
}
.t-hud-cross::before, .t-hud-cross::after {
    content: '';
    position: absolute;
    background: rgba(0,183,255,0.45);
}
.t-hud-cross::before { left: 50%; top: 0; width: 1px; height: 100%; }
.t-hud-cross::after { top: 50%; left: 0; height: 1px; width: 100%; }

/* ─── Spotlight cards (mouse-tracked border glow) ─── */
.t-spot { position: relative; }
.t-spot::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(0,183,255,0.08), transparent 65%);
}
.t-spot:hover::after { opacity: 1; }

/* ─── Blinking status dot ─── */
.t-blink {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--accent, #00B7FF);
    border-radius: 50%;
    margin-right: 8px;
    animation: t-blink 1.6s steps(2, start) infinite;
    vertical-align: middle;
}
@keyframes t-blink { to { visibility: hidden; } }

/* ============================================================
   ESAS INTERACTIVE EXPLORER (homepage)
============================================================ */
.esas-step { cursor: pointer; transition: background 0.25s; }
.esas-step:hover { background: #101010; }
.esas-step.active { background: #0f0f0f; }
.esas-step.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent, #00B7FF);
}
.esas-detail {
    border: 1px solid var(--border, #1E1E1E);
    border-top: none;
    background: #0c0c0c;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.esas-detail.open { max-height: 420px; }
.esas-detail-inner {
    padding: 36px 40px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
}
.esas-detail-visual {
    width: 120px; height: 120px;
    flex-shrink: 0;
    position: relative;
}
.esas-detail-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    color: var(--accent, #00B7FF);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}
.esas-detail-body {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.75;
    max-width: 640px;
}
.esas-progress {
    height: 2px;
    background: var(--border, #1E1E1E);
    position: relative;
    margin-top: -1px;
}
.esas-progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: var(--accent, #00B7FF);
    transition: width 0.3s linear;
}

/* Mini radar visual */
.t-mini-radar {
    width: 100%; height: 100%;
    border: 1px solid rgba(0,183,255,0.3);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}
.t-mini-radar::before {
    content: '';
    position: absolute;
    inset: 25%;
    border: 1px solid rgba(0,183,255,0.2);
    border-radius: 50%;
}
.t-mini-radar .sweep {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(0,183,255,0.35), transparent 70deg, transparent 360deg);
    border-radius: 50%;
    animation: t-sweep 3s linear infinite;
}
@keyframes t-sweep { to { transform: rotate(360deg); } }

/* ============================================================
   ASSESSMENT / QUIZ (personal page)
============================================================ */
.t-quiz {
    border: 1px solid var(--border, #1E1E1E);
    background: #0c0c0c;
    margin-top: 48px;
    position: relative;
    overflow: hidden;
}
.t-quiz-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #1E1E1E);
    padding: 18px 28px;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #555;
}
.t-quiz-head .t-quiz-counter { color: var(--accent, #00B7FF); }
.t-quiz-bar {
    height: 2px;
    background: var(--border, #1E1E1E);
}
.t-quiz-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent, #00B7FF);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.t-quiz-body { padding: 40px 28px; min-height: 320px; }
.t-quiz-q {
    font-family: var(--font-display, sans-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 8px;
    color: var(--white, #EAEAEA);
}
.t-quiz-scenario {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--accent, #00B7FF);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}
.t-quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.t-quiz-opt {
    text-align: left;
    background: #111;
    border: 1px solid #242424;
    color: #999;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    line-height: 1.55;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.t-quiz-opt:hover {
    border-color: var(--accent, #00B7FF);
    color: var(--white, #EAEAEA);
    background: #131313;
}
.t-quiz-opt .opt-key {
    color: var(--accent, #00B7FF);
    flex-shrink: 0;
}
.t-quiz-result { text-align: left; }
.t-quiz-result-tier {
    font-family: var(--font-display, sans-serif);
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    text-transform: uppercase;
    line-height: 0.95;
    margin: 12px 0 6px;
}
.t-quiz-result-tier em { font-style: normal; color: var(--accent, #00B7FF); }
.t-quiz-meter {
    height: 8px;
    background: #161616;
    border: 1px solid #242424;
    margin: 24px 0 8px;
    position: relative;
    max-width: 420px;
}
.t-quiz-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(0,183,255,0.35), var(--accent, #00B7FF));
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.t-quiz-meter-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}
.t-quiz-restart {
    background: none;
    border: none;
    color: #555;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0;
    margin-top: 18px;
    display: inline-block;
}
.t-quiz-restart:hover { color: var(--white, #EAEAEA); }

/* ============================================================
   RISK EXPOSURE AUDIT (corporate page)
============================================================ */
.t-audit {
    border: 1px solid var(--border, #1E1E1E);
    background: #0c0c0c;
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}
.t-audit-controls {
    padding: 36px 32px;
    border-right: 1px solid var(--border, #1E1E1E);
}
.t-audit-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    color: var(--accent, #00B7FF);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 12px;
}
.t-audit-label + .t-audit-label { margin-top: 28px; }
.t-audit-sectors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.t-audit-sector {
    background: #111;
    border: 1px solid #242424;
    color: #777;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.t-audit-sector:hover { border-color: var(--accent, #00B7FF); color: var(--white, #EAEAEA); }
.t-audit-sector.active {
    background: var(--accent, #00B7FF);
    color: var(--black, #090909);
    border-color: var(--accent, #00B7FF);
    font-weight: 600;
}
.t-audit-factors { display: flex; flex-direction: column; gap: 8px; }
.t-audit-factor {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111;
    border: 1px solid #242424;
    padding: 12px 16px;
    cursor: pointer;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: #777;
    transition: all 0.2s;
    user-select: none;
}
.t-audit-factor:hover { border-color: #3a3a3a; color: var(--white, #EAEAEA); }
.t-audit-factor .box {
    width: 14px; height: 14px;
    border: 1px solid #3a3a3a;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}
.t-audit-factor.checked { color: var(--white, #EAEAEA); border-color: rgba(0,183,255,0.4); }
.t-audit-factor.checked .box {
    background: var(--accent, #00B7FF);
    border-color: var(--accent, #00B7FF);
}
.t-audit-readout {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
}
.t-audit-gauge-num {
    font-family: var(--font-display, sans-serif);
    font-size: 4.5rem;
    line-height: 0.9;
    color: var(--accent, #00B7FF);
}
.t-audit-gauge-tier {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #777;
    margin: 8px 0 20px;
}
.t-audit-bar {
    height: 8px;
    background: #161616;
    border: 1px solid #242424;
    margin-bottom: 28px;
}
.t-audit-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(0,183,255,0.35), var(--accent, #00B7FF));
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.t-audit-findings { flex: 1; }
.t-audit-finding {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: #777;
    line-height: 1.6;
    padding: 10px 0;
    border-bottom: 1px solid var(--border, #1E1E1E);
    display: flex;
    gap: 10px;
}
.t-audit-finding::before { content: '//'; color: var(--accent, #00B7FF); flex-shrink: 0; }

@media (max-width: 860px) {
    .t-audit { grid-template-columns: 1fr; }
    .t-audit-controls { border-right: none; border-bottom: 1px solid var(--border, #1E1E1E); }
    .esas-detail-inner { grid-template-columns: 1fr; }
    .t-hud-cross, .t-hud-coords { display: none; }
}

/* ============================================================
   REDUCED MOTION — kill everything
============================================================ */
@media (prefers-reduced-motion: reduce) {
    .reveal, [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
    .ticker-content, .cred-content, .t-mini-radar .sweep, .t-blink,
    .radar-sweep, .radar-ping, .scan-line { animation: none !important; }
    .esas-detail, .t-quiz-bar-fill, .t-quiz-meter-fill, .t-audit-bar-fill { transition: none !important; }
    html { scroll-behavior: auto !important; }
}
