/* ===================================================================
   LAVA — shared stylesheet
   Loaded by every page. Edit here once, all pages update.
   =================================================================== */

body {
    background-color: #070709;
    color: #F5F5F0;
    overflow-x: hidden;
}

/* ---------- Ambient layers ---------- */

#cursorGlow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.7;
    background: radial-gradient(
        450px circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh),
        rgba(255, 248, 214, 0.15) 0%,
        rgba(212, 175, 55, 0.25) 20%,
        rgba(255, 94, 58, 0.08) 50%,
        transparent 70%
    );
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.15));
    transition: opacity 0.3s ease;
    will-change: background;
    mix-blend-mode: screen;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* ---------- Cards ---------- */

.premium-card {
    background: rgba(19, 19, 26, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    will-change: transform;
}

.premium-card:hover {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.12), 0 0 25px rgba(255, 94, 58, 0.06);
    transform: translateY(-6px) scale(1.01);
}

/* Panels that shouldn't lift on hover (nav bar, demo windows, data tables) */
.no-lift:hover { transform: none; }

.spotlight-card {
    position: relative;
    overflow: hidden;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: var(--card-mouse-y, -100px);
    left: var(--card-mouse-x, -100px);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
    border-radius: 50%;
}

.spotlight-card:hover::before { opacity: 1; }

/* ---------- Typography ---------- */

.luxury-text { font-family: 'Playfair Display', serif; }

.gold-gradient-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #D4AF37 50%, #FF5E3A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lava-flame-icon {
    display: inline-block;
    background: linear-gradient(135deg, #FF5E3A, #D4AF37);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

.lava-flame-icon:hover { transform: scale(1.2) rotate(5deg); }

.gold-divider-center {
    height: 1px;
    width: 80px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    margin: 1rem auto;
    transition: width 0.6s ease;
}

.reveal.active .gold-divider-center { width: 140px; }

.gold-divider-left {
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, #D4AF37, transparent);
    margin: 1rem 0;
}

/* ---------- Navigation ---------- */

header.scrolled .premium-card {
    background: rgba(12, 12, 16, 0.88);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, #D4AF37, #FF5E3A);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after { width: 100%; }

.nav-link.is-active {
    color: #D4AF37;
}

.nav-link.is-active::after { width: 100%; }

#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
}

#mobileMenu.open {
    max-height: 420px;
    opacity: 1;
}

/* ---------- Forms ---------- */

.input-field {
    background: rgba(7, 7, 9, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #F5F5F0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-field:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    background: rgba(19, 19, 26, 0.9);
    transform: translateY(-1px);
}

.input-field::placeholder { color: rgba(245, 245, 240, 0.35); }

/* ---------- Imagery ---------- */

.subtle-image {
    mix-blend-mode: luminosity;
    opacity: 0.2;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .subtle-image {
    opacity: 0.38;
    transform: scale(1.06);
}

/* ---------- Scroll reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Live demo stream ---------- */

#terminalStream {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Raw, unsafe value — visible for a beat before enforcement fires */
.leak-text {
    color: #FF5E3A;
    background: rgba(255, 94, 58, 0.12);
    border: 1px solid rgba(255, 94, 58, 0.35);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
    animation: leak-flash 0.7s ease-in-out infinite;
}

@keyframes leak-flash {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(255, 94, 58, 0); }
    50%      { opacity: 0.6; box-shadow: 0 0 14px rgba(255, 94, 58, 0.45); }
}

.redacted-text {
    background-color: #D4AF37;
    color: #070709;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    animation: redact-glow 0.5s ease-out;
}

@keyframes redact-glow {
    0%   { transform: scale(1.15); filter: brightness(1.8); }
    100% { transform: scale(1); filter: brightness(1); }
}

.stream-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: #D4AF37;
    vertical-align: -0.15em;
    margin-left: 2px;
    animation: caret-blink 1s steps(1) infinite;
}

.stream-cursor.done { display: none; }

@keyframes caret-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.audit-line {
    animation: log-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes log-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Code blocks ---------- */

.code-block {
    background: rgba(7, 7, 9, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 0.9rem;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.75;
    color: rgba(245, 245, 240, 0.85);
}

.code-block .c-key { color: #D4AF37; }
.code-block .c-str { color: #7DD3A0; }
.code-block .c-com { color: rgba(245, 245, 240, 0.35); font-style: italic; }
.code-block .c-add { color: #FF5E3A; font-weight: 600; }

/* ---------- Data tables ---------- */

.lava-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
}

.lava-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    color: #D4AF37;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.65rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    white-space: nowrap;
}

.lava-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(245, 245, 240, 0.75);
    vertical-align: top;
}

.lava-table tr:last-child td { border-bottom: none; }
.lava-table tbody tr { transition: background 0.25s ease; }
.lava-table tbody tr:hover { background: rgba(212, 175, 55, 0.04); }

.table-scroll { overflow-x: auto; }

/* ---------- Success state ---------- */

@keyframes check-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.check-ring {
    width: 84px;
    height: 84px;
    border-radius: 9999px;
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: check-pop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.check-ring::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    animation: glow-pulse 3s ease-in-out infinite;
}

/* ---------- Timeline ---------- */

.timeline-item {
    position: relative;
    padding-left: 2.25rem;
    padding-bottom: 2.25rem;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
}

.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background: #D4AF37;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}

.timeline-item.is-past::before {
    background: #1C1C26;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: none;
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #070709; }
::-webkit-scrollbar-thumb { background: #1C1C26; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #D4AF37; }

/* ---------- Accessibility ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    background: #D4AF37;
    color: #070709;
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    border-radius: 0 0 0.5rem 0;
}

.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
    .leak-text, .stream-cursor, .premium-card { animation: none; }
    * { scroll-behavior: auto !important; }
}
