/* CSS Variables */
:root {
    --primary-bg: #0A192F;
    --secondary-bg: #172A45;
    --primary-text: #CCD6F6;
    --heading-text: #E6F1FF;
    --accent1: #64FFDA;
    --accent2: #FFBF69;
    --primary-text-rgb: 204, 214, 246; /* For rgba usage */
    --accent1-rgb: 100, 255, 218;


    --font-body: 'Inter', sans-serif;
    --font-heading: 'Roboto Mono', monospace;

    --nav-height-universal: 60px; /* Consistent header height */
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; 
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.75; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative; /* For content dimming overlay */
}

body.body-no-scroll {
    overflow: hidden;
}
body::before { /* Content dimming overlay */
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1020; /* Below menu, above main content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
body.body-no-scroll::before {
    opacity: 1;
    visibility: visible;
}


/* Typography Styling */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading-text);
    margin-top: 1.75em; 
    margin-bottom: 1em; 
    line-height: 1.3;
}

h1 {
    font-size: 3rem; 
    margin-top: 0; 
    margin-bottom: 1em;
}

h2 {
    font-size: 2.25rem; 
    margin-top: 2.5em; 
    margin-bottom: 1.25em; 
    border-bottom: 2px solid var(--accent1);
    padding-bottom: 0.5rem;
    display: inline-block;
}
section:first-of-type h2 { 
    margin-top: 0em; 
}
#executive-summary h2 { 
     margin-top: 0em;
}


h3 {
    font-size: 1.75rem; 
    color: var(--accent1);
    margin-top: 2em;
    margin-bottom: 1em;
}

h4 { 
    font-size: 1.4rem; 
    color: var(--accent2);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.card h4 { 
    font-size: 1.25rem; 
    margin-top: 0; 
    margin-bottom: 1em; 
    color: var(--accent1);
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--accent2);
    padding-bottom: 0.6em; 
}
.visualization-container > h4 { /* Table titles */
    font-size: 1.6rem; 
    color: var(--heading-text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--secondary-bg);
    text-align: left;
}


p {
    margin-bottom: 1.5em; 
}

a {
    color: var(--accent1);
    text-decoration: none;
    transition: color 0.3s ease, filter 0.3s ease;
}

a:hover,
a:focus {
    color: var(--accent2);
    text-decoration: underline;
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height-universal); 
    background-color: rgba(10, 25, 47, 0.85); 
    backdrop-filter: blur(10px); 
    z-index: 1060; 
    padding: 0 20px; 
    display: flex;
    align-items: center;
    /* justify-content: space-between; Removed */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative; /* Added */
}

header .logo { /* Added flex-grow and text-align */
    flex-grow: 1;
    text-align: center;
}

header .logo a {
    font-family: var(--font-heading);
    font-size: 1.25rem; 
    color: var(--heading-text);
    font-weight: 600; 
    white-space: nowrap; 
    /* To ensure the link itself is centered if it were a block element with width */
    /* display: inline-block; /* or display: block; margin: 0 auto; */
}
header .logo a:hover {
    color: var(--accent1);
    text-decoration: none;
}

/* Hamburger Button - Always visible */
.hamburger-button {
    display: flex; 
    flex-direction: column;
    justify-content: space-around;
    width: 40px; 
    height: 40px; 
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px; 
    z-index: 1100; 
    position: absolute; /* Modified */
    right: 20px; /* Added */
    top: 50%; /* Added */
    transform: translateY(-50%); /* Added */
}

.hamburger-button .hamburger-line {
    display: block;
    width: 100%; 
    height: 3px;
    background-color: var(--heading-text);
    margin: 0; 
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), 
                opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
                background-color 0.3s ease;
}
.hamburger-button .hamburger-line:nth-child(1) {
    transform-origin: top left;
}
.hamburger-button .hamburger-line:nth-child(3) {
    transform-origin: bottom left;
}


.hamburger-button:hover .hamburger-line {
    background-color: var(--accent1);
}
/* Animation to X */
.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(2px, -3px);
}
.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(10px); 
}
.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(2px, 3px);
}


/* Universal Side Panel Menu */
.mobile-menu { 
    position: fixed;
    top: 0;
    right: 0;
    width: clamp(280px, 70vw, 400px); 
    height: 100%;
    background-color: var(--secondary-bg); 
    z-index: 1050; 
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    justify-content: flex-start; 
    padding-top: calc(var(--nav-height-universal) + 20px); /* Space for close button + header */
    padding-bottom: 20px;
    padding-left: 25px;
    padding-right: 25px; 
    transform: translateX(100%);
    visibility: hidden; 
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.mobile-menu.is-open {
    transform: translateX(0);
    visibility: visible;
}

.mobile-menu ul {
    list-style: none;
    text-align: left; 
    width: 100%; 
    flex-grow: 1; /* Allow ul to take available vertical space */
    overflow-y: auto; /* Enable vertical scrollbar if content overflows */
    padding-right: 10px; /* Space for scrollbar to avoid content overlap, adjust as needed */
    margin-right: -10px; /* Counteract padding-right for layout purposes if scrollbar is not present */
    
    /* For Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--accent1) var(--secondary-bg); /* thumb track */
}
/* Webkit scrollbar for UL inside mobile-menu */
.mobile-menu ul::-webkit-scrollbar {
    width: 8px;
}
.mobile-menu ul::-webkit-scrollbar-track {
    background: var(--secondary-bg); 
}
.mobile-menu ul::-webkit-scrollbar-thumb {
    background: var(--accent1);
    border-radius: 4px;
}
.mobile-menu ul::-webkit-scrollbar-thumb:hover {
    background: var(--accent2);
}


.mobile-menu ul li {
    margin: 10px 0; /* Reduced margin for tighter list */
}

.mobile-menu ul li a {
    font-family: var(--font-body); 
    font-size: 1.1rem; /* Slightly smaller for more items */ 
    color: var(--primary-text); 
    padding: 10px 5px; /* Adjust padding */
    display: block; 
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a.active {
    color: var(--accent1);
    background-color: rgba(var(--accent1-rgb), 0.05); 
}

.mobile-menu .order-project-btn {
    display: block; /* Make it block to take full width */
    background-color: var(--accent1);
    color: var(--primary-bg);
    padding: 12px 15px; /* Adjust padding */
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 1rem; 
    font-size: 1.1rem;
}
.mobile-menu .order-project-btn:hover {
    background-color: var(--accent2);
    color: var(--primary-bg);
    text-decoration: none;
}

.mobile-menu .menu-divider {
    height: 1px;
    background-color: rgba(var(--primary-text-rgb), 0.2);
    margin: 15px 0; 
    list-style: none; 
}


.close-menu-button {
    position: absolute;
    top: 12px; /* Align with header padding and hamburger size */
    right: 20px; 
    background: none;
    border: none;
    color: var(--accent1);
    font-size: 2.2rem; 
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.close-menu-button:hover {
    color: var(--accent2);
}


/* Main Content Sections - Increased whitespace */
main {
}

section {
    padding: 120px 80px; 
    min-height: auto; 
}
section:first-of-type { 
    padding: 0; 
}

/* Wrapper for general text content within sections for better readability */
.content-wrapper {
    max-width: 900px; 
    margin-left: auto;
    margin-right: auto;
}
.content-wrapper > p, 
.content-wrapper > ul, 
.content-wrapper > ol {
    margin-bottom: 1.5em; 
}
.content-wrapper > h3,
.content-wrapper > h4 { 
    margin-top: 2em;
}


section:last-of-type {
    border-bottom: none;
}

#your-element-selector {
    min-height: calc(100vh - var(--nav-height-universal)); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 30px; 
    position: relative; /* Added for Vanta.js integration */
    /* HERO BACKGROUND IMAGE: Replace 'placeholder-hero-bg.jpg' with a high-quality,
       abstract image fitting an ultra-modern AI/DAO theme (e.g., plexus network,
       geometric design, data visualization motif, or stylized nebula/space).
       Ensure the image is web-optimized for performance. */
    /* background: linear-gradient(rgba(10, 25, 47, 0.8), rgba(10, 25, 47, 0.8)), url('placeholder-hero-bg.jpg') no-repeat center center/cover; Removed for Vanta.js */
}

#your-element-selector h1 {
    font-size: 3.2rem; 
    max-width: 900px; 
    margin-bottom: 1em;
}
#your-element-selector p {
    font-size: 1.25rem; 
    color: var(--accent1);
    margin-top: 0.5em;
}


/* Footer - Increased whitespace */
footer {
    background-color: var(--secondary-bg);
    color: var(--primary-text);
    text-align: center;
    padding: 50px 30px; 
}

footer p {
    margin-bottom: 0.75rem; 
}

footer a {
    color: var(--accent1);
}
footer a:hover {
    color: var(--accent2);
}
footer .footer-copyright-link {
    font-size: 0.9rem;
    color: var(--primary-text); 
}
footer .footer-copyright-link:hover {
    color: var(--accent1);
}



/* --- Enhanced List and Card Styles --- */
.visual-list-container {
    margin-top: 2.5rem; 
    margin-bottom: 2.5rem; 
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2.5rem; 
    margin-top: 2rem; 
}

.card {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    padding: 2.25rem; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.25); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--accent1); 
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(var(--accent1-rgb), 0.1); 
}

/* Disable hover effects for cards within table-like structures */
.visualization-container .card:hover,
.table-card-grid .card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25); /* Revert to original shadow if needed, or set to none */
}


/* Card h4 already defined in Typography section */

.card h5 {
    color: var(--heading-text);
    font-size: 1.15rem; 
    margin-bottom: 0.6em;
    font-family: var(--font-heading);
}


/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background-color: var(--accent1);
    color: var(--primary-bg);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    line-height: 50px;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.scroll-top-btn:hover {
    background-color: var(--accent2);
    color: var(--primary-bg);
    text-decoration: none; /* Ensure no underline on hover */
}

.card p {
    font-size: 1rem; 
    margin-bottom: 0.75em; 
    line-height: 1.7;
}

.card p strong { 
    color: var(--accent1); 
    font-weight: 600;
    margin-right: 0.5em; 
}

.card ul {
    list-style: none; 
    padding-left: 0;
}

.card ul li {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    padding-left: 1.2em;
    position: relative;
}

.card ul li::before {
    content: '»'; 
    position: absolute;
    left: 0;
    color: var(--accent1);
    font-weight: bold;
}

/* Specific styling for table-like cards */
.table-card-grid .card p {
    /* display: flex; removed */
    /* justify-content: space-between; removed */
    border-bottom: 1px solid rgba(var(--primary-text-rgb), 0.1); 
    padding-bottom: 0.5rem;
    margin-bottom: 1em; /* Added to separate p elements more clearly */
}
.table-card-grid .card p:last-child {
    border-bottom: none;
    margin-bottom: 0; /* No margin for the last p in a card */
}

.table-card-grid .card p strong {
    color: var(--accent1); 
    /* margin-right: 10px; removed */
    /* flex-shrink: 0; removed */
    display: block; /* Added */
    margin-bottom: 0.25em; /* Added */
}
.table-card-grid .card p span {
    text-align: left; 
    color: var(--primary-text);
    /* flex-grow: 1; removed */
    word-break: break-word; 
    display: block; /* Added */
}

/* Enhanced List Styling */
.enhanced-list {
    list-style: none;
    padding-left: 0;
    margin-top: 1.5rem; 
}

.enhanced-list li {
    background-color: var(--secondary-bg);
    padding: 1.25rem 1.75rem; 
    margin-bottom: 1rem; 
    border-radius: 6px;
    border-left: 4px solid var(--accent2); 
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

.enhanced-list li:hover {
    background-color: #2A3F5E; 
}

.enhanced-list li strong { 
    color: var(--accent1);
    font-weight: 600; 
}

/* Section-specific card grid adjustments if needed */
#introduction .cards-grid { 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 1.5rem;
}
#introduction .list-cards-grid .card {
    padding: 1.5rem;
}


/* Scrollbar Styling (Webkit Browsers) - Global */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-bg);
    border-radius: 5px;
}

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

/* Responsive Design */
@media (max-width: 992px) { 
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    h1 { font-size: 2.6rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.6rem; }
    #your-element-selector h1 { font-size: 2.8rem; }
    section {
        padding: 100px 40px; 
    }
    header {
        height: var(--nav-height-universal); 
    }
    main {
    }
     .mobile-menu {
        padding-top: calc(var(--nav-height-universal) + 25px);
        padding-left: 25px;
        padding-right: 25px;
        padding-bottom: 25px;
    }
}


/* Tablets and smaller (<= 768px) */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
     header {
        height: var(--nav-height-universal); 
        padding: 0 15px;
    }
    /* .desktop-nav is already removed from HTML, so no need to hide */
    .hamburger-button {
        display: flex; 
    }
    main {
    }

    h1 { font-size: 2.2rem; }
    #your-element-selector h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }


    section {
        padding: 100px 30px; 
    }
    #your-element-selector { 
      padding-top: var(--nav-height-universal);
      padding-right: 20px;
      padding-bottom: 40px; 
      padding-left: 20px;
      min-height: calc(100vh - var(--nav-height-universal));
    }


    .cards-grid {
        grid-template-columns: 1fr; 
        gap: 2rem; 
    }
    .card {
        padding: 1.75rem; 
    }
    .mobile-menu {
        padding-top: calc(var(--nav-height-universal) + 20px);
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 20px;
    }
}

/* Smaller mobile phones (<= 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 { font-size: 1.8rem; } 
    #your-element-selector h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.05rem; }


    section {
        padding: 80px 20px; 
    }
     #your-element-selector { 
      padding-top: var(--nav-height-universal);
      padding-right: 15px;
      padding-bottom: 30px;
      padding-left: 15px;
    }

    header .logo a {
        font-size: 1.1rem; 
    }
    header {
        padding: 0 15px;
    }


    .card {
        padding: 1.5rem; 
    }
    .card h4 {
        font-size: 1.05rem;
    }
    .card p {
        font-size: 0.92rem;
    }

    /* Styles for .table-card-grid .card p and .table-card-grid .card p span 
       within @media (max-width: 480px) are now largely handled by the main rules.
       The flex-direction and align-items are no longer needed.
       The margin-top on span might be redundant due to margin-bottom on strong.
       Removing these specific overrides for cleaner code. */
    /* 
    .table-card-grid .card p {
        flex-direction: column; 
        align-items: flex-start;
    }
    .table-card-grid .card p span {
        text-align: left;
        margin-top: 0.3em; 
    }
    */

    .mobile-menu {
        width: 90%; 
        padding-top: calc(var(--nav-height-universal) + 15px);
        padding-left: 15px;
        padding-right: 15px;
        padding-bottom: 15px;
    }
    .mobile-menu ul {
        padding-right: 10px; 
    }
    .mobile-menu ul li a {
        font-size: 1.4rem; 
    }
    .close-menu-button {
        font-size: 2rem; 
        top: 12px; 
        right: 12px;
    }
    .recommendations-container ol li {
        padding: 1.25rem 1.5rem 1.25rem 3rem; 
    }
    .recommendations-container ol li::before {
        width: 28px;
        height: 28px;
        left: 1rem;
    }

}


/* --- Table Specific Visualizations --- */

/* Common style for the heading of a visualization container */
.visualization-container > h3,
.visualization-container > h4 { 
    font-size: 1.6rem; 
    color: var(--heading-text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--secondary-bg);
    text-align: left;
}
.visualization-container > h4 { /* This is the table title, e.g., "Table 1: ..." */
    font-size: 1.4rem; 
    color: var(--accent2);
    margin-bottom: 1em; 
}


/* Table 1: DAO Governance Models */
#table1-viz .card h4 { 
    border-bottom: 1px solid var(--accent2);
    padding-bottom: 0.6em; 
    margin-bottom: 1em; 
}
#table1-viz .card p strong { 
    display: block;
    color: var(--primary-text); 
    margin-bottom: 0.3em; 
    font-weight: 600; 
}
#table1-viz .card p { 
    margin-bottom: 0.85em; 
    font-size: 0.95rem; 
}


/* Table 2: AI Agent Capabilities */
#table2-viz .card {
    border-left-color: var(--accent2); 
}
#table2-viz .card:hover { /* Specifically for table2 if its hover is different */
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#table2-viz .card h4 { 
    color: var(--accent2);
}
#table2-viz .card p strong { 
    color: var(--primary-text);
    font-weight: 600;
}
#table2-viz .card p:last-child { 
    margin-top: 0.75em; 
    font-style: italic;
    color: #a8b2d1; 
}


/* Table 3 & 4 & 5 & 6 will use .table-card-grid for key-value pair styling within cards */
.table-card-grid .card h4 { 
    border-bottom: 1px solid var(--accent2);
    padding-bottom: 0.6em; 
    margin-bottom: 1em; 
}

/* For lists that are transformed into cards or visually distinct items */
.list-visualization-container > h4 { 
    font-size: 1.4rem; 
    color: var(--accent2);
    margin-bottom: 1.5em; 
}

.list-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2.5rem; 
}

.list-cards-grid .card {
    padding: 1.75rem; 
}
.list-cards-grid .card ul li::before { 
    content: '✓'; 
}

/* Actionable recommendations custom styling */
.recommendations-container > div { 
    margin-bottom: 3.5rem; 
}
.recommendations-container h4 { 
    font-size: 1.75rem; 
    color: var(--accent1);
    margin-bottom: 1.75em; 
    padding-bottom: 0.6em; 
    border-bottom: 1px solid var(--secondary-bg);
}
.recommendations-container ol {
    list-style: none;
    padding-left: 0;
    counter-reset: recommendation-counter;
}
.recommendations-container ol li {
    background-color: var(--secondary-bg);
    padding: 1.5rem 2rem 1.5rem 4rem; 
    margin-bottom: 1.5rem; 
    border-radius: 8px; 
    border-left: 4px solid var(--accent2);
    position: relative;
    counter-increment: recommendation-counter;
    font-size: 1rem; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
}
.recommendations-container ol li::before {
    content: counter(recommendation-counter);
    position: absolute;
    left: 1.5rem; 
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--accent2);
    color: var(--primary-bg);
    width: 36px; 
    height: 36px; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: var(--font-heading);
}
.recommendations-container ol li strong {
    color: var(--heading-text);
}
