:root {
    --bg: #ffffff;
    --text: #000000;
    --border: #000000;
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Montserrat', 'Helvetica Neue', Helvetica, sans-serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #ffffff;
    --border: #ffffff;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    line-height: 1.5;
    min-height: 100vh;
}

/* Theme Switch */
.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

#theme-toggle {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: transform var(--transition);
}

#theme-toggle:hover {
    transform: scale(1.1);
}

.theme-icon-wrapper {
    width: 30px;
    height: 30px;
    overflow: hidden;
    position: relative;
}

.theme-icon {
    width: 30px;
    height: 60px;
    position: absolute;
    top: 0;
    left: 0;
    transition: top 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme - show upper half (sun) */
[data-theme="light"] .theme-icon {
    top: -30px;
}

/* Dark theme - show lower half (moon) */
[data-theme="dark"] .theme-icon {
    top: 0;
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
    border-bottom: 5px solid var(--text);
    transition: all var(--transition);
}

header.scrolled {
    border-bottom-width: 2px;
}

.logo-container {
    padding: 40px 20px 20px;
    text-align: center;
    transition: all var(--transition);
}

header.scrolled .logo-container {
    padding: 15px 20px 10px;
}

.logo {
    max-width: 200px;
    height: auto;
    transition: all var(--transition);
}

[data-theme="dark"] .logo {
    filter: invert(1);
}

header.scrolled .logo {
    max-width: 120px;
}

/* Hamburger Menu - Hidden on Desktop */
.menu-toggle {
    display: none;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

.menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--text);
    transition: all var(--transition);
}

.menu-toggle span:nth-child(1) {
    top: 0;
}

.menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
    bottom: 0;
}

.menu-toggle.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Navigation - Desktop */
nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 0 20px 20px;
    transition: all var(--transition);
}

header.scrolled nav {
    padding: 0 20px 15px;
    gap: 30px;
}

.nav-item {
    background: transparent;
    color: var(--text);
    border: none;
    padding: 15px 30px 25px;
    font-size: 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    position: relative;
}

header.scrolled .nav-item {
    padding: 10px 25px 20px;
    font-size: 13px;
}

.nav-item:hover {
    transform: translateY(-2px);
}

.nav-item.active {
    font-weight: 200;
}

/* Animated dots for active item */
.nav-item::before,
.nav-item::after,
.nav-item .middle-dot {
    content: '';
    position: absolute;
    bottom: 10px;
    width: 6px;
    height: 6px;
    background: var(--text);
    opacity: 0;
    transition: opacity var(--transition);
}

.nav-item::before {
    left: calc(50% - 15px);
}

.nav-item .middle-dot {
    position: absolute;
    bottom: 10px;
    left: calc(50% - 3px);
    width: 6px;
    height: 6px;
    background: var(--text);
    opacity: 0;
    transition: opacity var(--transition);
}

.nav-item::after {
    right: calc(50% - 15px);
}

.nav-item.active::before {
    animation: dotPulse 2s infinite;
}

.nav-item.active .middle-dot {
    animation: dotPulse 2s infinite 0.666s;
}

.nav-item.active::after {
    animation: dotPulse 2s infinite 1.333s;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
}

/* Main Content */
main {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 300px);
}

/* Content Animation */
.page-content {
    animation: fadeIn var(--transition) ease-out;
}

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

/* Typography for Pages */
.page-content h1 {
    font-family: var(--font-heading);
    font-size: 72px;
    font-weight: 200;
    letter-spacing: -2px;
    margin-bottom: 60px;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    padding-bottom: 30px;
}

.page-content h2 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    margin: 60px auto 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: 100%;
    text-align: center;
}

.page-content p {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.8;
    margin-bottom: 20px;
    max-width: 100%;
    text-align: justify;
}

.page-content .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin: 40px 0;
}

.page-content .card {
    border: 5px solid var(--text);
    padding: 30px;
    transition: all var(--transition);
}

.page-content .card:hover {
    background: var(--text);
    color: var(--bg);
}

.page-content .card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form Styles */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    font-family: var(--font-heading);
    display: block;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    width: 100%;
    padding: 15px;
    background: transparent;
    color: var(--text);
    border: 5px solid var(--text);
    font-size: 16px;
    font-weight: 400;
    transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--text);
    color: var(--bg);
}

.btn-submit {
    font-family: var(--font-heading);
    background: var(--text);
    color: var(--bg);
    border: 5px solid var(--text);
    padding: 20px 60px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
}

.btn-submit:hover {
    background: transparent;
    color: var(--text);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Theme Switch Mobile */
    .theme-switch {
        top: 15px;
        right: 15px;
    }
    
    #theme-toggle {
        width: 30px;
        height: 30px;
    }
    
    /* Header Mobile */
    header {
        border-bottom-width: 3px;
    }
    
    header.scrolled {
        border-bottom-width: 2px;
    }
    
    .logo-container {
        padding: 60px 20px 20px;
    }
    
    header.scrolled .logo-container {
        padding: 40px 20px 15px;
    }
    
    .logo {
        max-width: 150px;
    }
    
    header.scrolled .logo {
        max-width: 100px;
    }
    
    /* Show Hamburger */
    .menu-toggle {
        display: block;
    }
    
    header.scrolled .menu-toggle {
        top: 35px;
    }
    
    /* Mobile Navigation */
    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        padding: 0;
        transition: left var(--transition);
    }
    
    nav.active {
        left: 0;
    }
    
    .nav-item {
        width: 100%;
        padding: 30px;
        font-size: 18px;
        letter-spacing: 3px;
        text-align: center;
        border-bottom: 1px solid var(--text);
    }
    
    .nav-item:first-child {
        border-top: 1px solid var(--text);
    }
    
    .nav-item:hover {
        transform: none;
        background: var(--text);
        color: var(--bg);
    }
    
    /* Disable dots on mobile */
    .nav-item::before,
    .nav-item::after,
    .nav-item .middle-dot {
        display: none;
    }
    
    /* Content adjustments */
    main {
        padding: 40px 20px;
    }
    
    .page-content h1 {
        font-size: 36px;
        letter-spacing: -1px;
        margin-bottom: 30px;
    }
    
    .page-content h2 {
        font-size: 24px;
    }
    
    .page-content p {
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo {
        max-width: 120px;
    }
    
    header.scrolled .logo {
        max-width: 80px;
    }
    
    .nav-item {
        padding: 25px;
        font-size: 16px;
    }
    
    .page-content h1 {
        font-size: 28px;
    }
    
    .form-group input,
    .form-group textarea {
        border-width: 3px;
        padding: 12px;
    }
    
    .btn-submit {
        border-width: 3px;
        padding: 15px 40px;
    }
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: var(--bg);
    border-top: 4px solid var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate; /* Creates new stacking context */
}

.footer-content {
    position: relative;
    text-align: center;
    pointer-events: none;
}

.footer-content p {
    font-family: var(--font-body);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 200;
}

/* Adjust main content for footer */
main {
    padding: 60px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 360px); /* Account for header and footer */
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin: 60px 0;
}

.product-card {
    border: 5px solid var(--text);
    padding: 30px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    background: var(--bg);
    /* Add flex layout for alignment */
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.9);
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 10px 10px 0 rgba(255,255,255,0.1);
}

.product-status {
    font-family: var(--font-heading);
    position: absolute;
    top: 30px;
    right: 30px;
    background: var(--text);
    color: var(--bg);
    padding: 5px 15px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 1;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 200;
    letter-spacing: -1px;
    margin-bottom: 10px;
    padding-right: 120px;
}

.product-tagline {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    opacity: 0.7;
}

.product-highlight {
    font-family: var(--font-heading);
    display: inline-block;
    border: 3px solid var(--text);
    padding: 10px 20px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-size: 14px;
    align-self: flex-start;
}

.product-brief {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 25px;
    flex: 1 0 auto;
}

.product-features {
    margin-bottom: 25px;
}

.product-feature {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
    padding-left: 10px;
}

.product-specs {
    display: grid;
    gap: 10px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .product-specs {
    background: rgba(255,255,255,0.02);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.spec-label {
    opacity: 0.7;
}

.spec-value {
    font-weight: 700;
}

.product-cta {
    font-family: var(--font-heading);
    background: var(--text);
    color: var(--bg);
    padding: 15px 30px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 12px;
    transition: all var(--transition);
    margin-top: auto;
}

.product-card:hover .product-cta {
    background: var(--bg);
    color: var(--text);
    box-shadow: inset 0 0 0 3px var(--text);
}

/* Technology Section */
.technology-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 5px solid var(--text);
}

.technology-section h2 {
    font-family: var(--font-heading);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.tech-card {
    padding: 30px;
    border: 3px solid var(--text);
    transition: all var(--transition);
}

.tech-card:hover {
    background: var(--text);
    color: var(--bg);
}

.tech-card h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.tech-card p {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

/* Mobile adjustments for products */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-card {
        border-width: 3px;
        padding: 25px;
    }
    
    .product-name {
        font-size: 28px;
    }
    
    .product-status {
        top: 20px;
        right: 20px;
        padding: 3px 10px;
    }
}

/* Minimized windows bar */
.minimized-bar {
    position: fixed;
    bottom: 44px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg);
    border-top: 2px solid var(--text);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
    z-index: 200;
}

.minimized-item {
    padding: 5px 15px;
    background: var(--text);
    color: var(--bg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all var(--transition);
}

.minimized-item:hover {
    transform: translateY(-2px);
}

/* Typography for Pages - UPDATED */
.page-content {
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn var(--transition) ease-out;
}

.page-content h1 {
    font-size: 72px;
    font-weight: 200;
    letter-spacing: 0px;
    margin-bottom: 60px;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    padding-bottom: 30px;
}

/* Add a line under H1 for corporate look */
.page-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: var(--text);
}

.page-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 60px auto 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: 100%;
    text-align: center;
}

.page-content p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
    max-width: 100%;
    text-align: justify;
}

/* About Page Specific Styles - UPDATED */
.page-content .lead {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0;
    margin-bottom: 60px;
    color: var(--text);
    opacity: 0.9;
    text-align: center;
    max-width: 100%;
}

.about-section {
    margin: 80px 0;
    max-width: 100%;
}

.about-section:first-of-type {
    margin-top: 10px;
}

.about-section p {
    margin-bottom: 25px;
}

.about-section p strong {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Principles Grid - UPDATED */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 60px 0;
    max-width: 100%;
}

.principle-card {
    border: 3px solid var(--text);
    padding: 30px;
    transition: all var(--transition);
    background: var(--bg);
    text-align: center;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.principle-card:hover {
    background: var(--text);
    color: var(--bg);
    transform: translateY(-5px);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.1);
}

[data-theme="dark"] .principle-card:hover {
    box-shadow: 10px 10px 0 rgba(255,255,255,0.1);
}

.principle-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.principle-card p {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* About Quote - UPDATED */
.about-quote {
    margin: 100px 0 60px;
    padding: 60px 40px;
    border-top: 5px solid var(--text);
    border-bottom: 5px solid var(--text);
    text-align: center;
    background: linear-gradient(to right, 
        transparent, 
        rgba(0,0,0,0.02) 20%, 
        rgba(0,0,0,0.02) 80%, 
        transparent);
}

[data-theme="dark"] .about-quote {
    background: linear-gradient(to right, 
        transparent, 
        rgba(255,255,255,0.02) 20%, 
        rgba(255,255,255,0.02) 80%, 
        transparent);
}

.about-quote p {
    font-family: var(--font-body);
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 3px;
    margin: 0;
    text-align: center;
    font-style: italic;
}

/* Add visual separators between sections */
.about-section {
    position: relative;
}

.about-section:not(:last-of-type)::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 5px;
    background: var(--text);
}

/* Contact page improvements */
.contact-info {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 3px solid var(--text);
    text-align: center;
}

.contact-info h2 {
    text-align: center;
    margin-bottom: 30px;
}

.contact-info p {
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.5px;
}

/* Form centering */
#contact-form {
    max-width: 600px;
    margin: 60px auto;
}

/* Tablet adjustments */
@media (max-width: 1024px) {
    .page-content {
        max-width: 90%;
    }
    
    .principles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile adjustments - UPDATED */
@media (max-width: 768px) {
    .page-content h1 {
        font-size: 48px;
        margin-bottom: 40px;
    }
    
    .page-content h1::after {
        width: 60px;
        height: 3px;
    }
    
    .page-content h2 {
        font-size: 24px;
        margin: 40px auto 20px;
    }
    
    .page-content p {
        font-size: 16px;
        text-align: left; /* Better readability on mobile */
    }
    
    .page-content .lead {
        font-size: 18px;
        margin-bottom: 40px;
    }
    
    .about-section {
        margin: 60px 0;
    }
    
    .principles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .principle-card {
        border-width: 2px;
        padding: 25px;
        min-height: auto;
    }
    
    .about-quote {
        padding: 40px 20px;
        border-width: 3px;
        margin: 60px 0 40px;
    }
    
    .about-quote p {
        font-size: 20px;
        letter-spacing: 1px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .page-content h1 {
        font-size: 36px;
    }
    
    .page-content h2 {
        font-size: 20px;
    }
    
    .principle-card h3 {
        font-size: 16px;
    }
}