/* ============================================
   miris.tech - Retro-Futuristic Game Dev Studio
   Inflated 3D / Diagonal Sections / Glitch Art
   ============================================ */

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

:root {
    /* Palette */
    --purple-dark: #1A0A30;
    --blue-dark: #0A2040;
    --electric-violet: #8040E0;
    --hot-pink: #E040A0;
    --neon-cyan: #40E0D0;
    --marble-white: #E8E0D8;
    --bright-text: #F0E8FF;
    --inflated-light: #F0E8F0;
    --inflated-shadow: #C0B0D0;

    /* Spring easing */
    --spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --spring-soft: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    color: var(--bright-text);
    background: var(--purple-dark);
    overflow-x: hidden;
}

code {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 13px;
}

/* --- Section Base --- */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px;
    position: relative;
    z-index: 2;
}

.section-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(32px, 5vw, 72px);
    margin-bottom: 60px;
    color: var(--bright-text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Hero Section --- */
.section-hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-gradient-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--blue-dark) 50%, #0D1A35 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

/* Logotype */
.logotype {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(48px, 10vw, 140px);
    line-height: 1;
    margin-bottom: 20px;
    opacity: 0;
    transform: scale(1.3);
    animation: logoSlam 0.5s var(--spring) 0.2s forwards;
}

.logotype-text {
    display: inline-block;
    color: var(--bright-text);
    text-shadow:
        0 0 0 var(--bright-text),
        2px 2px 0 var(--electric-violet),
        4px 4px 0 rgba(128, 64, 224, 0.6),
        6px 6px 0 rgba(128, 64, 224, 0.3),
        8px 8px 16px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Glitch pseudo-elements on logotype */
.logotype-text::before,
.logotype-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.logotype-text::before {
    color: var(--hot-pink);
    z-index: -1;
}

.logotype-text::after {
    color: var(--neon-cyan);
    z-index: -1;
}

.logotype-text.glitching::before {
    opacity: 0.7;
    animation: glitchRed 0.15s steps(3) forwards;
}

.logotype-text.glitching::after {
    opacity: 0.7;
    animation: glitchBlue 0.15s steps(3) forwards;
}

@keyframes logoSlam {
    0% {
        opacity: 0;
        transform: scale(1.3);
    }
    60% {
        opacity: 1;
        transform: scale(0.97);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-tagline {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 2vw, 24px);
    color: var(--neon-cyan);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease 0.7s forwards;
    letter-spacing: 0.05em;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Marble Sphere */
.marble-sphere {
    position: absolute;
    right: 12%;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(160px, 22vw, 320px);
    height: clamp(160px, 22vw, 320px);
    border-radius: 50%;
    z-index: 2;
    opacity: 0;
    animation: sphereFloat 0.8s var(--spring-soft) 0.4s forwards;
}

.marble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(128, 64, 224, 0.3) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(224, 64, 160, 0.15) 0%, transparent 60%),
        linear-gradient(145deg, #F0E8F0 0%, #C0B0D0 40%, #E8E0D8 70%, #B0A0C0 100%);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.4),
        0 20px 60px rgba(128, 64, 224, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.3),
        inset 0 -4px 12px rgba(0, 0, 0, 0.15);
    animation: sphereRotate 20s linear infinite;
}

/* Marble veining overlay */
.marble-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        linear-gradient(47deg, transparent 30%, rgba(192, 176, 208, 0.4) 32%, transparent 34%),
        linear-gradient(127deg, transparent 50%, rgba(200, 190, 210, 0.3) 52%, transparent 54%),
        linear-gradient(200deg, transparent 60%, rgba(180, 170, 195, 0.35) 62%, transparent 64%),
        linear-gradient(320deg, transparent 40%, rgba(210, 200, 220, 0.25) 42%, transparent 44%);
    mix-blend-mode: overlay;
}

.marble-highlight {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 35%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    filter: blur(4px);
}

@keyframes sphereFloat {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.7) rotate(-20deg);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
}

@keyframes sphereRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Hero diagonal cut */
.hero-diagonal-cut {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: var(--blue-dark);
    clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
    z-index: 4;
}

/* Glitch overlay */
.glitch-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(128, 64, 224, 0.05) 2px,
        rgba(128, 64, 224, 0.05) 4px
    );
}

.glitch-overlay.active {
    animation: glitchOverlay 0.15s steps(4) forwards;
}

@keyframes glitchOverlay {
    0% { opacity: 1; clip-path: inset(0 0 95% 0); transform: translateX(0); }
    25% { opacity: 1; clip-path: inset(40% 0 20% 0); transform: translateX(-4px); }
    50% { opacity: 1; clip-path: inset(80% 0 0% 0); transform: translateX(4px); }
    75% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translateX(-2px); }
    100% { opacity: 0; clip-path: inset(0); transform: translateX(0); }
}

@keyframes glitchRed {
    0% { transform: translateX(-2px) translateY(1px); clip-path: inset(0 0 80% 0); }
    33% { transform: translateX(2px) translateY(-1px); clip-path: inset(30% 0 40% 0); }
    66% { transform: translateX(-1px) translateY(2px); clip-path: inset(70% 0 5% 0); }
    100% { transform: translateX(0); clip-path: inset(0); opacity: 0; }
}

@keyframes glitchBlue {
    0% { transform: translateX(2px) translateY(-1px); clip-path: inset(20% 0 60% 0); }
    33% { transform: translateX(-2px) translateY(1px); clip-path: inset(60% 0 10% 0); }
    66% { transform: translateX(1px) translateY(-2px); clip-path: inset(0 0 70% 0); }
    100% { transform: translateX(0); clip-path: inset(0); opacity: 0; }
}

/* --- Glitch Section Transitions --- */
.glitch-transition {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 10%,
        var(--hot-pink) 15%,
        transparent 20%,
        var(--neon-cyan) 40%,
        transparent 45%,
        var(--electric-violet) 70%,
        transparent 75%
    );
}

.glitch-transition.active {
    animation: glitchBar 0.2s steps(3) forwards;
}

@keyframes glitchBar {
    0% { opacity: 1; transform: translateX(-5px) scaleY(1); }
    33% { opacity: 1; transform: translateX(5px) scaleY(3); }
    66% { opacity: 1; transform: translateX(-3px) scaleY(1.5); }
    100% { opacity: 0; transform: translateX(0) scaleY(1); }
}

/* --- Services Section --- */
.section-services {
    background: var(--blue-dark);
    clip-path: polygon(0 0, 100% 4vh, 100% 100%, 0 96%);
    margin-top: -4vh;
    padding-top: 4vh;
}

.inflated-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.inflated-card {
    border-radius: 20px;
    background: linear-gradient(145deg, var(--inflated-light), var(--inflated-shadow));
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    color: var(--purple-dark);
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.inflated-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s ease, transform 0.6s var(--spring);
}

.inflated-card:hover {
    transform: scale(1.05) translateY(-4px);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(128, 64, 224, 0.3);
}

.inflated-card h3 {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(20px, 2.5vw, 28px);
    margin-bottom: 12px;
    color: var(--purple-dark);
}

.inflated-card p {
    color: #2A1A4A;
    line-height: 1.7;
}

.card-icon {
    margin-bottom: 20px;
}

.card-icon svg {
    display: block;
}

/* --- Tech Section --- */
.section-tech {
    background: linear-gradient(180deg, var(--purple-dark) 0%, #120828 100%);
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
    margin-top: -4vh;
    padding-top: 4vh;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.inflated-badge {
    border-radius: 16px;
    background: linear-gradient(145deg, var(--inflated-light), var(--inflated-shadow));
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.3),
        inset 0 2px 3px rgba(255, 255, 255, 0.25),
        inset 0 -2px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.inflated-badge.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.5s var(--spring);
}

.inflated-badge:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.35),
        inset 0 2px 3px rgba(255, 255, 255, 0.3),
        inset 0 -2px 3px rgba(0, 0, 0, 0.1);
}

.tech-item {
    padding: 20px 32px;
}

.tech-item code {
    color: var(--purple-dark);
    font-size: 16px;
    font-weight: 400;
}

/* --- Projects Section --- */
.section-projects {
    background: var(--blue-dark);
    clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%);
    margin-top: -4vh;
    padding-top: 4vh;
}

.project-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.project-card {
    position: relative;
    padding: 50px 30px 40px;
}

.project-number {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(48px, 6vw, 80px);
    color: rgba(128, 64, 224, 0.15);
    position: absolute;
    top: -10px;
    right: 20px;
    line-height: 1;
    pointer-events: none;
}

.project-card h3 {
    color: var(--purple-dark);
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.inflated-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 10px;
    background: linear-gradient(145deg, #E8E0F0, #D0C0E0);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.08);
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--electric-violet);
    font-weight: 400;
}

/* --- About Section --- */
.section-about {
    background: linear-gradient(180deg, #120828 0%, var(--purple-dark) 100%);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    margin-top: -4vh;
    padding-top: 4vh;
}

.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text {
    color: var(--purple-dark);
}

.about-text p {
    margin-bottom: 16px;
    color: #2A1A4A;
}

.about-text p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--electric-violet);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    padding: 24px;
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(32px, 4vw, 56px);
    color: var(--electric-violet);
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #4A3A6A;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Contact Section --- */
.section-contact {
    background: var(--blue-dark);
    clip-path: polygon(0 0, 100% 6%, 100% 100%, 0 100%);
    margin-top: -4vh;
    padding-top: 4vh;
    text-align: center;
}

.contact-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2.5vw, 28px);
    margin-bottom: 40px;
    color: var(--bright-text);
}

.inflated-button {
    display: inline-block;
    padding: 20px 48px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--hot-pink), #C03080);
    color: #fff;
    text-decoration: none;
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 2vw, 22px);
    box-shadow:
        0 8px 24px rgba(224, 64, 160, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease;
    letter-spacing: 0.02em;
}

.inflated-button:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow:
        0 14px 40px rgba(224, 64, 160, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(224, 64, 160, 0.3);
}

.inflated-button:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* --- Footer --- */
.site-footer {
    background: #050210;
    padding: 40px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: 20px;
    color: var(--electric-violet);
}

.footer-copy {
    font-size: 13px;
    color: rgba(240, 232, 255, 0.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        padding: 80px 24px;
    }

    .marble-sphere {
        right: 5%;
        opacity: 0.4;
    }

    .inflated-cards {
        grid-template-columns: 1fr;
    }

    .project-showcase {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-item {
        flex: 1;
        min-width: 120px;
    }

    .tech-grid {
        gap: 12px;
    }

    .tech-item {
        padding: 14px 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .section-services,
    .section-tech,
    .section-projects,
    .section-about,
    .section-contact {
        clip-path: polygon(0 0, 100% 2vh, 100% 100%, 0 98%);
    }
}

@media (max-width: 480px) {
    .logotype {
        font-size: clamp(36px, 14vw, 80px);
    }

    .inflated-button {
        padding: 16px 32px;
    }
}
