/* ============================================================
   gabs.reviews — A Woodland Ledger of Worth
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --parchment-cream: #F5F0E8;
    --birch-white: #FDFBF7;
    --dark-loam: #3E2E20;
    --warm-umber: #5A4A3A;
    --honeyed-oak: #C4A882;
    --forest-sage: #5B8C6A;
    --faded-lichen: #8B7D6B;
    --deep-moss: #2D4A37;
    --warm-mist: #E8DFD2;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    --font-korean: 'Noto Serif KR', 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;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--warm-umber);
    background-color: var(--parchment-cream);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

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

/* --- Navigation Vine --- */
.nav-vine {
    position: fixed;
    left: 24px;
    top: 0;
    height: 100vh;
    width: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.vine-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
}

.vine-line line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: vineGrow 2000ms ease-in-out forwards;
    animation-delay: 300ms;
}

@keyframes vineGrow {
    to {
        stroke-dashoffset: 0;
    }
}

.vine-node {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--honeyed-oak);
    background: var(--parchment-cream);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: background-color 600ms ease, border-color 600ms ease, box-shadow 600ms ease;
}

.vine-node[data-section="0"] { top: 10%; }
.vine-node[data-section="1"] { top: 30%; }
.vine-node[data-section="2"] { top: 50%; }
.vine-node[data-section="3"] { top: 70%; }
.vine-node[data-section="4"] { top: 90%; }

.vine-node.active {
    background: var(--honeyed-oak);
    border-color: var(--honeyed-oak);
    box-shadow: 0 0 8px rgba(196, 168, 130, 0.5);
    animation: nodePulse 2000ms ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 4px rgba(196, 168, 130, 0.3); }
    50% { box-shadow: 0 0 12px rgba(196, 168, 130, 0.6); }
}

/* --- Clearing Sections --- */
.clearing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.clearing-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.clearing-character {
    font-family: var(--font-korean);
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 5rem);
    color: var(--dark-loam);
    display: block;
    letter-spacing: 0.03em;
    line-height: 1.25;
}

.opening-char {
    font-size: clamp(6rem, 15vw, 12rem);
    opacity: 0;
    animation: fadeInSlow 1200ms ease forwards;
    animation-delay: 200ms;
}

.clearing-subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--warm-umber);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeInSlow 1200ms ease forwards;
    animation-delay: 600ms;
    letter-spacing: 0.03em;
}

@keyframes fadeInSlow {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.clearing-watermark {
    font-family: var(--font-korean);
    font-weight: 300;
    font-size: clamp(8rem, 20vw, 16rem);
    color: var(--warm-mist);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms ease;
}

.clearing-watermark.visible {
    opacity: 1;
}

.clearing-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    color: var(--faded-lichen);
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 800ms ease 400ms;
}

.clearing-text.visible {
    opacity: 1;
}

.clearing-colophon {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    color: var(--faded-lichen);
    letter-spacing: 0.06em;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 800ms ease 800ms;
}

.clearing-colophon.visible {
    opacity: 1;
}

/* --- Masonry Sections --- */
.masonry-section {
    position: relative;
    padding: 6rem 4rem 8rem;
    min-height: 100vh;
    overflow: hidden;
}

.masonry-grid {
    display: grid;
    grid-template-columns: 1fr 1.618fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.masonry-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.masonry-col-left {
    padding-top: 80px;
}

.masonry-col-center {
    padding-top: 0;
}

.masonry-col-right {
    padding-top: 40px;
}

/* --- Background Characters (Layer 3) --- */
.bg-characters {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-char {
    font-family: var(--font-korean);
    font-weight: 300;
    font-size: clamp(5rem, 12vw, 10rem);
    color: var(--warm-mist);
    position: absolute;
    opacity: 0;
    filter: blur(1.2px);
    transition: opacity 800ms ease;
    line-height: 1;
}

.bg-char.visible {
    opacity: 0.6;
}

/* --- Botanical SVG Backgrounds --- */
.botanical-bg {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.botanical-branch {
    width: 50%;
    height: 80%;
    top: 10%;
    right: 0;
    opacity: 0.6;
}

.botanical-spiral {
    width: 40%;
    height: 60%;
    bottom: 5%;
    left: 5%;
    opacity: 0.6;
}

.botanical-radial {
    width: 45%;
    height: 70%;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
}

.botanical-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3000ms ease-out;
}

.botanical-path.drawn {
    stroke-dashoffset: 0;
}

/* --- Specimen Cards --- */
.specimen-card {
    background: var(--birch-white);
    border-radius: 6px;
    padding: 2rem 1.8rem;
    position: relative;
    z-index: 1;
    border: 1px solid transparent;
    transition: border-color 300ms ease-out, box-shadow 300ms ease-out;
    opacity: 0;
    transform: translateY(20px);
    overflow: hidden;
}

.specimen-card.in-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease, transform 600ms ease, border-color 300ms ease-out, box-shadow 300ms ease-out;
}

/* Layer depths */
.specimen-card.layer-1 {
    box-shadow: 0 2px 12px rgba(62, 46, 32, 0.08);
}

.specimen-card.layer-2 {
    opacity: 0;
    box-shadow: none;
}

.specimen-card.layer-2.in-view {
    opacity: 0.85;
    filter: blur(0.3px);
}

/* Card border animation */
.card-border-animate {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--honeyed-oak);
    transition: width 600ms ease;
    z-index: 3;
}

.specimen-card.in-view .card-border-animate {
    width: 100%;
}

/* Card hover */
.specimen-card.layer-1:hover {
    border-color: var(--honeyed-oak);
    box-shadow: 0 4px 20px rgba(62, 46, 32, 0.14);
}

.specimen-card.layer-1:hover .card-seal svg {
    transform: scale(1.15);
    color: rgba(91, 140, 106, 0.8);
}

/* --- Card Seal (Pressed Flower Marks) --- */
.card-seal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    color: rgba(91, 140, 106, 0.5);
    opacity: 0;
    transition: opacity 400ms ease 400ms;
}

.card-seal svg {
    width: 100%;
    height: 100%;
    transition: transform 300ms ease-out, color 300ms ease-out;
}

.specimen-card.in-view .card-seal {
    opacity: 1;
}

/* --- Card Typography --- */
.card-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--dark-loam);
    letter-spacing: 0.03em;
    line-height: 1.25;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    color: var(--warm-umber);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.card-quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--dark-loam);
    line-height: 1.5;
}

.card-meta {
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-tag {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    color: var(--faded-lichen);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.meta-date {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    color: var(--faded-lichen);
    letter-spacing: 0.06em;
}

/* --- Korean Inline Text --- */
.korean-inline {
    font-family: var(--font-korean);
    font-weight: 500;
    color: var(--forest-sage);
    font-size: 0.9em;
    position: relative;
    display: inline;
}

.korean-inline::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(91, 140, 106, 0.4);
    transition: width 500ms ease;
}

.korean-inline.underline-drawn::after {
    width: 100%;
}

/* --- Dewdrop Cursor Trail --- */
.dew-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--forest-sage);
    opacity: 0.4;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: dewFade 800ms ease-out forwards;
}

@keyframes dewFade {
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Touch device tap pulse */
.tap-pulse {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--forest-sage);
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: tapPulse 600ms ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes tapPulse {
    from {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* --- Leather Cross-Hatch Pattern for dividers --- */
.masonry-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0,8 L8,0' stroke='%23C4A882' stroke-width='1' opacity='0.12'/%3E%3Cpath d='M0,0 L8,8' stroke='%23C4A882' stroke-width='1' opacity='0.12'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .vine-line line {
        stroke-dashoffset: 0;
    }

    .opening-char,
    .clearing-subtitle {
        opacity: 1;
    }

    .specimen-card {
        opacity: 1;
        transform: none;
    }

    .specimen-card.layer-2 {
        opacity: 0.85;
    }

    .botanical-path {
        stroke-dashoffset: 0;
    }

    .bg-char {
        opacity: 0.6;
    }

    .clearing-watermark {
        opacity: 1;
    }

    .clearing-text,
    .clearing-colophon {
        opacity: 1;
    }

    .card-border-animate {
        width: 100%;
    }

    .card-seal {
        opacity: 1;
    }

    .korean-inline::after {
        width: 100%;
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .masonry-section {
        padding: 4rem 2rem 6rem;
    }

    .masonry-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .masonry-col-left {
        padding-top: 40px;
    }

    .masonry-col-right {
        padding-top: 20px;
    }

    .nav-vine {
        left: 12px;
    }
}

@media (max-width: 600px) {
    .masonry-section {
        padding: 3rem 1rem 4rem;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .masonry-col-left,
    .masonry-col-center,
    .masonry-col-right {
        padding-top: 0;
    }

    .specimen-card {
        padding: 1.5rem 1.2rem;
    }

    .nav-vine {
        display: none;
    }

    .botanical-bg {
        display: none;
    }

    .bg-characters {
        display: none;
    }
}