/* ============================================
   miris.works - Diagonal Jewel-Toned Portfolio Gallery
   ============================================ */

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

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

body {
    background: #1A2C5A;
    color: #F0E8F0;
    font-family: 'Spectral', serif;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Color Variables --- */
:root {
    --ruby: #6B1A3A;
    --sapphire: #1A2C5A;
    --emerald: #1A4A2C;
    --amethyst: #3A1A5A;
    --soft-white: #F0E8F0;
    --ruby-light: #C44060;
    --sapphire-light: #4070C0;
    --emerald-light: #40A060;
    --amethyst-light: #8050C0;
    --skew-angle: 8deg;
}

/* --- Typography --- */
.hero-title,
.card-title,
.closing-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--soft-white);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
}

.card-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    margin-bottom: 0.5rem;
}

.closing-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.card-description,
.hero-tagline,
.closing-text {
    font-family: 'Spectral', serif;
    font-weight: 400;
    line-height: 1.75;
}

.tag {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: inline-block;
    padding: 0.2em 0.7em;
    margin-right: 0.5em;
    margin-bottom: 0.3em;
    border: 1px solid currentColor;
    border-radius: 2px;
}

/* --- Diagonal Sections --- */
.diagonal-section {
    position: relative;
    padding: 120px 0;
    clip-path: polygon(0 0, 100% 60px, 100% calc(100% - 0px), 0 calc(100% - 60px));
    margin-top: -80px;
    overflow: hidden;
}

.diagonal-section:first-child {
    margin-top: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0px), 0 calc(100% - 60px));
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.diagonal-section:last-child {
    clip-path: polygon(0 0, 100% 60px, 100% 100%, 0 100%);
    padding-bottom: 100px;
}

/* --- Section Colors --- */
.section-ruby {
    background-color: var(--ruby);
}

.section-sapphire {
    background-color: var(--sapphire);
}

.section-emerald {
    background-color: var(--emerald);
}

.section-amethyst {
    background-color: var(--amethyst);
}

/* --- Diagonal Transition Lines --- */
.diagonal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    transform-origin: top left;
    transform: rotate(calc(atan(60 / var(--vw, 1440))));
    z-index: 2;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.section-ruby .diagonal-line {
    background: var(--ruby-light);
}

.section-sapphire .diagonal-line {
    background: var(--sapphire-light);
}

.section-emerald .diagonal-line {
    background: var(--emerald-light);
}

.section-amethyst .diagonal-line {
    background: var(--amethyst-light);
}

/* --- Section Patterns (5% opacity generative backgrounds) --- */
.section-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.pattern-circles {
    background: repeating-radial-gradient(
        circle at 50% 50%,
        transparent 0px,
        transparent 30px,
        var(--ruby-light) 30px,
        var(--ruby-light) 32px,
        transparent 32px,
        transparent 60px
    );
}

.pattern-lines {
    background: repeating-linear-gradient(
        45deg,
        transparent 0px,
        transparent 18px,
        var(--sapphire-light) 18px,
        var(--sapphire-light) 20px,
        transparent 20px,
        transparent 38px
    );
}

.pattern-dots {
    background:
        radial-gradient(circle, var(--emerald-light) 2px, transparent 2px) 0 0 / 24px 24px,
        radial-gradient(circle, var(--emerald-light) 2px, transparent 2px) 12px 12px / 24px 24px;
}

.pattern-triangles {
    background:
        linear-gradient(60deg, transparent 48%, var(--amethyst-light) 48%, var(--amethyst-light) 52%, transparent 52%) 0 0 / 40px 40px,
        linear-gradient(-60deg, transparent 48%, var(--amethyst-light) 48%, var(--amethyst-light) 52%, transparent 52%) 0 0 / 40px 40px,
        linear-gradient(0deg, transparent 48%, var(--amethyst-light) 48%, var(--amethyst-light) 52%, transparent 52%) 0 0 / 40px 40px;
}

/* --- Section Inner / Grid --- */
.section-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

.diagonal-section:first-child .section-inner {
    width: 100%;
}

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

.section-grid.align-left .work-card,
.section-grid.align-left .hero-content {
    grid-column: 1 / 5;
}

.section-grid.align-right .work-card {
    grid-column: 3 / 7;
}

.section-grid.align-center .closing-content {
    grid-column: 2 / 6;
    text-align: center;
}

/* --- Hero Section --- */
.hero-content {
    padding: 40px 0;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateX(-40px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.6s ease;
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateX(0);
}

.hero-title .letter.dot {
    color: var(--ruby-light);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--ruby-light);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}

.hero-tagline.visible {
    opacity: 0.85;
    transform: translateY(0);
}

/* --- Portfolio Work Cards --- */
.work-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-60px) rotate(-3deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.6s ease,
                box-shadow 0.3s ease;
    cursor: default;
}

.work-card[data-enter="right"] {
    transform: translateX(60px) rotate(3deg);
}

.work-card.visible {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

/* Card hover */
.work-card:hover {
    transform: translateY(-4px);
}

/* Per-section card shadows */
.card-sapphire {
    box-shadow: 12px 12px 0 rgba(64, 112, 192, 0.3);
}
.card-sapphire:hover {
    box-shadow: 16px 16px 0 rgba(64, 112, 192, 0.45);
}

.card-emerald {
    box-shadow: 12px 12px 0 rgba(64, 160, 96, 0.3);
}
.card-emerald:hover {
    box-shadow: 16px 16px 0 rgba(64, 160, 96, 0.45);
}

.card-amethyst {
    box-shadow: 12px 12px 0 rgba(128, 80, 192, 0.3);
}
.card-amethyst:hover {
    box-shadow: 16px 16px 0 rgba(128, 80, 192, 0.45);
}

/* --- Card Thumbnail (Generative Art) --- */
.card-thumbnail {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.thumb-sapphire {
    background: linear-gradient(135deg, #1A2C5A 0%, #2A3C6A 100%);
}

.thumb-emerald {
    background: linear-gradient(135deg, #1A4A2C 0%, #2A5A3C 100%);
}

.thumb-amethyst {
    background: linear-gradient(135deg, #3A1A5A 0%, #4A2A6A 100%);
}

.gen-art {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gen-shape {
    position: absolute;
}

/* Sapphire gen-art shapes */
.gen-rect-1 {
    width: 60%;
    height: 40%;
    top: 10%;
    left: 20%;
    background: rgba(64, 112, 192, 0.25);
    border: 2px solid rgba(64, 112, 192, 0.4);
    transform: rotate(12deg);
}

.gen-rect-2 {
    width: 40%;
    height: 50%;
    top: 30%;
    left: 50%;
    background: rgba(240, 232, 240, 0.08);
    border: 2px solid rgba(240, 232, 240, 0.15);
    transform: rotate(-5deg);
}

.gen-circle-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    border-radius: 50%;
    background: rgba(64, 112, 192, 0.2);
    border: 2px solid rgba(64, 112, 192, 0.35);
}

.gen-tri-1 {
    width: 0;
    height: 0;
    top: 15%;
    left: 30%;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 80px solid rgba(64, 112, 192, 0.2);
}

.gen-tri-2 {
    width: 0;
    height: 0;
    top: 35%;
    left: 55%;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid rgba(240, 232, 240, 0.1);
    transform: rotate(30deg);
}

.gen-rect-3 {
    width: 30%;
    height: 30%;
    bottom: 10%;
    left: 10%;
    background: rgba(64, 112, 192, 0.15);
    transform: rotate(-15deg);
}

/* Emerald gen-art shapes */
.gen-hex-1 {
    width: 70px;
    height: 70px;
    top: 20%;
    left: 25%;
    background: rgba(64, 160, 96, 0.25);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.gen-hex-2 {
    width: 50px;
    height: 50px;
    top: 45%;
    left: 60%;
    background: rgba(64, 160, 96, 0.3);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.gen-circle-2 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 15%;
    border-radius: 50%;
    border: 2px solid rgba(64, 160, 96, 0.3);
}

.gen-wave-1 {
    width: 100%;
    height: 3px;
    top: 35%;
    left: 0;
    background: repeating-linear-gradient(90deg, rgba(64, 160, 96, 0.3) 0px, rgba(64, 160, 96, 0.3) 10px, transparent 10px, transparent 20px);
    transform: rotate(5deg);
}

.gen-wave-2 {
    width: 100%;
    height: 3px;
    top: 60%;
    left: 0;
    background: repeating-linear-gradient(90deg, rgba(240, 232, 240, 0.15) 0px, rgba(240, 232, 240, 0.15) 10px, transparent 10px, transparent 20px);
    transform: rotate(-3deg);
}

.gen-dot-cluster {
    width: 60px;
    height: 60px;
    top: 25%;
    right: 20%;
    background:
        radial-gradient(circle, rgba(64, 160, 96, 0.4) 3px, transparent 3px) 0 0 / 12px 12px;
}

.gen-line-1 {
    width: 80%;
    height: 2px;
    top: 30%;
    left: 10%;
    background: rgba(64, 160, 96, 0.3);
    transform: rotate(-8deg);
}

.gen-line-2 {
    width: 60%;
    height: 2px;
    top: 55%;
    left: 25%;
    background: rgba(240, 232, 240, 0.12);
    transform: rotate(4deg);
}

.gen-circle-3 {
    width: 60px;
    height: 60px;
    bottom: 15%;
    left: 20%;
    border-radius: 50%;
    background: rgba(64, 160, 96, 0.15);
    border: 2px solid rgba(64, 160, 96, 0.25);
}

/* Amethyst gen-art shapes */
.gen-spiral-1 {
    width: 90px;
    height: 90px;
    top: 15%;
    left: 20%;
    border-radius: 50%;
    border: 3px solid rgba(128, 80, 192, 0.3);
    border-top-color: transparent;
    transform: rotate(45deg);
}

.gen-spiral-2 {
    width: 60px;
    height: 60px;
    top: 30%;
    left: 35%;
    border-radius: 50%;
    border: 2px solid rgba(128, 80, 192, 0.25);
    border-bottom-color: transparent;
    transform: rotate(-30deg);
}

.gen-rect-4 {
    width: 45%;
    height: 35%;
    top: 40%;
    right: 10%;
    background: rgba(128, 80, 192, 0.15);
    border: 1px solid rgba(128, 80, 192, 0.25);
    transform: rotate(8deg);
}

.gen-diamond-1 {
    width: 60px;
    height: 60px;
    top: 20%;
    left: 30%;
    background: rgba(128, 80, 192, 0.2);
    transform: rotate(45deg);
}

.gen-diamond-2 {
    width: 40px;
    height: 40px;
    top: 50%;
    right: 25%;
    background: rgba(240, 232, 240, 0.08);
    border: 2px solid rgba(128, 80, 192, 0.3);
    transform: rotate(45deg);
}

.gen-line-3 {
    width: 70%;
    height: 2px;
    bottom: 25%;
    left: 15%;
    background: rgba(128, 80, 192, 0.25);
    transform: rotate(-6deg);
}

/* --- Card Body --- */
.card-body {
    padding: 24px;
}

.card-tags {
    margin-bottom: 10px;
}

/* Per-section text colors */
.section-sapphire .card-description {
    color: rgba(64, 112, 192, 0.85);
}
.section-sapphire .tag {
    color: rgba(64, 112, 192, 0.7);
}

.section-emerald .card-description {
    color: rgba(64, 160, 96, 0.85);
}
.section-emerald .tag {
    color: rgba(64, 160, 96, 0.7);
}

.section-amethyst .card-description {
    color: rgba(128, 80, 192, 0.85);
}
.section-amethyst .tag {
    color: rgba(128, 80, 192, 0.7);
}

/* --- Closing Section --- */
.closing-content {
    padding: 60px 0;
}

.closing-text {
    color: var(--ruby-light);
    font-size: 1.15rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.closing-mark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ruby-light);
    opacity: 0.5;
}

/* --- Background pattern pulse (hero) --- */
@keyframes patternPulse {
    0% { opacity: 0.05; }
    50% { opacity: 0.10; }
    100% { opacity: 0.05; }
}

#section-hero .section-pattern {
    animation: patternPulse 2s ease-in-out 0.5s 1;
}

/* --- Diagonal line pulse --- */
@keyframes linePulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

.diagonal-line.pulse {
    animation: linePulse 0.6s ease-in-out;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --skew-angle: 5deg;
    }

    .diagonal-section {
        clip-path: polygon(0 0, 100% 35px, 100% calc(100% - 0px), 0 calc(100% - 35px));
        margin-top: -50px;
        padding: 80px 0;
    }

    .diagonal-section:first-child {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0px), 0 calc(100% - 35px));
    }

    .diagonal-section:last-child {
        clip-path: polygon(0 0, 100% 35px, 100% 100%, 0 100%);
    }

    .section-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .section-grid.align-left .work-card,
    .section-grid.align-left .hero-content {
        grid-column: 1 / 4;
    }

    .section-grid.align-right .work-card {
        grid-column: 2 / 5;
    }

    .section-grid.align-center .closing-content {
        grid-column: 1 / 5;
    }

    .section-inner {
        padding: 0 30px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    :root {
        --skew-angle: 0deg;
    }

    .diagonal-section {
        clip-path: none;
        margin-top: 0;
        padding: 60px 0;
    }

    .diagonal-section:first-child {
        clip-path: none;
    }

    .diagonal-section:last-child {
        clip-path: none;
    }

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

    .section-grid.align-left .work-card,
    .section-grid.align-left .hero-content,
    .section-grid.align-right .work-card,
    .section-grid.align-center .closing-content {
        grid-column: 1 / -1;
    }

    .section-inner {
        padding: 0 20px;
    }

    .card-thumbnail {
        height: 140px;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}
