:root {
    --bg-color: #ffffff;
    --text-color: #0f172a;
    --primary-color: #6B5A99;
    --secondary-color: #64748b;
    --surface-color: #f8fafc;
    --border-color: #e2e8f0;
    --font-family: 'Helvetica Neue', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background-color: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

/* Ensure white MenubarIcon remains visible on light backgrounds by making it dark. */
body:not(.home-mode) .navbar .logo img {
    /* Recolor white PNG icon to match --primary-color (#6B5A99) */
    /* Filter sequence approximates the primary color from white base */
    filter: brightness(0) invert(45%) sepia(14%) saturate(1100%) hue-rotate(225deg) brightness(95%) contrast(90%);
    transition: filter 0.25s ease;
}

/* Keep original white icon for purple hero background */
body.home-mode .navbar .logo img {
    filter: none;
}

body .navbar .logo img {
    margin-bottom: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Footer */
/* Footer */
#footer {
    position: relative;
    width: 100%;
    /* Align image to the right */
    display: flex;
    justify-content: flex-end;
    /* Ensure no extra spacing interferes with bottom alignment */
    padding: 0;
    margin: 0;
    background: transparent;
    pointer-events: none;
    /* Let clicks pass through container */
}

#footer .container {
    padding: 0;
    margin: 0;
    /* Container inherits width/flex properties or just acts as wrapper */
    width: auto;
    max-width: none;
    display: contents;
    /* Remove container influence on layout if possible, or style it to match */
}

/* If .container is needed for structure, we might need to target it differently. 
   But HTML is <div id="footer"><div class="container"><div class="footer-content"><img>... 
   Let's simplify.
*/
#footer .footer-content {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}


#footer img {
    display: block;
    max-width: 900px;
    width: 90vw;
    /* Responsive sizing */
    height: auto;
    pointer-events: auto;
    /* Ensure it aligns to the bottom if there's line-height issues */
    vertical-align: bottom;
}

/* Markdown Styles */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 2.5rem;
}

.markdown-content h2 {
    font-size: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.markdown-content h3 {
    font-size: 1.5rem;
}

.markdown-content p {
    margin-bottom: 1.5rem;
}

.markdown-content strong {
    color: var(--primary-color);
}

.markdown-content em {
    font-style: italic;
    color: var(--secondary-color);
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--secondary-color);
    font-style: italic;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
}

.markdown-content th,
.markdown-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.markdown-content th {
    background-color: rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.markdown-content tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: var(--secondary-color);
    padding: 2rem;
}

/* Homepage Poster Styles */
.hidden {
    display: none !important;
}

#home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding-top: 9vh;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 120px;
    color: #000;
}

.poster-card {
    /* Removed card styling */
    background-color: transparent;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: none;
}

.eyes-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 0;
    position: relative;
    gap: 40px;
    margin-top: 0;
    position: relative;
    /* height: 200px; Removed fixed height */
    background-color: transparent;
}

.eye {
    width: 14vw;
    max-width: 200px;
    min-width: 120px;
    aspect-ratio: 1 / 1;
    height: auto;
    background-color: #ffffff;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.eye.left {
    transform: translateX(10px);
    z-index: 1;
}

.eye.right {
    transform: translateX(-10px);
    z-index: 2;
}

.pupil {
    width: 40%;
    height: 40%;
    background-color: #000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hero Text */
.hero-text {
    /* text-align: center; */
    margin-top: 2.2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-text h1 {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2.2rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-text p {
    font-size: 2.5rem;
    /* Larger, slightly smaller than h1 (3.5rem) */
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 4rem;
    /* More space for scroll effect */
    line-height: 1.3;

    /* Scroll reveal magic */
    color: transparent;
    /* Text itself is transparent */
    background-clip: text;
    -webkit-background-clip: text;
    background-image: linear-gradient(to right,
            #ffffff var(--reveal-progress, 0%),
            rgba(255, 255, 255, 0.7) var(--reveal-progress, 0%));
    /* 
       Concept: The gradient has a hard stop. 
       0% to X% is White (revealed).
       X% to 100% is Dimmed (unrevealed).
       We animate X% (var(--reveal-progress)) from 0% -> 100%.
    */

    /* Optimization */
    will-change: background-image;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .hero-text p {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 3rem;
}

/* App Store Button */
.app-store-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    /* Handled by group */
    padding: 0.875rem 1.75rem;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-store-button:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.app-store-button:active {
    transform: translateY(0);
}

.app-store-button svg {
    flex-shrink: 0;
}

/* Demo Button */
.btn-demo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
    margin-top: 0.5rem;
}

.btn-demo:hover {
    background-color: transparent;
    color: #fff;
    text-decoration: underline;
    transform: none;
}

.color-code {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.character-name {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.show-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.poster-footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.poster-footer a {
    color: inherit;
    text-decoration: underline;
}

.poster-footer p {
    margin-top: 0.5rem;
}

/* Home Mode Navbar Overrides */
body.home-mode .navbar {
    border-bottom: none;
}

body.home-mode .logo {
    color: #ffffff;
}

body.home-mode .nav-links a {
    color: rgba(255, 255, 255, 0.8);
}

body.home-mode .nav-links a:hover,
body.home-mode .nav-links a.active {
    color: #ffffff;
}

body.home-mode .footer {
    display: none;
}

/* Demo Overlay */
.demo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.demo-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.demo-bezel {
    width: 99%;
    height: 99%;
    background: var(--primary-color);
    border-radius: 14px;
    padding: 2px;
    /* The bezel width */
    overflow: hidden;
    position: relative;
}

.demo-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    /* Slightly less than bezel */
    background: #fff;
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.8rem;
        font-size: 0.85rem;
    }
}