/* ============================================
   a6c.boo — Glassmorphism Zen-Contemplative
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --deep-burgundy: #4a0e1b;
    --rich-burgundy: #7a1e33;
    --muted-rose: #b0596d;
    --warm-cream: #f5ece3;
    --pale-ivory: #faf6f0;
    --luminous-gold: #d4a96a;
    --glass-bg: rgba(74, 14, 27, 0.18);
    --glass-border: rgba(176, 89, 109, 0.3);
    --glass-bg-strong: rgba(74, 14, 27, 0.25);
    --scroll-progress: 0;
    --sidebar-width: 280px;
}

/* ---- Reset ---- */
*, *::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: 300;
    color: var(--pale-ivory);
    background: var(--deep-burgundy);
    overflow-x: hidden;
    line-height: 1.85;
    font-size: 1.1rem;
    min-height: 100vh;
}

/* ---- Background Gradient ---- */
#bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(
        180deg,
        var(--deep-burgundy) 0%,
        var(--rich-burgundy) calc(var(--scroll-progress) * 50%),
        var(--muted-rose) calc(var(--scroll-progress) * 80%),
        var(--warm-cream) 100%
    );
    transition: background 0.3s ease;
}

/* ---- Ink Wash Blobs ---- */
#ink-wash-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.ink-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--rich-burgundy);
    opacity: 0.07;
    filter: blur(40px);
}

.ink-blob-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    left: 60%;
    animation: inkDrift1 40s ease-in-out infinite;
}

.ink-blob-2 {
    width: 500px;
    height: 350px;
    top: 40%;
    left: 20%;
    animation: inkDrift2 50s ease-in-out infinite;
}

.ink-blob-3 {
    width: 300px;
    height: 450px;
    top: 70%;
    left: 75%;
    animation: inkDrift3 45s ease-in-out infinite;
}

.ink-blob-4 {
    width: 350px;
    height: 350px;
    top: 25%;
    left: 5%;
    animation: inkDrift4 55s ease-in-out infinite;
}

@keyframes inkDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

@keyframes inkDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 20px) scale(1.08); }
    66% { transform: translate(25px, -30px) scale(0.93); }
}

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

@keyframes inkDrift4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-25px, 35px) scale(1.04); }
    80% { transform: translate(20px, -15px) scale(0.97); }
}

/* ---- Grid Pattern ---- */
#grid-pattern {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(176, 89, 109, 0.04) 0px, rgba(176, 89, 109, 0.04) 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(90deg, rgba(176, 89, 109, 0.04) 0px, rgba(176, 89, 109, 0.04) 1px, transparent 1px, transparent 60px);
}

/* ---- Bubble Layers ---- */
.bubble-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

#bubbles-bg {
    z-index: 2;
}

#bubbles-fg {
    z-index: 20;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(212, 169, 106, 0.15),
        rgba(245, 236, 227, 0.08) 40%,
        rgba(245, 236, 227, 0.02) 70%,
        transparent
    );
    border: 1px solid rgba(245, 236, 227, 0.06);
    box-shadow: inset 0 0 6px rgba(212, 169, 106, 0.08);
    animation: bubbleRise var(--duration) cubic-bezier(0.4, 0, 0.2, 1) var(--delay) infinite;
}

.bubble::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 169, 106, 0.2), transparent);
}

@keyframes bubbleRise {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(var(--wobble)) scale(1);
        opacity: 0;
    }
}

/* ---- Sidebar (Shoji Frame) ---- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 30;
    overflow: hidden;
}

@supports (backdrop-filter: blur(10px)) {
    #sidebar {
        background: rgba(74, 14, 27, 0.35);
        backdrop-filter: blur(24px) saturate(1.3);
        -webkit-backdrop-filter: blur(24px) saturate(1.3);
        border-right: 1px solid rgba(176, 89, 109, 0.2);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    #sidebar {
        background: rgba(74, 14, 27, 0.85);
        border-right: 1px solid rgba(176, 89, 109, 0.3);
    }
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2.5rem 1.5rem;
    position: relative;
}

#sidebar-wordmark {
    margin-bottom: 3rem;
}

.wordmark-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--warm-cream);
    letter-spacing: 0.02em;
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
}

#sidebar-nav {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 1.2rem;
}

.nav-item a {
    text-decoration: none;
    display: inline-block;
    position: relative;
}

.nav-label {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--warm-cream);
    opacity: 0.7;
    transition: opacity 0.3s ease, color 0.3s ease;
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
    opacity: 1;
    color: var(--luminous-gold);
}

.nav-underline {
    display: block;
    width: 100%;
    height: 8px;
    margin-top: 2px;
    overflow: visible;
}

.nav-underline path {
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    transition: stroke-dashoffset 0.4s ease-out;
}

.nav-item:hover .nav-underline path,
.nav-item.active .nav-underline path {
    stroke-dashoffset: 0;
}

#sidebar-bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
}

.sidebar-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(212, 169, 106, 0.12),
        rgba(245, 236, 227, 0.05) 50%,
        transparent
    );
    border: 1px solid rgba(245, 236, 227, 0.05);
    animation: sidebarBubbleRise var(--duration) ease-in-out var(--delay) infinite;
}

@keyframes sidebarBubbleRise {
    0% {
        transform: translateY(200px) translateX(0);
        opacity: 0;
    }
    15% { opacity: 0.6; }
    85% { opacity: 0.6; }
    100% {
        transform: translateY(-50px) translateX(var(--wobble));
        opacity: 0;
    }
}

/* ---- Main Content Area ---- */
#main-content {
    position: relative;
    z-index: 10;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 0 3rem;
    min-height: 100vh;
}

.content-section {
    position: relative;
    min-height: 100vh;
    padding: 10vh 0;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* ---- Glass Panels ---- */
.glass-panel {
    position: relative;
    padding: 2.5rem 3rem;
    border-radius: 16px;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@supports (backdrop-filter: blur(10px)) {
    .glass-panel {
        background: var(--glass-bg);
        backdrop-filter: blur(18px) saturate(1.3);
        -webkit-backdrop-filter: blur(18px) saturate(1.3);
        border: 1px solid var(--glass-border);
        box-shadow: 0 8px 32px rgba(74, 14, 27, 0.3),
                    inset 0 1px 0 rgba(245, 236, 227, 0.1);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    .glass-panel {
        background: rgba(74, 14, 27, 0.7);
        border: 1px solid var(--glass-border);
        box-shadow: 0 8px 32px rgba(74, 14, 27, 0.4);
    }
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Panel variations */
.panel-hero {
    max-width: 700px;
    margin-top: 25vh;
    align-self: flex-start;
}

.panel-offset-right {
    max-width: 550px;
    align-self: flex-end;
    margin-right: 5%;
}

.panel-offset-left {
    max-width: 480px;
    align-self: flex-start;
    margin-left: 3%;
    margin-top: -2rem;
}

.panel-wide {
    max-width: 750px;
    align-self: center;
}

.panel-narrow-right {
    max-width: 350px;
    align-self: flex-end;
    margin-right: 8%;
}

.panel-medium-left {
    max-width: 520px;
    align-self: flex-start;
    margin-left: 5%;
}

.panel-center-large {
    max-width: 680px;
    align-self: center;
}

.panel-small-right {
    max-width: 420px;
    align-self: flex-end;
    margin-right: 10%;
}

.panel-accent {
    max-width: 500px;
    align-self: center;
    text-align: center;
    padding: 3rem 3.5rem;
}

.panel-final-message {
    max-width: 600px;
    align-self: center;
    text-align: center;
    padding: 4rem;
    margin-top: 20vh;
    margin-bottom: 20vh;
    background: rgba(74, 14, 27, 0.1);
}

.section-final {
    min-height: 80vh;
    justify-content: center;
    align-items: center;
}

/* ---- Typography ---- */
.headline {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.2rem, 5.5vw, 4.5rem);
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--warm-cream);
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
    margin-bottom: 1rem;
}

.headline-small {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.headline-final {
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--luminous-gold);
}

/* Letter-by-letter animation for hero headline */
.headline-animated {
    overflow: hidden;
}

.headline-animated .letter-reveal {
    display: inline-block;
    opacity: 0;
    animation: letterAppear 0.1s ease forwards;
    animation-play-state: paused;
}

.headline-animated.animate .letter-reveal {
    animation-play-state: running;
}

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

.body-text {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--pale-ivory);
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
}

.panel-subtitle {
    font-size: 1.2rem;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.panel-label {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-rose);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
}

.accent-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    line-height: 1.6;
    color: var(--warm-cream);
    font-style: italic;
    text-shadow: 0 0 20px rgba(120, 30, 50, 0.15);
}

.gold-accent {
    color: var(--luminous-gold);
}

/* ---- Hexagonal Clusters ---- */
.hex-cluster {
    position: absolute;
    width: 200px;
    height: 180px;
    pointer-events: none;
    z-index: 5;
}

.hex-cluster-1 {
    right: 5%;
    top: 30%;
}

.hex-cluster-2 {
    left: 2%;
    bottom: 15%;
}

/* ---- Circuit Path ---- */
#circuit-path {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ---- Mobile Navigation ---- */
#mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 0.6rem 0.5rem;
    gap: 0;
}

@supports (backdrop-filter: blur(10px)) {
    #mobile-nav {
        background: rgba(74, 14, 27, 0.45);
        backdrop-filter: blur(24px) saturate(1.3);
        -webkit-backdrop-filter: blur(24px) saturate(1.3);
        border-top: 1px solid rgba(176, 89, 109, 0.2);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    #mobile-nav {
        background: rgba(74, 14, 27, 0.9);
        border-top: 1px solid rgba(176, 89, 109, 0.3);
    }
}

.mobile-nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 0.5rem 0.25rem;
}

.mobile-nav-label {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--warm-cream);
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.mobile-nav-item.active .mobile-nav-label,
.mobile-nav-item:hover .mobile-nav-label {
    opacity: 1;
    color: var(--luminous-gold);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    #sidebar {
        display: none;
    }

    #mobile-nav {
        display: flex;
    }

    #main-content {
        margin-left: 0;
        width: 100%;
        padding: 0 1.5rem;
    }

    #grid-pattern {
        left: 0;
        width: 100%;
    }

    .glass-panel {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: stretch !important;
    }

    .panel-hero {
        margin-top: 15vh;
    }

    .content-section {
        gap: 2.5rem;
        padding: 8vh 0;
    }

    .headline {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    .headline-final {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 1.8rem 1.5rem;
    }

    .body-text {
        font-size: 1rem;
    }
}

/* ---- Selection ---- */
::selection {
    background: rgba(176, 89, 109, 0.4);
    color: var(--pale-ivory);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--deep-burgundy);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-rose);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rich-burgundy);
}
