/* ================================================================
   riron.xyz — Naturalist's Watercolor Journal
   Palette: Earth tones | Layout: Organic-flow | Typography: Condensed
   ================================================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #F5EEDF;
    color: #3E2C1C;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.25rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Navigation Dot Cluster --- */
.nav-dots {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.dot:hover {
    transform: scale(1.4);
    opacity: 1;
}

.dot-1 { background-color: #D4A574; width: 12px; height: 12px; }
.dot-2 { background-color: #8B7355; width: 9px; height: 9px; margin-left: 4px; }
.dot-3 { background-color: #C9A84C; width: 11px; height: 11px; margin-left: 2px; }
.dot-4 { background-color: #6B3A2A; width: 8px; height: 8px; margin-left: 6px; }
.dot-5 { background-color: #8A9A6B; width: 10px; height: 10px; margin-left: 1px; }

.nav-labels {
    position: absolute;
    left: 28px;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-dots:hover .nav-labels {
    pointer-events: auto;
    opacity: 1;
}

.nav-label {
    font-family: 'Kalam', cursive;
    font-weight: 300;
    font-size: 0.85rem;
    color: #7A6455;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    padding-bottom: 2px;
}

.nav-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #7A6455;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-in-out;
}

.nav-label:hover::after {
    transform: scaleX(1);
}

/* --- Dust Mote Canvas --- */
.dust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

/* --- Wash Zones (Sections) --- */
.wash-zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.wash-opening {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wash-theory {
    min-height: 150vh;
    padding: 8vh 0;
}

.wash-connection {
    min-height: 150vh;
    padding: 8vh 0;
}

.wash-synthesis {
    min-height: 100vh;
    padding: 8vh 0;
}

.wash-closing {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Wash Textures (Background washes) --- */
.wash-texture {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    pointer-events: none;
    z-index: 0;
}

.wash-texture-sienna {
    background:
        radial-gradient(ellipse 80% 70% at 20% 40%, rgba(212, 165, 116, 0.45) 0%, rgba(212, 165, 116, 0.15) 50%, transparent 75%),
        radial-gradient(ellipse 60% 50% at 70% 60%, rgba(212, 165, 116, 0.3) 0%, rgba(212, 165, 116, 0.08) 60%, transparent 80%),
        radial-gradient(ellipse 90% 80% at 50% 50%, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 1.2s ease;
}

.wash-texture-sienna.active {
    opacity: 1;
}

.wash-texture-umber {
    background:
        radial-gradient(ellipse 75% 65% at 30% 35%, rgba(139, 115, 85, 0.4) 0%, rgba(139, 115, 85, 0.12) 55%, transparent 80%),
        radial-gradient(ellipse 55% 45% at 75% 55%, rgba(139, 115, 85, 0.25) 0%, rgba(107, 58, 42, 0.08) 50%, transparent 75%),
        radial-gradient(ellipse 40% 60% at 50% 80%, rgba(155, 139, 122, 0.18) 0%, transparent 65%);
}

.wash-texture-ochre {
    background:
        radial-gradient(ellipse 70% 60% at 25% 45%, rgba(201, 168, 76, 0.4) 0%, rgba(201, 168, 76, 0.1) 55%, transparent 80%),
        radial-gradient(ellipse 65% 50% at 70% 30%, rgba(212, 165, 116, 0.25) 0%, rgba(201, 168, 76, 0.08) 50%, transparent 75%),
        radial-gradient(ellipse 50% 70% at 55% 75%, rgba(138, 154, 107, 0.15) 0%, transparent 65%);
}

.wash-texture-convergence {
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(212, 165, 116, 0.35) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 75% 50%, rgba(139, 115, 85, 0.3) 0%, transparent 65%),
        radial-gradient(ellipse 70% 40% at 45% 70%, rgba(201, 168, 76, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 60% 20%, rgba(107, 58, 42, 0.15) 0%, transparent 55%);
}

.wash-texture-clearing {
    background:
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(245, 238, 223, 0.9) 0%, rgba(245, 238, 223, 0.4) 40%, transparent 70%),
        radial-gradient(ellipse 90% 90% at 50% 50%, rgba(212, 165, 116, 0.2) 30%, rgba(139, 115, 85, 0.15) 60%, rgba(201, 168, 76, 0.1) 80%);
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Content Positioning --- */
.wash-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(2rem, 8vw, 10rem);
}

/* Organic margin rivers — varying padding per section */
.theory-content {
    padding-left: clamp(3rem, 12vw, 14rem);
    padding-right: clamp(2rem, 8vw, 8rem);
}

.connection-content {
    padding-left: clamp(2rem, 8vw, 8rem);
    padding-right: clamp(3rem, 14vw, 16rem);
}

.synthesis-content {
    padding-left: clamp(4rem, 10vw, 12rem);
    padding-right: clamp(3rem, 10vw, 12rem);
}

.closing-content {
    text-align: center;
    padding: 0 clamp(2rem, 15vw, 20rem);
}

/* --- Opening Section --- */
.opening-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

.domain-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw + 0.8rem, 4.5rem);
    letter-spacing: 0.03em;
    color: #3E2C1C;
    margin-bottom: 1rem;
    display: inline-block;
}

.domain-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    position: relative;
}

.domain-title .letter::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #6B3A2A;
    transform: scaleX(0);
    transform-origin: left;
}

.domain-title .letter.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.domain-title .letter.revealed::after {
    transform: scaleX(1);
    transition: transform 0.4s ease-in-out;
}

.domain-title .letter-dot {
    display: inline-block;
    opacity: 0;
    color: #6B3A2A;
}

.domain-title .letter-dot.revealed {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.subtitle {
    font-size: clamp(0.9rem, 1.2vw + 0.3rem, 1.2rem);
    color: rgba(122, 100, 85, 0.85);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 1.5s, transform 0.8s ease 1.5s;
}

.subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Dodecahedron (CSS 3D) --- */
.dodecahedron-container {
    position: absolute;
    top: 15%;
    right: 15%;
    width: 120px;
    height: 120px;
    perspective: 600px;
    z-index: 2;
}

.dodecahedron {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: dodecahedron-rotate 40s linear infinite;
}

.face {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    margin-left: -25px;
    margin-top: -25px;
    background: rgba(212, 165, 116, 0.4);
    border: 1px solid rgba(107, 58, 42, 0.3);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.face-1  { transform: rotateX(0deg) rotateY(0deg) translateZ(45px); }
.face-2  { transform: rotateX(0deg) rotateY(72deg) translateZ(45px); }
.face-3  { transform: rotateX(0deg) rotateY(144deg) translateZ(45px); }
.face-4  { transform: rotateX(0deg) rotateY(216deg) translateZ(45px); }
.face-5  { transform: rotateX(0deg) rotateY(288deg) translateZ(45px); }
.face-6  { transform: rotateX(60deg) rotateY(36deg) translateZ(45px); }
.face-7  { transform: rotateX(60deg) rotateY(108deg) translateZ(45px); }
.face-8  { transform: rotateX(60deg) rotateY(180deg) translateZ(45px); }
.face-9  { transform: rotateX(60deg) rotateY(252deg) translateZ(45px); }
.face-10 { transform: rotateX(60deg) rotateY(324deg) translateZ(45px); }
.face-11 { transform: rotateX(180deg) translateZ(45px); }
.face-12 { transform: rotateX(120deg) translateZ(45px); }

@keyframes dodecahedron-rotate {
    from { transform: rotateX(15deg) rotateY(0deg); }
    to   { transform: rotateX(15deg) rotateY(360deg); }
}

/* --- Cream Glow Highlight Color: #FFF8EB --- */
.float-island:hover {
    box-shadow: 0 10px 30px rgba(62, 44, 28, 0.15),
                0 3px 10px rgba(62, 44, 28, 0.1),
                0 0 0 1px rgba(255, 248, 235, 0.3);
}

/* --- Float Islands (Content Cards) --- */
.float-island {
    background: #FFF8EB; /* Cream Glow */
    background-color: rgba(255, 248, 235, 0.75);
    border-radius: 4px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 4vh, 4rem);
    position: relative;
    transform: perspective(800px) rotateX(1.5deg) rotateY(-1deg) translateY(20px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 24px rgba(62, 44, 28, 0.12),
                0 2px 8px rgba(62, 44, 28, 0.08);
    max-width: 680px;
}

.float-island.visible {
    transform: perspective(800px) rotateX(1.5deg) rotateY(-1deg) translateY(0);
    opacity: 1;
}

/* Staggered organic curve positioning */
.float-island-1 { margin-left: 0; }
.float-island-2 { margin-left: clamp(2rem, 8vw, 10rem); }
.float-island-3 { margin-left: clamp(1rem, 4vw, 5rem); }
.float-island-4 { margin-left: clamp(3rem, 10vw, 12rem); }
.float-island-5 { margin-left: 0; }
.float-island-6 { margin-left: clamp(2rem, 6vw, 8rem); }
.float-island-7 { margin-left: clamp(1rem, 3vw, 4rem); }
.float-island-8 { margin-left: clamp(0rem, 4vw, 5rem); }
.float-island-9 { margin-left: clamp(3rem, 8vw, 10rem); }
.float-island-10 { margin-left: clamp(1rem, 5vw, 6rem); }
.float-island-11 { margin-left: clamp(2rem, 6vw, 8rem); }

/* Islands in connection section curve right */
.connection-content .float-island {
    margin-left: auto;
    margin-right: 0;
}

.connection-content .float-island-6 {
    margin-right: clamp(2rem, 6vw, 8rem);
}

.connection-content .float-island-7 {
    margin-right: clamp(3rem, 8vw, 10rem);
}

/* --- Typography --- */
.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw + 0.5rem, 2.8rem);
    letter-spacing: 0.03em;
    color: #3E2C1C;
    margin-bottom: 0.75rem;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.25rem);
    line-height: 1.72;
    color: #4A3728;
}

.body-text em {
    font-weight: 600;
    font-style: italic;
}

.kalam-text {
    font-family: 'Kalam', cursive;
    font-weight: 300;
}

.annotation {
    font-family: 'Kalam', cursive;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw + 0.3rem, 1.05rem);
    color: rgba(122, 100, 85, 0.85);
    line-height: 1.6;
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: #2D1F14;
}

/* --- Bracket Decorations --- */
.bracket-left,
.bracket-right {
    position: absolute;
    font-size: 4rem;
    color: rgba(122, 100, 85, 0.4);
    line-height: 1;
    pointer-events: none;
}

.bracket-left {
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.bracket-right {
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* --- Watercolor Dot Bullets --- */
.watercolor-dots {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
    align-items: center;
}

.wc-dot {
    display: block;
    border-radius: 50%;
}

.wc-dot:nth-child(1) {
    width: 8px;
    height: 8px;
    background: #D4A574;
    opacity: 0.7;
}

.wc-dot:nth-child(2) {
    width: 6px;
    height: 6px;
    background: #8B7355;
    opacity: 0.6;
}

.wc-dot:nth-child(3) {
    width: 10px;
    height: 10px;
    background: #C9A84C;
    opacity: 0.5;
}

/* --- Clay Tablets --- */
.clay-tablets {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 3rem 0;
    position: relative;
    z-index: 2;
}

.tablet {
    width: 80px;
    height: 50px;
    border-radius: 3px;
    position: relative;
    box-shadow: 0 4px 12px rgba(62, 44, 28, 0.2);
}

.tablet-1 {
    background: linear-gradient(135deg, #D4A574 0%, #B8916A 100%);
    transform: rotate(-2deg) translateY(4px);
}

.tablet-2 {
    background: linear-gradient(135deg, #C4956A 0%, #A88060 100%);
    transform: rotate(1deg) translateY(-2px);
}

.tablet-3 {
    background: linear-gradient(135deg, #BF8F65 0%, #A07A58 100%);
    transform: rotate(-1deg) translateY(6px);
}

.tablet::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    height: 1px;
    background: rgba(62, 44, 28, 0.2);
    box-shadow:
        0 8px 0 rgba(62, 44, 28, 0.15),
        0 16px 0 rgba(62, 44, 28, 0.1),
        0 24px 0 rgba(62, 44, 28, 0.08);
}

/* --- Current Lines SVG --- */
.current-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.current-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.05s linear;
    opacity: 0.6;
}

/* --- Wireframe Sphere --- */
.wireframe-sphere-container {
    width: 160px;
    height: 160px;
    margin: 3rem auto;
    position: relative;
    z-index: 2;
    perspective: 600px;
    cursor: pointer;
}

.wireframe-sphere {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: sphere-breathe 8s ease-in-out infinite, sphere-rotate 30s linear infinite;
}

.ring {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 1px solid rgba(180, 140, 80, 0.5);
    border-radius: 50%;
}

.ring-1 { transform: rotateY(0deg); }
.ring-2 { transform: rotateY(30deg); }
.ring-3 { transform: rotateY(60deg); }
.ring-4 { transform: rotateY(90deg); }
.ring-5 { transform: rotateY(120deg); }
.ring-6 { transform: rotateY(150deg); }

@keyframes sphere-breathe {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

@keyframes sphere-rotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* Ink Diffusion effect container */
.ink-diffusion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* --- Code Block --- */
.code-block {
    background: rgba(245, 238, 223, 0.9);
    border-left: 3px solid #C9A84C;
    padding: 1.2rem 1.5rem;
    border-radius: 2px;
    overflow-x: auto;
}

.code-block code {
    white-space: pre;
    font-size: 0.85rem;
    line-height: 1.8;
}

.code-comment {
    color: #9B8B7A;
    font-style: italic;
}

/* --- Dense Notes (Synthesis) --- */
.dense-notes {
    padding: clamp(1rem, 2vw, 1.5rem);
    background: rgba(255, 248, 235, 0.6);
}

/* --- Closing Question --- */
.closing-question {
    font-family: 'Kalam', cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw + 0.5rem, 2rem);
    color: #3E2C1C;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.closing-question.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Splatter Zone --- */
.splatter-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

/* --- Underline-draw link style --- */
a {
    color: #6B3A2A;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #6B3A2A;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-in-out;
}

a:hover::after {
    transform: scaleX(1);
}

/* --- Wobbly HR SVG --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .dodecahedron-container {
        top: 8%;
        right: 5%;
        width: 80px;
        height: 80px;
    }

    .face {
        width: 35px;
        height: 35px;
        margin-left: -17.5px;
        margin-top: -17.5px;
    }

    .face-1, .face-2, .face-3, .face-4, .face-5,
    .face-6, .face-7, .face-8, .face-9, .face-10,
    .face-11, .face-12 {
        transform: none;
    }

    .float-island {
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .connection-content .float-island {
        margin-left: 0;
        margin-right: 0;
    }

    .bracket-left,
    .bracket-right {
        display: none;
    }

    .nav-dots {
        top: 1rem;
        left: 1rem;
    }

    .wireframe-sphere-container {
        width: 120px;
        height: 120px;
    }

    .clay-tablets {
        gap: 4px;
    }

    .tablet {
        width: 60px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .wash-content {
        padding: 0 1.2rem;
    }

    .theory-content,
    .connection-content,
    .synthesis-content {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }
}
