/* ============================
   gabs.boo - Wabi-Sabi Imperfect Ceramic
   Kintsugi Design System
   ============================ */

/* --- CSS Custom Properties --- */
:root {
    --bisque: #f0e6d6;
    --crack-dark: #1a1410;
    --kintsugi-gold: #c9a227;
    --aged-moss: #7a8a6a;
    --clay-warm: #c4a882;
    --shadow-umber: #3a2e24;
    --glow-amber: rgba(201, 162, 39, 0.3);
    --glow-amber-strong: rgba(201, 162, 39, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif', Georgia, serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--shadow-umber);
    background-color: var(--bisque);
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Noto Serif', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--shadow-umber);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--shadow-umber);
}

.gowun {
    font-family: 'Gowun Batang', serif;
    font-weight: 400;
}

/* --- Ceramic Texture Overlay --- */
.ceramic-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#ceramic);
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* --- Ghost Wisps --- */
.wisp {
    position: absolute;
    border-radius: 40% 60% 60% 40%;
    background: var(--glow-amber);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    animation: wisp-float 8s ease-in-out infinite;
}

.wisp-1 {
    width: 80px;
    height: 200px;
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.wisp-2 {
    width: 60px;
    height: 160px;
    top: 40%;
    right: 20%;
    animation-delay: 2.5s;
}

.wisp-3 {
    width: 50px;
    height: 140px;
    top: 60%;
    left: 60%;
    animation-delay: 5s;
}

@keyframes wisp-float {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scaleY(1.5) rotate(-5deg);
    }
    30% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.1;
        transform: translateY(-30px) scaleY(1.8) rotate(3deg);
    }
    70% {
        opacity: 0.06;
    }
}

/* ============================
   HERO SECTION
   ============================ */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bisque);
    z-index: 1;
}

.hero-depth {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--crack-dark);
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gabs-char {
    font-family: 'Gowun Batang', serif;
    font-size: clamp(8rem, 20vw, 16rem);
    color: var(--kintsugi-gold);
    opacity: 0.25;
    text-shadow: 0 0 40px var(--glow-amber), 0 0 80px var(--glow-amber);
    animation: gabs-pulse 4s ease-in-out infinite;
}

@keyframes gabs-pulse {
    0%, 100% {
        opacity: 0.2;
        text-shadow: 0 0 40px var(--glow-amber), 0 0 80px var(--glow-amber);
    }
    50% {
        opacity: 0.35;
        text-shadow: 0 0 60px var(--glow-amber-strong), 0 0 120px var(--glow-amber);
    }
}

.hero-crack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* The hero surface is clipped to reveal the dark depth through a crack */
.hero-surface {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 0,
        /* crack cutout - thin diagonal sliver */
        18% 100%,
        22% 68%,
        28% 50%,
        32% 48%,
        35% 40%,
        30% 28%,
        38% 10%,
        42% 0%,
        45% 0%,
        40% 12%,
        33% 30%,
        37% 42%,
        34% 49%,
        30% 52%,
        24% 70%,
        20% 100%
    );
}

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

/* --- Broken Circle Logo --- */
.broken-circle-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.circle-half {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--shadow-umber);
    border-radius: 50%;
}

.circle-left {
    clip-path: polygon(0 0, 48% 0, 48% 100%, 0 100%);
    transform: translateX(-2px);
}

.circle-right {
    clip-path: polygon(52% 0, 100% 0, 100% 100%, 52% 100%);
    transform: translateX(2px);
}

.circle-crack-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--kintsugi-gold) 10%,
        var(--kintsugi-gold) 30%,
        transparent 35%,
        var(--kintsugi-gold) 40%,
        var(--kintsugi-gold) 60%,
        transparent 65%,
        var(--kintsugi-gold) 70%,
        var(--kintsugi-gold) 90%,
        transparent 100%
    );
    filter: drop-shadow(0 0 4px var(--glow-amber-strong));
}

.site-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--shadow-umber);
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    /* Slightly irregular: subtle rotation for imperfect feel */
    transform: rotate(-0.5deg);
}

.site-tagline {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--clay-warm);
    font-style: italic;
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

/* ============================
   CONTENT SECTIONS
   ============================ */
.content-section {
    position: relative;
    padding: 0;
}

.section-crack {
    width: 100%;
    height: 4px;
    overflow: visible;
}

.section-crack svg {
    width: 100%;
    height: 4px;
    display: block;
}

.section-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

/* ============================
   CONCEPT SECTION
   ============================ */
#concept {
    background-color: var(--crack-dark);
    color: var(--bisque);
}

#concept h2 {
    color: var(--bisque);
}

.concept-text {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--kintsugi-gold);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.6;
}

.concept-english {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--clay-warm);
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

/* ============================
   VALUE REVEAL CARDS
   ============================ */
#reveals {
    background-color: var(--bisque);
}

.reveal-cards {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.reveal-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    min-height: 220px;
}

.card-surface {
    position: relative;
    background-color: var(--clay-warm);
    padding: 2.5rem;
    z-index: 2;
    transition: clip-path 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    min-height: 220px;
}

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

.card-surface-content h3 {
    margin-bottom: 0.75rem;
    color: var(--shadow-umber);
}

.card-surface-content p {
    color: var(--shadow-umber);
    opacity: 0.8;
    font-size: 1rem;
}

.card-crack-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0.7;
}

.card-depth {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--crack-dark);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.depth-value {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--kintsugi-gold);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.depth-value .gowun {
    font-weight: 400;
}

.depth-detail {
    color: var(--bisque);
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.9;
}

/* Card hover/active states — clip-path reveals depth */
.reveal-card.is-cracked .card-surface {
    clip-path: polygon(
        0 0,
        42% 0,
        42% 0,
        38% 30%,
        44% 50%,
        40% 70%,
        43% 100%,
        0 100%
    );
}

/* Alternate crack direction for second card */
.reveal-card[data-index="1"].is-cracked .card-surface {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 38%,
        70% 42%,
        50% 38%,
        30% 44%,
        0 40%
    );
}

/* Third card: two cracks from edges */
.reveal-card[data-index="2"].is-cracked .card-surface {
    clip-path: polygon(
        0 0,
        30% 0,
        28% 40%,
        35% 60%,
        30% 100%,
        0 100%
    );
}

/* ============================
   GALLERY / MASONRY
   ============================ */
#gallery {
    background-color: var(--crack-dark);
}

#gallery h2 {
    color: var(--bisque);
}

.masonry-grid {
    columns: 3;
    column-gap: 1.5rem;
    margin-top: 2rem;
}

.masonry-tile {
    position: relative;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.tile-tall {
    height: 320px;
}

.tile-short {
    height: 180px;
}

.tile-medium {
    height: 250px;
}

.tile-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--clay-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.tile-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.tile-icon {
    font-family: 'Gowun Batang', serif;
    font-size: 3rem;
    color: var(--shadow-umber);
}

.tile-label {
    font-family: 'Noto Serif', serif;
    font-size: 0.9rem;
    color: var(--shadow-umber);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.tile-crack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.tile-crack svg {
    width: 100%;
    height: 100%;
}

.tile-revealed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--crack-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1;
}

.tile-revealed p {
    color: var(--bisque);
    font-style: italic;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tile hover: surface fades, crack glows */
.masonry-tile:hover .tile-surface,
.masonry-tile.is-revealed .tile-surface {
    opacity: 0;
}

.masonry-tile:hover .tile-crack,
.masonry-tile.is-revealed .tile-crack {
    opacity: 1;
}

/* ============================
   CLOSING SECTION
   ============================ */
#closing {
    background-color: var(--bisque);
}

.closing-inner {
    text-align: center;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.closing-korean {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    color: var(--kintsugi-gold);
    margin-bottom: 0.75rem;
}

.closing-english {
    font-size: 1.1rem;
    color: var(--shadow-umber);
    margin-bottom: 2rem;
}

.closing-crack {
    width: 200px;
    margin: 0 auto 2rem;
}

.closing-crack svg {
    width: 100%;
    height: 60px;
}

.closing-boo {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--clay-warm);
    font-style: italic;
    opacity: 0;
    animation: boo-appear 0.5s ease forwards;
    animation-delay: 0.8s;
}

@keyframes boo-appear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    60% {
        opacity: 1;
        transform: translateY(-3px);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .masonry-grid {
        columns: 2;
        column-gap: 1rem;
    }

    .section-inner {
        padding: 3rem 1.5rem;
    }

    .tile-tall {
        height: 260px;
    }

    .tile-medium {
        height: 200px;
    }

    .tile-short {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        columns: 1;
    }

    .card-surface {
        padding: 1.5rem;
    }

    .card-depth {
        padding: 1.5rem;
    }

    .hero-surface {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 0,
            20% 100%,
            25% 68%,
            30% 50%,
            34% 48%,
            37% 40%,
            32% 28%,
            40% 10%,
            44% 0%,
            48% 0%,
            42% 12%,
            35% 30%,
            39% 42%,
            36% 49%,
            32% 52%,
            27% 70%,
            22% 100%
        );
    }
}
