/* gabs.cx -- Art Deco Vault */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1A1A1E;
    --bg-secondary: #242428;
    --gold: #C5A55A;
    --gold-light: #E8D5A3;
    --cream: #F0EAD6;
    --ruby: #6B2D3E;
    --verdigris: #4A7C6F;
    --shadow: #0D0D10;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.75;
    color: var(--cream);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* ===================== OVERLAYS ===================== */

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.fan-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background:
        repeating-conic-gradient(from 0deg at 50% 100%, transparent 0deg, transparent 8deg, rgba(197, 165, 90, 0.3) 8deg, rgba(197, 165, 90, 0.3) 9deg, transparent 9deg, transparent 18deg);
    background-size: 80px 80px;
}

.section {
    min-height: 100vh;
    position: relative;
}

/* ===================== WATERMARKS ===================== */

.watermark-bg {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: 40vw;
    color: var(--cream);
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

.scale-wm {
    font-family: 'Noto Serif JP', serif;
    font-size: 30vw;
}

/* ===================== VAULT DOOR (HERO) ===================== */

#vault-door {
    display: flex;
    align-items: center;
    justify-content: center;
}

.octagon-frame {
    position: relative;
    width: clamp(280px, 50vw, 500px);
    height: clamp(280px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: var(--bg-secondary);
    z-index: 2;
    transform: rotate(0deg);
    animation: vaultRotate 1.2s ease-out forwards;
}

@keyframes vaultRotate {
    from { transform: rotate(-1deg); opacity: 0.5; }
    to { transform: rotate(0deg); opacity: 1; }
}

.octagon-border {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    border: 1px solid var(--gold);
    pointer-events: none;
}

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

.domain-name {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
}

.domain-name span {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 0.3s ease forwards;
}

.translations {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: center;
}

.trans-item {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.trans-item:nth-child(1) { font-family: 'Noto Serif KR', serif; font-weight: 300; }
.trans-item:nth-child(2) { font-family: 'Noto Serif JP', serif; font-weight: 300; }

.trans-item.visible {
    opacity: 1;
}

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

/* ===================== APPRAISAL GALLERY ===================== */

#gallery {
    padding: 100px 40px;
    min-height: 180vh;
}

.bento-gallery {
    display: grid;
    grid-template-areas:
        "main main side1"
        "sub1 sub2 side1"
        "sub3 sub3 side2";
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.vitrine {
    background: var(--bg-secondary);
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    padding: 40px 32px;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    min-height: 200px;
    box-shadow: inset 0 0 30px rgba(197, 165, 90, 0.08);
    transition: box-shadow 0.4s ease;
}

.vitrine:hover {
    box-shadow: inset 0 0 40px rgba(197, 165, 90, 0.15);
}

.vitrine[data-area="main"] { grid-area: main; min-height: 280px; }
.vitrine[data-area="side1"] { grid-area: side1; }
.vitrine[data-area="sub1"] { grid-area: sub1; }
.vitrine[data-area="sub2"] { grid-area: sub2; }
.vitrine[data-area="sub3"] { grid-area: sub3; }
.vitrine[data-area="side2"] { grid-area: side2; }

.vitrine::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    border: 1px solid var(--gold);
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.vitrine:hover::after {
    opacity: 0.8;
}

.vitrine-front,
.vitrine-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.vitrine-front {
    position: relative;
}

.vitrine-back {
    display: none;
}

.vitrine.flipped .vitrine-front {
    display: none;
}

.vitrine.flipped .vitrine-back {
    display: flex;
}

.vitrine h2 {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
}

.vitrine p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.7;
}

/* ===================== SCALE ENTRY ===================== */

.scale-entry {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-entry.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ===================== THE SCALE ===================== */

#the-scale {
    padding: 100px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scale-layout {
    display: flex;
    gap: 40px;
    max-width: 1000px;
    align-items: center;
}

.scale-text-left,
.scale-text-right {
    flex: 0 0 30%;
}

.scale-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 12px;
}

.scale-text-left p,
.scale-text-right p {
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.7;
}

.scale-svg-container {
    flex: 0 0 auto;
}

#scale-beam-g {
    transition: transform 0.8s ease-out;
}

/* ===================== INSCRIPTION ===================== */

#inscription {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 80px 40px;
}

.inscription-content {
    text-align: center;
}

.inscription-domain {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    transform: rotate(-2deg);
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.inscription-domain.revealed {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
}

.inscription-proverb {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.inscription-proverb::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 1s ease, left 1s ease;
}

.inscription-proverb.underlined::after {
    width: 100%;
    left: 0;
}

.inscription-meaning {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--cream);
    opacity: 0.5;
    margin-top: 16px;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 900px) {
    .bento-gallery {
        grid-template-areas:
            "main"
            "side1"
            "sub1"
            "sub2"
            "sub3"
            "side2";
        grid-template-columns: 1fr;
    }

    .scale-layout {
        flex-direction: column;
        text-align: center;
    }

    .scale-text-left,
    .scale-text-right {
        flex: auto;
    }
}

@media (max-width: 600px) {
    #gallery {
        padding: 60px 20px;
    }

    .vitrine {
        padding: 28px 20px;
        min-height: 160px;
    }
}
