/* ============================================
   lotus.dev — Crystalline Geological Design
   ============================================ */

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

:root {
    --deep-amethyst: #1a0e2e;
    --garnet-shadow: #2d1f45;
    --smoky-topaz: #3d2a5c;
    --alexandrite: #8b6fc0;
    --peridot: #a8d84e;
    --moonstone: #f0e6d3;
    --chalcedony: #d4c8b0;
    --tourmaline: #e05297;
    --citrine: #d4a843;
    --labradorite: #4a6fa5;
    --amethyst-mid: #4a3068;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', serif;
    font-weight: 400;
    font-variation-settings: 'FLAR' 50, 'VOLM' 50;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.7;
    color: var(--chalcedony);
    background: var(--deep-amethyst);
    overflow-x: hidden;
}

/* --- Crystal Navigation --- */
.crystal-nav {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

.nav-crystal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--smoky-topaz);
    transition: color 0.3s, filter 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
}

.nav-crystal:hover,
.nav-crystal.active {
    color: var(--alexandrite);
}

.nav-crystal.active {
    animation: crystal-pulse 2s infinite;
}

@keyframes crystal-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--alexandrite)); }
    50% { filter: drop-shadow(0 0 12px var(--alexandrite)); }
}

.nav-label {
    font-family: 'Commissioner', serif;
    font-weight: 200;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--alexandrite);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-crystal:hover .nav-label,
.nav-crystal.active .nav-label {
    opacity: 1;
}

/* --- Stratum Base --- */
.stratum {
    position: relative;
    overflow: hidden;
}

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

/* --- Stratum 1: Surface --- */
.stratum-surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-amethyst);
}

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

.title-crystalline {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: clamp(3rem, 12vw, 10rem);
    letter-spacing: 0.03em;
    line-height: 1;
    margin-bottom: 2rem;
    color: var(--moonstone);
}

.letter {
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, var(--crystal-color) 0%, transparent 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    filter: brightness(1.2);
}

.letter.dot {
    margin: 0 -0.02em;
}

.hex-frame {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    clip-path: polygon(5% 0, 95% 0, 100% 50%, 95% 100%, 5% 100%, 0 50%);
    background: var(--garnet-shadow);
    border: 1px solid var(--smoky-topaz);
}

.tagline {
    font-family: 'Commissioner', serif;
    font-weight: 300;
    font-variation-settings: 'FLAR' 80, 'VOLM' 80;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--chalcedony);
    line-height: 1.8;
}

.crystal-decor {
    position: absolute;
    z-index: 0;
    opacity: 0.5;
}

.crystal-decor-left {
    left: 3%;
    bottom: 5%;
}

.crystal-decor-right {
    right: 5%;
    top: 10%;
}

/* --- Crystal Dividers --- */
.crystal-divider {
    position: relative;
    z-index: 2;
    margin-top: -1px;
    margin-bottom: -1px;
    line-height: 0;
}

.divider-1 { background: var(--deep-amethyst); }
.divider-2 { background: var(--garnet-shadow); }
.divider-3 { background: var(--deep-amethyst); }
.divider-4 { background: var(--garnet-shadow); }

/* --- Stratum Titles --- */
.stratum-title {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    color: var(--moonstone);
    letter-spacing: 0.03em;
    text-align: center;
    padding: 3rem 2rem 0.5rem;
    position: relative;
    z-index: 1;
}

.stratum-subtitle {
    font-family: 'Commissioner', serif;
    font-weight: 200;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--alexandrite);
    text-align: center;
    padding: 0 2rem 2.5rem;
    position: relative;
    z-index: 1;
}

/* --- Stratum 2: The Vein --- */
.stratum-vein {
    background: var(--garnet-shadow);
    padding-bottom: 4rem;
}

/* --- Masonry Layout --- */
.masonry {
    position: relative;
    z-index: 1;
    padding: 0 3rem;
}

.masonry-vein {
    column-count: 3;
    column-gap: 24px;
    column-fill: balance;
}

.masonry-deep {
    column-count: 4;
    column-gap: 16px;
    column-fill: balance;
}

/* --- Gem Cards --- */
.gem-card {
    break-inside: avoid;
    margin-bottom: 24px;
    padding: 2rem;
    position: relative;
    background: var(--smoky-topaz);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.gem-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.gem-card h3 {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: 1.3rem;
    color: var(--moonstone);
    letter-spacing: 0.03em;
    margin-bottom: 0.8rem;
}

.gem-card p {
    color: var(--chalcedony);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card-crystal {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 50px;
    height: 50px;
    opacity: 0.4;
}

/* Gem cut shapes */
.gem-cut-emerald {
    clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
}

.gem-cut-baguette {
    clip-path: polygon(3% 0, 97% 0, 100% 3%, 100% 97%, 97% 100%, 3% 100%, 0 97%, 0 3%);
}

.gem-cut-trillion {
    clip-path: polygon(50% 2%, 98% 95%, 2% 95%);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
}

.gem-cut-marquise {
    clip-path: polygon(50% 0, 95% 25%, 100% 50%, 95% 75%, 50% 100%, 5% 75%, 0 50%, 5% 25%);
    padding: 3rem 2.5rem;
    text-align: center;
}

/* Deep cards have darker bg */
.deep-card {
    background: var(--amethyst-mid);
}

.deep-card h3 {
    font-size: 1.1rem;
}

.deep-card p {
    font-size: 0.85rem;
}

/* --- Stratum 3: Crystal Cave --- */
.stratum-cave {
    min-height: 100vh;
    background: var(--deep-amethyst);
    position: relative;
}

.cave-illustration {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.cave-crystals {
    width: 100%;
    height: 100%;
}

.cave-text-scroll {
    position: relative;
    z-index: 2;
    margin-top: -60vh;
    padding-bottom: 10vh;
}

.cave-text-block {
    max-width: 550px;
    margin: 0 auto 6rem;
    padding: 2.5rem 3rem;
    background: rgba(26, 14, 46, 0.88);
    clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.cave-text-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.cave-text-block h2 {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--moonstone);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.cave-text-block p {
    color: var(--chalcedony);
    line-height: 1.8;
}

.cave-text-block em {
    color: var(--tourmaline);
    font-style: italic;
}

/* --- Stratum 4: Deep Vein --- */
.stratum-deep {
    background: var(--garnet-shadow);
    padding-bottom: 4rem;
}

/* --- Stratum 5: Core --- */
.stratum-core {
    min-height: 100vh;
    background: var(--deep-amethyst);
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4rem 2rem;
}

.mandala-container {
    position: relative;
    width: clamp(280px, 50vw, 500px);
    height: clamp(280px, 50vw, 500px);
    margin: 0 auto 3rem;
}

.lotus-mandala {
    width: 100%;
    height: 100%;
    animation: spin 120s linear infinite;
}

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

.mandala-ring {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    animation: spin 180s linear infinite reverse;
}

.core-title {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--moonstone);
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
}

.core-text {
    max-width: 650px;
    margin: 0 auto 3rem;
    color: var(--chalcedony);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.8;
}

.core-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sig-label {
    font-family: 'Commissioner', serif;
    font-weight: 700;
    font-variation-settings: 'FLAR' 100, 'VOLM' 100;
    font-size: 1.2rem;
    color: var(--alexandrite);
}

.sig-divider {
    color: var(--smoky-topaz);
}

.sig-sub {
    font-family: 'Commissioner', serif;
    font-weight: 200;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--alexandrite);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .masonry-vein { column-count: 2; }
    .masonry-deep { column-count: 3; }
}

@media (max-width: 768px) {
    .masonry-vein { column-count: 1; }
    .masonry-deep { column-count: 2; }
    .masonry { padding: 0 1.5rem; }
    .crystal-nav { right: 0.5rem; }
    .nav-label { display: none; }
    .crystal-decor { display: none; }
}

@media (max-width: 480px) {
    .masonry-deep { column-count: 1; }
    .hex-frame { padding: 1.5rem; }
    .cave-text-block { margin-left: 1rem; margin-right: 1rem; padding: 1.5rem; }
}
