/* =========================================================
   JJUGGL.com — a room of cream and burgundy
   anti-design · ma · zen-contemplative · vintage collage
   ========================================================= */

:root {
    /* palette */
    --bg-primary: #F5F0E8;      /* warm cream */
    --bg-secondary: #EDE6D6;    /* aged parchment */
    --text-primary: #2C1A1D;    /* deep burgundy-black */
    --text-secondary: #6B3A3F;  /* muted burgundy */
    --accent: #8B2252;          /* true burgundy */
    --accent-warm: #C4787A;     /* faded rose */
    --skel-dark: #D4B5B0;       /* dusty mauve */
    --skel-light: #F0DDD9;      /* pale blush */
    --rule: #7A5C58;            /* oxidized copper */

    /* typography */
    --font-display: "Nunito", "Inter", system-ui, sans-serif;
    --font-body: "Quicksand", "Inter", system-ui, sans-serif;
    --font-mono: "Inconsolata", ui-monospace, monospace;

    /* rhythm */
    --gap-section: clamp(120px, 15vw, 200px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    cursor: crosshair;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
    padding: 0;
}

a { color: var(--text-secondary); text-decoration: none; transition: color 300ms ease; }
a:hover { color: var(--accent); }

p em { font-style: italic; color: var(--text-secondary); }

/* ─────────────────────────────────────────────
   NOISE OVERLAY (aged paper grain)
   ────────────────────────────────────────── */
.noise-filter-host { position: fixed; top: -10px; left: -10px; opacity: 0; pointer-events: none; }

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.03;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.10 0 0 0 0 0.11 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ─────────────────────────────────────────────
   NAVIGATION — floating glyph
   ────────────────────────────────────────── */
.nav-glyph {
    position: fixed;
    top: 36px;
    left: 36px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.8rem;
    line-height: 1;
    cursor: crosshair;
    z-index: 200;
    transition: color 300ms ease, transform 600ms ease;
}

.nav-glyph__mark { display: inline-block; transform: rotate(-4deg); }

.nav-glyph:hover { color: var(--text-primary); }
.nav-glyph.is-open { transform: rotate(45deg); }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 180;
    opacity: 0;
    pointer-events: none;
    transition: opacity 700ms ease;
}
.nav-overlay.is-open { opacity: 1; pointer-events: auto; }

.nav-overlay__inner {
    position: relative;
    height: 100%;
    width: 100%;
    padding: 120px 12vw 80px 18vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-overlay__meta,
.nav-overlay__footer {
    display: flex;
    gap: 2rem;
    opacity: 0.8;
}

.nav-overlay__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    margin: 4rem 0;
}
.nav-overlay__list li {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.nav-overlay__list a {
    color: var(--text-secondary);
    display: inline-block;
    position: relative;
    padding-left: 1.5rem;
}
.nav-overlay__list a::before {
    content: "·";
    position: absolute;
    left: 0;
    color: var(--accent);
}
.nav-overlay__list a:hover { color: var(--accent); }

/* ─────────────────────────────────────────────
   TAGS (mono accent labels)
   ────────────────────────────────────────── */
.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.tag--vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.small-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 1rem;
    display: block;
}

.kicker {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.2rem;
}

/* ─────────────────────────────────────────────
   SECTION BASE
   ────────────────────────────────────────── */
.section {
    position: relative;
    width: 100%;
    padding: 0 8vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section + .section { margin-top: var(--gap-section); }

/* ─────────────────────────────────────────────
   CORNER INK BLOTS
   ────────────────────────────────────────── */
.corner-ink {
    position: absolute;
    width: 56px;
    height: 56px;
    background: radial-gradient(ellipse at 40% 30%, var(--text-primary) 0%, var(--text-primary) 55%, transparent 70%);
    opacity: 0.85;
    filter: blur(0.3px);
    pointer-events: none;
}
.corner-ink--tl {
    top: 0; left: 0;
    clip-path: polygon(0 0, 95% 10%, 80% 40%, 100% 60%, 60% 80%, 30% 70%, 0 100%);
}
.corner-ink--br {
    bottom: 40px; right: 60px;
    width: 38px; height: 38px;
    clip-path: polygon(10% 0, 100% 20%, 90% 55%, 100% 90%, 55% 100%, 20% 80%, 0 40%);
    opacity: 0.5;
}

/* ─────────────────────────────────────────────
   TITLE SECTION
   ────────────────────────────────────────── */
.section--title {
    min-height: 100vh;
    padding-top: 18vh;
    padding-bottom: 10vh;
}
.title-meta {
    position: absolute;
    top: 42px;
    right: 48px;
}
.title-stack {
    margin-left: 5vw;
    margin-top: 4vh;
    max-width: 78vw;
    position: relative;
}
.title {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
    font-size: clamp(2.5rem, 9vw, 7.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}
.title__line { display: block; }
.title__line--a { color: var(--accent); transform: translateX(-0.4vw); }
.title__line--b {
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    font-size: clamp(1.3rem, 3vw, 2.6rem);
    letter-spacing: -0.01em;
    margin: 0.8rem 0 0.4rem 8vw;
    line-height: 1.2;
}
.title__line--c {
    color: var(--text-primary);
    transform: translateX(3vw);
}

.title-caption {
    position: absolute;
    bottom: 16vh;
    right: 9vw;
    max-width: 320px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.title-asterisk {
    position: absolute;
    top: 38%;
    right: 12vw;
    font-family: var(--font-mono);
    font-size: 4rem;
    color: var(--accent);
    transform: rotate(9deg);
    opacity: 0.85;
    pointer-events: none;
}

.title-scrollhint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
    animation: hint-drift 4s ease-in-out infinite;
}

@keyframes hint-drift {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.35; }
    50% { transform: translate(-50%, 6px); opacity: 0.75; }
}

/* ─────────────────────────────────────────────
   BREATH / THREAD SECTIONS
   ────────────────────────────────────────── */
.section--breath {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.section--breath-tall { min-height: 70vh; }

.thread {
    height: 0.5px;
    background: var(--rule);
    width: 0;
    transform-origin: left center;
    opacity: 0.9;
    position: relative;
}
.thread--a { align-self: center; }
.thread--b { margin-left: 20vw; }
.thread--c { margin-right: 20vw; align-self: flex-end; }

.thread.is-drawn { animation: thread-draw 1.2s ease-out forwards; }
@keyframes thread-draw {
    from { width: 0; }
    to { width: 100vw; }
}

.section--breath .thread--b.is-drawn { animation-name: thread-draw-offset; }
@keyframes thread-draw-offset {
    from { width: 0; }
    to { width: 80vw; }
}

.floating-label {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
}
.floating-label--right { right: 8vw; top: 20%; transform: rotate(90deg); transform-origin: right top; }

.lonely-asterisk {
    position: absolute;
    right: 18vw;
    top: 58%;
    font-family: var(--font-mono);
    font-size: 4.5rem;
    color: var(--accent);
    transform: rotate(-12deg);
    opacity: 0.7;
}

/* ─────────────────────────────────────────────
   COLLAGE SECTION
   ────────────────────────────────────────── */
.section--collage {
    min-height: 110vh;
    padding: 10vh 6vw;
    position: relative;
}

.collage-gutter {
    position: absolute;
    left: 2vw;
    top: 12vh;
    height: 60vh;
}

.collage-foot {
    margin-top: 6vh;
    padding-left: 4vw;
}

.collage-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(60px, auto);
    column-gap: 1.6rem;
    row-gap: 2.2rem;
    align-items: start;
    position: relative;
}

.torn {
    position: relative;
    overflow: visible;
    margin: 0;
}
.torn__inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--bg-secondary);
}
.duotone-art {
    display: block;
    width: 100%;
    height: 100%;
    filter: saturate(0.55) contrast(1.1) sepia(0.1);
    opacity: 0.85;
}

.torn--one {
    grid-column: 1 / span 5;
    grid-row: 1 / span 6;
    transform: rotate(-1.4deg);
}
.torn--one .torn__inner {
    height: 44vh;
    clip-path: polygon(
        2% 4%, 14% 1%, 26% 5%, 38% 2%, 52% 6%, 68% 2%, 82% 5%, 96% 2%, 99% 16%,
        97% 32%, 99% 48%, 96% 68%, 98% 84%, 95% 98%, 82% 96%, 66% 99%, 48% 95%,
        30% 98%, 14% 96%, 2% 99%, 4% 82%, 1% 64%, 3% 46%, 1% 28%
    );
}

.torn--two {
    grid-column: 8 / span 5;
    grid-row: 2 / span 5;
    transform: rotate(2deg);
    margin-top: 6vh;
}
.torn--two .torn__inner {
    height: 38vh;
    clip-path: polygon(
        1% 8%, 12% 3%, 28% 6%, 44% 2%, 58% 5%, 74% 1%, 92% 4%, 98% 18%,
        95% 34%, 99% 50%, 96% 66%, 99% 82%, 94% 96%, 78% 99%, 60% 96%,
        44% 99%, 28% 97%, 10% 99%, 4% 88%, 2% 72%, 5% 58%, 1% 42%, 4% 24%
    );
}

.torn--three {
    grid-column: 3 / span 7;
    grid-row: 7 / span 4;
    transform: rotate(-0.8deg);
    margin-top: 2rem;
}
.torn--three .torn__inner {
    height: 30vh;
    clip-path: polygon(
        2% 10%, 18% 3%, 34% 7%, 52% 2%, 68% 6%, 84% 3%, 98% 8%, 95% 26%,
        99% 44%, 96% 62%, 98% 80%, 93% 96%, 76% 99%, 58% 96%, 40% 99%,
        22% 96%, 4% 99%, 1% 80%, 4% 62%, 1% 44%, 3% 28%
    );
}

.torn__caption {
    margin-top: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-left: 0.4rem;
}

.collage-text { font-size: 1.05rem; color: var(--text-primary); }
.collage-text .lead {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.3rem, 2vw, 1.75rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.collage-text p + p { margin-top: 1rem; color: var(--text-secondary); }
.collage-text--a {
    grid-column: 6 / span 4;
    grid-row: 1 / span 3;
    margin-top: 8vh;
    padding-left: 0.5rem;
}
.collage-text--b {
    grid-column: 1 / span 4;
    grid-row: 9 / span 3;
    margin-top: 1.2rem;
    padding-right: 1rem;
}

.stamp {
    grid-column: 10 / span 3;
    grid-row: 7 / span 3;
    width: 160px;
    height: 160px;
    margin-top: 4vh;
    transform: rotate(-8deg);
    opacity: 0.85;
}
.stamp svg { width: 100%; height: 100%; display: block; }

/* ─────────────────────────────────────────────
   PULL QUOTE
   ────────────────────────────────────────── */
.section--quote {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 0 14vw;
}
.pull-quote {
    position: relative;
    max-width: 780px;
    margin-left: 8vw;
    padding-left: 2rem;
    color: var(--text-primary);
}
.pull-quote__rule {
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 25%;
    width: 1px;
    background: var(--accent);
    opacity: 0.9;
}
.pull-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.6vw, 3rem);
    font-style: italic;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.pull-quote footer {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   PARCHMENT SECTION
   ────────────────────────────────────────── */
.section--parchment {
    min-height: 110vh;
    background: var(--bg-secondary);
    padding: 14vh 10vw;
    position: relative;
    overflow: hidden;
}
.parchment-grain {
    position: absolute; inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(122, 92, 88, 0.08), transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 34, 82, 0.06), transparent 60%);
}
.parchment-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6vw;
    align-items: center;
    position: relative;
    z-index: 2;
}
.parchment-content__inner {
    display: contents;
}

.seal-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-6deg);
}
.seal {
    width: 100%;
    max-width: 360px;
    height: auto;
    animation: seal-drift 28s ease-in-out infinite;
}
@keyframes seal-drift {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(3deg); }
}

.parchment-text h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin-bottom: 1.8rem;
}
.parchment-body {
    color: var(--text-secondary);
    max-width: 440px;
    font-size: 1.1rem;
}

.parchment-margin {
    position: absolute;
    left: 3vw;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
}

/* ─────────────────────────────────────────────
   GHOST SECTION
   ────────────────────────────────────────── */
.section--ghost {
    min-height: 95vh;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4vw;
    align-items: center;
    padding: 8vh 6vw;
}

.ghost-text {
    padding-left: 4vw;
    max-width: 420px;
}
.ghost-text h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
}
.ghost-text p {
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
}

.ghost-image {
    position: relative;
}
.ghost-image__inner {
    position: relative;
    opacity: 0.9;
    transform: rotate(1.2deg);
}
.ghost-image__inner::after {
    content: "";
    position: absolute; inset: 0;
    background: var(--bg-primary);
    mix-blend-mode: lighten;
    opacity: 0.12;
    pointer-events: none;
}
.ghost-image .duotone-art--ghost {
    width: 100%;
    height: auto;
    max-height: 70vh;
    opacity: 0.85;
    clip-path: polygon(
        1% 5%, 14% 2%, 30% 6%, 46% 3%, 62% 7%, 78% 2%, 96% 5%, 98% 22%,
        96% 40%, 99% 58%, 95% 76%, 98% 92%, 82% 98%, 64% 95%, 46% 98%,
        28% 95%, 10% 98%, 2% 90%, 5% 72%, 1% 54%, 4% 36%, 1% 18%
    );
}
.ghost-image__caption {
    position: absolute;
    bottom: -36px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   CLOSING SECTION
   ────────────────────────────────────────── */
.section--closing {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4vh;
    padding: 10vh 8vw;
    position: relative;
}
.closing-meta { opacity: 0.75; }
.closing-word h2 {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--accent);
}
.closing-word__a { display: block; transform: translateX(-3vw); color: var(--accent); }
.closing-word__b {
    display: block;
    transform: translateX(4vw);
    color: var(--text-primary);
    opacity: 0.6;
    font-weight: 300;
}
.closing-signoff { opacity: 0.7; margin-top: 2vh; }

/* ─────────────────────────────────────────────
   SKELETON LOADING
   ────────────────────────────────────────── */
.skeleton {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--skel-dark) 25%, var(--skel-light) 50%, var(--skel-dark) 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s ease-in-out infinite;
    opacity: 0.7;
    transition: opacity 400ms ease;
    pointer-events: none;
    z-index: 2;
}
.skeleton--title { height: 60%; top: 15%; }
.skeleton--line { height: 16px; top: 45%; }
.skeleton--paragraph { height: 80%; top: 10%; }
.skeleton--block { }
.skeleton--quote { height: 70%; top: 10%; }

.skeleton.is-gone { opacity: 0; }

@keyframes pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────
   REVEAL / SCROLL FADE
   ────────────────────────────────────────── */
.reveal { position: relative; }
[data-content] {
    opacity: 0;
    transition: opacity 800ms ease-out;
    transition-delay: 300ms;
}
.reveal.is-ready [data-content] {
    opacity: 1;
}

/* ─────────────────────────────────────────────
   PARALLAX DRIFT HOOKS
   ────────────────────────────────────────── */
.stamp,
.torn--two,
.ghost-image__inner,
.title-asterisk,
.lonely-asterisk {
    will-change: transform;
}

/* ─────────────────────────────────────────────
   RESPONSIVE (preserve ma even on small screens)
   ────────────────────────────────────────── */
@media (max-width: 900px) {
    .section { padding: 0 6vw; }
    .title__line--b { margin-left: 2vw; }
    .title-caption { position: static; text-align: left; margin: 4vh 0 0 5vw; }
    .title-asterisk { right: 6vw; top: 26%; }

    .collage-grid { grid-template-columns: repeat(6, 1fr); }
    .torn--one { grid-column: 1 / span 6; grid-row: auto; }
    .torn--two { grid-column: 1 / span 6; grid-row: auto; margin-top: 2rem; }
    .torn--three { grid-column: 1 / span 6; grid-row: auto; }
    .collage-text--a, .collage-text--b { grid-column: 1 / span 6; grid-row: auto; margin-top: 0; }
    .stamp { grid-column: 1 / span 6; grid-row: auto; margin: 2vh auto; }

    .parchment-content { grid-template-columns: 1fr; gap: 6vh; }
    .section--ghost { grid-template-columns: 1fr; }
    .ghost-text { padding-left: 0; }
    .pull-quote { margin-left: 0; }
}
