/* ============================================
   nonri.net - Inflated-3D Zen
   ============================================ */
:root {
    --carbon-black: #0A0A0A;
    --aged-linen: #F2EDE4;
    --warm-ash: #D6CFC3;
    --deep-ink: #1A1614;
    --bone-white: #EDE8E0;
    --burnt-clay: #B8542A;
    --faded-terracotta: #C4805E;
    --void-black: #050505;
    --tea-wash: #E8DCC8;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--carbon-black);
    color: var(--deep-ink);
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.03em;
    overflow-x: hidden;
}

/* ==============================
   OPENING SEQUENCE
   ============================== */
.opening {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--carbon-black);
    z-index: 10;
}
.opening-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bone-white);
    opacity: 0;
    transition: opacity 2s ease, color 1.8s ease;
}
.opening-title.visible {
    opacity: 1;
}
.opening-title.transitioned {
    color: var(--deep-ink);
}
.opening.revealed {
    background: radial-gradient(ellipse at center, var(--aged-linen) 0%, var(--aged-linen) 60%, var(--carbon-black) 100%);
    transition: background 1.8s ease;
}
.opening-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--burnt-clay);
    margin-top: 3rem;
    opacity: 0;
    animation: dotPulse 3s ease-in-out infinite;
    transition: opacity 1s ease 5s;
}
.opening.revealed .opening-dot {
    opacity: 1;
}
@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==============================
   PAPER COLUMN
   ============================== */
.paper-column {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 2.5rem);
    /* Paper grain texture */
    background-image:
        radial-gradient(circle at 1px 1px, rgba(26, 22, 20, 0.03) 1px, transparent 1px);
    background-size: 2px 2px;
    background-color: var(--aged-linen);
    min-height: 1200vh;
    padding-top: 25vh;
    padding-bottom: 25vh;
}

/* ==============================
   CIRCUIT TRACES
   ============================== */
.circuit-traces {
    position: absolute;
    top: 5%;
    left: 0;
    width: 100%;
    height: 200px;
    opacity: 0.08;
    pointer-events: none;
}
.trace {
    stroke: var(--deep-ink);
    stroke-width: 0.5;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}
.trace.drawn {
    stroke-dashoffset: 0;
}
.node-dot {
    fill: var(--deep-ink);
    opacity: 0.6;
}

/* ==============================
   CONTENT BLOCKS
   ============================== */
.content-block {
    position: relative;
    margin-bottom: clamp(200px, 30vh, 320px);
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0);
}
.content-block.visible {
    opacity: 1;
    transform: translateY(0) !important;
}

/* Paper Leaf */
.paper-leaf {
    background: var(--aged-linen);
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}
.paper-leaf:nth-child(3n+1) {
    clip-path: polygon(0% 0%, 100% 0%, 100% 97%, 97% 100%, 92% 98%, 85% 100%, 78% 97%, 70% 100%, 62% 98%, 55% 100%, 0% 100%);
}
.paper-leaf:nth-child(3n+2) {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 95%, 2% 90%, 0% 85%, 3% 78%, 0% 72%, 2% 65%, 0% 60%);
}
.paper-leaf:nth-child(3n) {
    clip-path: polygon(0% 0%, 95% 0%, 100% 2%, 97% 5%, 100% 8%, 98% 12%, 100% 15%, 100% 100%, 0% 100%);
}

/* Fold Lines */
.fold-line {
    position: absolute;
    left: 5%;
    right: 5%;
    height: 1px;
    background: var(--warm-ash);
    opacity: 0.06;
}
.fold-line--top { top: 33%; }
.fold-line--bottom { top: 66%; }

/* Aging Stains */
.aging-stain {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--tea-wash), transparent 70%);
    opacity: 0.2;
    pointer-events: none;
    transition: width 3s ease, height 3s ease;
}
.aging-stain--tl { top: -40px; left: -40px; }
.aging-stain--br { bottom: -40px; right: -40px; }
.content-block.visible .aging-stain {
    width: 260px;
    height: 260px;
}

/* Data Whispers */
.data-whisper {
    display: block;
    font-family: monospace;
    font-size: 9px;
    color: var(--deep-ink);
    opacity: 0.04;
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
}

/* ==============================
   TYPOGRAPHY
   ============================== */
.section-heading {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--deep-ink);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}
.body-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: var(--deep-ink);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}
.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    line-height: 1.7;
    color: var(--burnt-clay);
    padding-left: 1.5rem;
    border-left: 2px solid rgba(184, 84, 42, 0.25);
    margin: 2rem 0;
    opacity: 0.85;
}

/* ==============================
   INFLATED 3D FORMS
   ============================== */
.inflated-form {
    margin: 0 auto clamp(200px, 30vh, 320px);
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0);
}
.inflated-form.visible {
    opacity: 1;
    transform: translateY(0);
}

.inflated-form--pill {
    width: 100%;
    height: 140px;
    border-radius: 70px;
    background: var(--aged-linen);
    background-image: radial-gradient(ellipse at 35% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    box-shadow:
        0 2px 4px rgba(5, 5, 5, 0.15),
        0 4px 8px rgba(5, 5, 5, 0.12),
        0 8px 16px rgba(5, 5, 5, 0.1),
        0 16px 32px rgba(5, 5, 5, 0.08),
        0 32px 50px rgba(5, 5, 5, 0.06),
        inset 0 -4px 8px rgba(5, 5, 5, 0.06),
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 4px 4px 12px rgba(255, 255, 255, 0.04);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), box-shadow 0.8s ease;
}
.inflated-form--pill:hover {
    transform: scale(1.02, 0.98);
}
.inflated-form--pill.breathing {
    box-shadow:
        0 2px 4px rgba(5, 5, 5, 0.15),
        0 4px 8px rgba(5, 5, 5, 0.12),
        0 8px 16px rgba(5, 5, 5, 0.1),
        0 16px 32px rgba(5, 5, 5, 0.08),
        0 36px 56px rgba(5, 5, 5, 0.07),
        inset 0 -4px 8px rgba(5, 5, 5, 0.06),
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 4px 4px 12px rgba(255, 255, 255, 0.04);
}

.inflated-form--round {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--aged-linen);
    background-image: radial-gradient(ellipse at 35% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 55%);
    box-shadow:
        0 2px 4px rgba(5, 5, 5, 0.14),
        0 4px 10px rgba(5, 5, 5, 0.12),
        0 10px 20px rgba(5, 5, 5, 0.1),
        0 20px 40px rgba(5, 5, 5, 0.08),
        0 30px 50px rgba(5, 5, 5, 0.06),
        inset 0 -3px 6px rgba(5, 5, 5, 0.06),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 3px 3px 10px rgba(255, 255, 255, 0.05);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), box-shadow 0.8s ease;
}
.inflated-form--round:hover {
    transform: scale(1.02, 0.98);
}

.inflated-form--wide {
    width: 100%;
    height: 100px;
    border-radius: 50px;
    background: var(--aged-linen);
    background-image: radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.12) 0%, transparent 65%);
    box-shadow:
        0 2px 3px rgba(5, 5, 5, 0.14),
        0 4px 8px rgba(5, 5, 5, 0.11),
        0 8px 16px rgba(5, 5, 5, 0.09),
        0 16px 30px rgba(5, 5, 5, 0.07),
        0 28px 46px rgba(5, 5, 5, 0.05),
        inset 0 -3px 7px rgba(5, 5, 5, 0.05),
        inset 0 2px 3px rgba(255, 255, 255, 0.09),
        inset 3px 3px 8px rgba(255, 255, 255, 0.04);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), box-shadow 0.8s ease;
}
.inflated-form--wide:hover {
    transform: scale(1.02, 0.98);
}

.inflated-form--small {
    width: 60%;
    height: 90px;
}

.inflated-form--dot {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--burnt-clay);
    background-image: radial-gradient(ellipse at 35% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    box-shadow:
        0 2px 4px rgba(5, 5, 5, 0.18),
        0 4px 8px rgba(5, 5, 5, 0.14),
        0 8px 16px rgba(5, 5, 5, 0.1),
        0 16px 28px rgba(5, 5, 5, 0.07),
        inset 0 -2px 4px rgba(5, 5, 5, 0.1),
        inset 0 2px 3px rgba(255, 255, 255, 0.08);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

/* ==============================
   COLOPHON
   ============================== */
.colophon {
    text-align: center;
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0), transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1.0);
}
.colophon.visible {
    opacity: 1;
    transform: translateY(0);
}
.colophon-domain {
    display: block;
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--deep-ink);
    margin-bottom: 0.5rem;
}
.colophon-note {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--faded-terracotta);
    opacity: 0.6;
    letter-spacing: 0.08em;
}

/* ==============================
   BACK TO TOP DOT
   ============================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--burnt-clay);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.3s ease;
    z-index: 100;
}
.back-to-top.visible {
    opacity: 0.7;
}
.back-to-top:hover {
    opacity: 1;
    transform: scale(1.3);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .paper-column {
        max-width: 100%;
    }
    .inflated-form--round {
        width: 120px;
        height: 120px;
    }
    .inflated-form--pill {
        height: 100px;
        border-radius: 50px;
    }
    .content-block {
        margin-bottom: clamp(120px, 20vh, 200px);
    }
    .inflated-form {
        margin-bottom: clamp(120px, 20vh, 200px);
    }
}
