/* ==========================================================================
   HHUDDL.com - Editorial Stillness Design System
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --color-bg: #FDFCFA;
    --color-surface: #F5F2ED;
    --color-border: #E8E4DF;
    --color-text: #2C2A27;
    --color-text-secondary: #8A8580;
    --color-accent: #B8977E;
    --color-accent-hover: #A07D62;
    --color-highlight: #F0E6D8;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-ui: 'DM Sans', Helvetica, Arial, sans-serif;

    --baseline: 28px;
}

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

::selection {
    background: var(--color-highlight);
    color: var(--color-text);
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: color 300ms ease;
}

a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 400ms ease;
}

a:hover {
    color: var(--color-accent);
}

a:hover::after {
    width: 100%;
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-accent);
    z-index: 1000;
    transition: width 50ms linear;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 900;
    padding: 40px 48px;
}

.nav-trigger {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 300ms ease;
}

.nav-trigger:hover {
    color: var(--color-accent);
}

/* --- Menu Panel --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 252, 250, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    z-index: 950;
    transition: opacity 400ms ease, visibility 400ms ease;
}

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

.menu-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: var(--color-bg);
    z-index: 960;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    transition: right 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-panel.active {
    right: 0;
}

.menu-close {
    position: absolute;
    top: 40px;
    right: 48px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 300ms ease;
}

.menu-close:hover {
    color: var(--color-accent);
}

.menu-list {
    list-style: none;
}

.menu-list li {
    margin-bottom: 16px;
}

.menu-link {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 48px;
    color: var(--color-text);
    letter-spacing: 0.02em;
    transition: color 300ms ease;
}

.menu-link::after {
    display: none;
}

.menu-link:hover {
    color: var(--color-accent);
}

/* --- Spreads (Common) --- */
.spread {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Section Numbers --- */
.section-number {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4rem, 6vw, 6rem);
    color: var(--color-border);
    position: absolute;
    left: 8%;
    top: 80px;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

/* --- White Pause --- */
.white-pause {
    height: 40vh;
    width: 100%;
}

/* ==========================================================================
   Spread 1: The Masthead
   ========================================================================== */
.spread--masthead {
    min-height: 100vh;
    justify-content: flex-end;
    padding-bottom: 20vh;
}

.masthead-inner {
    text-align: center;
    position: relative;
}

.masthead-rule {
    width: 40vw;
    height: 1px;
    background: var(--color-border);
    margin: 0 auto 40px;
}

.masthead-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: 24px;
}

.masthead-tagline {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    display: inline;
    min-height: 1.5em;
}

.tagline-cursor {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    color: var(--color-accent);
    animation: blink 800ms ease-in-out infinite;
    display: inline;
    margin-left: 1px;
}

.tagline-cursor.hidden {
    animation: cursorFade 600ms ease forwards;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes cursorFade {
    to { opacity: 0; }
}

/* ==========================================================================
   Spread 2: The Feature Well
   ========================================================================== */
.spread--feature {
    padding: 120px 0 80px;
}

.feature-well {
    max-width: 520px;
    width: 100%;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.feature-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-bottom: 48px;
    text-align: center;
}

.feature-body p {
    margin-bottom: calc(var(--baseline) * 1.5);
    text-align: left;
}

/* --- Drop Cap --- */
.drop-cap {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-accent);
    float: left;
    font-size: 4.2em;
    line-height: 0.8;
    padding-right: 12px;
    padding-top: 6px;
}

/* --- Pull Quotes --- */
.pull-quote {
    margin: calc(var(--baseline) * 2) 0;
    margin-left: -60px;
    padding-left: 20px;
    position: relative;
}

.pull-quote-rule {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--color-accent);
}

.pull-quote blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 1.4em;
    line-height: 1.5;
    color: var(--color-text);
}

/* ==========================================================================
   Spread 3: The Image Pause
   ========================================================================== */
.spread--image {
    padding: 120px 0 80px;
}

.image-container {
    width: 60vw;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.image-frame {
    border: 1px solid var(--color-border);
    overflow: hidden;
    line-height: 0;
}

.editorial-image {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    margin-top: 16px;
    text-align: center;
    overflow: hidden;
}

.caption-text {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    opacity: 0;
    filter: blur(2px);
    transition: opacity 500ms ease, filter 500ms ease;
    display: inline-block;
}

.image-container:hover .caption-text {
    opacity: 1;
    filter: blur(0px);
}

/* ==========================================================================
   Spread 4: The Index Grid
   ========================================================================== */
.spread--index {
    padding: 120px 0 80px;
}

.index-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-bottom: 64px;
    text-align: center;
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 900px;
    width: 100%;
    padding: 0 48px;
    position: relative;
    z-index: 1;
}

.index-item {
    opacity: var(--item-opacity, 1);
}

.index-number {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: var(--color-border);
    display: block;
    line-height: 1;
    margin-bottom: 12px;
}

.index-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.index-desc {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   Spread 5: The Colophon
   ========================================================================== */
.spread--colophon {
    min-height: 80vh;
    justify-content: flex-end;
    padding-bottom: 10vh;
}

.colophon-inner {
    text-align: center;
}

.colophon-rule {
    width: 60px;
    height: 1px;
    background: var(--color-border);
    margin: 0 auto 32px;
}

.colophon-credits {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    line-height: 1.8;
}

.colophon-links {
    margin-top: 24px;
    margin-bottom: 32px;
}

.colophon-link {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    transition: color 300ms ease;
}

.colophon-link:hover {
    color: var(--color-accent);
}

.colophon-divider {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--color-border);
    margin: 0 16px;
}

.colophon-copyright {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* ==========================================================================
   Reveal Animations (Blur-Focus)
   ========================================================================== */
.reveal-element {
    opacity: 0;
    filter: blur(4px);
    transition: opacity 800ms ease-out, filter 800ms ease-out;
}

.reveal-element.revealed {
    opacity: 1;
    filter: blur(0px);
}

/* Index items maintain their depth opacity when revealed */
.index-item.reveal-element.revealed {
    opacity: var(--item-opacity, 1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    body {
        line-height: 1.7;
    }

    .nav {
        padding: 24px 24px;
    }

    .spread--masthead {
        padding-bottom: 15vh;
    }

    .masthead-rule {
        width: 50vw;
    }

    .section-number {
        left: 5%;
        font-size: clamp(3rem, 5vw, 4rem);
    }

    .feature-well {
        max-width: 100%;
        padding: 0 max(12vw, 24px);
    }

    .pull-quote {
        margin-left: 0;
        padding-left: 16px;
    }

    .pull-quote blockquote {
        font-size: 1.2em;
    }

    .image-container {
        width: 80vw;
    }

    .index-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px;
        padding: 0 max(12vw, 24px);
    }

    .menu-panel {
        width: 280px;
        right: -280px;
        padding: 60px 32px;
    }

    .menu-close {
        right: 32px;
    }

    .white-pause {
        height: 25vh;
    }
}

@media (max-width: 480px) {
    .index-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nav {
        padding: 20px 20px;
    }

    .menu-panel {
        width: 100%;
        right: -100%;
    }

    .menu-close {
        right: 20px;
    }

    .section-number {
        display: none;
    }

    .image-container {
        width: 88vw;
    }

    .feature-well {
        padding: 0 20px;
    }
}
