/* aiice.dev - Cyberpunk Crystal */
/* Palette: #0b1628, #1a2744, #e8f0fe, #4fc3f7, #ff6b9d, #80d8ff, #7c4dff */

:root {
    --frost-deep: #0b1628;
    --ice-surface: #1a2744;
    --crystal-white: #e8f0fe;
    --frost-glow: #4fc3f7;
    --warm-spark: #ff6b9d;
    --crystal-edge: #80d8ff;
    --deep-accent: #7c4dff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--frost-deep);
    color: var(--crystal-white);
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================
   NAVIGATION
   ======================== */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    background: rgba(26, 39, 68, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(128, 216, 255, 0.1);
    transform: translateY(-100%);
    transition: transform 0.4s ease;
}

.nav-bar.visible {
    transform: translateY(0);
}

.nav-brand {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--crystal-white);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-link {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: rgba(232, 240, 254, 0.6);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--frost-glow);
}

.nav-diamond {
    width: 4px;
    height: 4px;
    background: var(--frost-glow);
    transform: rotate(45deg);
    opacity: 0.4;
}

/* ========================
   GLOBAL SECTION
   ======================== */
.crystal-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    overflow: hidden;
}

/* ========================
   CRYSTAL BACKGROUND SVG
   ======================== */
.crystal-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}

.crystal-bg.grown {
    opacity: 1;
}

/* ========================
   SNOWFALL
   ======================== */
.snow-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.snow-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--crystal-white);
    border-radius: 50%;
    opacity: 0;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    50% {
        transform: translateY(50vh) translateX(20px);
    }
    95% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) translateX(-10px);
        opacity: 0;
    }
}

/* ========================
   BREATH VAPOR / MIST
   ======================== */
.breath-vapor {
    position: absolute;
    width: 300px;
    height: 200px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.04;
    filter: blur(60px);
    animation: vaporDrift 20s ease-in-out infinite;
}

.vapor-1 {
    background: var(--frost-glow);
    top: 20%;
    left: -5%;
    animation-delay: 0s;
    animation-duration: 22s;
}

.vapor-2 {
    background: var(--crystal-edge);
    top: 60%;
    right: -5%;
    animation-delay: -7s;
    animation-duration: 18s;
}

.vapor-3 {
    background: var(--deep-accent);
    bottom: 10%;
    left: 30%;
    animation-delay: -12s;
    animation-duration: 25s;
}

.vapor-4 {
    background: var(--frost-glow);
    top: 15%;
    right: 10%;
    animation-delay: -4s;
    animation-duration: 20s;
}

.vapor-5 {
    background: var(--warm-spark);
    top: 40%;
    left: 15%;
    animation-delay: -10s;
    animation-duration: 24s;
    opacity: 0.03;
}

@keyframes vaporDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(40px, -20px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 15px) scale(0.9);
    }
    75% {
        transform: translate(20px, 25px) scale(1.05);
    }
}

/* ========================
   HERO
   ======================== */
.hero-hex {
    position: relative;
    z-index: 2;
    text-align: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(26, 39, 68, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5rem 4rem;
    border: 1px solid rgba(128, 216, 255, 0.15);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.5s ease 1s, transform 1.5s ease 1s;
}

.hero-hex.revealed {
    opacity: 1;
    transform: scale(1);
}

.brand-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 6rem);
    color: var(--crystal-white);
    letter-spacing: 0.05em;
    text-shadow: 0 0 40px rgba(79, 195, 247, 0.3);
}

.brand-sub {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--frost-glow);
    margin-top: 0.75rem;
    letter-spacing: 0.03em;
    opacity: 0.8;
}

/* ========================
   SECTION HEADING
   ======================== */
.section-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--crystal-white);
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.snowflake-icon {
    color: var(--frost-glow);
    opacity: 0.7;
}

/* ========================
   HEX GRID
   ======================== */
.archive-section {
    min-height: 150vh;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.hex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 850px;
    position: relative;
    z-index: 2;
}

.hex-cell {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(26, 39, 68, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 240px;
    height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.8rem;
    text-align: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.7s ease, transform 0.7s ease, background 0.4s ease;
    position: relative;
    cursor: default;
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.hex-frost-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), rgba(232, 240, 254, 0.08) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hex-cell:hover .hex-frost-overlay {
    opacity: 1;
}

.hex-cell:hover {
    background: rgba(26, 39, 68, 0.8);
}

.hex-title {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--frost-glow);
    margin-bottom: 0.6rem;
    letter-spacing: 0.05em;
}

.hex-body {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.72rem;
    line-height: 1.55;
    color: rgba(232, 240, 254, 0.6);
}

/* Neural network connections between hex cells */
.neural-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.neural-line {
    stroke: var(--frost-glow);
    stroke-width: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

.neural-line.visible {
    opacity: 0.15;
}

.neural-node {
    fill: var(--frost-glow);
    opacity: 0;
    transition: opacity 1s ease;
}

.neural-node.visible {
    opacity: 0.3;
}

/* ========================
   FADE IN UTILITY
   ======================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================
   THAW SECTION
   ======================== */
.thaw-section {
    background: linear-gradient(180deg, var(--frost-deep) 0%, #0f1e3a 50%, #141b30 100%);
}

.thaw-content {
    max-width: 580px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.thaw-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--warm-spark);
    letter-spacing: 0.05em;
    margin-bottom: 1.8rem;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.2);
}

.thaw-body {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(232, 240, 254, 0.72);
}

.thaw-body em {
    color: var(--warm-spark);
    font-style: italic;
}

.thaw-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 2rem 0;
}

.thaw-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--warm-spark), transparent);
}

.thaw-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warm-spark);
    box-shadow: 0 0 12px rgba(255, 107, 157, 0.4);
}

.thaw-quote {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(232, 240, 254, 0.5);
    letter-spacing: 0.05em;
    font-style: italic;
}

/* ========================
   EMERGENCE SECTION
   ======================== */
.emergence-section {
    background: linear-gradient(180deg, #141b30 0%, var(--frost-deep) 100%);
    min-height: 100vh;
}

.emergence-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.emergence-panel {
    background: rgba(26, 39, 68, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(128, 216, 255, 0.12);
    border-radius: 16px;
    padding: 3.5rem 3rem;
    max-width: 560px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.warm-core {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--warm-spark);
    box-shadow: 0 0 30px var(--warm-spark), 0 0 60px rgba(255, 107, 157, 0.3), 0 0 90px rgba(255, 107, 157, 0.1);
    margin: 0 auto 2.5rem;
    animation: coreGlow 3s ease-in-out infinite;
}

@keyframes coreGlow {
    0%, 100% {
        box-shadow: 0 0 20px var(--warm-spark), 0 0 40px rgba(255, 107, 157, 0.2), 0 0 60px rgba(255, 107, 157, 0.05);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px var(--warm-spark), 0 0 80px rgba(255, 107, 157, 0.4), 0 0 120px rgba(255, 107, 157, 0.15);
        transform: scale(1.1);
    }
}

.emergence-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.98rem;
    line-height: 1.85;
    color: rgba(232, 240, 254, 0.72);
    margin-bottom: 1.5rem;
}

.emergence-text em {
    color: var(--warm-spark);
    font-style: italic;
}

.emergence-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(128, 216, 255, 0.3), transparent);
    margin: 1.5rem auto;
}

.code-snippet {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.8;
    text-align: left;
    display: block;
    padding: 0 1.5rem;
}

.code-comment {
    color: rgba(128, 216, 255, 0.35);
}

.code-keyword {
    color: var(--deep-accent);
}

.code-var {
    color: var(--frost-glow);
}

.code-func {
    color: var(--warm-spark);
}

.code-string {
    color: rgba(232, 240, 254, 0.5);
}

/* ========================
   PRISMATIC LIGHT EFFECTS
   ======================== */
.prismatic-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(79, 195, 247, 0.3),
        rgba(124, 77, 255, 0.3),
        rgba(255, 107, 157, 0.3),
        rgba(128, 216, 255, 0.3),
        transparent
    );
    pointer-events: none;
    opacity: 0.4;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .hex-cell {
        width: 170px;
        height: 190px;
        padding: 2.2rem 1.2rem;
    }

    .hex-body {
        font-size: 0.65rem;
    }

    .hero-hex {
        padding: 3.5rem 2.5rem;
    }

    .nav-links {
        gap: 0.4rem;
    }

    .nav-link {
        font-size: 0.7rem;
    }

    .emergence-panel {
        padding: 2.5rem 1.5rem;
        margin: 0 1rem;
    }

    .thaw-content {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .hex-grid {
        gap: 1rem;
    }

    .hex-cell {
        width: 140px;
        height: 160px;
        padding: 1.8rem 1rem;
    }

    .hex-title {
        font-size: 0.8rem;
    }

    .hex-body {
        font-size: 0.6rem;
    }

    .nav-bar {
        padding: 0.6rem 1rem;
    }

    .nav-diamond {
        display: none;
    }

    .code-snippet {
        padding: 0 0.5rem;
        font-size: 0.68rem;
    }
}
