/* ===========================================
   ronri.net — Logic Rendered in Watercolor
   =========================================== */

/* --- CSS Custom Properties --- */
:root {
    --paper-white: #F5F2ED;
    --deep-slate: #2D3142;
    --ink-charcoal: #3B3F47;
    --cool-graphite: #4A5568;
    --stone: #B0ACA5;
    --mist: #E0DDD7;
    --wash-blue: #7B8FA3;
    --blush-umber: #C4A882;
    --faded-graphite: #8B8D92;
    --warm-parchment: #E8E4DF;

    --font-display: 'Space Grotesk', sans-serif;
    --font-sub: 'Outfit', sans-serif;
    --font-body: 'Source Serif 4', serif;
}

/* --- 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 {
    background-color: var(--paper-white);
    color: var(--ink-charcoal);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* --- Paper Texture Overlay --- */
#paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: multiply;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='t'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23t)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

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

/* --- Ink Seal (Rakkan) --- */
#rakkan-seal {
    position: fixed;
    top: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    z-index: 900;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#rakkan-seal.visible {
    opacity: 1;
}

.seal-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.seal-bloom {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 168, 130, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

#rakkan-seal:hover .seal-bloom {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

#rakkan-seal:hover .seal-svg {
    animation: seal-pulse 1.5s ease-in-out infinite;
}

@keyframes seal-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- Navigation Panel --- */
#nav-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--paper-white);
    z-index: 950;
    transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    box-shadow: 4px 0 30px rgba(45, 49, 66, 0);
}

#nav-panel.open {
    left: 0;
    box-shadow: 4px 0 30px rgba(45, 49, 66, 0.08);
}

#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 49, 66, 0.15);
    z-index: 940;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-inner {
    padding: 2rem 3rem;
    width: 100%;
}

.nav-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--deep-slate);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 2.5rem;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 1.2rem;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--cool-graphite);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--wash-blue);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--deep-slate);
    transform: translateX(6px);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Opening Sequence --- */
.full-height {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.opening-wash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.opening-wash {
    width: 100%;
    height: 100%;
}

.opening-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 9rem);
    color: var(--deep-slate);
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.8s, transform 1s ease 0.8s;
}

.site-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

.site-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--cool-graphite);
    line-height: 1.7;
    max-width: 600px;
    margin: 1.5rem auto 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 1.3s, transform 0.8s ease 1.3s;
}

.site-subtitle.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    padding: 6rem 2rem;
    max-width: 100%;
    overflow: hidden;
}

.spine-right .section-content {
    max-width: 680px;
    margin-left: auto;
    margin-right: calc(50% - 340px + 6%);
}

.spine-left .section-content {
    max-width: 680px;
    margin-left: calc(50% - 340px - 6%);
    margin-right: auto;
}

@media (max-width: 900px) {
    .spine-right .section-content,
    .spine-left .section-content {
        margin-left: auto;
        margin-right: auto;
        padding: 0 1.5rem;
    }
}

.section-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.section-wash svg {
    width: 100%;
    height: 100%;
}

.section-content {
    position: relative;
    z-index: 1;
}

/* Reveal animation for content blocks */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--deep-slate);
    letter-spacing: 0.06em;
    margin-bottom: 2rem;
    line-height: 1.2;
}

/* --- Subheadings --- */
.sub-heading {
    font-family: var(--font-sub);
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--cool-graphite);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

/* --- Body Text --- */
.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--ink-charcoal);
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

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

/* --- Margin Annotations --- */
.margin-annotation {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--faded-graphite);
    margin-bottom: 0.8rem;
    opacity: 0.85;
}

/* --- Section Dividers --- */
.section-divider {
    padding: 1rem 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.divider-stroke {
    width: 100%;
    height: 40px;
    display: block;
}

.divider-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease;
}

.section-divider.revealed .divider-path {
    stroke-dashoffset: 0;
}

/* --- Marble Quote Blocks --- */
.marble-quote {
    position: relative;
    text-align: center;
    padding: 3rem 4rem;
    margin: 2.5rem 0;
    border: none;
    overflow: hidden;
    border-radius: 4px;
}

.marble-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(176, 172, 165, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(176, 172, 165, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(224, 221, 215, 0.15) 0%, transparent 40%),
        linear-gradient(135deg, rgba(232, 228, 223, 0.3) 0%, rgba(245, 242, 237, 0.5) 50%, rgba(224, 221, 215, 0.3) 100%);
    box-shadow: inset 0 2px 15px rgba(45, 49, 66, 0.04), inset 0 -2px 15px rgba(45, 49, 66, 0.02);
    animation: marble-drift 30s ease-in-out infinite;
}

@keyframes marble-drift {
    0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%; }
    50% { background-position: 30% 20%, 70% 50%, 40% 60%, 10% 10%; }
}

.quote-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--deep-slate);
    letter-spacing: 0.04em;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.quote-cite {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--stone);
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .marble-quote {
        padding: 2rem 1.5rem;
    }
}

/* --- Nature Accent Elements --- */
.nature-accent {
    position: relative;
    display: inline-block;
    margin: 1.5rem 0;
    cursor: default;
}

.ginkgo-accent {
    width: 80px;
    height: 90px;
}

.bamboo-accent {
    width: 60px;
    height: 120px;
}

.tree-accent {
    width: 100px;
    height: 120px;
}

.ginkgo-leaf,
.bamboo-svg,
.tree-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bloom-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.6s ease;
    pointer-events: none;
}

.ginkgo-accent .bloom-bg {
    background: radial-gradient(circle, rgba(123, 143, 163, 0.15) 0%, transparent 70%);
}

.bamboo-accent .bloom-bg {
    background: radial-gradient(circle, rgba(196, 168, 130, 0.15) 0%, transparent 70%);
}

.tree-accent .bloom-bg {
    background: radial-gradient(circle, rgba(123, 143, 163, 0.12) 0%, transparent 70%);
}

.nature-accent:hover .bloom-bg {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* --- Hover-Lift Pattern --- */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(45, 49, 66, 0.08);
}

/* Apply hover-lift to quote blocks */
.marble-quote {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.marble-quote:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(45, 49, 66, 0.08);
}

/* --- Closing Section --- */
.closing-section {
    flex-direction: column;
    background: transparent;
}

.closing-wash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.closing-wash {
    width: 100%;
    height: 100%;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.falling-leaf {
    width: 50px;
    height: 60px;
    margin: 0 auto 3rem;
    animation: leaf-fall 8s ease-in-out infinite;
}

@keyframes leaf-fall {
    0% { transform: translateY(-15px) rotate(-5deg); }
    25% { transform: translateY(5px) rotate(3deg); }
    50% { transform: translateY(15px) rotate(-3deg); }
    75% { transform: translateY(5px) rotate(5deg); }
    100% { transform: translateY(-15px) rotate(-5deg); }
}

.leaf-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.closing-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--stone);
    line-height: 1.8;
    max-width: 520px;
    margin: 0 auto;
}

/* --- Breathing Gutters --- */
.content-section + .section-divider {
    margin: 0;
}

/* Variable spacing via sections */
#section-logic {
    padding-top: 4rem;
    padding-bottom: 5rem;
}

#section-water {
    padding-top: 5rem;
    padding-bottom: 6rem;
}

#section-stone {
    padding-top: 4rem;
    padding-bottom: 5rem;
}

#section-garden {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

/* --- Link Styles --- */
a {
    color: var(--wash-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--deep-slate);
}

/* --- Selection --- */
::selection {
    background: rgba(123, 143, 163, 0.2);
    color: var(--deep-slate);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--paper-white);
}

::-webkit-scrollbar-thumb {
    background: var(--stone);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--faded-graphite);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #rakkan-seal {
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }

    #nav-panel {
        width: 280px;
        left: -280px;
    }

    .content-section {
        padding: 4rem 1.5rem;
    }

    .section-heading {
        font-size: clamp(1.6rem, 5vw, 2.5rem);
    }

    .margin-annotation {
        position: relative;
        margin-left: 0;
    }
}
