/* ============================================
   saram.ai - Scandinavian Editorial Design
   사람 — human
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --warm-blush: #F5F0F0;
    --slate-mist: #94A3B8;
    --mountain-gray: #CBD5E1;
    --petal-pink: #FECDD3;
    --sage-soft: #D1D5B8;
    --deep-slate: #334155;
    --snow-white: #FAFAF9;

    --font-headline: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Lora', 'Georgia', serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;

    --content-width: 640px;
    --section-spacing: clamp(80px, 12vh, 160px);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--slate-mist);
    background-color: var(--warm-blush);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-headline);
    color: var(--deep-slate);
    letter-spacing: -0.01em;
}

h2 {
    font-weight: 600;
    font-size: clamp(28px, 5vw, 64px);
    margin-top: 0;
    margin-bottom: 1em;
    line-height: 1.15;
}

h3 {
    font-weight: 600;
    font-size: clamp(18px, 2.5vw, 24px);
    margin-bottom: 0.75em;
}

p {
    margin-bottom: 1.5em;
}

.mono {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* --- Section Base --- */
section, footer {
    position: relative;
    overflow: hidden;
}

/* ============================================
   SECTION 1: Human Threshold (Hero)
   ============================================ */
#human-threshold {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--warm-blush);
    position: relative;
}

.threshold-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: clamp(120px, 22vh, 260px);
}

.wordmark {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    color: var(--deep-slate);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.8s ease, letter-spacing 0.8s ease;
}

.wordmark.visible {
    opacity: 1;
    letter-spacing: -0.01em;
}

.wordmark-subtitle {
    color: var(--slate-mist);
    margin-top: 0.75em;
    opacity: 0;
    transition: opacity 1s ease 0.4s;
}

.wordmark-subtitle.visible {
    opacity: 1;
}

.mountain-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1;
}

#mountain-hero {
    display: block;
    width: 100%;
    height: auto;
}

.mountain-back {
    fill: var(--mountain-gray);
    opacity: 0.5;
}

.mountain-front {
    fill: var(--mountain-gray);
    opacity: 0.35;
}

/* ============================================
   SECTION 2-5: Editorial Chapters
   ============================================ */
.editorial-chapter {
    background-color: var(--snow-white);
    padding-block: var(--section-spacing);
    position: relative;
}

.editorial-chapter.alt-bg {
    background-color: var(--warm-blush);
}

.editorial-content {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 24px;
    position: relative;
    z-index: 2;
}

.chapter-label {
    display: block;
    color: var(--slate-mist);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2em;
    opacity: 0.7;
}

.editorial-chapter h2 {
    margin-top: 0;
}

.editorial-chapter p {
    color: var(--slate-mist);
}

.pull-quote {
    font-family: var(--font-headline);
    font-size: clamp(20px, 3vw, 28px);
    font-style: italic;
    color: var(--deep-slate);
    line-height: 1.6;
    margin-top: 2em;
    margin-bottom: 2em;
    padding-left: 1.5em;
    border-left: 2px solid var(--petal-pink);
}

/* Editorial Dividers */
.editorial-divider {
    margin-block: 4em;
}

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

.divider-mountain {
    fill: var(--mountain-gray);
    opacity: 0.3;
}

/* ============================================
   SECTION 4: The Mirror
   ============================================ */
#the-mirror {
    background-color: var(--snow-white);
    padding-block: var(--section-spacing);
}

.mirror-intro {
    font-size: clamp(17px, 1.8vw, 20px);
    color: var(--deep-slate);
    margin-bottom: 3em;
}

.mirror-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(16px, 3vw, 40px);
    margin-block: 3em;
    align-items: start;
}

.mirror-column h3 {
    color: var(--slate-mist);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5em;
}

.mirror-column ul {
    list-style: none;
    padding: 0;
}

.mirror-column ul li {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.3vw, 16px);
    line-height: 1.8;
    color: var(--slate-mist);
    padding-block: 0.5em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.mirror-column ul li.visible {
    opacity: 1;
    transform: translateY(0);
}

.mirror-human {
    text-align: right;
}

.mirror-ai {
    text-align: left;
}

.mirror-divider-vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
}

.mirror-divider-vertical svg {
    width: 60px;
    height: 300px;
}

.morph-line {
    fill: none;
    stroke: var(--petal-pink);
    stroke-width: 1.5;
    transition: d 3s ease;
}

.morph-line.geometric {
    d: path("M30,0 L30,50 L45,100 L15,150 L45,200 L15,250 L30,300");
}

/* Morph Container (organic-to-geometric) */
.morph-container {
    display: flex;
    justify-content: center;
    margin-top: 4em;
}

#morph-svg {
    width: clamp(200px, 40vw, 400px);
    height: auto;
}

.morph-shape-path {
    fill: none;
    stroke: var(--mountain-gray);
    stroke-width: 1.5;
    transition: d 3s ease-in-out;
}

.morph-shape-path.geometric {
    d: path("M120,50 L200,50 L280,50 L280,100 L280,150 L200,150 L120,150 L120,100 Z");
}

/* ============================================
   SECTION 6: Horizon Footer
   ============================================ */
#horizon-footer {
    background-color: var(--warm-blush);
    padding-top: 0;
    padding-bottom: clamp(40px, 6vh, 80px);
    position: relative;
}

.footer-mountain {
    position: relative;
    z-index: 1;
}

.footer-mountain svg {
    display: block;
    width: 100%;
    height: clamp(100px, 15vh, 200px);
}

.mountain-footer {
    fill: var(--mountain-gray);
    opacity: 0.3;
}

.footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: clamp(40px, 6vh, 80px);
}

.footer-wordmark {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(20px, 3vw, 32px);
    color: var(--deep-slate);
    letter-spacing: -0.01em;
    margin-bottom: 0.5em;
}

.footer-tagline {
    color: var(--slate-mist);
    opacity: 0.7;
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.editorial-chapter .editorial-content > h2,
.editorial-chapter .editorial-content > p,
.editorial-chapter .editorial-content > .pull-quote,
#the-mirror .editorial-content > h2,
#the-mirror .editorial-content > p,
#the-mirror .mirror-grid {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.editorial-chapter .editorial-content > h2.revealed,
.editorial-chapter .editorial-content > p.revealed,
.editorial-chapter .editorial-content > .pull-quote.revealed,
#the-mirror .editorial-content > h2.revealed,
#the-mirror .editorial-content > p.revealed,
#the-mirror .mirror-grid.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Mountain Breathing Animation
   ============================================ */
@keyframes mountainBreathe {
    0%, 100% {
        transform: scaleY(1) translateY(0);
    }
    50% {
        transform: scaleY(1.03) translateY(-2px);
    }
}

#mountain-hero .mountain-back {
    animation: mountainBreathe 8s ease-in-out infinite;
    transform-origin: bottom center;
}

#mountain-hero .mountain-front {
    animation: mountainBreathe 8s ease-in-out infinite 1s;
    transform-origin: bottom center;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .mirror-grid {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    .mirror-human {
        text-align: left;
    }

    .mirror-divider-vertical {
        display: none;
    }

    .editorial-content {
        padding-inline: 20px;
    }
}
