/* Custom Properties / Tokens */
:root {
    --theme-black: #000000;
    --theme-dark-gray: #1c1c1e;
    --theme-light-gray: #f5f5f7;
    --theme-white: #ffffff;

    --bg-color: var(--theme-black);
    --text-color: var(--theme-white);
    --modal-bg: rgba(28, 28, 30, 0.7);
    --modal-border: rgba(255, 255, 255, 0.1);
    --btn-bg: var(--theme-white);
    --btn-text: var(--theme-black);
    --btn-hover: #e0e0e0;
    --btn-sec-bg: transparent;
    --btn-sec-border: var(--theme-white);
    --btn-sec-text: var(--theme-white);
    --btn-sec-hover: rgba(255, 255, 255, 0.1);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-color: var(--theme-light-gray);
    --text-color: var(--theme-black);
    --modal-bg: rgba(255, 255, 255, 0.7);
    --modal-border: rgba(0, 0, 0, 0.1);
    --btn-bg: var(--theme-black);
    --btn-text: var(--theme-white);
    --btn-hover: #333333;
    --btn-sec-bg: transparent;
    --btn-sec-border: var(--theme-black);
    --btn-sec-text: var(--theme-black);
    --btn-sec-hover: rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3 {
    letter-spacing: -0.04em;
    font-weight: 700;
}

p {
    line-height: 1.6;
    color: inherit;
    opacity: 0.85;
}

/* Navigation */
.header-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1.1;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-cta {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(30px);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.primary-btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: none;
}

.primary-btn:hover {
    background-color: var(--btn-hover);
}

.secondary-btn {
    background-color: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border: 1px solid var(--btn-sec-border);
}

.secondary-btn:hover {
    background-color: var(--btn-sec-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--modal-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--modal-border);
    border-radius: 32px;
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
}

/* Custom Scrollbar */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.5);
    border-radius: 4px;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(128, 128, 128, 0.2);
    border: none;
    color: var(--text-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.close-modal:hover {
    background: rgba(128, 128, 128, 0.4);
}

.modal-content {
    padding: 50px;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Heritage & Images */
.timeline {
    margin: 40px 0;
    border-left: 2px solid var(--modal-border);
    padding-left: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--text-color);
    border-radius: 50%;
}

.nano-banana-gallery {
    display: flex;
    gap: 20px;
    margin: 40px 0 10px;
    flex-direction: column;
}

@media (min-width: 600px) {
    .nano-banana-gallery {
        flex-direction: row;
    }
}

.gallery-img {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.caption {
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.6;
}

/* Vision System UI */
.vision-container {
    background: rgba(28, 28, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.vision-container:hover {
    background: rgba(44, 44, 46, 0.8);
    transform: translateY(-2px);
}

[data-theme="light"] .vision-container {
    background: rgba(20, 20, 20, 0.95);
    /* Deeper contrast in light mode for the terminal */
    color: white;
}

[data-theme="light"] .vision-container:hover {
    background: rgba(30, 30, 30, 1);
}

[data-theme="light"] .vision-container h3 {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .vision-container .terminal-output {
    color: #a1a1a6;
}

.vision-container h3 {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 25px;
    pointer-events: none;
    /* Let clicks pass through to container */
}

.terminal-output {
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #a1a1a6;
    min-height: 140px;
    height: auto;
    pointer-events: none;
}

.confidence-score {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-top: 30px;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Contact Specific */
.contact-content {
    text-align: center;
}

.email-btn {
    margin: 30px 0 50px;
}

.branding-badge {
    font-weight: 600;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-nav {
        padding: 20px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 2rem;
    }

    .modal {
        max-height: 85vh;
    }
}