/* ===========================
   ronri.xyz - Styles
   Logic Archive Maximalist Design
   =========================== */

:root {
    /* Color Palette */
    --color-primary: #A8C4E0;
    --color-accent-gold: #D4B87A;
    --color-light-blue: #E8F0F8;
    --color-cream: #F5E6C8;
    --color-dark-navy: #1A2D4A;
    --color-dark-blue: #0A1628;
    --color-navy: #2A4A6B;

    /* Typography */
    --font-display: 'Fraunces', serif;
    --font-body: 'Work Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-accent: 'IM Fell English', serif;

    /* Scroll Weight for Variable Font */
    --scroll-weight: 400;

    /* Spacing */
    --spacing-unit: 1rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-dark-blue);
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===========================
   Z-Pattern Layout Grid
   =========================== */

.z-section {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.z-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    gap: 2rem;
}

.z-quadrant {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    opacity: 0;
    animation: fadeInQuadrant 500ms ease-out forwards;
}

.z-quadrant.top-left {
    animation-delay: 0ms;
    animation-direction: normal;
}

.z-quadrant.top-right {
    animation-delay: 200ms;
    align-items: flex-end;
}

.z-quadrant.bottom-left {
    animation-delay: 400ms;
    align-items: flex-start;
}

.z-quadrant.bottom-right {
    animation-delay: 600ms;
    align-items: flex-end;
}

@keyframes fadeInQuadrant {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3 {
    font-family: var(--font-display);
}

h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: var(--scroll-weight, 400);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    background: linear-gradient(135deg, var(--color-dark-blue) 0%, var(--color-navy) 100%);
}

.domain-name {
    font-size: clamp(4rem, 10vw, 7rem);
    font-weight: 700;
    color: var(--color-primary);
    font-variation-settings: 'wght' var(--scroll-weight), 'WONK' 100;
    text-shadow: 0 10px 30px rgba(168, 196, 224, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-accent-gold);
    font-family: var(--font-mono);
    margin-top: 0.5rem;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--color-light-blue);
    max-width: 90%;
    line-height: 1.8;
}

/* ===========================
   Book Spines
   =========================== */

.book-spine {
    width: 30px;
    height: 200px;
    background: linear-gradient(90deg, var(--spine-color) 0%, color-mix(in srgb, var(--spine-color) 70%, white) 100%);
    transform: rotateZ(calc(-5deg + var(--offset, 0) * 2deg));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 300ms ease;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: 0.5rem;
}

.book-spine:hover {
    transform: rotateZ(calc(-5deg + var(--offset, 0) * 2deg)) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.spine-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.book-cluster {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
    width: 100%;
}

/* ===========================
   Section Styles
   =========================== */

.branches {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-dark-blue) 100%);
}

.library {
    background: linear-gradient(135deg, var(--color-dark-blue) 0%, var(--color-navy) 100%);
}

.theorems {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-dark-blue) 100%);
}

.footer-section {
    background: linear-gradient(135deg, var(--color-dark-blue) 0%, var(--color-navy) 100%);
}

.section-title {
    color: var(--color-primary);
    margin-bottom: 2rem;
}

.section-desc {
    color: var(--color-accent-gold);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* ===========================
   Branch Cards
   =========================== */

.branch-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-left: 3px solid var(--color-accent-gold);
    backdrop-filter: blur(10px);
    transition: all 300ms ease;
    max-width: 350px;
}

.branch-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
}

.branch-card h3 {
    color: var(--color-primary);
}

.branch-card p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

/* ===========================
   Library Grid
   =========================== */

.library-grid-section {
    width: 100%;
}

.library-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.z-quadrant.top-right .library-grid {
    justify-content: flex-end;
}

.z-quadrant.bottom-right .library-grid {
    justify-content: flex-end;
}

.book-spine.interactive {
    transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-spine.interactive:hover {
    transform: rotateZ(calc(-5deg + var(--offset, 0) * 2deg)) translateY(-10px) scale(1.1);
    filter: brightness(1.2);
}

/* ===========================
   Theorem Cards
   =========================== */

.theorem-card {
    background: rgba(168, 196, 224, 0.1);
    padding: 2rem;
    border-top: 2px solid var(--color-primary);
    border-radius: 2px;
    max-width: 320px;
    transition: all 300ms ease;
}

.theorem-card:hover {
    background: rgba(168, 196, 224, 0.15);
    transform: translateY(-5px);
}

.theorem-card h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.theorem-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.formula {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-accent-gold);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
}

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

.section-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.nav-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(168, 196, 224, 0.3);
    transition: all 200ms ease;
    font-family: var(--font-mono);
}

.nav-link:hover {
    color: var(--color-accent-gold);
    border-bottom-color: var(--color-accent-gold);
    padding-left: 10px;
}

/* ===========================
   Footer
   =========================== */

.footer-text {
    color: var(--color-primary);
    font-size: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-link {
    color: var(--color-accent-gold);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 200ms ease;
}

.footer-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-credit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.footer-year {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* ===========================
   Scroll-Based Animations
   =========================== */

@media (max-width: 1024px) {
    .z-grid {
        gap: 1rem;
    }

    .z-quadrant {
        padding: 1rem;
    }

    .book-spine {
        width: 25px;
        height: 150px;
    }

    .domain-name {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }

    h2 {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
}

@media (max-width: 768px) {
    .z-section {
        height: auto;
        min-height: 100vh;
        padding: 1rem;
    }

    .z-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
    }

    .z-quadrant {
        grid-column: auto;
        grid-row: auto;
    }

    .z-quadrant.top-right,
    .z-quadrant.bottom-right {
        align-items: flex-start;
    }

    .book-spine {
        width: 20px;
        height: 120px;
    }

    .domain-name {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    h2 {
        font-size: clamp(1.25rem, 3vw, 2rem);
    }

    .branch-card,
    .theorem-card {
        max-width: 100%;
    }
}

/* ===========================
   Utility Classes
   =========================== */

.text-gold {
    color: var(--color-accent-gold);
}

.text-primary {
    color: var(--color-primary);
}

.text-light {
    color: var(--color-light-blue);
}
