/* ============================================================
   BBATTL.com - Wabi-Sabi Scholarly Frost
   ============================================================ */

/* CSS Custom Properties */
:root {
    --bg-frozen-parchment: #F0EDE8;
    --surface-frost-glass: rgba(255, 255, 255, 0.45);
    --text-ink-carbon: #1C1917;
    --text-weathered-slate: #6B7280;
    --accent-frozen-teal: #5B8A8A;
    --marble-vein-pale-gold: #C9B99A;
    --frost-highlight-ice: #DBEAFE;
    --deep-obsidian-mist: #1E293B;

    --font-heading: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-ui: 'Inter', 'Helvetica Neue', sans-serif;

    --frost-blur: blur(16px) saturate(1.2);
    --frost-border: 1px solid rgba(255, 255, 255, 0.18);
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-frozen-parchment);
    color: var(--text-ink-carbon);
    line-height: 1.72;
    font-size: 1.1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    cursor: none;
}

/* ============================================================
   Cursor Frost Circle
   ============================================================ */
#cursor-frost {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 10000;
    transform: translate3d(-50%, -50%, 0);
    will-change: transform, width, height;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: normal;
    opacity: 0;
}

#cursor-frost.visible {
    opacity: 1;
}

#cursor-frost.hover-text {
    width: 60px;
    height: 60px;
    background-color: rgba(91, 138, 138, 0.06);
    border-color: rgba(91, 138, 138, 0.2);
}

#cursor-frost.hover-marble {
    width: 50px;
    height: 50px;
    backdrop-filter: blur(8px) contrast(1.15) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) contrast(1.15) saturate(1.3);
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    #cursor-frost {
        display: none;
    }
}

/* ============================================================
   Navigation Pill
   ============================================================ */
#nav-pill {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
}

.nav-pill-dot {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: var(--frost-border);
    animation: pill-breathe 4s ease-in-out infinite;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: inset 0 0 12px rgba(91, 138, 138, 0.1);
}

@keyframes pill-breathe {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

#nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem 1.6rem;
    border-radius: 16px;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: var(--frost-border);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
    min-width: 140px;
}

#nav-pill:hover .nav-pill-dot {
    opacity: 0;
    transform: scale(0.8);
}

#nav-pill:hover #nav-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-ink-carbon);
    text-decoration: none;
    padding: 0.35rem 0;
    position: relative;
    transition: color 0.25s ease;
}

.nav-link:hover {
    color: var(--accent-frozen-teal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-frozen-teal);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================================
   Full Section Foundations
   ============================================================ */
.full-section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ============================================================
   Marble Background
   ============================================================ */
.marble-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            #F0EDE8 0%,
            #E8E4DE 15%,
            #F2EFEA 30%,
            #E5E1DA 45%,
            #F0EDE8 55%,
            #EBE7E0 70%,
            #F3F0EB 85%,
            #E9E5DF 100%
        );
    background-size: cover;
}

.marble-veins {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vein {
    fill: none;
    stroke: var(--marble-vein-pale-gold);
    stroke-width: 1.2;
    opacity: 0.4;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2.5s ease-out;
}

.vein.animate-in {
    stroke-dashoffset: 0;
}

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

.sigil-watermark {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-ink-carbon);
    opacity: 0.04;
    pointer-events: none;
}

/* ============================================================
   Scan Lines (Futuristic Motif)
   ============================================================ */
.scan-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(91, 138, 138, 0.08) 20%, rgba(91, 138, 138, 0.08) 80%, transparent 100%);
}

/* ============================================================
   Section 1: Hero
   ============================================================ */
#section-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-frozen-parchment);
}

.hero-circular-reveal {
    position: relative;
    z-index: 3;
    width: clamp(280px, 45vw, 520px);
    height: clamp(280px, 45vw, 520px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: circle(50%);
    overflow: hidden;
}

.hero-frost-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: var(--frost-border);
    border-radius: 50%;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-ink-carbon);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: var(--font-ui);
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-weathered-slate);
}

/* ============================================================
   Section Grid (Two-column: Content + Annotation)
   ============================================================ */
.section-grid {
    display: grid;
    grid-template-columns: 1fr 20px minmax(200px, 0.55fr) 60px minmax(150px, 0.3fr) 1fr;
    min-height: 100vh;
    align-content: center;
    padding: 8vh 0;
}

.content-column {
    grid-column: 3 / 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.annotation-column {
    grid-column: 5 / 6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    position: relative;
}

/* Section Headings */
.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-ink-carbon);
    margin-bottom: 0.5rem;
}

.section-heading-light {
    color: var(--bg-frozen-parchment);
}

/* Body Text */
.body-text {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    color: var(--text-ink-carbon);
}

.body-text-light {
    color: rgba(240, 237, 232, 0.9);
}

/* Hand-drawn underline for links inside body */
.body-text a {
    color: var(--accent-frozen-teal);
    text-decoration: none;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='6' viewBox='0 0 100 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,3 Q10,1 20,3 T40,3 T60,3 T80,3 T100,3' fill='none' stroke='%235B8A8A' stroke-width='1' opacity='0.6'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: 0 100%;
    background-size: 100px 6px;
    padding-bottom: 2px;
}

/* ============================================================
   Annotations
   ============================================================ */
.annotation {
    padding: 1rem 0;
    border-left: 1px solid rgba(201, 185, 154, 0.3);
    padding-left: 1rem;
}

.annotation-label {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-frozen-teal);
    display: block;
    margin-bottom: 0.4rem;
}

.annotation-text {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-weathered-slate);
}

/* Node Indicator */
.node-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-frozen-teal);
    opacity: 0.5;
    position: relative;
    margin-left: -3px;
}

.node-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--accent-frozen-teal);
    opacity: 0.5;
}

/* Pull Quote */
.pull-quote {
    width: clamp(160px, 100%, 220px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: 1px solid var(--marble-vein-pale-gold);
    transform: rotate(-2deg);
}

.pull-quote-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-ink-carbon);
}

/* Wavy Divider */
.wavy-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
}

/* ============================================================
   Section 2: Concept
   ============================================================ */
.section-light {
    background-color: var(--bg-frozen-parchment);
    position: relative;
}

#section-concept {
    position: relative;
}

/* ============================================================
   Section 3: Fracture / Crack Reveal
   ============================================================ */
.section-fracture {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fracture-marble-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.marble-bg-fracture {
    position: absolute;
    inset: 0;
}

.crack-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.crack {
    fill: none;
    stroke: var(--deep-obsidian-mist);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1.8s ease-out;
    opacity: 0.7;
}

.crack.animate-in {
    stroke-dashoffset: 0;
}

.fracture-teal-layer {
    position: relative;
    z-index: 3;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(91, 138, 138, 0.0) 0%, rgba(91, 138, 138, 0.85) 30%, rgba(30, 41, 59, 0.95) 100%);
    opacity: 0;
    transition: opacity 1.5s ease-out 0.5s;
    padding: 4rem 2rem;
}

.section-fracture.revealed .fracture-teal-layer {
    opacity: 1;
}

.fracture-content {
    max-width: 600px;
    text-align: center;
}

.fracture-content .section-heading {
    margin-bottom: 1.5rem;
}

/* ============================================================
   Section 4: Gallery
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.gallery-card {
    border-radius: 48% 52% 50% 50% / 50% 50% 48% 52%;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: var(--frost-border);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(91, 138, 138, 0.1);
}

.gallery-card-inner {
    padding: 2rem 1.5rem;
    text-align: center;
}

.gallery-card-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--marble-vein-pale-gold);
    display: block;
    margin-bottom: 0.5rem;
}

.gallery-card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-ink-carbon);
    margin-bottom: 0.6rem;
}

.gallery-card-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-weathered-slate);
}

/* ============================================================
   Section 5: Close
   ============================================================ */
#section-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-frozen-parchment);
    position: relative;
}

.close-frost-panel {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: 3.5rem 3rem;
    border-radius: 20px;
    background: var(--surface-frost-glass);
    backdrop-filter: var(--frost-blur);
    -webkit-backdrop-filter: var(--frost-blur);
    border: var(--frost-border);
    text-align: center;
}

.close-quote-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    line-height: 1.45;
    color: var(--text-ink-carbon);
    letter-spacing: -0.01em;
}

.close-sigil {
    margin: 2rem auto 1rem;
    opacity: 0.5;
}

.close-domain {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-weathered-slate);
}

/* Hairline Cracks Background */
.hairline-cracks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hairline-crack {
    fill: none;
    stroke: var(--marble-vein-pale-gold);
    stroke-width: 0.8;
    opacity: 0.15;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background-color: var(--deep-obsidian-mist);
    padding: 2.5rem 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: rgba(240, 237, 232, 0.6);
}

.footer-year {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--marble-vein-pale-gold);
    opacity: 0.6;
}

/* ============================================================
   Animations: Section Fade-In
   ============================================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

[data-animate="fade-up-slow"] {
    transition-duration: 1.3s;
    transition-delay: 0.15s;
}

[data-animate].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .section-grid {
        grid-template-columns: 1fr;
        padding: 6vh 1.5rem;
        gap: 3rem;
    }

    .content-column,
    .annotation-column {
        grid-column: 1 / -1;
    }

    .annotation-column {
        padding-left: 0;
        border-left: none;
    }

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

    #nav-pill {
        top: 1rem;
        right: 1rem;
    }

    .hero-circular-reveal {
        width: clamp(240px, 70vw, 360px);
        height: clamp(240px, 70vw, 360px);
    }

    .pull-quote {
        width: 180px;
    }

    .close-frost-panel {
        margin: 0 1.5rem;
        padding: 2.5rem 2rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .section-heading {
        font-size: 1.6rem;
    }

    .section-grid {
        padding: 4vh 1rem;
    }
}

/* ============================================================
   Touch Ripple (Mobile)
   ============================================================ */
.touch-ripple {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 138, 138, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%) scale(0);
    animation: touch-ripple-anim 0.6s ease-out forwards;
}

@keyframes touch-ripple-anim {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}
