/* ============================================
   mosoon.xyz — Light Academia Research Station
   Palette: muted-vintage | Layout: layered-depth
   ============================================ */

/* Fonts: Albert Sans, Source Sans 3, Libre Franklin (Google Fonts) */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: #4A4A54;
    background-color: #F6F2EA;
    overflow-x: hidden;
    position: relative;
}

/* --- Cursor-Follow Spotlight (z-2 overlay) --- */
#cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 224, 208, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.spotlight-active #cursor-spotlight {
    opacity: 1;
}

/* --- Circuit Trace Background (z-0) --- */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.08;
}

#circuit-svg {
    width: 100%;
    height: 100%;
}

#circuit-svg .trace {
    stroke: #8A8A90;
    stroke-width: 1;
    fill: none;
}

#circuit-svg .node {
    fill: #8A8A90;
    stroke: none;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Albert Sans', sans-serif;
    color: #2A2A34;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: 0.08em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
}

h3 {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    font-weight: 700;
    margin-bottom: 0.5em;
}

p {
    color: #4A4A54;
}

/* --- Annotations (z-2 floating tooltips) --- */
.annotation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Libre Franklin', sans-serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.82rem;
    color: #7A7A84;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.annotation.visible {
    opacity: 1;
    transform: translateY(0);
}

.annotation-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #7A7A84;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* --- Line Illustrations (Line Art Grey: #5A6070) --- */
.hero-line-illustration svg,
.method-line-illustration svg,
.footer-line-illustration svg {
    stroke: #5A6070;
}

/* --- Section Headers --- */
.section-header {
    margin-bottom: 3rem;
    position: relative;
}

.section-header h2 {
    display: inline-block;
    position: relative;
    padding-right: 1rem;
}

.section-line {
    height: 1px;
    background: linear-gradient(to right, #7A7A84, transparent);
    margin-top: 0.75rem;
    max-width: 200px;
}

/* --- Depth Cards (z-1) --- */
.depth-card {
    background: #FEFCF8;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(40, 40, 50, 0.06);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.depth-card:hover {
    box-shadow: 0 6px 20px rgba(40, 40, 50, 0.1);
    transform: translateY(-2px);
}

/* --- Card Circuit Background --- */
.card-circuit-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    opacity: 0.04;
    background-image:
        linear-gradient(to right, #8A8A90 1px, transparent 1px),
        linear-gradient(to bottom, #8A8A90 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 0 6px 0 0;
}

/* --- HERO SECTION --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6rem;
    max-width: 1100px;
    width: 100%;
}

.hero-title-block {
    text-align: left;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.12em;
    line-height: 1.1;
    color: #2A2A34;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.3s;
}

.hero-subtitle {
    font-family: 'Libre Franklin', sans-serif;
    font-style: italic;
    color: #7A7A84;
    font-size: 1.1rem;
    margin-top: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-line-illustration {
    width: 280px;
    flex-shrink: 0;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.9s;
}

.hero-line-illustration svg {
    width: 100%;
    height: auto;
}

.hero-line-illustration svg line,
.hero-line-illustration svg polyline,
.hero-line-illustration svg circle {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawLine 2s ease forwards;
    animation-delay: 1s;
}

.annotation-hero {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}

.annotation-hero.visible {
    transform: translateX(-50%) translateY(0);
}

/* --- RESEARCH FIELDS --- */
#research-fields {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.2rem;
}

.card-icon svg {
    width: 100%;
    height: 100%;
    stroke: #5A6070;
}

.depth-card h3 {
    font-family: 'Albert Sans', sans-serif;
    font-size: 1.15rem;
}

.depth-card p {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.annotation-card {
    margin-top: 0.5rem;
}

/* --- METHODOLOGY --- */
#methodology {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.method-panel {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.method-number {
    font-family: 'Albert Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #E8E0D0;
    display: block;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.method-panel h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.method-panel p {
    font-size: 0.88rem;
    line-height: 1.7;
}

.method-line-illustration {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.method-line-illustration.visible {
    opacity: 1;
}

.method-line-illustration svg {
    width: 100%;
    height: auto;
}

/* --- PUBLICATIONS --- */
#publications {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pub-entry {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.75rem 2rem;
}

.pub-year {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #E8E0D0;
    min-width: 60px;
    flex-shrink: 0;
    line-height: 1.3;
}

.pub-details {
    flex: 1;
}

.pub-details h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.pub-authors {
    font-family: 'Libre Franklin', sans-serif;
    font-style: italic;
    color: #7A7A84;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
}

.pub-journal {
    font-size: 0.85rem;
    color: #8A8A90;
}

.annotation-pub {
    flex-shrink: 0;
    align-self: center;
}

/* --- STATION LOG --- */
#station-log {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.log-entry {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(138, 138, 144, 0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.log-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.log-date {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8A8A90;
    min-width: 90px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.log-text {
    font-size: 0.95rem;
    color: #4A4A54;
    line-height: 1.7;
}

.annotation-log {
    margin-top: 1.5rem;
}

/* --- FOOTER --- */
#site-footer {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-left,
.footer-right {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-brand {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #2A2A34;
    letter-spacing: 0.1em;
}

.footer-tagline {
    font-family: 'Libre Franklin', sans-serif;
    font-style: italic;
    font-size: 0.8rem;
    color: #7A7A84;
}

.footer-status {
    font-family: 'Albert Sans', sans-serif;
    font-size: 0.82rem;
    color: #7A7A84;
    text-align: right;
}

.footer-coord {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 0.78rem;
    color: #8A8A90;
    text-align: right;
    letter-spacing: 0.03em;
}

.footer-line-illustration {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    opacity: 0.3;
}

.footer-line-illustration svg {
    width: 100%;
    height: 40px;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Scroll Reveal for depth cards --- */
.depth-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.depth-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.depth-card:hover {
    transform: translateY(-2px);
}

.depth-card.visible:hover {
    transform: translateY(-2px);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .hero-title-block {
        text-align: center;
    }

    .hero-line-illustration {
        width: 200px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .methodology-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pub-entry {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pub-year {
        font-size: 1.1rem;
    }

    .annotation-pub {
        align-self: flex-start;
    }
}

@media (max-width: 600px) {
    .methodology-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .footer-right {
        align-items: flex-start;
    }

    .footer-status,
    .footer-coord {
        text-align: left;
    }

    .log-entry {
        flex-direction: column;
        gap: 0.3rem;
    }

    .method-line-illustration {
        display: none;
    }
}
