/* ============================================
   aei.st - Mid-Century Sci-Fi HUD Design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0A0A14;
    color: #B8C4D0;
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Marble Background (Plane 0) --- */
#marble-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
    background:
        radial-gradient(ellipse at 20% 50%, #2A1A30 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, #1A1A2E 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, #2A1A30 0%, transparent 45%),
        linear-gradient(135deg, rgba(255,215,0,0.08) 0%, transparent 2%, transparent 15%, rgba(255,215,0,0.05) 15.5%, transparent 16%, transparent 40%, rgba(255,215,0,0.06) 40.3%, transparent 41%, transparent 70%, rgba(255,215,0,0.04) 70.2%, transparent 71%),
        linear-gradient(45deg, transparent 30%, rgba(255,215,0,0.03) 30.2%, transparent 31%, transparent 55%, rgba(255,215,0,0.05) 55.1%, transparent 56%, transparent 85%, rgba(255,215,0,0.04) 85.3%, transparent 86%),
        #0A0A14;
}

#marble-bg.visible {
    opacity: 1;
}

#marble-noise-layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    filter: url(#marble-noise);
    opacity: 0.15;
    background: linear-gradient(180deg, #1A1A2E, #0A0A14, #2A1A30, #0A0A14);
}

/* --- Ambient Particles --- */
#ambient-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ambient-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00FFCC;
    border-radius: 50%;
    opacity: 0.08;
    animation: particle-float linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 0.08;
    }
    90% {
        opacity: 0.08;
    }
    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

/* --- HUD Overlay Frame (Plane 2) --- */
#hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hud-frame.visible {
    opacity: 1;
}

.hud-corner {
    position: fixed;
    width: 60px;
    height: 60px;
}

.hud-corner path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hud-frame.visible .hud-corner path {
    stroke-dashoffset: 0;
}

.hud-corner-tl { top: 12px; left: 12px; }
.hud-corner-tr { top: 12px; right: 12px; }
.hud-corner-bl { bottom: 12px; left: 12px; }
.hud-corner-br { bottom: 12px; right: 12px; }

/* HUD Edge dashed lines */
.hud-edge {
    position: fixed;
    background: none;
}

.hud-edge-top, .hud-edge-bottom {
    left: 72px;
    right: 72px;
    height: 1px;
    border-top: 1px dashed rgba(255,45,111,0.2);
}

.hud-edge-top { top: 13px; }
.hud-edge-bottom { bottom: 13px; }

.hud-edge-left, .hud-edge-right {
    top: 72px;
    bottom: 72px;
    width: 1px;
    border-left: 1px dashed rgba(255,45,111,0.2);
}

.hud-edge-left { left: 13px; }
.hud-edge-right { right: 13px; }

/* HUD Data Readouts */
.hud-readout {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #FF2D6F;
    opacity: 0.8;
}

.hud-label {
    font-size: 9px;
    opacity: 0.5;
}

.hud-value {
    opacity: 1;
}

.hud-pulse {
    animation: hud-pulse-anim 3s ease-in-out infinite;
}

@keyframes hud-pulse-anim {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.hud-readout-tl { top: 28px; left: 80px; }
.hud-readout-tr { top: 28px; right: 80px; text-align: right; }
.hud-readout-bl { bottom: 28px; left: 80px; }
.hud-readout-br { bottom: 28px; right: 80px; text-align: right; }

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

/* Atomic Orbital SVG */
#atomic-orbital {
    width: 280px;
    height: 280px;
    margin-bottom: 24px;
}

.orbital-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    opacity: 0;
}

.orbital-path.animate {
    opacity: 1;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.orbital-nucleus.animate {
    stroke-dasharray: 60;
    transition-duration: 0.5s;
    transition-delay: 0s;
}

.orbital-ring-1.animate {
    stroke-dasharray: 520;
    transition-duration: 1.2s;
    transition-delay: 0.3s;
}

.orbital-ring-2.animate {
    stroke-dasharray: 520;
    transition-duration: 1.2s;
    transition-delay: 0.8s;
}

.orbital-ring-3.animate {
    stroke-dasharray: 520;
    transition-duration: 1.2s;
    transition-delay: 1.3s;
}

.orbital-electron-1.animate,
.orbital-electron-2.animate,
.orbital-electron-3.animate {
    stroke-dasharray: 30;
    transition-duration: 0.4s;
    transition-delay: 1.8s;
}

.orbital-trajectory-1.animate {
    stroke-dasharray: 600;
    transition-duration: 1s;
    transition-delay: 2s;
}

.orbital-trajectory-2.animate {
    stroke-dasharray: 600;
    transition-duration: 1s;
    transition-delay: 2.2s;
}

.orbital-signal-1.animate,
.orbital-signal-2.animate,
.orbital-signal-3.animate,
.orbital-signal-4.animate {
    stroke-dasharray: 15;
    transition-duration: 0.3s;
    transition-delay: 2.5s;
}

/* Site Title */
#site-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 72px;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.25);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#site-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Site Tagline */
#site-tagline {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: #B8C4D0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

#site-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Indicator */
#scroll-indicator {
    margin-top: 40px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#scroll-indicator.visible {
    opacity: 1;
    animation: scroll-bounce 2s ease-in-out infinite;
}

#scroll-indicator svg {
    width: 24px;
    height: 24px;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* --- Card Grid Container --- */
#card-grid-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

/* --- Content Sections --- */
.content-section {
    margin-bottom: 60px;
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* --- Cards --- */
.card {
    position: relative;
    background: #1A1A2E;
    border-radius: 12px 2px 12px 2px;
    border: 1px solid rgba(0, 255, 204, 0.15);
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 1px rgba(0,255,204,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 2px rgba(0,255,204,0.5);
    border-color: rgba(0, 255, 204, 0.6);
}

.card:hover .section-illustration .draw-path {
    filter: drop-shadow(0 0 6px rgba(0,255,204,0.4));
}

/* Card Reveal Animation */
.card-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Full-width card */
.card-full {
    grid-column: 1 / -1;
}

/* Card Title */
.card-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.25);
    margin-bottom: 12px;
}

h3.card-title {
    font-size: 22px;
}

/* Card Body */
.card-body {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: #B8C4D0;
}

/* --- Card HUD Brackets --- */
.card-hud-brackets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bracket {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 0.4;
    animation: bracket-pulse 3s ease-in-out infinite;
}

.bracket::before,
.bracket::after {
    content: '';
    position: absolute;
    background: #FF2D6F;
}

.bracket-tl { top: 8px; left: 8px; }
.bracket-tl::before { top: 0; left: 0; width: 8px; height: 1px; }
.bracket-tl::after { top: 0; left: 0; width: 1px; height: 8px; }

.bracket-tr { top: 8px; right: 8px; }
.bracket-tr::before { top: 0; right: 0; width: 8px; height: 1px; }
.bracket-tr::after { top: 0; right: 0; width: 1px; height: 8px; }

.bracket-bl { bottom: 8px; left: 8px; }
.bracket-bl::before { bottom: 0; left: 0; width: 8px; height: 1px; }
.bracket-bl::after { bottom: 0; left: 0; width: 1px; height: 8px; }

.bracket-br { bottom: 8px; right: 8px; }
.bracket-br::before { bottom: 0; right: 0; width: 8px; height: 1px; }
.bracket-br::after { bottom: 0; right: 0; width: 1px; height: 8px; }

@keyframes bracket-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* --- Status Pills --- */
.status-pill {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid #FFD700;
    color: #FFD700;
    opacity: 0.7;
    margin-bottom: 16px;
    height: 20px;
    line-height: 16px;
}

.status-pill-pink {
    border-color: #FF2D6F;
    color: #FF2D6F;
}

.status-pill-gold {
    border-color: #FFD700;
    color: #FFD700;
}

/* --- Data Ribbons --- */
.data-ribbon {
    position: absolute;
    bottom: 16px;
    right: -20px;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,255,204,0.3), transparent);
}

.data-ribbon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 3px;
    height: 5px;
    background: rgba(0,255,204,0.3);
}

.data-ribbon::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 20px;
    width: 3px;
    height: 5px;
    background: rgba(0,255,204,0.3);
}

/* --- SVG Illustrations --- */
.card-svg-container {
    margin-bottom: 24px;
}

.section-illustration {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.draw-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    opacity: 0;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease, filter 0.3s ease;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
    opacity: 1;
}

/* Staggered draw delays for satellite */
.satellite-antenna.drawn { transition-delay: 0s; stroke-dasharray: 50; }
.satellite-dish.drawn { transition-delay: 0.2s; stroke-dasharray: 60; }
.satellite-body.drawn { transition-delay: 0.4s; stroke-dasharray: 150; }
.satellite-panel-l.drawn { transition-delay: 0.6s; stroke-dasharray: 70; }
.satellite-panel-l2.drawn { transition-delay: 0.7s; stroke-dasharray: 30; }
.satellite-panel-l3.drawn { transition-delay: 0.8s; stroke-dasharray: 100; }
.satellite-panel-r.drawn { transition-delay: 0.9s; stroke-dasharray: 70; }
.satellite-panel-r2.drawn { transition-delay: 1.0s; stroke-dasharray: 30; }
.satellite-panel-r3.drawn { transition-delay: 1.1s; stroke-dasharray: 100; }
.satellite-orbit.drawn { transition-delay: 1.3s; stroke-dasharray: 500; transition-duration: 1s; }
.satellite-sig-1.drawn { transition-delay: 1.8s; stroke-dasharray: 15; }
.satellite-sig-2.drawn { transition-delay: 1.9s; stroke-dasharray: 15; }
.satellite-sig-3.drawn { transition-delay: 2.0s; stroke-dasharray: 15; }
.satellite-sig-4.drawn { transition-delay: 2.1s; stroke-dasharray: 15; }

/* Staggered draw delays for constellation */
.const-star-1.drawn { transition-delay: 0s; stroke-dasharray: 25; }
.const-star-2.drawn { transition-delay: 0.15s; stroke-dasharray: 25; }
.const-star-3.drawn { transition-delay: 0.3s; stroke-dasharray: 25; }
.const-star-4.drawn { transition-delay: 0.45s; stroke-dasharray: 25; }
.const-star-5.drawn { transition-delay: 0.6s; stroke-dasharray: 25; }
.const-star-6.drawn { transition-delay: 0.75s; stroke-dasharray: 25; }
.const-star-7.drawn { transition-delay: 0.9s; stroke-dasharray: 25; }
.const-line-1.drawn { transition-delay: 1.0s; stroke-dasharray: 100; }
.const-line-2.drawn { transition-delay: 1.15s; stroke-dasharray: 100; }
.const-line-3.drawn { transition-delay: 1.3s; stroke-dasharray: 120; }
.const-line-4.drawn { transition-delay: 1.45s; stroke-dasharray: 100; }
.const-line-5.drawn { transition-delay: 1.6s; stroke-dasharray: 100; }
.const-line-6.drawn { transition-delay: 1.75s; stroke-dasharray: 100; }
.const-line-7.drawn { transition-delay: 1.9s; stroke-dasharray: 150; }
.const-label.drawn { transition-delay: 2.1s; stroke-dasharray: 300; }

/* Staggered draw delays for lattice */
.lattice-h1.drawn { transition-delay: 0s; stroke-dasharray: 350; }
.lattice-h2.drawn { transition-delay: 0.15s; stroke-dasharray: 400; }
.lattice-h3.drawn { transition-delay: 0.3s; stroke-dasharray: 350; }
.lattice-v1.drawn { transition-delay: 0.5s; stroke-dasharray: 200; }
.lattice-v2.drawn { transition-delay: 0.65s; stroke-dasharray: 200; }
.lattice-v3.drawn { transition-delay: 0.8s; stroke-dasharray: 200; }
.lattice-d1.drawn { transition-delay: 1.0s; stroke-dasharray: 120; }
.lattice-d2.drawn { transition-delay: 1.15s; stroke-dasharray: 120; }
.lattice-d3.drawn { transition-delay: 1.3s; stroke-dasharray: 120; }
.lattice-d4.drawn { transition-delay: 1.45s; stroke-dasharray: 120; }
.lattice-node.drawn { transition-delay: 1.7s; stroke-dasharray: 40; }

/* --- Decorative Elements --- */

/* Starburst */
.starburst-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    opacity: 0.2;
}

.starburst-decoration::before,
.starburst-decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #00FFCC;
}

.starburst-decoration::before {
    width: 24px;
    height: 1px;
}

.starburst-decoration::after {
    width: 1px;
    height: 24px;
}

/* Atomic dot */
.atomic-dot-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 50%;
    opacity: 0.25;
}

.atomic-dot-decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #FFD700;
}

/* Diamond Divider */
.diamond-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 60px 0;
}

.diamond {
    width: 8px;
    height: 8px;
    background: #00FFCC;
    transform: rotate(45deg);
    opacity: 0.3;
}

.diamond-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,204,0.3), transparent);
}

/* --- Footer --- */
#site-footer {
    padding: 40px 0;
    text-align: center;
}

.footer-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hud-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #7A8A9A;
}

.footer-separator {
    opacity: 0.3;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #site-title {
        font-size: 48px;
    }

    #site-tagline {
        font-size: 16px;
        padding: 0 20px;
    }

    #atomic-orbital {
        width: 200px;
        height: 200px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-title {
        font-size: 24px;
    }

    h3.card-title {
        font-size: 20px;
    }

    .card {
        padding: 24px;
    }

    #card-grid-container {
        padding: 40px 16px 40px;
    }

    .hud-readout {
        font-size: 9px;
    }

    .hud-readout-tl { top: 20px; left: 50px; }
    .hud-readout-tr { top: 20px; right: 50px; }
    .hud-readout-bl { bottom: 20px; left: 50px; }
    .hud-readout-br { bottom: 20px; right: 50px; }

    .hud-corner-tl { top: 6px; left: 6px; }
    .hud-corner-tr { top: 6px; right: 6px; }
    .hud-corner-bl { bottom: 6px; left: 6px; }
    .hud-corner-br { bottom: 6px; right: 6px; }

    .hud-edge-top, .hud-edge-bottom {
        left: 50px;
        right: 50px;
    }

    .hud-edge-left, .hud-edge-right {
        top: 50px;
        bottom: 50px;
    }

    .hud-edge-top { top: 7px; }
    .hud-edge-bottom { bottom: 7px; }
    .hud-edge-left { left: 7px; }
    .hud-edge-right { right: 7px; }
}

@media (max-width: 480px) {
    #site-title {
        font-size: 36px;
    }

    .card-title {
        font-size: 22px;
    }

    h3.card-title {
        font-size: 18px;
    }

    .hud-readout-tl,
    .hud-readout-tr,
    .hud-readout-bl,
    .hud-readout-br {
        display: none;
    }
}
