/* ============================================
   concepts.news — Styles
   Editorial magazine-spread design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0e0e0e;
    --bg-secondary: #161616;
    --text-primary: #f0ece4;
    --text-secondary: #b0a898;
    --accent: #8b7355;
    --accent-hover: #c4a265;
    --highlight: #2a2218;
    --divider: #2a2a2a;
    --bg-colophon: #080808;

    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Lora', 'Georgia', serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Paper Grain Texture --- */
.paper-grain-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.paper-grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Intro Overlay --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

#intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-overlay.hidden {
    display: none;
}

.intro-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.intro-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.intro-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.intro-rule {
    width: 120px;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.intro-rule.visible {
    transform: scaleX(1);
}

/* --- Masthead --- */
#masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--divider);
    z-index: 1000;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease, background-color 0.3s ease, backdrop-filter 0.3s ease;
}

#masthead.visible {
    opacity: 1;
}

#masthead.scrolled {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(14, 14, 14, 0.92);
}

.masthead-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.masthead-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--text-primary);
}

.masthead-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-link {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 16px;
    position: relative;
    transition: color 0.25s ease;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 16px;
    right: 16px;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

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

.nav-divider {
    width: 1px;
    height: 14px;
    background-color: #3a3a3a;
    flex-shrink: 0;
}

/* --- Opening Spread (Hero) --- */
#opening-spread {
    min-height: 100vh;
    padding-top: 56px;
    position: relative;
    overflow: hidden;
}

.spread-grid {
    display: grid;
    grid-template-columns: 1fr 1.618fr;
    min-height: calc(100vh - 56px);
}

.spread-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 60px 80px 80px;
    position: relative;
    z-index: 2;
}

.overline-rule {
    width: 60px;
    height: 1px;
    background-color: var(--accent);
    margin-bottom: 24px;
}

.hero-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.8rem, 5.5vw, 5rem);
    line-height: 1.05;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.byline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    color: var(--accent);
}

.date-mono {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.hero-excerpt {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 480px;
}

.spread-image {
    position: relative;
    overflow: hidden;
}

.spread-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(to right, rgba(14, 14, 14, 1) 0%, transparent 100%);
    z-index: 2;
}

.hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    mix-blend-mode: luminosity;
    opacity: 0.85;
    filter: grayscale(100%) sepia(12%) contrast(1.1) brightness(0.95);
    transition: filter 0.6s ease;
    will-change: transform;
}

.hero-image:hover {
    filter: grayscale(0%) contrast(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Content reveal animations --- */
.spread-text,
.spread-image {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.spread-text.revealed,
.spread-image.revealed {
    opacity: 1;
}

.hero-image.revealed {
    animation: heroZoom 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes heroZoom {
    from {
        transform: scale(1.04);
    }
    to {
        transform: scale(1);
    }
}

/* --- Section backgrounds --- */
.section-dark {
    background-color: var(--bg-primary);
}

.section-alt {
    background-color: var(--bg-secondary);
}

/* --- Fleurons --- */
.section-fleuron {
    text-align: center;
    font-size: 18px;
    color: var(--accent);
    padding: 48px 0;
    line-height: 1;
}

/* --- Wide Text (Essay) Sections --- */
.essay-wide {
    padding: 0 40px 120px;
}

.wide-text-container {
    max-width: 780px;
    margin: 0 auto;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 28px;
}

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

/* --- Drop Capital --- */
.drop-cap {
    float: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 72px;
    line-height: 0.8;
    padding-right: 12px;
    padding-bottom: 4px;
    color: var(--accent);
    transition: color 0.3s ease;
}

.body-text:hover .drop-cap {
    color: var(--accent-hover);
}

/* --- Pull Quotes --- */
.pull-quote {
    margin: 48px 0 48px 60px;
    padding-left: 24px;
    position: relative;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}

.pull-quote.revealed {
    opacity: 1;
    transform: translateX(0);
}

.pull-quote-rule {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background-color: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.pull-quote.revealed .pull-quote-rule {
    transform: scaleY(1);
}

.pull-quote blockquote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    line-height: 1.4;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

/* --- Image-Text Spreads --- */
.image-text-spread {
    padding: 120px 0;
    overflow: hidden;
}

.image-text-spread .spread-grid {
    min-height: auto;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    align-items: center;
}

.spread-image-right {
    grid-template-columns: 1fr 1.618fr;
}

.spread-image-left {
    grid-template-columns: 1.618fr 1fr;
}

.spread-text-col {
    padding: 40px 60px;
}

.spread-text-col .overline-rule {
    margin-bottom: 24px;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.spread-image-col {
    overflow: hidden;
}

.image-container {
    position: relative;
    overflow: hidden;
    height: 500px;
}

.image-dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.image-container.revealed .image-dark-overlay {
    opacity: 0;
}

.spread-photo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) sepia(12%) contrast(1.1) brightness(0.95);
    transition: filter 0.6s ease, transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    transform: translateX(100%);
}

.spread-image-left .spread-photo {
    transform: translateX(-100%);
}

.image-container.revealed .spread-photo {
    transform: translateX(0);
}

.spread-photo:hover {
    filter: grayscale(0%) contrast(1.05);
}

/* --- Concept Cards --- */
.concept-cards-section {
    padding: 0 40px 120px;
}

.concept-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.concept-card {
    padding-top: 24px;
    position: relative;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.concept-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.card-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.concept-card.revealed .card-border {
    transform: scaleX(1);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-excerpt {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--accent);
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.card-link:hover {
    color: var(--accent-hover);
    transform: translateX(3px);
}

/* --- End Mark --- */
.end-mark {
    text-align: center;
    color: var(--divider);
    font-size: 16px;
    letter-spacing: 0.5em;
    margin-top: 60px;
    padding: 48px 0;
}

/* --- Colophon (Footer) --- */
#colophon {
    background-color: var(--bg-colophon);
    padding: 120px 40px;
}

.colophon-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.colophon-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.colophon-rule {
    width: 120px;
    height: 1px;
    background-color: var(--divider);
}

.colophon-mission {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 480px;
    line-height: 1.75;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .spread-grid {
        grid-template-columns: 1fr;
    }

    .spread-text {
        padding: 60px 40px;
        min-height: 60vh;
    }

    .spread-image {
        height: 50vh;
    }

    .spread-image::before {
        width: 100%;
        height: 35%;
        background: linear-gradient(to bottom, rgba(14, 14, 14, 1) 0%, transparent 100%);
    }

    .spread-image-right,
    .spread-image-left {
        grid-template-columns: 1fr;
    }

    .spread-image-left .spread-image-col {
        order: -1;
    }

    .image-container {
        height: 350px;
    }

    .spread-text-col {
        padding: 40px;
    }

    .concept-cards-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .masthead-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .spread-text {
        padding: 40px 24px;
    }

    .essay-wide {
        padding: 0 24px 80px;
    }

    .wide-text-container {
        max-width: 100%;
    }

    .pull-quote {
        margin-left: 24px;
    }

    .image-text-spread {
        padding: 80px 0;
    }

    .image-text-spread .spread-grid {
        padding: 0 24px;
    }

    .spread-text-col {
        padding: 24px 0;
    }

    .concept-cards-section {
        padding: 0 24px 80px;
    }

    #colophon {
        padding: 80px 24px;
    }

    .masthead-inner {
        padding: 0 24px;
    }
}
