/* tanso.tech - Art-Deco Observatory Design */

:root {
    --deep: #0e1a2b;
    --frost: #c8d4e0;
    --star: #e8eef4;
    --brass: #b08d57;
    --teal: #3a7d8c;
    --vein: #8a9bb0;
    --ember: #c4654a;
}

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

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

body {
    background-color: var(--deep);
    color: var(--star);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ===================== */
/* Navigation Diamonds   */
/* ===================== */

#nav-diamonds {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.diamond {
    width: 10px;
    height: 10px;
    background: var(--frost);
    transform: rotate(45deg);
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.4s ease, background-color 0.4s ease;
    animation: counter-pulse 3s ease-in-out infinite;
}

.diamond.active {
    opacity: 1;
    background: var(--ember);
    animation: none;
}

.diamond:hover {
    opacity: 0.85;
    background: var(--ember);
}

/* ===================== */
/* Observatory Sections  */
/* ===================== */

.observatory {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--deep);
    background-image:
        radial-gradient(ellipse at 23% 40%, rgba(138, 155, 176, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 65%, rgba(200, 212, 224, 0.03) 0%, transparent 45%),
        radial-gradient(ellipse at 45% 80%, rgba(176, 141, 87, 0.02) 0%, transparent 60%);
}

/* Frost Overlay */
.frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    filter: url(#frost-noise);
    mix-blend-mode: overlay;
}

.frost-overlay-intense {
    opacity: 0.05;
}

/* Section Numbers */
.section-number {
    position: absolute;
    top: 5vh;
    right: 5vw;
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.65;
    color: var(--frost);
    z-index: 5;
}

/* Z-Trace Lines */
.z-trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.z-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    opacity: 0.4;
}

.z-path.animate {
    animation: draw-reverse 4s ease-out forwards;
}

/* ===================== */
/* Observatory I - Hero  */
/* ===================== */

.wordmark {
    position: absolute;
    top: 5vh;
    left: 5vw;
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--star);
    z-index: 5;
}

.hero-star-container {
    position: absolute;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.hero-star {
    animation: star-rotate 120s linear infinite;
}

.hero-inscription {
    position: absolute;
    bottom: 15vh;
    left: 5vw;
    max-width: 500px;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--star);
    opacity: 0.8;
    z-index: 5;
}

/* ============================= */
/* Observatory II - The Thesis   */
/* ============================= */

.thesis-layout {
    position: absolute;
    top: 10vh;
    left: 5vw;
    right: 5vw;
    bottom: 10vh;
    display: flex;
    gap: clamp(24px, 4vw, 60px);
    align-items: center;
    z-index: 5;
}

.marble-panel {
    width: 35%;
    min-width: 200px;
    height: 80vh;
    flex-shrink: 0;
    background:
        radial-gradient(ellipse at 23% 40%, rgba(138, 155, 176, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 65%, rgba(200, 212, 224, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 45% 80%, rgba(176, 141, 87, 0.06) 0%, transparent 60%),
        linear-gradient(175deg, #0e1a2b 0%, #162233 50%, #0e1a2b 100%);
    border: 1px solid rgba(200, 212, 224, 0.12);
}

.thesis-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5em;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.thesis-text.visible {
    opacity: 1;
}

.thesis-text p {
    color: var(--star);
    max-width: 540px;
}

.thesis-text p strong {
    font-weight: 600;
}

/* ================================= */
/* Observatory III - Constellation    */
/* ================================= */

.constellation-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.constellation-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 6;
}

.node-star {
    display: block;
}

.node-value {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--star);
}

.node-label {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.65;
    color: var(--frost);
    white-space: nowrap;
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.constellation-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.constellation-line.animate {
    animation: draw-reverse 3s ease-out forwards;
}

/* =========================== */
/* Observatory IV - Counter-Z  */
/* =========================== */

.counter-z-layout {
    position: absolute;
    bottom: 10vh;
    left: 5vw;
    right: 5vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(16px, 3vw, 40px);
    z-index: 5;
}

.ziggurat {
    flex: 1;
    max-width: 320px;
    clip-path: polygon(10% 0%, 90% 0%, 95% 8%, 100% 16%, 100% 100%, 0% 100%, 0% 16%, 5% 8%);
    background: rgba(200, 212, 224, 0.06);
    border: 1px solid rgba(200, 212, 224, 0.08);
    padding: 32px 24px 24px;
    opacity: 0;
    transform: translateY(-40px);
}

.ziggurat.animate {
    animation: settle-down 1.2s ease-out forwards;
}

.ziggurat-1 { animation-delay: 0s; }
.ziggurat-2 { animation-delay: 0.3s; }
.ziggurat-3 { animation-delay: 0.6s; }

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

.ziggurat-content p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.72;
    color: var(--star);
    opacity: 0.85;
}

.ziggurat-star {
    display: block;
}

.marble-stratum {
    width: 100%;
    height: 2px;
    margin-top: 20px;
    background:
        radial-gradient(ellipse at 23% 40%, rgba(138, 155, 176, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 65%, rgba(200, 212, 224, 0.1) 0%, transparent 45%),
        linear-gradient(90deg, transparent, rgba(138, 155, 176, 0.35), transparent);
}

/* ======================== */
/* Observatory V - Coda     */
/* ======================== */

.coda-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 5;
}

.coda-star {
    animation: star-rotate 120s linear infinite;
}

.coda-name {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--star);
}

.coda-domain {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.45;
    color: var(--frost);
}

/* ==================== */
/* Scattered Stars      */
/* ==================== */

.scattered-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.small-star {
    position: absolute;
    display: block;
}

/* ==================== */
/* Animations           */
/* ==================== */

@keyframes star-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes draw-reverse {
    from { stroke-dashoffset: 3000; }
    to { stroke-dashoffset: 0; }
}

@keyframes counter-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes settle-down {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes constellation-draw {
    from { stroke-dashoffset: 500; }
    to { stroke-dashoffset: 0; }
}

/* ======================== */
/* Reduced Motion           */
/* ======================== */

@media (prefers-reduced-motion: reduce) {
    .hero-star,
    .coda-star {
        animation: none;
    }

    .z-path,
    .constellation-line {
        stroke-dashoffset: 0;
        animation: none;
    }

    .ziggurat {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .diamond {
        animation: none;
        opacity: 0.5;
    }

    .thesis-text {
        opacity: 1;
        transition: none;
    }
}

/* ======================== */
/* Responsive               */
/* ======================== */

@media (max-width: 768px) {
    .thesis-layout {
        flex-direction: column;
    }

    .marble-panel {
        width: 100%;
        height: 30vh;
        min-width: unset;
    }

    .counter-z-layout {
        flex-direction: column;
        align-items: center;
    }

    .ziggurat {
        max-width: 100%;
    }

    .constellation-node {
        transform: scale(0.85);
    }

    #nav-diamonds {
        right: 12px;
    }

    .wordmark {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .hero-star-container {
        left: 70%;
        top: 35%;
    }
}
