/* ============================================================
   hensai.quest — Design Implementation
   Palette: Deep Bark #2C1A0E, Fired Clay #8B3A1C, Warm Amber #D4892A,
            River Sand #C8AB82, Aged Linen #F0E8D6, Pale Straw #FAF5E9,
            Weathered Copper #7A6A4F, Moss Divider #A07850
   Fonts: Fraunces (display), Newsreader (body), DM Sans (UI), Fira Code (tech)
   ============================================================ */

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

/* ── Base ── */
html {
    scroll-behavior: smooth;
}

body {
    background-color: #FAF5E9;
    color: #7A6A4F;
    font-family: 'Newsreader', serif;
    font-size: clamp(16px, 1.2vw, 19px);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── Header / Navigation ── */
#header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: 80px;
    background: #2C1A0E;
}

.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6vw;
}

.wordmark {
    font-family: 'Fraunces', serif;
    font-variation-settings: 'wght' 700, 'opsz' 36;
    font-size: 20px;
    color: #FAF5E9;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.wordmark-dot {
    color: #D4892A;
}

.nav {
    display: flex;
    gap: 2.5em;
    align-items: center;
}

.nav-link {
    font-family: 'DM Sans', sans-serif;
    font-variation-settings: 'wght' 300;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #FAF5E9;
    text-decoration: none;
    transition: font-variation-settings 200ms ease;
}

.nav-link:hover {
    font-variation-settings: 'wght' 600;
}

/* ── Hero Section ── */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    min-height: 90vh;
    background: #FAF5E9;
    position: relative;
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    grid-column: 2;
    left: 50%;
    right: 0;
    background-image:
        linear-gradient(#A07850 1px, transparent 1px),
        linear-gradient(90deg, #A07850 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.hero-text {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding: 80px 6vw 80px 8vw;
    z-index: 2;
    position: relative;
}

.hero-kicker {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #C8AB82;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-headline {
    font-family: 'Fraunces', serif;
    font-variation-settings: 'wght' 700, 'opsz' 144;
    font-size: clamp(48px, 8vw, 112px);
    font-style: normal;
    line-height: 1.0;
    color: #2C1A0E;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-headline em {
    font-style: italic;
    color: #8B3A1C;
    font-variation-settings: 'wght' 600, 'opsz' 144;
}

.hero-body {
    font-family: 'Newsreader', serif;
    font-size: clamp(16px, 1.3vw, 20px);
    font-weight: 400;
    color: #7A6A4F;
    max-width: 40ch;
    line-height: 1.65;
}

.hero-blob-col {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.blob-shape {
    position: absolute;
    top: -10%;
    right: -15%;
    width: 65vw;
    height: 80vh;
    background: #D4892A;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 20%, rgba(255,255,255,0.08) 0%, transparent 45%),
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 35%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphBlob 18s ease-in-out infinite alternate;
    filter: blur(0);
    transition: opacity 0.8s ease;
}

.blob-shape.faded {
    opacity: 0.2;
}

@keyframes morphBlob {
    0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    100% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* ── Zone Root ── */
.zone-root {
    background: #FAF5E9;
    display: flex;
    justify-content: flex-end;
    padding: 2rem 8vw;
}

.zone-root-text {
    font-family: 'Fraunces', serif;
    font-variation-settings: 'wght' 400, 'opsz' 24;
    font-size: 13px;
    color: #C8AB82;
    text-align: right;
}

.small-caps {
    font-variant: small-caps;
    letter-spacing: 0.12em;
}

/* ── Ripple Divider ── */
.ripple-divider {
    width: 100%;
    line-height: 0;
    display: block;
    margin: 0.5rem 0;
}

.ripple-divider svg {
    display: block;
    width: 100%;
}

/* ── Content Body ── */
.content-body {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 6vw;
}

/* ── Content Sections ── */
.content-section {
    padding: 100px 0;
}

.section-inner {
    display: grid;
    gap: 6vw;
    align-items: center;
}

/* Odd: text left (55%), visual right (45%) */
.section-odd .section-inner {
    grid-template-columns: 55fr 45fr;
}

.section-odd .section-text {
    grid-column: 1;
}

.section-odd .section-visual {
    grid-column: 2;
}

/* Even: visual left (45%), text right (55%) */
.section-even .section-inner {
    grid-template-columns: 45fr 55fr;
}

.section-even .section-visual {
    grid-column: 1;
}

.section-even .section-text {
    grid-column: 2;
}

/* ── Section Typography ── */
.section-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #C8AB82;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-headline {
    font-family: 'Fraunces', serif;
    font-variation-settings: 'wght' 500, 'opsz' 72;
    font-size: clamp(28px, 4vw, 52px);
    color: #2C1A0E;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.section-body {
    font-family: 'Newsreader', serif;
    font-size: clamp(16px, 1.2vw, 19px);
    font-weight: 400;
    color: #7A6A4F;
    line-height: 1.7;
    max-width: 52ch;
    margin-bottom: 1.2rem;
}

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

.italic-body {
    font-style: italic;
    font-weight: 300;
}

/* ── Section Visuals ── */
.section-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 280px;
}

.section-visual.has-grid-bg {
    background-image:
        linear-gradient(#A07850 1px, transparent 1px),
        linear-gradient(90deg, #A07850 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 1;
    border-radius: 4px;
}

.method-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#A07850 1px, transparent 1px),
        linear-gradient(90deg, #A07850 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.04;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Accent Blob (Section 1) ── */
.accent-blob {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 280px;
    background: #C8AB82;
    border-radius: 58% 42% 36% 64% / 54% 38% 62% 46%;
    opacity: 0.6;
    z-index: 0;
}

.icon-cluster {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.tech-icon {
    width: 48px;
    height: 48px;
    display: block;
}

.tech-icon-large {
    width: 80px;
    height: 80px;
}

/* ── Footer ── */
#footer {
    background: #2C1A0E;
    position: relative;
    overflow: hidden;
}

.footer-atmosphere-blob {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 180deg at 50% 100%, #2C1A0E 0deg, #8B3A1C 120deg, #2C1A0E 240deg);
    opacity: 0.08;
    pointer-events: none;
}

.footer-inner {
    position: relative;
    z-index: 1;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 6vw;
}

.footer-ripple {
    width: calc(100% + 12vw);
    margin-left: -6vw;
    line-height: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem 0 3rem;
}

.footer-wordmark {
    font-family: 'Fraunces', serif;
    font-variation-settings: 'wght' 600, 'opsz' 36;
    font-size: 18px;
    color: #FAF5E9;
    text-decoration: none;
    opacity: 0.85;
}

.footer-version {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 13px;
    color: #C8AB82;
    letter-spacing: 0.06em;
}

.footer-nav-link {
    color: #C8AB82;
}

.footer-nav-link:hover {
    font-variation-settings: 'wght' 600;
}

/* ── Reveal Animation ── */
.reveal-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-bottom: 50vw;
    }

    .hero-text {
        grid-column: 1;
        padding: 60px 6vw 40px 6vw;
    }

    .hero-blob-col {
        grid-column: 1;
        height: 50vw;
    }

    .blob-shape {
        top: auto;
        bottom: -30%;
        right: -20%;
        width: 90vw;
        height: 60vw;
    }

    .section-inner,
    .section-odd .section-inner,
    .section-even .section-inner {
        grid-template-columns: 1fr;
    }

    .section-odd .section-visual,
    .section-even .section-visual {
        grid-column: 1;
        grid-row: 2;
        order: 2;
    }

    .section-odd .section-text,
    .section-even .section-text {
        grid-column: 1;
        grid-row: 1;
        order: 1;
    }

    .nav {
        gap: 1.5em;
    }

    .content-section {
        padding: 60px 0;
    }

    .accent-blob {
        width: 180px;
        height: 180px;
    }
}
