/* ===========================================
   miris.studio - Brutalist Marble Atelier
   Neubrutalism meets frozen marble aesthetic
   =========================================== */

:root {
    --color-glacial: #e8edf2;
    --color-concrete: #f0f3f7;
    --color-ethereal-deep: #4a7a9e;
    --color-ethereal-ice: #7ba3c4;
    --color-frost-bright: #a8d4f0;
    --color-obsidian: #1a1d23;
    --color-slate: #3a3f48;
    --color-steel: #7a8594;
    --color-border: #b0bcc8;
    --color-vein: #c5d0db;
    --color-cut: #8b2d3a;
    --color-shadow: #2a3545;
    --split-width: 50vw;
    --split-border: 4px;
    --grid-gap: 16px;
    --radius: 0px;
    --transition-fast: 180ms;
    --transition-medium: 350ms;
    --transition-slow: 800ms;

    /* Marble interactive properties */
    --mx: 50%;
    --my: 50%;
    --vein-rotation: 0deg;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    color: var(--color-slate);
    background: var(--color-concrete);
    overflow-x: hidden;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}

/* ===========================================
   Entry Overlay
   =========================================== */

#entry-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    pointer-events: none;
}

#entry-overlay.complete {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    transition-delay: 0.3s;
}

#entry-overlay.hidden {
    display: none;
}

#entry-left {
    width: 50%;
    height: 100%;
    background: var(--color-obsidian);
    position: relative;
    overflow: hidden;
}

#entry-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#entry-line line {
    stroke-dasharray: 142;
    stroke-dashoffset: 142;
    animation: draw-line 600ms ease-out 300ms forwards;
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

#entry-marble {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: reveal-marble var(--transition-slow) ease-out 900ms forwards;
    background:
        linear-gradient(180deg, #e8edf2 0%, #dde5ed 100%),
        repeating-linear-gradient(35deg, transparent, transparent 78px, #c5d0db 78px, #c5d0db 79px),
        repeating-linear-gradient(145deg, transparent, transparent 120px, rgba(163,185,206,0.08) 120px, rgba(163,185,206,0.08) 122px),
        radial-gradient(ellipse at 30% 70%, rgba(122,163,196,0.12), transparent 60%);
    background-blend-mode: normal;
}

@keyframes reveal-marble {
    to {
        opacity: 1;
    }
}

#entry-right {
    width: 50%;
    height: 100%;
    background: var(--color-concrete);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 48px;
    padding-right: clamp(24px, 4vw, 64px);
    border-left: var(--split-border) solid var(--color-obsidian);
}

#entry-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 7vw, 6rem);
    color: var(--color-obsidian);
    opacity: 0;
    transform: translateY(15px);
    animation: fade-up 500ms ease-out 1100ms forwards;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

#entry-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.8vw, 1.125rem);
    color: var(--color-steel);
    opacity: 0;
    transform: translateY(10px);
    animation: fade-up 400ms ease-out 1500ms forwards;
    margin-top: 12px;
    letter-spacing: 0.04em;
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   Split Container
   =========================================== */

#split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===========================================
   Left Pane: The Stone Wall
   =========================================== */

#left-pane {
    width: var(--split-width);
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    border-right: var(--split-border) solid var(--color-obsidian);
    overflow: hidden;
    z-index: 10;
}

#marble-surface {
    width: 100%;
    height: 100%;
    position: relative;
    filter: url(#marble-noise);
}

/* Marble panels - layered marble texture */
.marble-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            calc(35deg + var(--vein-rotation)),
            transparent,
            transparent 78px,
            var(--color-vein) 78px,
            var(--color-vein) 79px
        ),
        repeating-linear-gradient(
            calc(145deg + var(--vein-rotation)),
            transparent,
            transparent 120px,
            rgba(163,185,206,0.08) 120px,
            rgba(163,185,206,0.08) 122px
        ),
        radial-gradient(
            ellipse at var(--mx) var(--my),
            rgba(122,163,196,0.12),
            transparent 60%
        ),
        linear-gradient(180deg, #e8edf2 0%, #dde5ed 100%);
    transition: clip-path 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Stacking panels for cut accumulation */
.marble-panel[data-section="0"] { z-index: 7; }
.marble-panel[data-section="1"] { z-index: 6; }
.marble-panel[data-section="2"] { z-index: 5; }
.marble-panel[data-section="3"] { z-index: 4; }
.marble-panel[data-section="4"] { z-index: 3; }
.marble-panel[data-section="5"] { z-index: 2; }
.marble-panel[data-section="6"] { z-index: 1; }

/* Clip-path cut states - applied via JS */
.marble-panel[data-section="0"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 100%);
}

.marble-panel[data-section="1"].cut {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 7vw));
}

.marble-panel[data-section="2"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 calc(100% - 8vw));
}

.marble-panel[data-section="3"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6vw), 0 calc(100% - 2vw));
}

.marble-panel[data-section="4"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3vw), 0 calc(100% - 9vw));
}

.marble-panel[data-section="5"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vw), 0 calc(100% - 4vw));
}

.marble-panel[data-section="6"].cut {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 calc(100% - 6vw));
}

/* Cut crimson lines - diagonal accents revealed between panels */
.cut-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--color-cut);
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    z-index: 8;
}

.cut-line.visible {
    opacity: 1;
}

.cut-line-1 {
    top: 28%;
    left: 0;
    transform: rotate(23deg);
}

.cut-line-2 {
    top: 45%;
    left: -5%;
    width: 110%;
    transform: rotate(-17deg);
}

.cut-line-3 {
    top: 60%;
    left: 0;
    transform: rotate(37deg);
}

.cut-line-4 {
    top: 75%;
    left: -3%;
    width: 106%;
    transform: rotate(-8deg);
}

.cut-line-5 {
    top: 88%;
    left: 0;
    transform: rotate(52deg);
}

/* Geometric shard decorations */
.shard {
    position: absolute;
    opacity: 0.18;
    background: var(--color-ethereal-ice);
    z-index: 9;
    pointer-events: none;
}

.shard-1 {
    width: 60px;
    height: 60px;
    top: 12%;
    left: 15%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 80%);
}

.shard-2 {
    width: 45px;
    height: 75px;
    top: 35%;
    right: 20%;
    clip-path: polygon(0% 0%, 100% 25%, 80% 100%, 10% 90%);
    opacity: 0.22;
}

.shard-3 {
    width: 80px;
    height: 50px;
    top: 55%;
    left: 30%;
    clip-path: polygon(20% 0%, 100% 0%, 75% 100%, 0% 100%);
    opacity: 0.15;
}

.shard-4 {
    width: 40px;
    height: 65px;
    top: 72%;
    right: 35%;
    clip-path: polygon(50% 0%, 100% 50%, 70% 100%, 0% 75%);
    opacity: 0.2;
}

.shard-5 {
    width: 55px;
    height: 55px;
    bottom: 8%;
    left: 55%;
    clip-path: polygon(0% 15%, 100% 0%, 85% 100%, 15% 85%);
    opacity: 0.16;
}

/* ===========================================
   Right Pane: The Notation Wall
   =========================================== */

#right-pane {
    width: var(--split-width);
    background: var(--color-concrete);
    padding-left: 48px;
    padding-right: clamp(24px, 4vw, 64px);
    padding-top: 0;
    padding-bottom: 48px;
    min-height: 100vh;
}

/* ===========================================
   Navigation
   =========================================== */

#main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 32px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.nav-item {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-obsidian);
    cursor: pointer;
    position: relative;
    padding-bottom: 2px;
    transition: transform var(--transition-fast) cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(12deg, transparent 48%, var(--color-ethereal-deep) 48%, var(--color-ethereal-deep) 52%, transparent 52%);
    opacity: 0;
    transition: opacity var(--transition-fast) ease-out;
}

.nav-item:hover {
    transform: scale(1.06);
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item.active {
    color: var(--color-ethereal-deep);
}

.nav-item.active::after {
    opacity: 1;
}

.nav-sep {
    color: var(--color-border);
    font-size: 0.75rem;
    user-select: none;
}

/* ===========================================
   Content Sections
   =========================================== */

.content-section {
    margin-bottom: 0;
    padding-top: 48px;
    padding-bottom: 48px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--grid-gap);
}

.meta-label {
    grid-column: 1 / -1;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-steel);
    margin-bottom: 8px;
}

.section-heading {
    grid-column: 1 / -1;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--color-obsidian);
    line-height: 1.15;
    margin-bottom: 24px;
}

.section-heading.accent-heading {
    color: var(--color-ethereal-deep);
}

.section-body {
    grid-column: 1 / 6;
}

.section-body p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.72;
    color: var(--color-slate);
    margin-bottom: 1.5em;
}

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

.section-divider {
    width: 100%;
    height: 1px;
    background: var(--color-border);
    margin-top: 0;
}

/* ===========================================
   Pull Quotes
   =========================================== */

.pull-quote {
    grid-column: 2 / -1;
    margin: 2em 0;
    padding: 24px 28px;
    border-left: 4px solid var(--color-ethereal-ice);
    background: rgba(122,163,196,0.06);
    transform: skewY(-2deg);
    transition: transform 200ms ease-out;
}

.pull-quote:hover {
    transform: skewY(-3deg);
}

.pull-quote p {
    transform: skewY(2deg);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.65;
    color: var(--color-ethereal-deep);
    margin-bottom: 0;
}

.pull-quote:hover p {
    transform: skewY(3deg);
}

/* ===========================================
   Fade Reveal Animation
   =========================================== */

.fade-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition-medium) ease-out, transform var(--transition-medium) ease-out;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================================
   Footer
   =========================================== */

#site-footer {
    padding: 48px 0 24px;
    border-top: 1px solid var(--color-border);
    margin-top: 48px;
}

#site-footer .meta-label {
    display: block;
}

/* ===========================================
   Mobile Adaptation (below 768px)
   =========================================== */

@media (max-width: 768px) {
    #split-container {
        flex-direction: column;
    }

    #left-pane {
        width: 100%;
        height: 40vh;
        position: relative;
        border-right: none;
        border-bottom: var(--split-border) solid var(--color-obsidian);
    }

    #right-pane {
        width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    #entry-left {
        width: 100%;
        height: 40vh;
    }

    #entry-right {
        width: 100%;
        height: 60vh;
        padding-left: 24px;
        border-left: none;
        border-top: var(--split-border) solid var(--color-obsidian);
    }

    #entry-overlay {
        flex-direction: column;
    }

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

    .section-body {
        grid-column: 1 / -1;
    }

    .pull-quote {
        grid-column: 1 / -1;
    }

    #main-nav {
        gap: 8px;
    }

    .nav-item {
        font-size: 0.85rem;
    }

    /* Mobile cut lines become horizontal with angled clips */
    .cut-line {
        transform: rotate(0deg) !important;
    }

    .cut-line-1 { clip-path: polygon(0 0, 100% 20%, 100% 100%, 0 80%); }
    .cut-line-2 { clip-path: polygon(0 30%, 100% 0, 100% 70%, 0 100%); }
    .cut-line-3 { clip-path: polygon(0 0, 100% 15%, 100% 100%, 0 85%); }
    .cut-line-4 { clip-path: polygon(0 20%, 100% 0, 100% 80%, 0 100%); }
    .cut-line-5 { clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%); }

    .section-divider {
        clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 70%);
        height: 4px;
        background: var(--color-border);
    }
}

/* ===========================================
   Scrollbar Styling (minimal)
   =========================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-concrete);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-steel);
}
