/* desca.works - Styles */
/* Colors: #2a1f14 (Espresso), #f2ebe0 (Parchment), #c4623a (Burnt Sienna), #b89b5e (Gold), #8a7e6f (Smoke Taupe), #140e08 (Obsidian) */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #2a1f14;
    color: #f2ebe0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ==================== NAVIGATION ==================== */

.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    pointer-events: none;
}

.nav-wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    color: #f2ebe0;
    letter-spacing: -0.02em;
    pointer-events: auto;
    transition: color 0.3s ease;
}

.nav-trigger {
    width: 48px;
    height: 48px;
    cursor: pointer;
    pointer-events: auto;
    color: #c4623a;
    transition: transform 0.3s ease;
}

.nav-trigger:hover {
    transform: scale(1.1);
}

.trigger-circle {
    width: 100%;
    height: 100%;
}

/* ==================== MENU OVERLAY ==================== */

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background-color: #140e08;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    text-align: center;
}

.menu-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: #f2ebe0;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
    opacity: 0;
    transform: translateY(20px);
}

.menu-overlay.active .menu-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.2s ease;
}

.menu-overlay.active .menu-link:nth-child(1) { transition-delay: 0.1s, 0.1s, 0s; }
.menu-overlay.active .menu-link:nth-child(2) { transition-delay: 0.15s, 0.15s, 0s; }
.menu-overlay.active .menu-link:nth-child(3) { transition-delay: 0.2s, 0.2s, 0s; }
.menu-overlay.active .menu-link:nth-child(4) { transition-delay: 0.25s, 0.25s, 0s; }
.menu-overlay.active .menu-link:nth-child(5) { transition-delay: 0.3s, 0.3s, 0s; }

.menu-link:hover {
    color: #c4623a;
}

/* ==================== CHAMBER 1 - THE THRESHOLD ==================== */

.chamber {
    position: relative;
    overflow: hidden;
}

.chamber-1 {
    min-height: 100vh;
    background-color: #2a1f14;
    display: flex;
    align-items: center;
    justify-content: center;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

.hero-content {
    text-align: center;
    z-index: 1;
    position: relative;
    padding: 0 20px;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 9rem);
    color: #f2ebe0;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-bottom: 40px;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 0.6s ease-out forwards;
    animation-delay: calc(var(--delay) * 120ms + 0.5s);
}

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

.hero-rule {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 32px;
    overflow: hidden;
}

.rule-line-svg {
    width: 100%;
    height: 4px;
}

.hero-rule-line {
    stroke-dashoffset: 1200;
    animation: lineDrawHero 2s ease-out 2s forwards;
}

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

.hero-inscription {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: #8a7e6f;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeIn 1s ease-out 3s forwards;
}

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

/* ==================== GRID DIVIDERS ==================== */

.grid-divider {
    padding: 0;
    position: relative;
}

.grid-divider.dark-bg {
    background-color: #2a1f14;
}

.divider-svg {
    width: 100%;
    height: 4px;
    display: block;
}

.draw-line {
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s ease-out;
}

.draw-line.animated {
    stroke-dashoffset: 0;
}

/* ==================== FADE REVEAL ==================== */

.fade-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== CHAMBER 2 - FIRST ILLUMINATION ==================== */

.chamber-2 {
    background-color: #f2ebe0;
    color: #2a1f14;
    position: relative;
    padding: 20vh 0 15vh;
}

.ruled-paper-bg {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 27px,
        rgba(42, 31, 20, 0.03) 27px,
        rgba(42, 31, 20, 0.03) 28px
    );
    pointer-events: none;
}

.content-panel {
    position: relative;
}

.panel-illumination {
    width: 70vw;
    margin-left: 15vw;
    position: relative;
    padding: 60px 0 60px 60px;
}

.margin-line {
    position: absolute;
    left: 12%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(196, 98, 58, 0.12);
}

.panel-text {
    position: relative;
    z-index: 1;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #2a1f14;
    margin-bottom: 1.5em;
}

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

.drop-cap-text {
    position: relative;
}

.drop-cap-wrapper {
    float: left;
    margin-right: 12px;
    margin-top: 4px;
    position: relative;
}

.drop-cap {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 5.5rem;
    line-height: 0.8;
    color: #2a1f14;
    display: block;
    padding: 8px 12px 4px 8px;
    border: 1px solid rgba(42, 31, 20, 0.15);
    border-radius: 2px;
}

.crosshatch-ornament {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.crosshatch-svg {
    width: 120px;
    height: 60px;
}

/* ==================== CHAMBER 3 - THE GALLERY ==================== */

.chamber-3 {
    background-color: #2a1f14;
    padding: 20vh 0 15vh;
    position: relative;
}

.gallery-panel {
    position: relative;
    margin-bottom: 0;
}

.gallery-panel.panel-1 {
    width: 45vw;
    margin-left: 5vw;
    padding-bottom: 20vh;
}

.gallery-panel.panel-2 {
    width: 60vw;
    margin-left: 30vw;
    padding-bottom: 20vh;
}

.gallery-panel.panel-3 {
    width: 40vw;
    margin-left: 10vw;
    padding-bottom: 5vh;
}

.gallery-divider {
    padding: 0 0 20vh;
}

.panel-illustration {
    margin-bottom: 24px;
}

.illustration-svg {
    width: 100%;
    height: auto;
    max-height: 300px;
}

.panel-description {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: #f2ebe0;
    margin-bottom: 12px;
}

.panel-caption {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #8a7e6f;
    display: block;
}

/* ==================== CHAMBER 4 - THE INSCRIPTION WALL ==================== */

.chamber-4 {
    background-color: #f2ebe0;
    color: #2a1f14;
    padding: 15vh 0;
    position: relative;
}

.inscription-panel {
    width: 90vw;
    margin-left: 5vw;
    position: relative;
}

.inscription-rule {
    position: relative;
    margin-bottom: 40px;
}

.inscription-rule:last-of-type {
    margin-top: 40px;
    margin-bottom: 24px;
}

.rule-svg {
    width: 100%;
    height: 4px;
    display: block;
}

.ink-splash {
    position: absolute;
    width: 24px;
    height: 24px;
    top: -10px;
}

.ink-splash-left {
    left: 5%;
    background: radial-gradient(circle at 40% 50%, #2a1f14 0%, #2a1f14 30%, transparent 31%),
                radial-gradient(circle at 65% 35%, #2a1f14 0%, #2a1f14 20%, transparent 21%),
                radial-gradient(circle at 50% 70%, #2a1f14 0%, #2a1f14 15%, transparent 16%),
                radial-gradient(circle at 30% 30%, #2a1f14 0%, #2a1f14 10%, transparent 11%);
    opacity: 0.35;
}

.ink-splash-right {
    right: 8%;
    background: radial-gradient(circle at 55% 45%, #2a1f14 0%, #2a1f14 25%, transparent 26%),
                radial-gradient(circle at 35% 60%, #2a1f14 0%, #2a1f14 18%, transparent 19%),
                radial-gradient(circle at 70% 30%, #2a1f14 0%, #2a1f14 12%, transparent 13%),
                radial-gradient(circle at 45% 75%, #2a1f14 0%, #2a1f14 8%, transparent 9%);
    opacity: 0.3;
}

.inscription-quote {
    position: relative;
    padding: 20px 0;
}

.gold-leaf-bg {
    position: absolute;
    inset: -10px -20px;
    background: conic-gradient(
        from 45deg,
        #b89b5e 0deg,
        rgba(184, 155, 94, 0.25) 60deg,
        #b89b5e 120deg,
        rgba(184, 155, 94, 0.25) 180deg,
        #b89b5e 240deg,
        rgba(184, 155, 94, 0.25) 300deg,
        #b89b5e 360deg
    );
    opacity: 0.06;
    z-index: 0;
    border-radius: 2px;
}

.inscription-quote p {
    position: relative;
    z-index: 1;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #2a1f14;
}

.inscription-attribution {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a7e6f;
    font-style: normal;
    display: block;
}

/* ==================== CHAMBER 5 - THE EXIT ==================== */

.chamber-5 {
    background-color: #2a1f14;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 30vh;
}

.exit-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.exit-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
    animation: slowRotate 60s linear infinite;
}

@keyframes slowRotate {
    to {
        transform: rotate(360deg);
    }
}

.exit-circle-svg {
    width: 100%;
    height: 100%;
}

.exit-wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    color: #f2ebe0;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.exit-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.exit-link {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a7e6f;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.exit-link:hover {
    color: #c4623a;
}

.exit-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #c4623a;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.exit-link:hover::after {
    transform: scaleX(1);
}

.exit-separator {
    color: #8a7e6f;
    font-size: 11px;
}

.exit-note {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #8a7e6f;
    opacity: 0.6;
}

/* ==================== NAV COLOR ADAPTATION ==================== */

body.nav-light .nav-wordmark {
    color: #2a1f14;
}

body.nav-light .nav-trigger {
    color: #c4623a;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .nav-fixed {
        padding: 16px 20px;
    }

    .nav-wordmark {
        font-size: 18px;
    }

    .nav-trigger {
        width: 40px;
        height: 40px;
    }

    .panel-illumination {
        width: 85vw;
        margin-left: 5vw;
        padding-left: 40px;
    }

    .margin-line {
        left: 8%;
    }

    .drop-cap {
        font-size: 3.8rem;
    }

    .gallery-panel.panel-1 {
        width: 85vw;
        margin-left: 5vw;
    }

    .gallery-panel.panel-2 {
        width: 70vw;
        margin-left: 5vw;
    }

    .gallery-panel.panel-3 {
        width: 90vw;
        margin-left: 5vw;
    }

    .inscription-panel {
        width: 90vw;
        margin-left: 5vw;
    }

    .grid-divider .divider-svg,
    .gallery-divider .divider-svg {
        width: 60vw;
        margin: 0 auto;
        display: block;
    }

    .exit-links {
        flex-direction: column;
        gap: 12px;
    }

    .exit-separator {
        display: none;
    }

    .chamber-5 {
        padding-bottom: 20vh;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .panel-illumination {
        width: 90vw;
        margin-left: 5vw;
        padding-left: 24px;
    }

    .drop-cap {
        font-size: 3rem;
        padding: 4px 8px 2px 4px;
    }

    .inscription-quote p {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}