/* xbom.wiki - Light-Academia Reference Hall */
/* Burgundy-Cream Palette with Futura-Geometric Typography */

/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    color: #5A1020;
    background-color: #FFF5E8;
    overflow-x: hidden;
}

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #8A3040;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5rem);
    color: #8A3040;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #5A1020;
    max-width: 480px;
    margin-top: 1.5rem;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.section-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #5A1020;
    margin-bottom: 1.2rem;
    max-width: 520px;
}

.rose-accent {
    color: #C87888;
    font-style: italic;
}

/* ===================== GOLD LINE ===================== */
.gold-line {
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, #C0A060, #C0A060 40%, transparent);
    margin-top: 0.75rem;
}

/* ===================== Z-PATTERN LAYOUT ===================== */
.z-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 80vh;
    position: relative;
    align-items: center;
}

.z-content {
    padding: 2.5rem;
    max-width: 520px;
    position: relative;
    z-index: 2;
}

.z-left {
    justify-self: start;
    padding-left: clamp(2rem, 5vw, 6rem);
}

.z-right {
    justify-self: end;
    padding-right: clamp(2rem, 5vw, 6rem);
}

/* ===================== HERO (Z-Row 1) ===================== */
.z-row-1 {
    min-height: 100vh;
    background-color: #FFF5E8;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icon .isometric-icon {
    width: 280px;
    height: 280px;
}

/* ===================== SECTION 2 (Z-Row 2 - Diagonal) ===================== */
.z-row-2 {
    background-color: #FFF5E8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.card-row {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

/* ===================== SECTION 3 (Z-Row 3 - Return) ===================== */
.z-row-3 {
    background-color: #F8ECD8;
}

/* ===================== SECTION 4 (Closing) ===================== */
.z-row-4 {
    background-color: #FFF5E8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    min-height: 80vh;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 1000px;
}

.closing-cards {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.closing-brand {
    text-align: center;
}

.closing-domain {
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #8A3040;
}

.bookplate-ornament {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    border: 2px solid #C0A060;
    position: relative;
}

.bookplate-ornament::before,
.bookplate-ornament::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #C0A060;
}

.bookplate-ornament::before {
    top: -6px;
    left: -6px;
    border-right: none;
    border-bottom: none;
}

.bookplate-ornament::after {
    bottom: -6px;
    right: -6px;
    border-left: none;
    border-top: none;
}

.closing-icons {
    margin-top: 3rem;
}

.closing-icon-row {
    width: 300px;
    height: 80px;
    opacity: 0.6;
}

/* ===================== CARD-FLIP PATTERNS ===================== */
.flip-card {
    width: 280px;
    height: 360px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-large {
    width: 320px;
    height: 420px;
}

.flip-card-revealed {
    width: 240px;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.flip-card-inner.flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
}

/* FRONT FACE */
.flip-card-front {
    background-color: #F8ECD8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-bookplate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    border: 2px solid #C0A060;
    padding: 1.5rem;
    position: relative;
}

.card-bookplate::before,
.card-bookplate::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid #C0A060;
}

.card-bookplate::before {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
}

.card-bookplate::after {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
}

.card-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
}

.flip-card-large .card-icon {
    width: 140px;
    height: 140px;
}

.card-title {
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #8A3040;
    text-align: center;
}

/* BACK FACE */
.flip-card-back {
    background-color: #5A1020;
    transform: rotateY(180deg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back-title {
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #C0A060;
    margin-bottom: 1rem;
    text-align: center;
}

.card-back-text {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #FFF0E0;
    margin-bottom: 0.8rem;
}

.card-back-text:last-child {
    margin-bottom: 0;
}

/* ===================== CIRCUIT BACKGROUND PATTERNS ===================== */
.circuit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Processor Grid Pattern */
.circuit-processor-grid {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 59px,
            rgba(138, 48, 64, 0.06) 59px,
            rgba(138, 48, 64, 0.06) 60px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 59px,
            rgba(138, 48, 64, 0.06) 59px,
            rgba(138, 48, 64, 0.06) 60px
        );
}

/* Data Bus Pattern */
.circuit-data-bus {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(138, 48, 64, 0.05) 39px,
            rgba(138, 48, 64, 0.05) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 79px,
            rgba(138, 48, 64, 0.04) 79px,
            rgba(138, 48, 64, 0.04) 80px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 19px,
            rgba(192, 160, 96, 0.03) 19px,
            rgba(192, 160, 96, 0.03) 20px
        );
}

/* Register Block Pattern */
.circuit-register-block {
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 99px,
            rgba(138, 48, 64, 0.06) 99px,
            rgba(138, 48, 64, 0.06) 100px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            rgba(138, 48, 64, 0.04) 49px,
            rgba(138, 48, 64, 0.04) 50px
        );
    background-size: 100px 50px;
}

/* Combined Pattern (closing section at 10% opacity) */
.circuit-combined {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(138, 48, 64, 0.10) 39px,
            rgba(138, 48, 64, 0.10) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 59px,
            rgba(138, 48, 64, 0.08) 59px,
            rgba(138, 48, 64, 0.08) 60px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 19px,
            rgba(192, 160, 96, 0.05) 19px,
            rgba(192, 160, 96, 0.05) 20px
        );
}

/* ===================== ISOMETRIC ICONS ===================== */
.isometric-icon {
    display: block;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .z-row {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 3rem 0;
    }

    .z-row-1 {
        min-height: 100vh;
    }

    .z-left,
    .z-right {
        justify-self: center;
        padding-left: 2rem;
        padding-right: 2rem;
        max-width: 100%;
    }

    .z-right {
        padding-top: 0;
    }

    .hero-icon .isometric-icon {
        width: 200px;
        height: 200px;
    }

    .card-row {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .flip-card {
        width: 260px;
        height: 340px;
    }

    .flip-card-large {
        width: 280px;
        height: 380px;
    }

    .flip-card-revealed {
        width: 220px;
        height: 280px;
    }

    .closing-cards {
        flex-direction: column;
        align-items: center;
    }

    .closing-icon-row {
        width: 240px;
    }

    .section-heading {
        font-size: clamp(1.6rem, 5vw, 3rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .z-left,
    .z-right {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .flip-card {
        width: 240px;
        height: 320px;
    }

    .flip-card-large {
        width: 260px;
        height: 360px;
    }

    .flip-card-revealed {
        width: 200px;
        height: 260px;
    }

    .bookplate-ornament {
        padding: 0.8rem 1.5rem;
    }

    .closing-domain {
        font-size: 1.4rem;
    }
}
