/* CSS Custom Properties for Modern Design */
:root {
    /* Colors - Classic Mac */
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-text-secondary: #000000;
    --color-accent: #000000;
    --color-accent-hover: #000000;
    --color-border: #000000;
    --color-grid-dot: #e0e0e0;
    
    /* Spacing Scale */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    --spacing-4xl: 8rem;
    
    /* Typography - Classic Mac */
    --font-family: 'VT323', 'Courier New', monospace;
    --font-display: 'VT323', 'Courier New', monospace;
    --font-artistic: 'VT323', 'Courier New', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;
    --font-size-6xl: 4.5rem;
    
    /* Layout */
    --container-max-width: 1280px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--color-bg);
    background-image: radial-gradient(circle, var(--color-grid-dot) 1px, transparent 1px);
    background-size: 15px 15px;
    background-position: 0 0;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    position: relative; /* Create stacking context for body */
    z-index: 0; /* Ensure body is at base level */
    background-color: transparent;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}


/* Header - Classic Mac Menu Bar */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0;
    padding-left: 8px;
    padding-right: 8px;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Monaco', 'Courier New', Courier, monospace;
    font-size: 11px;
    color: var(--color-text);
    user-select: none;
    -webkit-user-select: none;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 2px 4px;
    transition: opacity var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.logo:hover {
    opacity: 0.7;
}

.logo-image {
    height: 20px;
    width: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Hero Section */
.hero {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-md);
    padding-top: calc(var(--spacing-md) + 36px);
    padding-bottom: var(--spacing-md);
    overflow: hidden;
    min-height: 0;
}

.hero-content {
    position: relative;
    z-index: 1000; /* Very high z-index to ensure text is above paint canvas */
    max-width: 900px;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    isolation: isolate; /* Create stacking context to ensure canvas stays behind */
}

.hero-title {
    font-family: var(--font-artistic);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.05em;
    margin: 0 auto var(--spacing-lg);
    color: var(--color-text);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
    white-space: nowrap;
    text-transform: uppercase;
    text-align: center;
    display: block;
    width: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1000; /* Very high z-index to ensure text is above paint canvas */
    /* Hard white outline for visibility when paint passes behind */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

.gradient-text {
    color: var(--color-text);
    display: inline-block;
    position: relative;
    transition: color var(--transition-base);
}

.gradient-text:hover {
    color: var(--color-text);
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    letter-spacing: 0.02em;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    font-family: var(--font-family);
    text-align: center;
    position: relative;
    z-index: 1000; /* Very high z-index to ensure text is above paint canvas */
    /* Hard white outline for visibility when paint passes behind */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

.hero-separator {
    width: 240px;
    height: 1px;
    background-color: var(--color-border);
    margin: var(--spacing-xl) auto var(--spacing-lg);
    opacity: 0.4;
    position: relative;
    z-index: 1000;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}

.hero-cta {
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

.hero-download {
    margin-top: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* Buttons - Classic Mac */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-lg);
    font-weight: 400;
    letter-spacing: 0.05em;
    border-radius: 0;
    border: 2px solid var(--color-text);
    background: var(--color-bg);
    color: var(--color-text);
    transition: all 0.1s ease;
    text-decoration: none;
    position: relative;
    z-index: 1000; /* Very high z-index to ensure button is above paint canvas */
    white-space: nowrap;
    font-family: var(--font-family);
    box-shadow: 2px 2px 0 0 var(--color-text);
    isolation: isolate;
    /* Hard white outline for visibility when paint passes behind */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

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

.btn-primary:hover {
    background: #f5f5f5;
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 0 var(--color-text);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 0 var(--color-text);
}

/* Download Section - Now integrated into hero */

.download-title {
    font-family: var(--font-artistic);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.06em;
    margin: 0 auto var(--spacing-md);
    color: var(--color-text);
    text-transform: uppercase;
    text-align: center;
    display: block;
    width: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1000; /* Very high z-index to ensure text is above paint canvas */
    /* Hard white outline for visibility when paint passes behind */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

.download-subtitle {
    font-size: clamp(0.9375rem, 1.8vw, 1.125rem);
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    letter-spacing: 0.03em;
    font-family: var(--font-family);
    text-align: center;
    position: relative;
    z-index: 1000; /* Very high z-index to ensure text is above paint canvas */
    /* Hard white outline for visibility when paint passes behind */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
}

.download-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1000; /* Very high z-index to ensure buttons are above paint canvas */
    flex-wrap: wrap;
}

.download-btn {
    flex: 0 1 auto;
    min-width: 200px;
}

.download-note {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-family: var(--font-family);
    opacity: 0.5;
    margin: var(--spacing-xs) 0 0;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Footer */
.footer {
    position: relative;
    z-index: 2;
    padding: var(--spacing-xs) var(--spacing-md);
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    white-space: nowrap;
    margin-bottom: 8px;
}

.footer-text {
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
    font-family: 'Monaco', 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    margin-right: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.footer-separator {
    width: 1px;
    height: 14px;
    background-color: var(--color-border);
    margin: 0 12px;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.4;
    flex-shrink: 0;
}

.footer-emoji {
    font-size: 12px;
    margin: 0 2px 0 2px;
    margin-right: 6px;
    display: inline-block;
    flex-shrink: 0;
}

.footer-link {
    color: #0066cc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
    font-family: 'Monaco', 'Courier New', Courier, monospace;
    text-decoration: none;
    transition: opacity var(--transition-fast);
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.footer-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Chrome Badge - Styled as a badge */
.chrome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    background: #f5f5f5;
    border-radius: 0;
    font-family: var(--font-family);
    height: 24px;
}

.chrome-badge-icon {
    height: 16px;
    width: 16px;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.chrome-badge-text {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
    font-family: var(--font-family);
}

.footer-nav {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-nav a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.footer-nav a:hover {
    color: var(--color-accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Subtle background animation */
@keyframes gridPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.95;
    }
}

body {
    animation: gridPulse 8s ease-in-out infinite;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    }
    
    .chrome-badge-text {
        font-size: clamp(0.875rem, 1.9vw, 1.0625rem);
    }
    
    .download-title {
        font-size: clamp(1.5rem, 5vw, 2.25rem);
    }
}

/* Mobile and Tablet */
@media (max-width: 768px) {
    :root {
        --spacing-2xl: 2rem;
        --spacing-3xl: 3rem;
        --spacing-4xl: 4rem;
    }
    
    .header {
        font-size: 10px;
        padding-left: 6px;
    }
    
    .logo-image {
        height: 14px;
    }
    
    .hero {
        padding: var(--spacing-sm) var(--spacing-md);
        padding-top: calc(var(--spacing-sm) + 36px);
        padding-bottom: var(--spacing-sm);
    }
    
    .hero-content {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
        white-space: normal;
        line-height: 1.1;
        margin-bottom: var(--spacing-md);
    }
    
    .gradient-text {
        display: inline-block;
        margin-top: 0.1em;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
        line-height: 1.5;
        margin-bottom: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
    
    .hero-separator {
        width: 180px;
        margin: var(--spacing-lg) auto var(--spacing-md);
    }
    
    .chrome-badge {
        padding: 3px 6px;
        gap: 4px;
        height: 20px;
        border: 1px solid var(--color-border);
    }
    
    .chrome-badge-icon {
        height: 14px;
        width: 14px;
    }
    
    .chrome-badge-text {
        font-size: 11px;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-download {
        margin-top: var(--spacing-sm);
    }
    
    .download-title {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
        margin-bottom: var(--spacing-sm);
    }
    
    .download-subtitle {
        font-size: clamp(0.875rem, 2.5vw, 1rem);
        margin-bottom: var(--spacing-md);
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        min-width: 100%;
        max-width: 280px;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-base);
    }
    
    .footer {
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .footer-content {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .footer-text {
        color: #000000;
        font-size: 10px;
        font-weight: 600;
    }
    
    .footer-link {
        color: #000000;
        font-size: 10px;
        font-weight: 600;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }
    
    .header {
        font-size: 9px;
        padding-left: 4px;
        padding-right: 4px;
    }
    
    .logo-image {
        height: 12px;
    }
    
    .chrome-badge {
        padding: 2px 5px;
        gap: 3px;
        height: 18px;
        border: 1px solid var(--color-border);
    }
    
    .chrome-badge-icon {
        height: 12px;
        width: 12px;
    }
    
    .chrome-badge-text {
        font-size: 10px;
    }
    
    .hero {
        padding: var(--spacing-xs) var(--spacing-sm);
        padding-top: calc(var(--spacing-xs) + 36px);
        padding-bottom: var(--spacing-xs);
    }
    
    .hero-content {
        padding: 0;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
        letter-spacing: 0.03em;
        margin-bottom: var(--spacing-sm);
    }
    
    .gradient-text {
        font-size: 0.95em;
    }
    
    .hero-subtitle {
        font-size: clamp(0.875rem, 3.5vw, 1rem);
        line-height: 1.5;
        margin-bottom: var(--spacing-sm);
        padding: 0;
    }
    
    .hero-separator {
        width: 140px;
        margin: var(--spacing-md) auto var(--spacing-sm);
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: var(--font-size-sm);
    }
    
    .hero-download {
        margin-top: var(--spacing-xs);
    }
    
    .download-title {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
        margin-bottom: var(--spacing-xs);
    }
    
    .download-subtitle {
        font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
        margin-bottom: var(--spacing-sm);
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        min-width: 100%;
        max-width: 100%;
    }
    
    .footer {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .footer-content {
        flex-wrap: nowrap;
        justify-content: center;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .footer-text,
    .footer-link {
        font-size: 9px;
        white-space: nowrap;
        flex-shrink: 0;
        color: #000000;
        font-weight: 600;
    }
    
    .footer-emoji {
        font-size: 9px;
        flex-shrink: 0;
    }
    
    .footer-separator {
        height: 10px;
        margin: 0 6px;
        flex-shrink: 0;
    }
    
    .footer-text {
        margin-right: 2px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .gradient-text {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 0;
}

.btn:focus-visible {
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hero,
    .footer {
        display: none;
    }
}
