/* Palette: #0d1b2a #1b2838 #2a4a6b #c9a96e #f4f0e8 #e8e0d0 #1a1a2e #4a5568 #eae6de #8b5e3c */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.2vw, 1.25rem);
    line-height: 1.85;
    color: #1a1a2e;
    background-color: #0d1b2a;
    overflow-x: hidden;
}

/* === Sections === */
.section {
    min-height: 100vh;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* === Reveal Elements === */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Progress Track === */
.progress-track {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    height: 40vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-dot {
    position: absolute;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.6);
    transform: translate(-2.5px, -4px);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: translate(-2.5px, -4px) scale(1); }
    50% { transform: translate(-2.5px, -4px) scale(1.3); }
}

/* === Section 1: Opening Gate === */
.gate-section {
    background-color: #0d1b2a;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 8vw 15vh;
    overflow: hidden;
}

.gate-content {
    position: relative;
    z-index: 2;
}

.gate-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(5rem, 12vw, 14rem);
    color: #0d1b2a;
    letter-spacing: 0.12em;
    line-height: 1;
    /* Slightly lighter than bg to be visible */
    color: #eae6de;
    display: flex;
    align-items: baseline;
    gap: 0.05em;
}

.seal-dot-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: glow-seal 3s ease-in-out infinite;
    margin: 0 0.05em;
}

@keyframes glow-seal {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(201, 169, 110, 0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(201, 169, 110, 0.7)); }
}

.gate-rule {
    width: 40vw;
    height: 1px;
    background: linear-gradient(to right, #2a4a6b, rgba(201, 169, 110, 0.4));
    margin-left: auto;
    margin-top: 4vh;
    margin-right: -8vw;
}

.gate-whisper {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #4a5568;
    margin-top: 3vh;
    text-align: right;
}

.flowing-curve {
    position: absolute;
    right: 15vw;
    top: 0;
    height: 100%;
    width: 100px;
    z-index: 1;
    opacity: 0.5;
}

/* === Section 2: The Folio === */
.folio-section {
    background-color: #0d1b2a;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(26, 40, 58, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(42, 74, 107, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 94, 60, 0.08) 0%, transparent 60%);
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.4);
    padding: 15vh 8vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.folio-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-conic-gradient(
        rgba(26, 40, 58, 0.03) 0deg,
        transparent 1deg,
        transparent 3deg,
        rgba(13, 27, 42, 0.02) 4deg
    );
    /* Uses #1b2838 twilight navy undertone */
    border-top: 1px solid #1b2838;
    pointer-events: none;
}

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

.folio-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 8vh;
}

.folio-block {
    max-width: 38ch;
    color: #eae6de;
}

.folio-left {
    align-self: flex-start;
    margin-left: 5vw;
}

.folio-right {
    align-self: flex-end;
    margin-right: 5vw;
}

.folio-block p {
    font-size: clamp(1.05rem, 1.2vw, 1.25rem);
    line-height: 1.85;
}

.folio-italic {
    font-style: italic;
}

.seal-medium {
    margin-top: 8vh;
    opacity: 0.6;
    position: relative;
    z-index: 2;
}

/* === Section 3: The Notebook === */
.notebook-section {
    background-color: #f4f0e8;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    padding: 15vh 8vw;
}

.notebook-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6vh;
}

.notebook-card {
    background: #e8e0d0;
    padding: 3rem 2.5rem;
    box-shadow: 0 2px 16px rgba(13, 27, 42, 0.06);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    border-bottom: 2px solid transparent;
    position: relative;
}

.notebook-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #c9a96e;
    opacity: 0;
    transition: opacity 300ms ease;
}

.notebook-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(13, 27, 42, 0.12);
}

.notebook-card:hover::after {
    opacity: 1;
}

.card-wide {
    width: 55%;
}

.card-narrow {
    width: 45%;
}

.card-left {
    align-self: flex-start;
}

.card-right {
    align-self: flex-end;
}

.card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #4a5568;
    text-transform: lowercase;
    display: block;
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    letter-spacing: 0.04em;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.card-body {
    color: #1a1a2e;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.85;
}

/* === Section 4: The Seal === */
.seal-section {
    background-color: #0d1b2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4vh;
}

.seal-large-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-large {
    animation: rotate-seal 120s linear infinite;
}

@keyframes rotate-seal {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.seal-large-container svg circle,
.seal-large-container svg line {
    filter: drop-shadow(0 0 1px #8b5e3c);
}

.seal-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: #eae6de;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 768px) {
    .gate-section {
        padding: 0 6vw 10vh;
    }

    .card-wide,
    .card-narrow {
        width: 90vw;
    }

    .card-left,
    .card-right {
        align-self: center;
    }

    .folio-left,
    .folio-right {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .progress-track {
        position: fixed;
        right: auto;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        transform: none;
        flex-direction: row;
    }

    .progress-track svg {
        width: 100%;
        height: 3px;
    }

    .progress-dot {
        display: none;
    }

    .flowing-curve {
        display: none;
    }
}

@media (max-width: 480px) {
    .section {
        padding-top: 5vh;
        padding-bottom: 5vh;
    }

    .gate-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .folio-section::before {
        display: none;
    }
}
