:root {
    --bg-color: #ffffff;
    --text-primary: #3b2f2f;
    --text-secondary: #7c6a6a;
    --accent-color: #d4a373;

    /* Trunk colors */
    --bark-color: #4a3b32;
    --ring-base: #e6d5c3;
    --ring-alt: #d4c4b1;
    --ring-hover: #faedcd;
    --ring-stroke: #c2aa92;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f5f7fa;
    /* Light grey backdrop */
    color: #333;
    overflow: hidden;
    /* Prevent scroll on pure interactive split screen */
    height: 100vh;
}

.container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* LEFT PANEL (3D TRUNK) */
.left-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f3f8 0%, #e1e5eb 100%);
    perspective: 1000px;
    padding: 2rem;
    position: relative;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.svg-container {
    width: 100%;
    max-width: 600px;
    /* Constrains the physical CSS box size */
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
    /* CSS 3D illusion to lay it flat and tilt it */
    transform: rotateX(55deg) rotateZ(-15deg);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: crosshair;
}

.svg-container:hover {
    transform: rotateX(25deg) rotateZ(0deg) scale(1.30);
}

.trunk-svg,
.trunk-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.trunk-svg {
    z-index: 10;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.2));
}

.trunk-svg-layer {
    z-index: 1;
}

.ring {
    fill: none;
    stroke: var(--ring-stroke);
    stroke-width: 1.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ring-fill {
    transition: all 0.4s ease;
    cursor: pointer;
}

g.ring-group {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

g.ring-group:hover .ring-fill {
    fill: var(--ring-hover);
    filter: brightness(1.1);
}

g.ring-group:hover .ring {
    stroke: var(--bark-color);
    stroke-width: 2.5;
}

/* Optional: Slight 3D extrusion effect on hover */
g.ring-group:hover {
    transform: translateZ(35px) scale(1.01);
}

.ring-text {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    /* scaled down to fit cleanly inside rings */
    font-weight: 800;
    fill: var(--bark-color);
    text-anchor: middle;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    /* Let hovers pass through */
    letter-spacing: 2px;
}

g.ring-group:hover .ring-text {
    opacity: 1;
}

/* RIGHT PANEL (INFO) */
.right-panel {
    flex: 1;
    padding: 4rem 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #f9fbfd;
    position: relative;
}

.info-content {
    max-width: 600px;
}

.main-title {
    font-size: 3.5rem;
    /* Slightly smaller to fit */
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
    color: var(--bark-color);
    margin-bottom: 0.5rem;
    line-height: 1;
    white-space: nowrap;
    /* Force one line */
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4rem;
}

.dynamic-content {
    background: rgba(250, 237, 205, 0.1);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(212, 163, 115, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.02);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s ease;
}

.dynamic-content.active {
    background: rgba(250, 237, 205, 0.3);
    border-color: rgba(212, 163, 115, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05);
}

#topic-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--bark-color);
    transition: opacity 0.3s ease;
}

#topic-desc {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    transition: opacity 0.3s ease;
}

/* ========================================= */
/* THEME CONTROLS                            */
/* ========================================= */
.theme-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 8px 12px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: background 0.5s ease;
}

.theme-btn {
    border: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    color: #4a3e35;
}

.theme-btn.active {
    background: #4a3e35;
    color: white;
    box-shadow: 0 4px 10px rgba(74, 62, 53, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        overflow-y: auto;
    }

    .left-panel,
    .right-panel {
        width: 100%;
        padding: 2rem;
    }

    .left-panel {
        height: 50vh;
        min-height: 400px;
    }

    .right-panel {
        height: auto;
        min-height: 50vh;
    }

    .svg-container {
        transform: rotateX(20deg) rotateZ(0deg);
    }

    .main-title {
        font-size: 3rem;
    }
}