/* ===================================
   MiRiS.one — McBling Arcade Aesthetic
   =================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #3d3438;
    background: #f5f0e8;
    overflow-x: hidden;
    position: relative;
}

/* --- Noise Overlay (Vintage Texture) --- */
.noise-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3d3438;
}

h1 {
    font-size: clamp(3rem, 7vw, 6.5rem);
    text-shadow: 0 1px 0 #e8c8f0, 0 2px 0 #d4a0e0, 0 3px 4px rgba(180, 120, 200, 0.25);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.06em;
}

.tagline,
.maker-signature,
.signature-name {
    font-family: 'Satisfy', cursive;
    font-weight: 400;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #f5f0e8 0%, #ede4e0 40%, #e8dce8 70%, #f0e8f0 100%);
    z-index: 0;
}

.controller-watermark {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 400px;
    max-width: 50vw;
    color: #c9a0dc;
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
}

.controller-watermark svg {
    width: 100%;
    height: auto;
}

/* --- Rhinestone Stars --- */
.rhinestone-stars {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

.rhinestone-star {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #c9a0dc;
    transform: rotate(45deg);
    box-shadow: 0 0 4px rgba(201, 160, 220, 0.5);
    animation: rhinestone-pulse 2s ease-in-out infinite;
}

.rhinestone-star::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: rotate(45deg);
    top: -3px;
    left: -3px;
    box-shadow: inherit;
}

.rhinestone-star.star-gold {
    background: #d4c088;
    box-shadow: 0 0 4px rgba(212, 192, 136, 0.5);
}

.rhinestone-star.star-rose {
    background: #d4a0a8;
    box-shadow: 0 0 4px rgba(212, 160, 168, 0.5);
}

@keyframes rhinestone-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Hero Content --- */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.3s forwards;
}

.wordmark {
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.15em;
    line-height: 1;
    margin-bottom: 0.2em;
    text-shadow: 0 1px 0 #e8c8f0, 0 2px 0 #d4a0e0, 0 3px 4px rgba(180, 120, 200, 0.25);
}

.tagline {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: #8a7580;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.8s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Charm Navigation --- */
.charm-nav {
    position: relative;
    z-index: 4;
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
}

.charm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #c9a0dc;
    border: 2px solid #c9a0dc;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(201, 160, 220, 0.4);
    text-decoration: none;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, color 0.2s ease-out;
    opacity: 0;
    animation: charmEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.charm:nth-child(1) { animation-delay: 0.6s; }
.charm:nth-child(2) { animation-delay: 0.8s; }
.charm:nth-child(3) { animation-delay: 1.0s; }
.charm:nth-child(4) { animation-delay: 1.2s; }

.charm svg {
    width: 22px;
    height: 22px;
}

.charm:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(201, 160, 220, 0.6);
    color: #d4a0a8;
}

.charm-star { border-radius: 50%; }
.charm-heart { border-radius: 12px; }
.charm-diamond { border-radius: 4px; transform: rotate(0deg); }
.charm-moon { border-radius: 50%; }

@keyframes charmEnter {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Charm Bracelet Chain --- */
.charm-chain-container {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.charm-chain {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scrollChain 40s linear infinite;
    min-width: 200%;
}

.charm-chain-reverse {
    animation: scrollChainReverse 40s linear infinite;
}

.chain-line {
    display: inline-block;
    width: 30px;
    height: 0;
    border-top: 1px solid #d4c088;
    flex-shrink: 0;
}

.chain-piece {
    display: inline-block;
    flex-shrink: 0;
}

.chain-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9a0dc;
}

.chain-star-small {
    width: 10px;
    height: 10px;
    background: #d4a0a8;
    transform: rotate(45deg);
}

.chain-heart-small {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4a0a8;
    position: relative;
}

.chain-heart-small::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4a0a8;
    left: 4px;
}

.chain-diamond-small {
    width: 8px;
    height: 8px;
    background: #d4c088;
    transform: rotate(45deg);
}

@keyframes scrollChain {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes scrollChainReverse {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* --- Scrapbook Sections --- */
.scrapbook-section {
    position: relative;
    padding: 4rem 1.5rem;
    max-width: 1200px;
}

.section-inner {
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 3rem 2.5rem;
    max-width: 700px;
}

.section-1 {
    margin-left: auto;
    margin-right: 15%;
}
.section-1 .section-inner {
    transform: rotate(-0.8deg);
    background: rgba(237, 228, 224, 0.5);
}

.section-2 {
    margin-left: 8%;
    margin-right: auto;
}
.section-2 .section-inner {
    transform: rotate(0.6deg);
    background: rgba(232, 220, 232, 0.4);
}

.section-3 {
    margin-left: auto;
    margin-right: 5%;
}
.section-3 .section-inner {
    transform: rotate(-0.4deg);
    background: rgba(240, 232, 240, 0.4);
    max-width: 900px;
}

.section-4 {
    margin-left: 12%;
    margin-right: auto;
}
.section-4 .section-inner {
    transform: rotate(1.2deg);
    background: rgba(237, 228, 224, 0.5);
}

/* --- Section Headings with Underline Draw --- */
.section-heading {
    display: inline-block;
    position: relative;
    margin-bottom: 1.5rem;
}

.heading-text {
    position: relative;
    display: inline;
}

.heading-underline {
    display: block;
    height: 2px;
    background: #c9a0dc;
    margin-top: 4px;
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    width: 0%;
    transition: width 0.6s ease-out;
}

.section-heading[data-animated="true"] .heading-underline {
    width: 100%;
}

/* --- Section Body --- */
.section-body {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
}

.section-heading[data-animated="true"] ~ .section-body,
.section-body.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-body p {
    margin-bottom: 1.2em;
    color: #3d3438;
}

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

/* --- Project Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.project-card {
    padding: 1.5rem;
    text-align: center;
}

/* --- Purikura Frame --- */
.purikura-frame {
    border: 2px solid #c9a0dc;
    border-radius: 16px;
    box-shadow: 0 0 0 4px #f5f0e8, 0 0 0 6px #d4a0a8;
    transition: box-shadow 0.3s ease-out;
}

.purikura-frame:hover {
    box-shadow: 0 0 0 4px #f5f0e8, 0 0 0 6px #d4c088;
}

.project-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.project-placeholder {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-placeholder svg {
    width: 80px;
    height: 80px;
}

.project-title {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
    color: #3d3438;
}

.project-desc {
    font-size: 0.9em;
    color: #8a7580;
    line-height: 1.6;
}

/* --- Maker Section --- */
.maker-note {
    font-style: normal;
}

.maker-signature {
    margin-top: 2rem;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: #8a7580;
    text-align: right;
}

.signature-name {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #c9a0dc;
    display: inline-block;
    margin-top: 0.3em;
}

/* --- Footer (Sticker Sheet) --- */
.sticker-footer {
    position: relative;
    background: #6b4570;
    padding: 4rem 2rem 2rem;
    margin-top: 2rem;
    overflow: hidden;
}

.footer-noise-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise2)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

.footer-stars {
    z-index: 1;
}

.sticker-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.sticker {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0.5rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: #3d3438;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.sticker.visible {
    opacity: 1;
    transform: scale(1) rotate(var(--rotation, 0deg));
}

.sticker-round {
    background: #ede4e0;
    border-radius: 50%;
    width: 90px;
    height: 90px;
    margin: 0 auto;
}

.sticker-rect {
    background: #f0e8f0;
    border-radius: 12px;
    min-height: 60px;
}

.sticker-content {
    line-height: 1.3;
}

.sticker:nth-child(1) { --rotation: -2deg; }
.sticker:nth-child(2) { --rotation: 1.5deg; }
.sticker:nth-child(3) { --rotation: 3deg; }
.sticker:nth-child(4) { --rotation: -1deg; }
.sticker:nth-child(5) { --rotation: 2deg; }
.sticker:nth-child(6) { --rotation: -2.5deg; }
.sticker:nth-child(7) { --rotation: 0.5deg; }
.sticker:nth-child(8) { --rotation: -3deg; }
.sticker:nth-child(9) { --rotation: 1deg; }
.sticker:nth-child(10) { --rotation: -1.5deg; }
.sticker:nth-child(11) { --rotation: 2.5deg; }
.sticker:nth-child(12) { --rotation: -0.5deg; }

.footer-credit {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ede4e0;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 1rem;
    font-family: 'Quicksand', sans-serif;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .scrapbook-section {
        padding: 2rem 1rem;
    }

    .section-1,
    .section-2,
    .section-3,
    .section-4 {
        margin-left: auto;
        margin-right: auto;
    }

    .section-inner {
        padding: 2rem 1.5rem;
        transform: none !important;
    }

    .charm-nav {
        gap: 1.5rem;
    }

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

    .sticker-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .sticker-round {
        width: 70px;
        height: 70px;
    }

    .controller-watermark {
        width: 200px;
        bottom: 10%;
    }
}

@media (max-width: 480px) {
    .charm-nav {
        gap: 1rem;
    }

    .charm {
        width: 35px;
        height: 35px;
    }

    .charm svg {
        width: 18px;
        height: 18px;
    }

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