/* =============================================
   nonri.xyz — Memphis Milano × Futurism
   Design System Stylesheet
   ============================================= */

/* CSS Custom Properties */
:root {
    --color-espresso: #3D2B1F;
    --color-sage: #6B8F71;
    --color-amber: #E8B84B;
    --color-ink: #2C1810;
    --color-salmon: #D4917A;
    --color-cream: #FFF3E6;
    --color-terracotta: #C46D3B;
    --color-walnut: #8B5E3C;
    --color-kraft: #F5E6D3;
    --color-teal: #4A7C72;

    --font-display: 'Libre Baskerville', 'Georgia', serif;
    --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--color-kraft);
    color: var(--color-ink);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Depth Layers (Parallax System)
   ============================================= */

.depth-layer {
    position: relative;
    width: 100%;
}

#layer-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#layer-mid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#layer-fg {
    position: relative;
    z-index: 2;
}

/* Terrazzo Background Texture */
.terrazzo-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-kraft);
    background-image:
        radial-gradient(ellipse 4px 3px at 15% 25%, var(--color-salmon) 0%, transparent 100%),
        radial-gradient(ellipse 3px 5px at 35% 15%, var(--color-teal) 0%, transparent 100%),
        radial-gradient(ellipse 5px 3px at 55% 45%, var(--color-amber) 0%, transparent 100%),
        radial-gradient(ellipse 3px 4px at 75% 35%, var(--color-walnut) 0%, transparent 100%),
        radial-gradient(ellipse 4px 6px at 25% 65%, var(--color-terracotta) 0%, transparent 100%),
        radial-gradient(ellipse 6px 3px at 85% 55%, var(--color-sage) 0%, transparent 100%),
        radial-gradient(ellipse 3px 5px at 45% 85%, var(--color-salmon) 0%, transparent 100%),
        radial-gradient(ellipse 5px 4px at 65% 75%, var(--color-amber) 0%, transparent 100%),
        radial-gradient(ellipse 4px 3px at 10% 90%, var(--color-teal) 0%, transparent 100%),
        radial-gradient(ellipse 3px 5px at 90% 10%, var(--color-terracotta) 0%, transparent 100%),
        radial-gradient(ellipse 5px 3px at 50% 50%, var(--color-walnut) 0%, transparent 100%),
        radial-gradient(ellipse 4px 4px at 20% 40%, var(--color-sage) 0%, transparent 100%);
    opacity: 0.4;
}

/* Confetti Field */
.confetti-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 0.25;
    animation: confetti-drift 20s linear infinite;
}

.confetti-piece.shape-square {
    border-radius: 0;
}

.confetti-piece.shape-circle {
    border-radius: 50%;
}

.confetti-piece.shape-triangle {
    width: 0;
    height: 0;
    background: transparent !important;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid var(--color-amber);
}

@keyframes confetti-drift {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.25; }
    50% { opacity: 0.4; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Zigzag Strips */
.zigzag-strip {
    position: absolute;
    left: 0;
    width: 100%;
    height: 30px;
    opacity: 0.15;
}

.zigzag-top {
    top: 0;
    background: linear-gradient(135deg, var(--color-amber) 25%, transparent 25%) -20px 0,
                linear-gradient(225deg, var(--color-amber) 25%, transparent 25%) -20px 0,
                linear-gradient(315deg, var(--color-amber) 25%, transparent 25%),
                linear-gradient(45deg, var(--color-amber) 25%, transparent 25%);
    background-size: 40px 30px;
    background-color: transparent;
}

.zigzag-bottom {
    bottom: 0;
    background: linear-gradient(135deg, var(--color-terracotta) 25%, transparent 25%) -20px 0,
                linear-gradient(225deg, var(--color-terracotta) 25%, transparent 25%) -20px 0,
                linear-gradient(315deg, var(--color-terracotta) 25%, transparent 25%),
                linear-gradient(45deg, var(--color-terracotta) 25%, transparent 25%);
    background-size: 40px 30px;
    background-color: transparent;
}

/* Floating Memphis Columns */
.floating-column {
    position: absolute;
    width: 40px;
    height: 100%;
    opacity: 0.08;
}

.col-left {
    left: 5%;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-amber) 0px,
        var(--color-amber) 30px,
        var(--color-teal) 30px,
        var(--color-teal) 50px,
        var(--color-terracotta) 50px,
        var(--color-terracotta) 70px,
        var(--color-salmon) 70px,
        var(--color-salmon) 85px,
        transparent 85px,
        transparent 100px
    );
}

.col-right {
    right: 5%;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-teal) 0px,
        var(--color-teal) 25px,
        var(--color-salmon) 25px,
        var(--color-salmon) 55px,
        var(--color-amber) 55px,
        var(--color-amber) 75px,
        transparent 75px,
        transparent 95px
    );
}

/* =============================================
   Room (Section) System
   ============================================= */

.room {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    position: relative;
    overflow: hidden;
}

.room-inner {
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Room-specific backgrounds */
#room-hero {
    background: transparent;
    min-height: 100vh;
}

#room-logic {
    background: linear-gradient(180deg, transparent 0%, rgba(74, 124, 114, 0.06) 30%, rgba(74, 124, 114, 0.1) 70%, transparent 100%);
}

#room-gallery {
    background: linear-gradient(180deg, transparent 0%, rgba(232, 184, 75, 0.06) 30%, rgba(232, 184, 75, 0.1) 70%, transparent 100%);
}

#room-thinking {
    background: linear-gradient(180deg, transparent 0%, rgba(196, 109, 59, 0.06) 30%, rgba(196, 109, 59, 0.1) 70%, transparent 100%);
}

#room-archive {
    background: linear-gradient(180deg, transparent 0%, rgba(44, 24, 16, 0.06) 30%, rgba(44, 24, 16, 0.1) 70%, transparent 100%);
}

/* Room decorations */
.room-decoration {
    position: absolute;
    top: 40px;
    right: 40px;
    opacity: 0.6;
    z-index: 1;
}

.iso-pyramid {
    width: 120px;
    height: 120px;
}

.iso-staircase {
    width: 160px;
    height: 160px;
}

/* Sottsass Column */
.gallery-deco {
    top: 0;
    right: 60px;
    bottom: 0;
    height: 100%;
}

.sottsass-column {
    display: flex;
    flex-direction: column;
    width: 35px;
    height: 100%;
    position: relative;
}

.col-segment {
    width: 35px;
    height: 60px;
    flex-shrink: 0;
}

.col-segment.wide {
    width: 50px;
    margin-left: -7px;
}

/* =============================================
   Typography
   ============================================= */

.display-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(72px, 15vw, 180px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-ink);
}

.char-wrap {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) rotate(-5deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.char-wrap.revealed {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 80px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-ink);
    margin-bottom: 8px;
}

.section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-walnut);
    margin-bottom: 48px;
}

.mono-text {
    font-family: var(--font-mono);
}

/* =============================================
   Hero Section
   ============================================= */

#room-hero .room-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 160px);
}

.isometric-cluster {
    position: relative;
    margin-bottom: 40px;
}

.iso-cubes {
    width: 160px;
    height: 160px;
    animation: float-cube 6s ease-in-out infinite;
}

.iso-small {
    width: 100px;
    height: 100px;
    position: absolute;
    top: -20px;
    right: -60px;
    animation: float-cube 6s ease-in-out infinite reverse;
    animation-delay: -2s;
}

@keyframes float-cube {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.hero-text {
    margin-bottom: 60px;
}

.hero-subtitle {
    font-size: clamp(13px, 1.5vw, 16px);
    letter-spacing: 0.1em;
    color: var(--color-walnut);
    margin-top: 16px;
    text-transform: uppercase;
}

.hero-divider {
    margin: 32px auto;
    width: 200px;
    display: flex;
    justify-content: center;
}

.divider-zigzag {
    display: block;
    width: 200px;
    height: 12px;
    background: linear-gradient(135deg, var(--color-amber) 33%, var(--color-terracotta) 33%, var(--color-terracotta) 66%, var(--color-teal) 66%);
    clip-path: polygon(
        0% 50%, 5% 0%, 10% 50%, 15% 0%, 20% 50%, 25% 0%, 30% 50%, 35% 0%, 40% 50%, 45% 0%,
        50% 50%, 55% 0%, 60% 50%, 65% 0%, 70% 50%, 75% 0%, 80% 50%, 85% 0%, 90% 50%, 95% 0%,
        100% 50%, 95% 100%, 90% 50%, 85% 100%, 80% 50%, 75% 100%, 70% 50%, 65% 100%, 60% 50%, 55% 100%,
        50% 50%, 45% 100%, 40% 50%, 35% 100%, 30% 50%, 25% 100%, 20% 50%, 15% 100%, 10% 50%, 5% 100%
    );
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 400;
    color: var(--color-espresso);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fade-in 1s ease forwards 1.5s;
}

.scroll-indicator .mono-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-walnut);
}

.arrow-down {
    animation: bounce-down 2s ease-in-out infinite;
}

@keyframes fade-in {
    to { opacity: 1; }
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* =============================================
   Logic Grid Section
   ============================================= */

.logic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-cell {
    position: relative;
    height: 180px;
    perspective: 600px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-cell:hover {
    transform: scale(1.05);
}

.cell-face {
    position: absolute;
    transition: all 0.4s ease;
}

.cell-top {
    top: 0;
    left: 20%;
    width: 60%;
    height: 40%;
    background: var(--cell-color);
    opacity: 0.9;
    transform: skewX(-15deg);
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
}

.cell-front {
    top: 40%;
    left: 10%;
    width: 50%;
    height: 60%;
    background: var(--cell-color);
    opacity: 0.7;
    filter: brightness(0.85);
}

.cell-side {
    top: 40%;
    right: 10%;
    width: 40%;
    height: 60%;
    background: var(--cell-color);
    opacity: 0.5;
    filter: brightness(0.7);
    transform: skewY(-10deg);
}

.cell-label {
    position: absolute;
    bottom: -28px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-walnut);
}

.grid-cell {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.grid-cell.revealed {
    opacity: 1;
    transform: translateY(0);
}

.grid-cell.revealed:hover {
    transform: translateY(0) scale(1.05);
}

/* =============================================
   Gallery Section
   ============================================= */

.gallery-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.gallery-card {
    background: var(--color-cream);
    border: 3px solid var(--color-ink);
    padding: 0;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px) rotate(1deg);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card.revealed {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.gallery-card:nth-child(2) {
    transform: translateY(50px) rotate(-1deg);
}

.gallery-card:nth-child(2).revealed {
    transform: translateY(0) rotate(0deg);
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-amber), var(--color-terracotta), var(--color-teal));
}

.gallery-card:hover {
    transform: translateY(-8px) rotate(0deg) !important;
    box-shadow: 8px 8px 0 var(--color-ink);
}

.card-visual {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-kraft);
    border-bottom: 3px solid var(--color-ink);
}

.card-svg {
    width: 160px;
    height: 160px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--color-ink);
    padding: 20px 20px 8px;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-espresso);
    padding: 0 20px 24px;
}

/* =============================================
   Thinking Space Section
   ============================================= */

.thinking-blocks {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.think-block {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 24px;
    padding: 32px;
    border-left: 4px solid var(--color-amber);
    background: linear-gradient(90deg, rgba(232, 184, 75, 0.06) 0%, transparent 50%);
    position: relative;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.think-block.revealed {
    opacity: 1;
    transform: translateX(0);
}

.think-block:nth-child(2) {
    border-left-color: var(--color-teal);
    background: linear-gradient(90deg, rgba(74, 124, 114, 0.06) 0%, transparent 50%);
}

.think-block:nth-child(3) {
    border-left-color: var(--color-terracotta);
    background: linear-gradient(90deg, rgba(196, 109, 59, 0.06) 0%, transparent 50%);
}

.block-number {
    grid-row: 1 / 3;
    font-size: 48px;
    font-weight: 700;
    color: var(--color-amber);
    opacity: 0.3;
    line-height: 1;
    align-self: start;
}

.think-block:nth-child(2) .block-number {
    color: var(--color-teal);
}

.think-block:nth-child(3) .block-number {
    color: var(--color-terracotta);
}

.block-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    color: var(--color-ink);
    line-height: 1.2;
}

.block-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-espresso);
    max-width: 600px;
}

/* =============================================
   Archive / Footer Section
   ============================================= */

.archive-content {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.archive-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px;
    border: 2px solid rgba(44, 24, 16, 0.15);
    background: rgba(255, 243, 230, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.archive-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.archive-key {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-walnut);
}

.archive-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-ink);
}

.archive-footer {
    text-align: center;
    padding-top: 40px;
    border-top: 2px solid rgba(44, 24, 16, 0.1);
}

.footer-iso {
    margin-bottom: 24px;
}

.footer-shapes {
    width: 200px;
    height: 70px;
}

.footer-text {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--color-walnut);
}

/* Confetti burst in archive */
.confetti-burst {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.burst-piece {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    animation: burst 3s ease-out forwards;
}

@keyframes burst {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    60% { opacity: 0.8; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1); opacity: 0; }
}

/* =============================================
   Room Progress Indicator
   ============================================= */

.room-progress {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.progress-pip {
    width: 10px;
    height: 10px;
    border: 2px solid var(--color-walnut);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.progress-pip.active {
    background: var(--color-amber);
    border-color: var(--color-amber);
    transform: scale(1.3);
}

.progress-pip:hover {
    border-color: var(--color-amber);
}

/* =============================================
   Responsive Design
   ============================================= */

@media (max-width: 900px) {
    .room {
        padding: 60px 24px;
    }

    .logic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-showcase {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .archive-grid {
        grid-template-columns: 1fr;
    }

    .room-decoration {
        display: none;
    }

    .floating-column {
        display: none;
    }

    .think-block {
        grid-template-columns: 60px 1fr;
        padding: 24px;
    }
}

@media (max-width: 600px) {
    .room {
        padding: 48px 16px;
    }

    .logic-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }

    .display-heading {
        font-size: clamp(60px, 20vw, 120px);
    }

    .think-block {
        grid-template-columns: 1fr;
    }

    .block-number {
        grid-row: auto;
        font-size: 36px;
    }

    .iso-small {
        display: none;
    }

    .room-progress {
        right: 12px;
    }

    .progress-pip {
        width: 8px;
        height: 8px;
    }
}

/* =============================================
   Scroll Reveal Animations
   ============================================= */

.room {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.room.visible {
    opacity: 1;
}

#room-hero {
    opacity: 1;
}

/* Memphis decorative pattern for room borders */
.room::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-amber) 0px,
        var(--color-amber) 20px,
        var(--color-teal) 20px,
        var(--color-teal) 40px,
        var(--color-terracotta) 40px,
        var(--color-terracotta) 60px,
        var(--color-salmon) 60px,
        var(--color-salmon) 80px,
        transparent 80px,
        transparent 100px
    );
    opacity: 0.4;
}

.room:last-child::after {
    display: none;
}
