/* ========================================
   monopole.studio — Styles
   Dark-Academia Physics Research Atelier
   ======================================== */

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

html {
    scroll-behavior: auto;
    font-size: 16px;
}

body {
    background-color: #0a1118;
    color: #e8e0d0;
    font-family: 'Lora', Georgia, serif;
    line-height: 1.85;
    overflow-x: hidden;
}

/* ========================================
   THE OBSERVATORY (Hero)
   ======================================== */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(180deg, #0a1118 0%, #12202e 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-parallax-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 800px;
}

/* City Skyline */
.skyline {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
    transform: perspective(800px) rotateX(2deg);
    will-change: transform;
}

.building {
    position: absolute;
    bottom: 0;
    background: linear-gradient(180deg, #1a3050 0%, #12202e 100%);
    border-radius: 2px 2px 0 0;
    /* Ember (#d4724e) window lights */
    box-shadow:
        inset 3px 8px 0 #d4724e,
        inset 8px 20px 0 rgba(212, 114, 78, 0.4),
        inset 14px 35px 0 rgba(212, 114, 78, 0.5),
        inset 4px 50px 0 rgba(212, 114, 78, 0.3),
        inset 10px 65px 0 rgba(212, 114, 78, 0.45),
        inset 6px 80px 0 rgba(212, 114, 78, 0.35);
}

/* Arched Window Frame */
.arch-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55vw;
    max-width: 700px;
    height: 75vh;
    max-height: 600px;
    border-radius: 50% 50% 0 0;
    border: 2px solid rgba(184, 157, 106, 0.5);
    z-index: 2;
    overflow: hidden;
    box-shadow:
        inset 0 0 60px rgba(10, 17, 24, 0.8),
        inset 0 0 120px rgba(10, 17, 24, 0.4),
        0 0 40px rgba(10, 17, 24, 0.6);
    will-change: transform;
}

.arch-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center 60%, rgba(18, 32, 46, 0.3) 0%, rgba(10, 17, 24, 0.9) 70%);
}

/* Mullion lines */
.arch-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(184, 157, 106, 0.2);
    z-index: 3;
}

.arch-window::after {
    content: '';
    position: absolute;
    top: 55%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(184, 157, 106, 0.2);
    z-index: 3;
}

/* Monopole Field SVG */
.monopole-field {
    width: 60%;
    height: 60%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.monopole-core {
    animation: breathe 4s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(0, 201, 167, 0.6));
}

.field-ring {
    stroke-dasharray: 8 4;
    animation: ringPulse 6s ease-in-out infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 0.5s; }
.ring-3 { animation-delay: 1s; }
.ring-4 { animation-delay: 1.5s; }

@keyframes breathe {
    0%, 100% { transform: scale(0.95); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

@keyframes ringPulse {
    0%, 100% { opacity: var(--ring-base-opacity, 0.5); transform: scale(1); }
    50% { opacity: calc(var(--ring-base-opacity, 0.5) * 1.3); transform: scale(1.02); }
}

.ring-1 { --ring-base-opacity: 0.7; }
.ring-2 { --ring-base-opacity: 0.5; }
.ring-3 { --ring-base-opacity: 0.3; }
.ring-4 { --ring-base-opacity: 0.15; }

/* Hero Text */
.hero-text {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
    will-change: transform;
}

.title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #e8e0d0;
    line-height: 1;
    margin: 0;
}

.title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.1em;
    color: #8a9aad;
    margin-top: 0.25em;
    opacity: 0;
    transition: opacity 0.8s ease 0.8s;
}

.subtitle.visible {
    opacity: 1;
}

/* ========================================
   INK BLOOM DIVIDERS
   ======================================== */

.ink-bloom-divider {
    position: relative;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.brass-rule {
    width: 60%;
    max-width: 600px;
    height: 1px;
    background: rgba(184, 157, 106, 0.4);
}

.bloom {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.3) 0%, transparent 70%);
    transform: scale(0.8);
    transition: transform 0.8s ease;
}

.bloom.in-view {
    transform: scale(1);
}

/* ========================================
   THE THEOREM
   ======================================== */

.theorem-section {
    position: relative;
    padding: 120px 24px;
    background: #0a1118;
}

.theorem-content {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
}

.theorem-content p {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    color: #c4bfb5;
    margin-bottom: 1.5em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.theorem-content p.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: 0.05em;
    color: #e8e0d0;
    margin-bottom: 1em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-heading.in-view {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.1rem, 1.3vw, 1.3rem) !important;
    color: #b89d6a !important;
    border-left: 2px solid rgba(184, 157, 106, 0.4);
    padding-left: 1.5em;
    margin: 2em 0 !important;
}

/* Marginalia */
.marginalia {
    position: absolute;
    left: -180px;
    font-family: 'Caveat', cursive;
    font-size: 0.85rem;
    color: #a89872;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
}

.marginalia.in-view {
    opacity: 1;
    transform: translateX(0);
}

.margin-1 { top: 60px; }
.margin-2 { top: 180px; }
.margin-3 { top: 320px; }

/* Dirac String */
.dirac-string {
    position: absolute;
    left: -60px;
    top: 100px;
    width: 20px;
    height: 500px;
    opacity: 0.5;
}

.dirac-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease;
}

.dirac-path.drawn {
    stroke-dashoffset: 0;
}

/* Hide marginalia and dirac on smaller screens */
@media (max-width: 1200px) {
    .marginalia { display: none; }
    .dirac-string { display: none; }
}

/* ========================================
   THE APPARATUS HALL
   ======================================== */

.apparatus-section {
    padding: 120px 24px;
    background: #12202e;
}

.apparatus-heading {
    text-align: center;
    margin-bottom: 2em;
}

.triptych {
    display: flex;
    align-items: stretch;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    gap: 0;
}

.triptych-divider {
    width: 2px;
    background: #b89d6a;
    opacity: 0.4;
    flex-shrink: 0;
}

.panel {
    flex: 1;
    aspect-ratio: 3/5;
    max-width: 340px;
    background: #1a3050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    cursor: default;
}

.panel.in-view {
    opacity: 1;
    transform: translateY(0);
}

.panel:hover {
    transform: scale(1.03);
}

.panel:hover .field-viz {
    filter: drop-shadow(0 0 12px rgba(0, 201, 167, 0.3));
}

.panel-visual {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-viz {
    width: 90%;
    height: 90%;
    transition: filter 0.3s ease;
}

.toroidal-viz g {
    animation: toroidalRotate 20s linear infinite;
    transform-origin: center;
}

@keyframes toroidalRotate {
    from { transform: translate(150px, 250px) rotate(0deg); }
    to { transform: translate(150px, 250px) rotate(360deg); }
}

.panel-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: #e8e0d0;
    margin-top: 16px;
    text-align: center;
}

.panel-desc {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #8a9aad;
    text-align: center;
    margin-top: 8px;
}

/* Responsive triptych */
@media (max-width: 768px) {
    .triptych {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .triptych-divider {
        width: 60%;
        height: 2px;
    }
    .panel {
        max-width: 320px;
        width: 100%;
        aspect-ratio: auto;
        min-height: 400px;
    }
}

/* ========================================
   THE ARCHIVE
   ======================================== */

.archive-section {
    padding: 120px 24px;
    background: #0a1118;
}

.archive-section .section-heading {
    text-align: center;
    margin-bottom: 2em;
}

.citation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.citation-card {
    background: #1a3050;
    border-left: 2px solid #b89d6a;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.citation-card:hover {
    background: #1e3658;
}

.cite-year {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #00c9a7;
    letter-spacing: 0.05em;
}

.cite-author {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #e8e0d0;
}

.cite-desc {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #8a9aad;
}

.cite-ref {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #7e92a8;
    letter-spacing: 0.05em;
}

/* ========================================
   THE CODA (Footer)
   ======================================== */

.coda-section {
    padding: 80px 24px;
    background: #0a1118;
}

.coda-content {
    text-align: center;
}

.coda-domain {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: #8a9aad;
}

.coda-rule {
    width: 80px;
    height: 1px;
    background: #b89d6a;
    margin: 24px auto;
    opacity: 0.5;
}

.coda-inscription {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #8a9aad;
    opacity: 0.7;
}
