/* ===========================
   monopole.city — Styles
   =========================== */

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

:root {
    --deep-firmament: #1E1E2A;
    --parchment-dust: #E8E4DC;
    --muted-gold: #C4A265;
    --slate-dusk: #5B6178;
    --charcoal-ink: #2C2C34;
    --fog-silver: #A8A8B8;
    --signal-amber: #D4943A;
    --night-violet: #3D3554;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-firmament);
    color: var(--charcoal-ink);
    cursor: crosshair;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    position: relative;
    background-image: linear-gradient(var(--signal-amber), var(--signal-amber));
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 300ms ease;
}

a:hover {
    background-size: 100% 1px;
}

/* --- Star Navigation (fixed right) --- */
#star-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: center;
}

.star-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
}

.star-link:hover {
    background-size: 0 0;
}

.star-icon {
    width: 10px;
    height: 10px;
    background: var(--muted-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease;
    display: block;
}

.star-link.active .star-icon {
    filter: brightness(1.3);
    transform: scale(1.2);
}

.star-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    white-space: nowrap;
}

.star-link:hover .star-label {
    opacity: 1;
    transform: translateX(0);
}

/* --- District: The Observatory --- */
#observatory {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--deep-firmament);
    overflow: hidden;
}

.sunburst {
    position: absolute;
    inset: 0;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(196, 162, 101, 0.05) 0deg 0.5deg,
        transparent 0.5deg 15deg
    );
    animation: sunburst-rotate 720s linear infinite;
}

@keyframes sunburst-rotate {
    to { transform: rotate(360deg); }
}

.center-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--muted-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-star 4s ease-in-out infinite;
}

@keyframes pulse-star {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.observatory-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.site-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-gold);
    line-height: 1.0;
    margin-bottom: 1rem;
}

.site-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.03em;
    line-height: 1.35;
    color: var(--slate-dusk);
}

.district-nav {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 2;
}

.nav-item {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-bullet {
    width: 8px;
    height: 8px;
    background: var(--muted-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    display: inline-block;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-bullet:hover {
    transform: rotate(72deg);
}

/* Noise grain overlay */
#observatory::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* --- Interstitial Constellation Fields --- */
.interstitial {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-firmament);
}

.constellation-container {
    text-align: center;
}

.constellation-svg {
    display: block;
    margin: 0 auto 24px;
}

.star-dot {
    fill: var(--parchment-dust);
    opacity: 0;
    transition: opacity 200ms ease;
}

.constellation-line {
    stroke: var(--parchment-dust);
    stroke-width: 1;
    opacity: 0.4;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 400ms ease;
}

.constellation-name {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
    opacity: 0;
    transition: opacity 600ms ease 1.8s;
}

.interstitial.in-view .star-dot {
    opacity: 1;
}

.interstitial.in-view .constellation-line {
    stroke-dashoffset: 0;
}

.interstitial.in-view .constellation-name {
    opacity: 1;
}

/* Stagger star dots */
.interstitial.in-view .star-dot:nth-child(1) { transition-delay: 0ms; }
.interstitial.in-view .star-dot:nth-child(2) { transition-delay: 200ms; }
.interstitial.in-view .star-dot:nth-child(3) { transition-delay: 400ms; }
.interstitial.in-view .star-dot:nth-child(4) { transition-delay: 600ms; }
.interstitial.in-view .star-dot:nth-child(5) { transition-delay: 800ms; }
.interstitial.in-view .star-dot:nth-child(6) { transition-delay: 1000ms; }
.interstitial.in-view .star-dot:nth-child(7) { transition-delay: 1200ms; }

/* Stagger constellation lines */
.interstitial.in-view .constellation-line:nth-of-type(1) { transition-delay: 800ms; }
.interstitial.in-view .constellation-line:nth-of-type(2) { transition-delay: 1000ms; }
.interstitial.in-view .constellation-line:nth-of-type(3) { transition-delay: 1200ms; }
.interstitial.in-view .constellation-line:nth-of-type(4) { transition-delay: 1400ms; }
.interstitial.in-view .constellation-line:nth-of-type(5) { transition-delay: 1600ms; }

/* Use nth-of-type for lines (they come after circles in SVG) */
.interstitial.in-view .constellation-svg line:nth-of-type(1) { transition-delay: 800ms; }
.interstitial.in-view .constellation-svg line:nth-of-type(2) { transition-delay: 1000ms; }
.interstitial.in-view .constellation-svg line:nth-of-type(3) { transition-delay: 1200ms; }
.interstitial.in-view .constellation-svg line:nth-of-type(4) { transition-delay: 1400ms; }
.interstitial.in-view .constellation-svg line:nth-of-type(5) { transition-delay: 1600ms; }

/* --- District: The Archive --- */
#archive {
    position: relative;
    background: var(--deep-firmament);
    padding: 80px 24px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    grid-auto-flow: dense;
}

/* --- Cards --- */
.card {
    position: relative;
    background: var(--parchment-dust);
    padding: 32px;
    opacity: 0.3;
    filter: blur(4px);
    transform: translateY(20px);
    transition: opacity 600ms ease, filter 600ms ease, transform 600ms ease, box-shadow 400ms ease;
}

.card.in-view {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(30, 30, 42, 0.15);
}

/* Art Deco Corner Brackets */
.card-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: width 400ms ease-out, height 400ms ease-out;
}

.card:hover .card-corner {
    width: 40px;
    height: 40px;
}

.card-corner.tl {
    top: 0; left: 0;
    border-top: 2px solid var(--muted-gold);
    border-left: 2px solid var(--muted-gold);
}

.card-corner.tr {
    top: 0; right: 0;
    border-top: 2px solid var(--muted-gold);
    border-right: 2px solid var(--muted-gold);
}

.card-corner.bl {
    bottom: 0; left: 0;
    border-bottom: 2px solid var(--muted-gold);
    border-left: 2px solid var(--muted-gold);
}

.card-corner.br {
    bottom: 0; right: 0;
    border-bottom: 2px solid var(--muted-gold);
    border-right: 2px solid var(--muted-gold);
}

/* Card Grid Positions */
.card-1 { grid-column: 1 / 6; grid-row: span 2; }
.card-2 { grid-column: 6 / 9; }
.card-3 { grid-column: 9 / 10; grid-row: span 2; }
.card-4 { grid-column: 10 / 13; }
.card-5 { grid-column: 7 / 13; grid-row: span 2; }
.card-6 { grid-column: 1 / 4; }
.card-7 { grid-column: 4 / 5; grid-row: span 2; }
.card-8 { grid-column: 5 / 8; }
.card-9 { grid-column: 8 / 13; }

/* Card star backgrounds */
.card-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.card-constellation {
    width: 100%;
    height: 100%;
}

/* Card Typography */
.card-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--charcoal-ink);
    line-height: 1.0;
    margin-bottom: 16px;
    position: relative;
}

.card-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.03em;
    line-height: 1.35;
    color: var(--slate-dusk);
    margin-bottom: 12px;
}

.card-body {
    max-width: 38ch;
    color: #4A4A56;
    margin-bottom: 12px;
    position: relative;
}

.card-meta {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
}

.card-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.5;
    color: var(--slate-dusk);
}

/* Alley cards */
.alley-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Monument Card dark variant */
.monument-card {
    background: var(--deep-firmament);
    overflow: hidden;
}

.monument-card .card-title {
    color: var(--muted-gold);
}

.monument-card .card-body {
    color: var(--fog-silver);
}

.monument-card .card-corner.tl,
.monument-card .card-corner.tr,
.monument-card .card-corner.bl,
.monument-card .card-corner.br {
    border-color: var(--muted-gold);
}

/* --- District: The Signal Tower --- */
#signal-tower {
    position: relative;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--deep-firmament);
    padding: 120px 24px 80px;
}

.skyline-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    overflow: hidden;
}

.skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: var(--charcoal-ink);
    clip-path: polygon(
        0% 100%, 0% 60%, 3% 60%, 3% 40%, 6% 40%, 6% 55%,
        9% 55%, 9% 20%, 12% 20%, 12% 55%, 15% 55%, 15% 35%,
        18% 35%, 18% 50%, 21% 50%, 21% 25%, 24% 25%, 24% 15%,
        27% 15%, 27% 45%, 30% 45%, 30% 30%, 33% 30%, 33% 50%,
        36% 50%, 36% 40%, 39% 40%, 39% 55%, 42% 55%, 42% 20%,
        45% 20%, 45% 10%, 48% 10%, 48% 35%, 51% 35%, 51% 45%,
        54% 45%, 54% 25%, 57% 25%, 57% 50%, 60% 50%, 60% 35%,
        63% 35%, 63% 55%, 66% 55%, 66% 40%, 69% 40%, 69% 20%,
        72% 20%, 72% 45%, 75% 45%, 75% 30%, 78% 30%, 78% 50%,
        81% 50%, 81% 60%, 84% 60%, 84% 35%, 87% 35%, 87% 50%,
        90% 50%, 90% 55%, 93% 55%, 93% 45%, 96% 45%, 96% 60%,
        100% 60%, 100% 100%
    );
}

.skyline-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--signal-amber), var(--night-violet));
    opacity: 0.2;
    animation: skyline-pulse 8s ease-in-out infinite;
}

@keyframes skyline-pulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

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

.signal-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-gold);
    line-height: 1.0;
    margin-bottom: 32px;
}

.signal-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
}

.signal-link {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
}

.signal-caption {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog-silver);
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .archive-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card-1 { grid-column: 1 / -1; grid-row: span 1; }
    .card-2 { grid-column: 1 / 3; }
    .card-3 { grid-column: 3 / 5; grid-row: span 1; }
    .card-4 { grid-column: 1 / -1; }
    .card-5 { grid-column: 1 / -1; grid-row: span 1; }
    .card-6 { grid-column: 1 / 3; }
    .card-7 { grid-column: 3 / 5; grid-row: span 1; }
    .card-8 { grid-column: 1 / -1; }
    .card-9 { grid-column: 1 / -1; }

    #star-nav {
        right: 12px;
    }

    .star-label {
        display: none;
    }

    .district-nav {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}
