@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap');

:root {
    --bg: #000000;
    --bg-elevated: #080808;
    --bg-card: #050505;
    --bg-card-featured: #090909;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #888888;
    --border: #222222;
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-subtle: #1c1c1c;
    --accent: #0070f3;
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --btn-border: #ffffff;
    --overlay: rgba(0, 0, 0, 0.82);
    --modal-bg: #090909;
    --modal-border: #333333;
    --logo-fill: #000000;
    --logo-stroke: #ffffff;
    --page-zoom: 0.95;
    --desktop-zoom: 1.15; /* 115% zoomed in page by default */
    --tooltip-bg: #111111;
    --tooltip-border: #333333;
    --tooltip-text: #dddddd;
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-elevated: #f6f6f6;
    --bg-card: #fafafa;
    --bg-card-featured: #f0f0f0;
    --text-primary: #0a0a0a;
    --text-secondary: #555555;
    --text-muted: #767676;
    --border: #e3e3e3;
    --border-strong: rgba(0, 0, 0, 0.12);
    --border-subtle: #ececec;
    --accent: #0070f3;
    --btn-bg: #0a0a0a;
    --btn-text: #ffffff;
    --btn-border: #0a0a0a;
    --overlay: rgba(255, 255, 255, 0.75);
    --modal-bg: #ffffff;
    --modal-border: #dddddd;
    --logo-fill: #ffffff;
    --logo-stroke: #000000;
    --tooltip-bg: #ffffff;
    --tooltip-border: #dddddd;
    --tooltip-text: #333333;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.page-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    animation: pageFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-wrapper.fit-screen {
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

@keyframes pageFadeIn {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Navbar */
.navbar {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.25rem 3rem;
    z-index: 10;
    border-bottom: 1px solid var(--border-strong);
    background-color: var(--bg);
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Upward background extension to cover text gap during page load translate animation */
.navbar::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 1px);
    left: 0;
    right: 0;
    height: 40px;
    background-color: var(--bg);
    pointer-events: none;
}

.brand {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
}

/* Lock the icon wrapper to exact text height */
.brand-logo-outline {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevents oversized images from spilling out */
    flex-shrink: 0;   /* Keeps flexbox from stretching it */
}

/* Force the image itself to stay contained inside the 18px box */
.brand-logo-img {
    width: 100%;
    height: 100%;
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    display: block;
}

.brand-logo-shape {
    fill: var(--logo-fill);
    stroke: var(--logo-stroke);
}

.nav-links {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.925rem;
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.navbar-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* Theme Toggle Hint Tooltip */
.theme-hint {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card, #18181b);
    border: 1px solid var(--border, #27272a);
    color: var(--text-muted, #a1a1aa);
    font-family: 'Geist Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-hint.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.theme-hint-arrow {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--text-primary);
    transform: translateY(-1px);
}
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* Base Image & Breathing Animation (Light Mode) */
.brand-logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    will-change: filter, opacity;
    animation: logoBreatheLight 3.5s infinite ease-in-out;
}

/* Light Mode: Vibrant Blue & Ambient Glow on Dark Icon */
@keyframes logoBreatheLight {
    0% {
        filter: drop-shadow(0 0 1px rgba(59, 130, 246, 0.45)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.25));
        opacity: 0.9;
    }
    50% {
        filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.85)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.4));
        opacity: 1;
    }
    100% {
        filter: drop-shadow(0 0 1px rgba(59, 130, 246, 0.45)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.25));
        opacity: 0.9;
    }
}

/* Dark Mode: Vibrant White Core & Blue Aura Glow */
:root:not([data-theme="light"]) .brand-logo-img {
    animation: logoBreatheDark 3.5s infinite ease-in-out;
}

@keyframes logoBreatheDark {
    0% {
        filter: invert(1) drop-shadow(0 0 1px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 2px rgba(59, 130, 246, 0.5));
        opacity: 0.9;
    }
    50% {
        filter: invert(1) drop-shadow(0 0 2px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 4px rgba(59, 130, 246, 0.85));
        opacity: 1;
    }
    100% {
        filter: invert(1) drop-shadow(0 0 1px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 2px rgba(59, 130, 246, 0.5));
        opacity: 0.9;
    }
}

/* Beta Banner */
.beta-banner {
    width: 100%;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
}

.beta-tag {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.7rem;
    background: var(--accent);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Containers */
.container {
    width: 100%;
    max-width: 1100px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fit-screen .container {
    position: absolute;  
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    /* justify-content: center; no longer needed for vertical centering, but harmless to leave for horizontal flex children */
}

.fit-screen, 
.page-container {
    min-height: 100vh;
    height: auto; 
    overflow-y: auto;
    position: relative; 
}

.badge {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.badge-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 640px;
    text-align: center;
    letter-spacing: -0.01em;
    margin-bottom: 2rem;
}

/* VSL Placeholder */
.vsl-wrapper {
    width: 100%;
    max-width: 760px;
    aspect-ratio: 16 / 9;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vsl-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.85rem;
}

.vsl-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--btn-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.vsl-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
}
.play-icon {
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid var(--btn-text);
    margin-left: 3px;
}

/* Glossary term triggers */
button.term, .term {
    appearance: none;
    -webkit-appearance: none;
    display: inline;
    vertical-align: baseline;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600; /* Change to 500 if you want a slightly lighter bold */
    letter-spacing: inherit;
    word-spacing: inherit;
    line-height: inherit;
    color: var(--accent, #3b82f6);
    cursor: help;
    text-decoration: none;
    transition: color 0.18s ease, filter 0.18s ease;
}

button.term:hover, button.term:focus-visible {
    color: var(--accent, #3b82f6);
    filter: brightness(1.25);
    outline: none;
}

/* Pricing Section Container (Pricing Page Only) */
.pricing-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Individual Pricing Grid Cards */
.pricing-grid .price-card {
    flex: 1;
    max-width: 420px;
    width: 100%;
}

/* Standalone Card System Base (Index VSL & Calculator Cards) */
.price-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.price-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--text-primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 20px rgba(0, 112, 243, 0.08);
}

.price-card.featured {
    border-color: var(--text-primary);
    background: var(--bg-card-featured);
    position: relative;
}

/* Center Section Wrapper Utilities (for Index Page Sections) */
.vsl-section,
.calculator-section {
    width: 100%;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .pricing-grid {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        max-width: 100%;
        padding: 1rem;
    }

    .pricing-grid .price-card {
        max-width: 100%;
        width: 100%;
    }

    .vsl-section,
    .calculator-section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        box-sizing: border-box;
    }

    .price-card.featured {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Scale down oversized titles and tight margins on mobile */
    h1 {
        font-size: clamp(1.65rem, 6.5vw, 2.2rem);
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.925rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }
}


.card-header-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.675rem;
    padding: 0.25rem 0.6rem;
    background: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-top-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tier-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.tier-price {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.tier-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.feature-item {
    font-size: 0.825rem;
    color: var(--text-primary);
    opacity: 0.9;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.4;
}

.feature-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke: var(--text-primary);
}

.btn-action {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    display: block;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-action.secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-action.secondary:hover {
    border-color: var(--text-primary);
    background: var(--bg-elevated);
}

/* Software Stack Containers */
.app-stack-wrapper {
    width: 100%;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-section-title {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.775rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    width: 100%;
    text-align: center;
}

.app-logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 900px;
    margin-bottom: 2rem;
}

.app-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 210px;
}

.app-card:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.app-card-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-card-icon--badge {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 6px;
}

.app-info {
    display: flex;
    flex-direction: column;
}

.app-name {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app-role {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Prerequisites Grid */
.prereq-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    margin-top: 1rem;
}

.prereq-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 320px;
    max-width: 380px;
    min-height: 180px;
}

.prereq-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.prereq-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prereq-card h3 .expand-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.prereq-card:hover h3 .expand-icon {
    color: var(--text-primary);
    transform: scale(1.15);
}

.prereq-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 1rem;
}

.click-hint {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.725rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

/* Modal Overlay & Pop-up Box */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    padding: 2.25rem 2rem;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

.modal-tag {
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.725rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.modal-body {
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.65;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

/* About Content Card */
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    max-width: 800px;
    line-height: 1.75;
    color: var(--text-secondary);
    font-size: 1.05rem;
}
.about-card h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
}
.about-card h2:first-child {
    margin-top: 0;
}
.about-card p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.about-list {
    list-style: none;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.about-list li {
    font-size: 0.95rem;
    color: var(--text-primary);
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.about-list li::before {
    content: "";
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Footer */
.footer {
    width: 100%;
    padding: 1.5rem 3rem;
    font-family: 'Geist Mono', monospace !important;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-strong);
    margin-top: auto;
    background-color: var(--bg);
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop: default to a 115%-zoomed-in feel, mimicking a browser at 115% zoom.
   Same technique as the mobile zoom below - scale .page-wrapper's content with
   `zoom`, then compensate its min-height so it still fills the real viewport,
   while position: fixed elements (modals) stay unscaled against the root. */
@media (min-width: 769px) {
    .page-wrapper {
        zoom: var(--desktop-zoom);
        min-height: calc(100vh / var(--desktop-zoom));
    }

    .page-wrapper.fit-screen,
    .fit-screen,
    .page-container {
        min-height: calc(100vh / var(--desktop-zoom));
    }
}

@media (max-width: 768px) {
    html {
        width: 100%;
    }

    body {
        width: 100%;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* Move zoom here so page content shrinks, while position: fixed modals 
       stay on the unscaled root viewport for 100% full-screen blur */
    .page-wrapper {
        zoom: var(--page-zoom);
        min-height: calc(100vh / var(--page-zoom));
    }

    .page-wrapper.fit-screen,
    .fit-screen,
    .page-container {
        min-height: calc(100vh / var(--page-zoom));
    }

    .navbar, .footer {
        padding: 1rem 1.25rem;
    }

    .navbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
        width: 100%;
        gap: 1rem 0;
        grid-template-columns: none;
    }

    /* Container for top row elements */
    .brand {
        display: contents;
    }

    /* 1. Logo (Top Left) */
    .brand-logo-outline,
    .brand-logo-img {
        order: 1;
        z-index: 2;
    }

    /* 2. Text (Dead Center & Vertically Aligned) */
    .brand span,
    .brand-text {
        order: 2;
        position: absolute;
        top: calc(1rem + 16px); /* Centers against the 32px top row height */
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        font-size: 0.95rem;
        line-height: 1;
        white-space: nowrap;
        margin: 0;
    }

    /* 3. Theme Toggle (Top Right) */
    .navbar-actions {
        order: 3;
        z-index: 2;
        margin-left: auto;
    }

    /* Centered expanding horizontal nav bar */
    .nav-links {
        display: flex;
        order: 4;
        width: 100%;
        justify-content: safe center; /* Keeps content centered while allowing scroll to overflow items */
        align-items: center;
        gap: 1.25rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem 0.75rem 0.25rem 0.75rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 auto;
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Hides scrollbar on Chrome/Safari for a clean look */
    }

    .nav-links a {
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0; /* Ensures links keep their natural width without squeezing */
    }

    /* Software Infrastructure Stack Mobile Layout */
    .app-logo-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .app-card {
        min-width: calc(50% - 0.5rem);
        padding: 0.85rem 1rem;
    }

    /* Prerequisites Grid & Card Refactoring */
    .prereq-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .prereq-card {
        width: 100%;
        max-width: 100%;
        min-height: auto !important; /* Clears desktop 180px height forcing big empty boxes */
        padding: 1.5rem 1.5rem 1rem 1.5rem; /* Tightens vertical space */
        flex: none; /* Disables flex stretch */
    }

    .prereq-subtext {
        margin-bottom: 0.75rem;
    }

    .footer {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Prevents iOS Safari auto-zoom on input focus */
input, textarea {
    font-size: 16px !important; 
}

/* Chat Layout Mechanics */
.chat-container {
    height: 100dvh;
}

.chat-messages {
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Auth Buttons styling */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.btn-auth {
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-login {
    color: var(--text-primary);
}

.btn-login:hover {
    opacity: 0.8;
}

.btn-signup {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-signup:hover {
    filter: brightness(1.1);
}

/* User Avatar Styling */
.user-profile-menu {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

.avatar-link {
    text-decoration: none;
}

.avatar-img, .avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar-link:hover .avatar-img,
.avatar-link:hover .avatar-placeholder {
    border-color: var(--text-primary);
}

/* ==========================================================================
   AUTHENTICATION & LOGIN PAGE STYLES
   ========================================================================== */

.auth-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px);
    padding: 2rem 1rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    text-align: center;
    margin: 0 auto;
}

.login-card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subtitle {
    margin: 0 0 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-google:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
}

.google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.75rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 0.85rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    border-color: var(--text-primary);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: none;
    background-color: var(--accent);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: filter 0.2s ease;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* ==========================================================================
   Action Bar & Geist Interactive Buttons
   ========================================================================== */

.action-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-indicator.state-verifying { color: #f59e0b; }
.status-indicator.state-unlocked  { color: #10b981; }
.status-indicator.state-failed    { color: #ef4444; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.active {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.loading {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: statusPulse 1.2s infinite ease-in-out;
}

@keyframes statusPulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Geist Action Button (Inverted Primary Style) */
.geist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    
    /* Flip rule: background uses text color, text uses background color */
    background-color: var(--text-primary);
    color: var(--bg);
    border: 1px solid var(--text-primary);
}

.geist-btn:hover {
    opacity: 0.88;
}

.geist-btn.verifying {
    cursor: wait;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    pointer-events: none;
}

.geist-btn.unlocked {
    cursor: pointer;
    background-color: #10b981;
    color: #ffffff;
    border: 1px solid #10b981;
    pointer-events: auto;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.geist-btn.unlocked:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    opacity: 1;
}

/* ==========================================================================
   Custom Scrollbar (Trackless & High Contrast)
   ========================================================================== */

:root {
  --scrollbar-thumb: #ffffff;
  color-scheme: dark;
}

[data-theme="light"] {
  --scrollbar-thumb: #000000;
  color-scheme: light;
}

/* Base scrollbar sizing */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Always invisible rail/track */
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Dynamic Thumb using CSS Variables */
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb) !important;
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box !important;
}

/* Firefox Support */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Prevent list items from justifying or flex-spacing terms */
li {
    text-align: left;
}

/* Force the term button to strictly behave as inline text */
button.term, .term {
    display: inline !important;
    white-space: normal;
}

/* ==========================================================================
   Sticky Header for Long Pages
   ========================================================================== */

.navbar.is-sticky {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    background-color: var(--bg);
    transition: box-shadow 0.25s ease, background-color 0.2s ease;
}

.navbar.is-sticky.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .navbar.is-sticky.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}