/* CSS Variables for Light Mode */
:root {
    --tint-1: 255, 255, 255;
    --tint-2: 250, 250, 250;
    --tint-3: 247, 247, 247;
    --tint-4: 242, 242, 242;
    --tint-5: 237, 237, 237;
    --tint-6: 229, 229, 229;
    --tint-7: 217, 217, 217;
    --tint-8: 204, 204, 204;
    --tint-9: 133, 133, 133;
    --tint-10: 121, 121, 121;
    --tint-11: 110, 110, 110;
    --tint-12: 29, 29, 29;
    --header-background: 255, 255, 255;
    --header-link: 29, 29, 29;
    --primary-9: 97, 54, 94;
    --primary-10: 150, 103, 146;
    --shadow-color: 0, 0, 0;
    --blur-lg: 16px;
}

/* CSS Variables for Dark Mode */
.dark {
    --tint-1: 29, 29, 29;
    --tint-2: 34, 34, 34;
    --tint-3: 44, 44, 44;
    --tint-4: 48, 48, 48;
    --tint-5: 53, 53, 53;
    --tint-6: 57, 57, 57;
    --tint-7: 67, 67, 67;
    --tint-8: 78, 78, 78;
    --tint-9: 133, 133, 133;
    --tint-10: 144, 144, 144;
    --tint-11: 192, 192, 192;
    --tint-12: 255, 255, 255;
    --header-background: 31, 31, 31;
    --header-link: 255, 255, 255;
    --primary-9: 239, 123, 102;
    --primary-10: 219, 105, 85;
    --shadow-color: 0, 0, 0;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Lato", "Lato Fallback", system-ui, arial, sans-serif;
    font-size: 16px;
    line-height: 26px;
    color: rgb(var(--tint-12));
    background-color: rgb(var(--tint-1));
    transition: background-color 0.3s, color 0.3s;
}

h1 {
    line-height: 45px;
}

/* Header Container */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: 64px;
    flex: none;
    display: flex;
    flex-direction: column;
    background-color: rgba(var(--tint-1), 0.88);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    box-shadow: 0 1px 0 0 rgba(var(--tint-12), 0.08);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.dark .site-header {
    background-color: rgba(var(--tint-1), 0.88);
}

.header-wrapper {
    background-color: rgb(var(--header-background));
    box-shadow: 0 1px 0 0 rgba(var(--tint-12), 0.08);
}


.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    min-height: 64px;
    max-width: 1536px;
    margin: 0 auto;
    gap: 24px;
    transition: max-width 0.3s;
}

@media (min-width: 640px) {
    .header-content {
        padding: 12px 24px;
    }
}

@media (min-width: 768px) {
    .header-content {
        padding: 12px 32px;
    }
}

/* Header Left Section */
.header-left {
    display: flex;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 1;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

@media (min-width: 1024px) {
    .header-left {
        gap: 16px;
    }
}

.menu-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    padding: 4px 8px;
    margin-left: -8px;
    background: transparent;
    border: none;
    color: rgb(var(--tint-12));
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.15s;
    position: relative;
}

.menu-toggle:hover {
    background-color: rgba(var(--tint-6), 0.5);
}

.menu-chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
}

.menu-toggle:hover .menu-chevron {
    opacity: 1;
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.header-logo {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.header-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

.dark .logo-light {
    display: none;
}

.dark .logo-dark {
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 22.5px;
    color: rgb(var(--tint-12));
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    letter-spacing: -0.025em;
    flex-shrink: 1;
    min-width: 0;
}

@media (min-width: 1024px) {
    .logo-text {
        font-size: 18px;
    }
}

/* Dropdown Container */
.dropdown-container {
    position: relative;
    display: inline-block;
}

/* Header Right Section */
.header-right {
    display: flex;
    z-index: 20;
    margin-left: auto;
    min-width: 36px;
    flex-shrink: 1;
    flex-grow: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

@media (min-width: 1536px) {
    .header-right {
        flex-grow: 0;
    }
}

@media (min-width: 2560px) {
    .header-right {
        gap: 24px;
    }
}

.header-link {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    text-decoration: none;
    color: rgb(var(--tint-12));
    font-size: 14px;
    transition: color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-link:hover {
    color: rgb(var(--primary-9));
}

.link-chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.4;
    transition: all 0.15s;
}

.header-link:hover .link-chevron {
    opacity: 1;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    margin-top: 0;
    min-width: 220px;
    background-color: rgb(var(--tint-1));
    border: 0.67px solid rgba(var(--tint-12), 0.12);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.15), 0 0 0 1px rgba(var(--shadow-color), 0.05);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-2px);
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out, transform 0.2s ease-out;
    z-index: 50;
    pointer-events: none;
}

.dark .dropdown-menu {
    border-color: rgba(var(--tint-12), 0.2);
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.3), 0 0 0 1px rgba(var(--shadow-color), 0.1);
}

.dropdown-container:hover .dropdown-menu,
.dropdown-container:focus-within .dropdown-menu,
.dropdown-menu.dropdown-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Keep menu open when hovering over menu itself */
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Add an invisible bridge area above the menu to catch mouse movement */
.dropdown-container::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 49;
    pointer-events: none;
}

.dropdown-container:hover::after {
    pointer-events: auto;
}

.dropdown-container:hover .dropdown-trigger .link-chevron,
.dropdown-container:focus-within .dropdown-trigger .link-chevron {
    opacity: 1;
    transform: rotate(180deg);
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    color: rgb(var(--tint-12));
    text-decoration: none;
    font-size: 14px;
    line-height: 20px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.dropdown-item:hover {
    background-color: rgba(var(--tint-12), 0.08);
    color: rgb(var(--primary-9));
}

.dark .dropdown-item:hover {
    background-color: rgba(var(--tint-12), 0.12);
}



/* Responsive Adjustments */
@media (max-width: 1023px) {
    .header-content {
        gap: 16px;
    }
}

/* Demo Content Styles */
.main-content {
    max-width: 1012px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    background-color: rgb(var(--tint-1));
    border: 1px solid rgba(var(--tint-12), 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(var(--shadow-color), 0.05);
}

.dark .main-content {
    border-color: rgba(var(--tint-12), 0.15);
    box-shadow: 0 2px 8px rgba(var(--shadow-color), 0.1);
}

@media (max-width: 1024px) {
    .main-content {
        margin: 0 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin: 0 0.5rem;
        padding: 1rem;
        border-radius: 4px;
    }
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border: 1px solid rgba(var(--tint-12), 0.12);
    border-radius: 8px;
    background-color: rgb(var(--tint-1));
    color: rgb(var(--tint-12));
    font-size: 18px;
    transition: all 0.15s ease;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.15);
}

.dark .theme-toggle-btn {
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.3);
}

.theme-toggle-btn:hover {
    background-color: rgba(var(--tint-12), 0.08);
    border-color: rgba(var(--tint-12), 0.2);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-icon-dark,
.theme-icon-light {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-icon-dark {
    opacity: 0;
    transform: rotate(90deg);
}

.theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

.dark .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

.dark .theme-icon-light {
    opacity: 0;
    transform: rotate(-90deg);
}

@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
        font-size: 16px;
    }
}

/* Main Sections Buttons */
.main-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem 0;
}

.section-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background-color: rgb(var(--tint-1));
    border: 1px solid rgba(var(--tint-12), 0.12);
    border-radius: 8px;
    text-decoration: none;
    color: rgb(var(--tint-12));
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(var(--shadow-color), 0.1);
    position: relative;
    overflow: hidden;
}

.section-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--primary-9), 0.05) 0%, rgba(var(--primary-10), 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.section-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.15);
    border-color: rgba(var(--primary-9), 0.3);
    background-color: rgb(var(--tint-1));
}

.section-button:hover::before {
    opacity: 1;
}

.section-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--shadow-color), 0.1);
}

.section-button i:first-child {
    font-size: 24px;
    color: rgb(var(--primary-9));
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.section-button:hover i:first-child {
    transform: scale(1.1);
}

.section-button .button-content {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-button span {
    font-weight: 500;
}

.section-button .button-description {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgb(var(--tint-11));
    margin: 0;
    line-height: 1.4;
}

.section-button .button-description a {
    color: rgb(var(--primary-9));
    text-decoration: underline;
    transition: color 0.15s ease;
}

.section-button .button-description a:hover {
    color: rgb(var(--primary-10));
}

.section-button i:last-child {
    font-size: 14px;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.section-button:hover i:last-child {
    opacity: 1;
    transform: translateX(4px);
    color: rgb(var(--primary-9));
}

.dark .section-button {
    background-color: rgb(var(--tint-2));
    border-color: rgba(var(--tint-12), 0.2);
    box-shadow: 0 1px 3px rgba(var(--shadow-color), 0.2);
}

.dark .section-button:hover {
    background-color: rgb(var(--tint-3));
    border-color: rgba(var(--primary-9), 0.4);
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.3);
}

/* Content Link Styles */
.main-content a:not(.section-button) {
    color: rgb(var(--primary-9));
    text-decoration: none;
    transition: color 0.15s ease;
}

.main-content a:not(.section-button):hover {
    color: rgb(var(--primary-10));
    text-decoration: underline;
}

.dark .main-content a:not(.section-button) {
    color: rgb(var(--primary-9));
}

.dark .main-content a:not(.section-button):hover {
    color: rgb(var(--primary-10));
}

/* Dark Mode Specific Adjustments */