/* rinji.net - Memphis-Scholarly Encyclopedia of the Temporary */
/* Palette: dopamine-neon */

:root {
    --bg-indigo: #1a0a2e;
    --bg-teal: #0d1b2a;
    --bg-annotation: #f0e6ff;
    --grid-gap-color: #ff2d6f;
    --grid-gap-hover: #ff5a94;
    --accent-lime: #b8ff2d;
    --accent-tangerine: #ff6b2d;
    --accent-cyan: #2dfff5;
    --accent-magenta: #ff2d6f;
    --accent-violet: #6c2dff;
    --text-light: #f5f0eb;
    --text-dark: #1c1c28;
    --text-muted: #9b8bb4;
    --font-headline: 'Nunito', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    --font-annotation: 'Varela Round', sans-serif;
    --font-mono: 'Source Code Pro', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--grid-gap-color);
    color: var(--text-light);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
}

/* Navigation */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 1000;
    background: transparent;
    transition: background-color 0.3s ease;
}

.nav-bar.scrolled {
    background-color: var(--bg-indigo);
}

.nav-inner {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.nav-logo {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-lime);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-pill {
    font-family: var(--font-annotation);
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 240, 235, 0.2);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-pill:hover {
    background-color: rgba(184, 255, 45, 0.15);
    border-color: var(--accent-lime);
    color: var(--accent-lime);
}

/* Squiggles */
.squiggle-top,
.squiggle-bottom {
    display: block;
    width: 100%;
    height: 30px;
    background: var(--bg-indigo);
}

.squiggle-top {
    margin-top: 48px;
}

/* Mosaic Grid */
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(8rem, auto);
    gap: 3px;
    background-color: var(--grid-gap-color);
    padding: 3px;
}

/* Block base */
.block {
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.block:hover {
    box-shadow: 0 0 0 3px var(--grid-gap-hover);
    z-index: 1;
}

/* Block animations */
.block[data-animate] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.block[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Column spans */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* Text blocks */
.text-block {
    padding: clamp(2rem, 4vw, 4rem);
}

.text-block.bg-indigo {
    background-color: var(--bg-indigo);
}

.text-block.bg-teal {
    background-color: var(--bg-teal);
}

.block-headline {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-light);
    margin-bottom: 1.2rem;
}

.block-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--text-light);
    max-width: 62ch;
    margin-bottom: 1rem;
}

.block-body:last-child {
    margin-bottom: 0;
}

/* Underline draw effect */
.underline-draw {
    background-image: linear-gradient(var(--accent-lime), var(--accent-lime));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 3px;
    padding-bottom: 2px;
    transition: background-size 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.underline-draw.drawn {
    background-size: 100% 3px;
}

/* Monospace accent */
.mono-accent {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent-cyan);
}

/* Highlight blocks */
.highlight-block {
    background-color: var(--accent-violet);
    padding: clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.highlight-text {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-light);
}

.highlight-sub {
    display: block;
    font-size: 0.5em;
    color: var(--accent-lime);
    letter-spacing: 0.1em;
    margin-top: 0.3em;
}

.highlight-meaning {
    font-family: var(--font-annotation);
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: rgba(245, 240, 235, 0.7);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

.highlight-text-sm {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-light);
    font-style: italic;
}

/* Annotation blocks */
.annotation-block {
    background-color: var(--bg-annotation);
    padding: clamp(1.2rem, 2.5vw, 2rem);
    position: relative;
}

.annotation-label {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-violet);
    margin-bottom: 0.5rem;
}

.annotation-text {
    font-family: var(--font-annotation);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Dot grid in annotation blocks */
.dot-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, var(--text-muted) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.15;
    pointer-events: none;
}

/* Geometry blocks */
.geometry-block {
    background-color: var(--bg-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
}

.geometry-block.bg-lime {
    background-color: var(--accent-lime);
}

.geometry-block.bg-magenta {
    background-color: var(--accent-magenta);
}

/* Shapes */
.shape {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Circle rings - tree ring motif */
.circle-rings {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 12rem;
}

.circle-rings .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid;
    animation: pulse-ring 4s ease-in-out infinite;
}

.ring-1 {
    width: 80%;
    height: 0;
    padding-bottom: 80%;
    border-color: var(--accent-magenta);
}

.ring-2 {
    width: 60%;
    height: 0;
    padding-bottom: 60%;
    border-color: var(--accent-lime);
    animation-delay: 0.5s;
}

.ring-3 {
    width: 40%;
    height: 0;
    padding-bottom: 40%;
    border-color: var(--accent-tangerine);
    animation-delay: 1s;
}

.ring-4 {
    width: 20%;
    height: 0;
    padding-bottom: 20%;
    border-color: var(--accent-cyan);
    animation-delay: 1.5s;
}

.circle-rings.small .ring-1 { width: 70%; padding-bottom: 70%; }
.circle-rings.small .ring-2 { width: 50%; padding-bottom: 50%; }
.circle-rings.small .ring-3 { width: 30%; padding-bottom: 30%; }

@keyframes pulse-ring {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.04); }
}

/* Triangle stacks - mountain motif */
.triangles-stack {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 10rem;
}

.triangle {
    position: absolute;
    bottom: 15%;
    width: 0;
    height: 0;
    animation: tri-rotate 8s ease-in-out infinite;
}

.tri-1 {
    left: 10%;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--accent-magenta);
}

.tri-2 {
    left: 30%;
    border-left: 55px solid transparent;
    border-right: 55px solid transparent;
    border-bottom: 95px solid var(--accent-lime);
    animation-delay: 1s;
}

.tri-3 {
    left: 55%;
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 80px solid var(--accent-tangerine);
    animation-delay: 2s;
}

.tri-4 {
    left: 72%;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid var(--accent-cyan);
    animation-delay: 3s;
}

.tri-5 {
    left: 45%;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid var(--accent-violet);
    animation-delay: 4s;
}

.bg-lime .triangle {
    border-bottom-color: var(--bg-indigo);
}

.bg-lime .tri-2 {
    border-bottom-color: var(--accent-magenta);
}

.bg-lime .tri-3 {
    border-bottom-color: var(--accent-violet);
}

.rotated .triangle {
    animation: tri-rotate-alt 8s ease-in-out infinite;
}

@keyframes tri-rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg); }
}

@keyframes tri-rotate-alt {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-2deg); }
}

/* Half circles - sunrise/sunset motif */
.half-circle {
    width: 100%;
    height: 100%;
    min-height: 8rem;
}

.hc-tangerine {
    background: var(--accent-tangerine);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    width: 80%;
    margin: 0 auto;
}

.hc-lime {
    background: var(--accent-lime);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    width: 80%;
    margin: auto auto 0;
}

.hc-cyan {
    background: var(--accent-cyan);
    border-radius: 0 50% 50% 0 / 0 100% 100% 0;
    height: 80%;
    width: 50%;
    margin: auto 0 auto auto;
}

.hc-magenta {
    background: var(--accent-magenta);
    border-radius: 50% 0 0 50% / 100% 0 0 100%;
    height: 80%;
    width: 50%;
    margin: auto auto auto 0;
}

/* Zigzag lines - water current motif */
.zigzag-line {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.zigzag-line svg {
    width: 100%;
    height: 60px;
    animation: zigzag-drift 12s linear infinite;
}

@keyframes zigzag-drift {
    0% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
    100% { transform: translateX(0); }
}

/* Row 4 bar */
.row-4-bar {
    min-height: 4rem;
    max-height: 5rem;
    background-color: var(--bg-teal);
}

/* Squiggle blocks */
.squiggle-block {
    background-color: var(--bg-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    max-height: 4rem;
}

.squiggle-mid {
    width: 100%;
    height: 40px;
}

/* Contemplation block - full viewport */
.contemplation-block {
    background-color: var(--bg-indigo);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contemplation-inner {
    text-align: center;
}

.contemplation-rings {
    position: relative;
    width: clamp(250px, 50vw, 500px);
    height: clamp(250px, 50vw, 500px);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.c-ring-1 {
    width: 100%;
    height: 100%;
    border-color: var(--accent-magenta);
    animation: pulse-ring 4s ease-in-out infinite;
}

.c-ring-2 {
    width: 80%;
    height: 80%;
    border-color: var(--accent-lime);
    animation: pulse-ring 4s ease-in-out infinite 0.5s;
}

.c-ring-3 {
    width: 60%;
    height: 60%;
    border-color: var(--accent-tangerine);
    animation: pulse-ring 4s ease-in-out infinite 1s;
}

.c-ring-4 {
    width: 40%;
    height: 40%;
    border-color: var(--accent-cyan);
    animation: pulse-ring 4s ease-in-out infinite 1.5s;
}

.c-ring-5 {
    width: 20%;
    height: 20%;
    border-color: var(--accent-violet);
    animation: pulse-ring 4s ease-in-out infinite 2s;
}

.contemplation-kanji {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: clamp(8rem, 20vw, 16rem);
    color: var(--text-light);
    position: relative;
    z-index: 2;
    line-height: 1;
}

.contemplation-subtitle {
    font-family: var(--font-annotation);
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Footer */
.site-footer {
    background-color: var(--bg-indigo);
    padding: 3rem clamp(1rem, 3vw, 2rem);
    text-align: center;
}

.footer-text {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.footer-meta {
    font-family: var(--font-annotation);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .mosaic-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .span-2, .span-3, .span-4, .span-5,
    .span-6, .span-7, .span-8 {
        grid-column: span 4;
    }

    .span-12 {
        grid-column: span 4;
    }

    .span-2 { grid-column: span 2; }
    .span-3 { grid-column: span 2; }

    .nav-links {
        gap: 0.3rem;
    }

    .nav-pill {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .triangle {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-2, .span-3, .span-4, .span-5,
    .span-6, .span-7, .span-8, .span-12 {
        grid-column: span 2;
    }

    .nav-links {
        display: none;
    }

    .highlight-text {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .contemplation-kanji {
        font-size: clamp(5rem, 15vw, 8rem);
    }

    .triangle {
        transform: scale(0.5);
    }
}
