/* ================================================
   namu.biz - Translucent Frost / Art Deco Display
   ================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0B0E1A;
    color: #E8ECF4;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Background Lattice --- */
#lattice-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

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

/* --- Frost Chamber (Intro) --- */
#frost-chamber {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0B0E1A 0%, #1A1F2E 50%, #0B0E1A 100%);
    pointer-events: none;
}

#frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    background: rgba(11, 14, 26, 0.6);
    clip-path: circle(0% at 50% 50%);
    animation: frostMelt 2.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s forwards;
}

@keyframes frostMelt {
    0% {
        clip-path: circle(0% at 50% 50%);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
    }
    100% {
        clip-path: circle(150% at 50% 50%);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

#intro-title {
    position: relative;
    z-index: 1001;
    width: 80%;
    max-width: 800px;
}

#title-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

#title-svg text {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: strokeDraw 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.5s forwards;
}

@keyframes strokeDraw {
    0% {
        stroke-dashoffset: 1200;
        fill: transparent;
    }
    60% {
        stroke-dashoffset: 0;
        fill: transparent;
    }
    100% {
        stroke-dashoffset: 0;
        fill: #D4AF72;
    }
}

#frost-chamber.dismissed {
    animation: chamberFade 1s ease forwards;
}

@keyframes chamberFade {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* --- Main Content --- */
#main-content {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem);
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 100vh;
}

/* --- Content Layers (descending clarity) --- */
.content-layer {
    margin-bottom: clamp(4rem, 10vw, 8rem);
}

.layer-deep {
    opacity: 0.85;
}

.layer-deep .card {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.layer-mid {
    opacity: 0.92;
}

.layer-mid .card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.layer-clear {
    opacity: 1;
}

.layer-clear .card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --- Section Header --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8B95A8;
}

.diamond-bullet {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #D4AF72;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 3vw, 2.5rem);
}

/* Card Aspect Variations */
.card-tall {
    grid-row: span 2;
}

.card-wide {
    grid-column: span 2;
}

.card-full {
    grid-column: span 3;
}

.card-square {
    aspect-ratio: 1;
}

/* --- Card Base --- */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: border-color 400ms ease,
                box-shadow 400ms ease,
                transform 200ms ease;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 700ms cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 700ms cubic-bezier(0.25, 0.1, 0.25, 1),
                backdrop-filter 700ms ease,
                -webkit-backdrop-filter 700ms ease,
                border-color 400ms ease,
                box-shadow 400ms ease;
}

/* Card Gradient Washes */
.card:nth-child(odd) .card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 114, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.card:nth-child(even) .card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(225deg, rgba(126, 184, 212, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* Watermark Glyphs */
.card::after {
    content: attr(data-glyph);
    position: absolute;
    bottom: -0.15em;
    right: 0.1em;
    font-family: 'Poiret One', cursive;
    font-size: 12rem;
    line-height: 1;
    opacity: 0.04;
    color: #E8ECF4;
    pointer-events: none;
    user-select: none;
}

/* Art Deco Corner Clips */
.card-clip {
    position: absolute;
    width: 8px;
    height: 8px;
    transition: width 300ms ease, height 300ms ease;
}

.card-clip.top-left {
    top: 6px;
    left: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.card-clip.bottom-right {
    bottom: 6px;
    right: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* Card Inner */
.card-inner {
    position: relative;
    padding: clamp(1.5rem, 4vw, 3rem);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #E8ECF4;
    position: relative;
    display: inline-block;
    cursor: default;
    background-image: linear-gradient(#A78BCA, #A78BCA);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
    padding-bottom: 4px;
}

.card-title:hover {
    background-size: 100% 2px;
}

.card-body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.75;
    color: #8B95A8;
    margin-bottom: 1.5rem;
}

.card-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #D4AF72;
    margin-top: auto;
}

/* Card Hover States */
.card:hover {
    border-color: rgba(167, 139, 202, 0.35);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
}

.card:hover .card-clip {
    width: 12px;
    height: 12px;
}

.card:hover .card-inner::before {
    opacity: 1.5;
}

/* Card Active/Press */
.card:active {
    transform: translateY(1px);
}

.card:active.visible {
    transform: translateY(1px);
}

/* --- Floating Compass Navigation --- */
#compass {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
}

#compass-core {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(26, 31, 46, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 300ms ease, transform 300ms ease;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.15);
}

#compass-core:hover {
    border-color: rgba(167, 139, 202, 0.5);
    transform: scale(1.05);
}

.compass-chevron {
    transition: transform 300ms ease;
}

#compass.open .compass-chevron {
    transform: rotate(45deg);
}

#compass-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 300ms ease, transform 300ms ease;
}

#compass.open #compass-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.compass-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(26, 31, 46, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 300ms ease;
}

.compass-link:hover {
    border-color: rgba(167, 139, 202, 0.4);
}

.compass-link-diamond {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #D4AF72;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.compass-link-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #E8ECF4;
}

/* --- Underline Draw Animation on Links --- */
.compass-link-text {
    position: relative;
    background-image: linear-gradient(#A78BCA, #A78BCA);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
    padding-bottom: 2px;
}

.compass-link:hover .compass-link-text {
    background-size: 100% 2px;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-tall,
    .card-wide,
    .card-full {
        grid-column: span 1;
        grid-row: span 1;
    }

    .card:nth-child(odd) {
        margin-left: 8%;
        margin-right: 0;
    }

    .card:nth-child(even) {
        margin-right: 8%;
        margin-left: 0;
    }

    .card-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .card::after {
        font-size: 8rem;
    }

    #compass {
        bottom: 1rem;
        right: 1rem;
    }

    #compass-core {
        width: 52px;
        height: 52px;
    }

    #intro-title {
        width: 90%;
    }

    #title-svg text {
        font-size: 60;
    }
}

@media (max-width: 480px) {
    .card:nth-child(odd) {
        margin-left: 4%;
    }

    .card:nth-child(even) {
        margin-right: 4%;
    }

    .section-header {
        gap: 0.75rem;
    }
}

/* --- Accent Color Usage --- */
/* Frost Blue #7EB8D4 - used on alternate card labels */
.card:nth-child(3n+2) .card-label {
    color: #7EB8D4;
}

/* Rose Quartz #C4889A - used on section dividers and alternate card labels */
.card:nth-child(3n+3) .card-label {
    color: #C4889A;
}

.section-header::before,
.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #C4889A, transparent);
    opacity: 0.2;
}

.layer-clear .section-header::before,
.layer-clear .section-header::after {
    background: linear-gradient(to right, transparent, #7EB8D4, transparent);
    opacity: 0.25;
}

/* --- Scroll-linked lattice parallax handled in JS --- */
/* --- Card entrance stagger handled in JS --- */
