/* ==============================================
   thesecond.day - Aurora Observatory Theme
   ============================================== */

/* ---- CSS Custom Properties ---- */
:root {
    --aurora-green: #00E89B;
    --aurora-violet: #7B2FBE;
    --aurora-rose: #FF6B9D;
    --midnight-base: #0B0E1A;
    --brass-accent: #C9A84C;
    --frost-white: #E8ECF4;
    --deep-indigo: #1A1040;
    --steel-gray: #8A91A8;
    --brass-dark: #8A6F2C;
    --brass-light: #E8D48A;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dial-rotation: 60deg; /* points to 2 o'clock */

    --font-display: 'Playfair Display', Georgia, serif;
    --font-secondary: 'Josefin Sans', 'Helvetica Neue', sans-serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

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

body {
    background-color: var(--midnight-base);
    color: var(--frost-white);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* ---- Aurora Background ---- */
#aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0B0E1A 0%, #1A1040 30%, #7B2FBE 65%, #00E89B 100%);
    background-size: 400% 400%;
    animation: aurora 20s ease infinite;
    z-index: -3;
    opacity: 0.6;
}

@keyframes aurora {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Star Field ---- */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background-color: var(--frost-white);
    animation: twinkle var(--twinkle-duration) ease-in-out infinite;
    opacity: var(--base-opacity);
}

@keyframes twinkle {
    0%, 100% { opacity: var(--base-opacity); }
    50% { opacity: 1; }
}

/* ---- Constellation Lines ---- */
#constellation-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
}

.constellation-line {
    stroke: var(--frost-white);
    stroke-width: 1;
    stroke-opacity: 0.3;
    stroke-dasharray: 4 6;
}

/* ---- Crescent Moon ---- */
#crescent-moon {
    position: fixed;
    top: 40px;
    right: 60px;
    width: 60px;
    height: 60px;
    z-index: 1;
    pointer-events: none;
}

.moon-outer {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--frost-white);
    opacity: 0.85;
}

.moon-inner {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--midnight-base);
    top: -8px;
    left: 12px;
}

/* ==============================================
   SECTION 1: Hero Dial
   ============================================== */
.section-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    background: linear-gradient(135deg, var(--deep-indigo) 0%, rgba(11, 14, 26, 0.8) 100%);
}

.dial-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dial-outer-ring {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 8px solid var(--brass-accent);
    box-shadow:
        0 0 30px rgba(201, 168, 76, 0.3),
        0 0 60px rgba(201, 168, 76, 0.1),
        inset 0 0 20px rgba(201, 168, 76, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(11, 14, 26, 0.4);
    backdrop-filter: blur(24px) saturate(1.6);
}

@media (min-width: 768px) {
    .dial-outer-ring {
        width: 400px;
        height: 400px;
    }
}

.dial-face {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
}

/* Hour marks */
.hour-mark {
    position: absolute;
    width: 3px;
    height: 16px;
    background: var(--brass-accent);
    top: 12px;
    left: 50%;
    transform-origin: 50% calc(170px - 12px);
    transform: translateX(-50%) rotate(var(--rotation));
    border-radius: 2px;
}

@media (min-width: 768px) {
    .hour-mark {
        transform-origin: 50% calc(200px - 12px);
    }
}

/* Dial numerals */
.dial-numeral {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--frost-white);
    opacity: 0.6;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    top: 30px;
    left: calc(50% - 15px);
    transform-origin: 15px calc(140px - 15px);
    transform: rotate(var(--rotation));
    letter-spacing: 0.08em;
}

@media (min-width: 768px) {
    .dial-numeral {
        font-size: 1.1rem;
        transform-origin: 15px calc(165px - 15px);
    }
}

.dial-numeral > * {
    transform: rotate(calc(-1 * var(--rotation)));
}

.dial-numeral-active {
    color: var(--brass-accent);
    opacity: 1;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.6);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(201, 168, 76, 0.6); }
    50% { text-shadow: 0 0 35px rgba(201, 168, 76, 0.9), 0 0 60px rgba(201, 168, 76, 0.4); }
}

/* Dial hand */
.dial-hand {
    position: absolute;
    width: 4px;
    height: 110px;
    bottom: 50%;
    left: calc(50% - 2px);
    transform-origin: 50% 100%;
    transform: rotate(var(--dial-rotation));
    transition: transform 0.3s var(--spring-ease);
    background: linear-gradient(to top, var(--brass-accent), var(--brass-light));
    clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
    z-index: 3;
}

@media (min-width: 768px) {
    .dial-hand {
        height: 130px;
    }
}

.dial-center-pin {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--brass-light), var(--brass-accent), var(--brass-dark));
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    z-index: 4;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

/* Hero tagline */
.hero-tagline {
    margin-top: 3rem;
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--steel-gray);
    text-align: center;
    max-width: 600px;
    padding: 0 1.5rem;
}

/* ==============================================
   DIAGONAL PANELS
   ============================================== */
.diagonal-panel {
    position: relative;
    z-index: 2;
    padding: 6rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.diagonal-left {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    background: linear-gradient(135deg, rgba(26, 16, 64, 0.7) 0%, rgba(11, 14, 26, 0.85) 100%);
}

.diagonal-right {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    background: linear-gradient(225deg, rgba(26, 16, 64, 0.7) 0%, rgba(11, 14, 26, 0.85) 100%);
}

/* Glassmorphic card */
.panel-glass {
    background: rgba(11, 14, 26, 0.4);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 38rem;
    width: 100%;
    padding: 3rem 2.5rem;
    position: relative;
    /* Double-line embossed border effect */
    outline: 1px solid rgba(255, 255, 255, 0.03);
    outline-offset: 3px;
    /* Spring animation initial state */
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    transition: opacity 800ms var(--spring-ease), transform 800ms var(--spring-ease);
}

.panel-glass.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Brass screws */
.brass-screw {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #E8D48A, #C9A84C, #8A6F2C);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.brass-screw::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 2px;
    width: 8px;
    height: 1.5px;
    background: rgba(138, 111, 44, 0.6);
    border-radius: 1px;
}

.screw-tl { top: 12px; left: 12px; }
.screw-tr { top: 12px; right: 12px; }
.screw-bl { bottom: 12px; left: 12px; }
.screw-br { bottom: 12px; right: 12px; }

/* Panel content */
.panel-content {
    position: relative;
    z-index: 2;
}

.section-label {
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brass-accent);
    margin-bottom: 0.75rem;
}

.section-headline {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw + 0.5rem, 6.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--frost-white);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.15rem);
    font-weight: 400;
    line-height: 1.75;
    color: var(--frost-white);
    margin-bottom: 1.25rem;
    max-width: 60ch;
    opacity: 0.9;
}

/* ==============================================
   INTERSTICE ZONES
   ============================================== */
.interstice {
    position: relative;
    z-index: 1;
    height: 120px;
    overflow: visible;
}

.star-cluster {
    position: relative;
    width: 100%;
    height: 100%;
}

.cluster-star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--frost-white);
    opacity: var(--opacity);
    animation: twinkle 4s ease-in-out infinite;
}

/* ==============================================
   GAUGE (Skeuomorphic Instrument)
   ============================================== */
.gauge-container {
    margin: 2rem 0;
}

.gauge-frame {
    background: rgba(11, 14, 26, 0.6);
    border: 3px solid var(--brass-accent);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow:
        0 0 10px rgba(201, 168, 76, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gauge-label {
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--steel-gray);
    margin-bottom: 0.5rem;
}

.gauge-track {
    width: 100%;
    height: 20px;
    background: rgba(11, 14, 26, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    width: var(--fill-percent);
    background: linear-gradient(90deg, var(--aurora-green), var(--aurora-violet));
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0, 232, 155, 0.4);
    transition: width 1.5s var(--spring-ease);
}

.gauge-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
}

.gauge-marker-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--steel-gray);
    letter-spacing: 0.08em;
}

/* ==============================================
   COORDINATES
   ============================================== */
.coordinates {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.coord-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--brass-accent);
    letter-spacing: 0.08em;
}

.coord-separator {
    color: var(--steel-gray);
    opacity: 0.4;
}

/* ==============================================
   SECTION 5: Orrery Footer
   ============================================== */
.section-orrery {
    position: relative;
    z-index: 2;
    padding: 6rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
}

.orrery-title {
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--steel-gray);
    margin-bottom: 3rem;
}

.orrery-container {
    position: relative;
    width: 340px;
    height: 340px;
}

@media (min-width: 768px) {
    .orrery-container {
        width: 440px;
        height: 440px;
    }
}

/* Orbital rings */
.orbit-ring {
    position: absolute;
    border: 1px solid rgba(232, 236, 244, 0.12);
    border-radius: 50%;
    top: 50%;
    left: 50%;
}

.orbit-1 {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    margin-left: -40px;
}

.orbit-2 {
    width: 140px;
    height: 140px;
    margin-top: -70px;
    margin-left: -70px;
}

.orbit-3 {
    width: 210px;
    height: 210px;
    margin-top: -105px;
    margin-left: -105px;
}

.orbit-4 {
    width: 280px;
    height: 280px;
    margin-top: -140px;
    margin-left: -140px;
}

.orbit-5 {
    width: 340px;
    height: 340px;
    margin-top: -170px;
    margin-left: -170px;
}

@media (min-width: 768px) {
    .orbit-1 {
        width: 100px;
        height: 100px;
        margin-top: -50px;
        margin-left: -50px;
    }
    .orbit-2 {
        width: 180px;
        height: 180px;
        margin-top: -90px;
        margin-left: -90px;
    }
    .orbit-3 {
        width: 270px;
        height: 270px;
        margin-top: -135px;
        margin-left: -135px;
    }
    .orbit-4 {
        width: 360px;
        height: 360px;
        margin-top: -180px;
        margin-left: -180px;
    }
    .orbit-5 {
        width: 440px;
        height: 440px;
        margin-top: -220px;
        margin-left: -220px;
    }
}

/* Planet dots */
.planet {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: -7px;
    left: calc(50% - 7px);
    transform-origin: 7px calc(50% + 7px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--spring-ease), box-shadow 0.3s ease;
}

.planet:hover {
    transform: scale(1.4);
}

.planet-label {
    font-family: var(--font-mono);
    font-size: 0;
    color: transparent;
    pointer-events: none;
}

.planet-1 {
    background: var(--aurora-green);
    box-shadow: 0 0 8px rgba(0, 232, 155, 0.6);
    animation: orbit 8s linear infinite;
}

.planet-2 {
    background: var(--aurora-violet);
    box-shadow: 0 0 8px rgba(123, 47, 190, 0.6);
    animation: orbit 14s linear infinite;
}

.planet-3 {
    background: var(--aurora-rose);
    box-shadow: 0 0 8px rgba(255, 107, 157, 0.6);
    animation: orbit 22s linear infinite;
}

.planet-4 {
    background: var(--brass-accent);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
    animation: orbit 30s linear infinite;
}

.planet-5 {
    background: var(--frost-white);
    box-shadow: 0 0 8px rgba(232, 236, 244, 0.6);
    animation: orbit 40s linear infinite;
}

@keyframes orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Orrery Sun */
.orrery-sun {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--brass-light), var(--brass-accent));
    top: calc(50% - 12px);
    left: calc(50% - 12px);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.5), 0 0 40px rgba(201, 168, 76, 0.2);
}

.orrery-caption {
    margin-top: 3rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--steel-gray);
    text-align: center;
    max-width: 400px;
    line-height: 1.6;
}

/* ==============================================
   RESPONSIVE ADJUSTMENTS
   ============================================== */
@media (max-width: 600px) {
    .panel-glass {
        padding: 2rem 1.5rem;
    }

    .section-hero {
        clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
    }

    .diagonal-left {
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }

    .diagonal-right {
        clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    }

    #crescent-moon {
        width: 40px;
        height: 40px;
        top: 20px;
        right: 20px;
    }

    .moon-outer {
        width: 40px;
        height: 40px;
    }

    .moon-inner {
        width: 40px;
        height: 40px;
        top: -6px;
        left: 8px;
    }

    .dial-outer-ring {
        width: 260px;
        height: 260px;
    }

    .hour-mark {
        transform-origin: 50% calc(130px - 12px);
    }

    .dial-numeral {
        transform-origin: 15px calc(100px - 15px);
        font-size: 0.85rem;
    }

    .dial-hand {
        height: 85px;
    }
}
