/* longitude.quest - Design System */
/* Colors: #0a0a0a, #111111, #c9a84c, #8b7535, #e8e2d4, #f5f0e1 */
/* Fonts: Space Grotesk (700), Inter (400/500), JetBrains Mono (500) */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0a0a0a;
    color: #e8e2d4;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Grain Overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
    opacity: 0.5;
}

/* ========== MERIDIAN LINE ========== */
#meridian-line {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: linear-gradient(180deg, transparent, #c9a84c 20%, #c9a84c 80%, transparent);
    z-index: 1;
    transform: translateX(-50%);
    opacity: 0.6;
    transition: left 0.1s ease-out;
}

/* ========== COMPASS ROSE ========== */
#compass-rose {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80vmin;
    height: 80vmin;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    animation: compass-rotate 120s linear infinite;
}

@keyframes compass-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.compass-arm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 5%, rgba(201, 168, 76, 0.04) 20%, rgba(201, 168, 76, 0.04) 80%, transparent 95%);
    transform-origin: center center;
}

.compass-n { transform: translate(-50%, -50%) rotate(0deg); }
.compass-e { transform: translate(-50%, -50%) rotate(90deg); }
.compass-s { transform: translate(-50%, -50%) rotate(180deg); }
.compass-w { transform: translate(-50%, -50%) rotate(270deg); }
.compass-ne { transform: translate(-50%, -50%) rotate(45deg); }
.compass-se { transform: translate(-50%, -50%) rotate(135deg); }
.compass-sw { transform: translate(-50%, -50%) rotate(225deg); }
.compass-nw { transform: translate(-50%, -50%) rotate(315deg); }

.compass-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    border: 1px solid rgba(201, 168, 76, 0.04);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ========== HORIZONTAL LONGITUDE LINES ========== */
.h-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.h-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.06), transparent);
    transition: transform 0.3s ease-out;
}

/* ========== ZONE SECTIONS ========== */
.zone {
    position: relative;
    min-height: 100vh;
    padding: 0;
    z-index: 2;
}

/* ========== ZONE INTERSTITIAL ========== */
.zone-interstitial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    position: relative;
    z-index: 2;
}

.coord-display {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 15vw, 200px);
    color: #c9a84c;
    letter-spacing: 0.08em;
    line-height: 1.0;
    text-transform: uppercase;
    opacity: 0.15;
    user-select: none;
}

.zone-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    color: #8b7535;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 24px;
    opacity: 0.7;
}

/* ========== ZONE GRIDS ========== */
.zone-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 24px;
    padding: 64px 5vw;
    min-height: 80vh;
    position: relative;
    z-index: 2;
}

/* Zone 1: Tall narrow cards */
.grid-1 {
    grid-auto-rows: minmax(180px, auto);
}

/* Zone 2: Wide landscape cards */
.grid-2 {
    grid-auto-rows: minmax(220px, auto);
}

/* Zone 3: Small scattered cards */
.grid-3 {
    grid-auto-rows: minmax(150px, auto);
    gap: 20px;
}

/* ========== CARDS ========== */
.card {
    position: relative;
    background: #111111;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.08);
    transition: box-shadow 0.4s ease;
}

.card:hover {
    box-shadow: 0 0 50px rgba(201, 168, 76, 0.15);
}

/* Card border animation via pseudo-element */
.card-border {
    position: absolute;
    inset: 0;
    border: 1px solid #c9a84c;
    pointer-events: none;
    clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    transition: clip-path 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card.visible .card-border {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Card coordinate label */
.card-coord {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 10px;
    color: #8b7535;
    letter-spacing: 0.12em;
    opacity: 0.6;
    position: absolute;
    top: 12px;
    right: 16px;
}

/* Card title */
.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 48px);
    color: #c9a84c;
    letter-spacing: 0.08em;
    line-height: 1.0;
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* Card body text */
.card-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #e8e2d4;
    letter-spacing: 0.01em;
    line-height: 1.72;
    max-width: 52ch;
}

/* Card annotation */
.card-annotation {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 10px;
    color: #8b7535;
    letter-spacing: 0.12em;
    opacity: 0.6;
    position: absolute;
    bottom: 12px;
    left: 16px;
    text-transform: uppercase;
}

/* ========== CODA SECTION ========== */
.coda {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 64px 5vw;
}

.coda-coord {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #8b7535;
    letter-spacing: 0.12em;
    opacity: 0.5;
    margin-bottom: 32px;
}

.coda-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 36px);
    color: #c9a84c;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .zone-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 16px;
        padding: 40px 4vw;
    }

    .card {
        grid-column: span 4 !important;
        grid-row: span 1 !important;
        padding: 32px;
    }

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

    .coord-display {
        font-size: clamp(32px, 12vw, 100px);
    }
}

@media (max-width: 600px) {
    .zone-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 4vw;
    }

    .card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        padding: 24px;
    }

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

    .card-body {
        font-size: 14px;
    }
}
