/* ==========================================================================
   monopole.design — Wabi-Sabi Design Atelier
   Colors: #2A3A3A, #4A5A5A, #7A8A8A, #F4F2EE, #1A3040, #90B0A0, #C0A890
   Fonts: DM Serif Display, Karla, Caveat
   ========================================================================== */

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

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

body {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: #4A5A5A;
    background-color: #F4F2EE;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
.section-heading {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #2A3A3A;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-body {
    color: #4A5A5A;
    max-width: 640px;
    margin-bottom: 1.2rem;
}

.caveat-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    color: #7A8A8A;
}

/* --- Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Bubble Blobs --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    background-color: #90B0A0;
    opacity: 0.1;
    border-radius: 40% 60% 55% 45%;
    will-change: transform;
}

.bubble-1 {
    width: 320px;
    height: 280px;
    top: 10%;
    left: -5%;
    animation: blobDrift1 25s ease-in-out infinite;
}

.bubble-2 {
    width: 200px;
    height: 240px;
    top: 60%;
    right: -3%;
    border-radius: 55% 45% 40% 60%;
    animation: blobDrift2 30s ease-in-out infinite;
}

.bubble-3 {
    width: 160px;
    height: 180px;
    top: 30%;
    left: 70%;
    border-radius: 60% 40% 50% 50%;
    animation: blobDrift3 20s ease-in-out infinite;
}

.bubble-4 {
    width: 260px;
    height: 220px;
    top: 75%;
    left: 15%;
    border-radius: 45% 55% 60% 40%;
    animation: blobDrift4 28s ease-in-out infinite;
}

.bubble-5 {
    width: 140px;
    height: 160px;
    top: 5%;
    left: 50%;
    border-radius: 50% 50% 45% 55%;
    animation: blobDrift5 22s ease-in-out infinite;
}

.bubble-6 {
    width: 180px;
    height: 200px;
    top: 45%;
    left: 30%;
    border-radius: 55% 45% 50% 50%;
    animation: blobDrift1 35s ease-in-out infinite reverse;
}

.bubble-7 {
    width: 100px;
    height: 120px;
    top: 85%;
    left: 65%;
    border-radius: 45% 55% 55% 45%;
    animation: blobDrift3 18s ease-in-out infinite reverse;
}

@keyframes blobDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(40px, -30px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-20px, 20px) rotate(-3deg) scale(0.95); }
    75% { transform: translate(30px, 10px) rotate(4deg) scale(1.02); }
}

@keyframes blobDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, -40px) rotate(-4deg); }
    66% { transform: translate(20px, 30px) rotate(3deg); }
}

@keyframes blobDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-25px, 35px) scale(1.08); }
}

@keyframes blobDrift4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(3deg); }
    75% { transform: translate(-35px, 15px) rotate(-5deg); }
}

@keyframes blobDrift5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    40% { transform: translate(30px, 20px) rotate(6deg) scale(1.03); }
    80% { transform: translate(-15px, -25px) rotate(-2deg) scale(0.97); }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

#hero-bg-tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 60%, rgba(26, 48, 64, 0.12) 0%, transparent 70%);
    z-index: 0;
    transition: opacity 0.8s ease;
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 1.2s ease 0.3s forwards;
}

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

#hero-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #2A3A3A;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-dot {
    color: #C0A890;
}

#hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #7A8A8A;
    opacity: 0;
    animation: heroSubFadeIn 1s ease 1s forwards;
}

@keyframes heroSubFadeIn {
    to {
        opacity: 1;
    }
}

#scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    opacity: 0;
    animation: scrollHintIn 1s ease 1.8s forwards;
}

@keyframes scrollHintIn {
    to { opacity: 0.6; }
}

#scroll-hint .caveat-text {
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

#scroll-line {
    width: 1px;
    height: 40px;
    background: #7A8A8A;
    opacity: 0.4;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.4; }
    50% { transform: scaleY(0.5); opacity: 0.15; }
}

/* --- Glitch Dividers --- */
.glitch-divider {
    position: relative;
    width: 100%;
    height: 3px;
    margin: 0;
    overflow: hidden;
    z-index: 2;
}

.glitch-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-r {
    background: rgba(192, 168, 144, 0.6);
    transform: translateX(0);
}

.glitch-g {
    background: rgba(144, 176, 160, 0.4);
    transform: translateX(0);
}

.glitch-b {
    background: rgba(42, 58, 58, 0.3);
    transform: translateX(0);
}

.glitch-divider.glitching .glitch-r {
    animation: glitchR 0.4s steps(3) forwards;
}

.glitch-divider.glitching .glitch-g {
    animation: glitchG 0.4s steps(4) forwards;
}

.glitch-divider.glitching .glitch-b {
    animation: glitchB 0.4s steps(3) forwards;
}

@keyframes glitchR {
    0% { transform: translateX(0); }
    25% { transform: translateX(4px); }
    50% { transform: translateX(-2px); }
    75% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

@keyframes glitchG {
    0% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

@keyframes glitchB {
    0% { transform: translateX(0); }
    33% { transform: translateX(2px); }
    66% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

/* --- Sections General --- */
section {
    position: relative;
    z-index: 1;
    padding: 6rem 1.5rem;
}

.section-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.section-note {
    font-size: 1.1rem;
    margin-top: 1rem;
    display: block;
}

/* --- Philosophy Section --- */
#philosophy {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

#philosophy .section-body {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    max-width: 700px;
}

/* --- Cards Section --- */
#works {
    padding-top: 4rem;
    padding-bottom: 6rem;
}

#card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

.work-card {
    position: relative;
    background: #F4F2EE;
    border: 1px solid rgba(42, 58, 58, 0.08);
    border-radius: 4px;
    padding: 2rem;
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease;
    cursor: default;
}

.work-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(30, 50, 60, 0.08);
}

.card-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(192, 168, 144, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-number {
    font-size: 1.8rem;
    color: #C0A890;
    display: block;
    margin-bottom: 0.5rem;
}

.card-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 1.4rem;
    color: #2A3A3A;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.95rem;
    color: #4A5A5A;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.card-tag {
    font-size: 1rem;
    color: #7A8A8A;
}

/* --- Principles Section --- */
#principles {
    background-color: rgba(26, 48, 64, 0.03);
    padding-top: 5rem;
    padding-bottom: 5rem;
}

#principles-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.principle-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 700px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.principle-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.principle-num {
    font-size: 2rem;
    color: #C0A890;
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: right;
}

.principle-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 1.25rem;
    color: #2A3A3A;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.principle-desc {
    font-size: 0.95rem;
    color: #4A5A5A;
    line-height: 1.8;
}

/* --- Studio Section --- */
#studio {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

#studio-content {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

#studio-text {
    flex: 1;
}

#studio-text .section-body {
    max-width: 560px;
}

#studio-visual {
    position: relative;
    flex-shrink: 0;
    width: 240px;
    height: 280px;
}

#studio-shape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #90B0A0 0%, #C0A890 100%);
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    opacity: 0.2;
    animation: shapeFloat 12s ease-in-out infinite;
}

#studio-shape-shadow {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 100%;
    height: 100%;
    background: rgba(26, 48, 64, 0.05);
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    animation: shapeFloat 12s ease-in-out infinite;
    animation-delay: -0.5s;
}

@keyframes shapeFloat {
    0%, 100% {
        border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%;
        transform: rotate(5deg);
    }
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    padding: 5rem 1.5rem 3rem;
    background: rgba(26, 48, 64, 0.04);
}

#contact-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-item {
    font-size: 1.2rem;
}

.contact-divider {
    color: #C0A890;
    opacity: 0.5;
}

#footer-mark {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(42, 58, 58, 0.08);
}

#footer-mark .caveat-text {
    font-size: 1rem;
    color: #7A8A8A;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    section {
        padding: 4rem 1.25rem;
    }

    #card-grid {
        grid-template-columns: 1fr;
    }

    #studio-content {
        flex-direction: column;
        gap: 2rem;
    }

    #studio-visual {
        width: 180px;
        height: 210px;
        align-self: center;
    }

    .principle-item {
        gap: 1rem;
    }

    .principle-num {
        min-width: 2rem;
    }

    #contact-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    #hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .work-card {
        padding: 1.5rem;
    }
}
