:root {
    /* Light mode (default) */
    --background: #ffffff;
    --foreground: #0a0a0a;
    --primary: #00d1b5;
    --secondary: #009bd0;
    --accent: #d900c2;
    --card-bg: rgba(255, 255, 255, 0.5);
    --card-border: #e5e7eb;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --input-bg: #f9fafb;
}

.dark {
    /* Dark mode */
    --background: #0A0A0A;
    --foreground: #EAEAEA;
    --primary: #00F5D4;
    --secondary: #00BBF9;
    --accent: #FF00E4;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --input-bg: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
    /* Fix for iOS Safari click delegation */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1.5rem 0;
    background-color: var(--nav-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    margin-bottom: 2rem;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

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

.nav-links a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
    cursor: pointer;
}

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

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0.5rem;
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        top: auto !important;
        padding: 0 !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
}

/* Mobile styles moved to bottom of file */

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pages / Sections Visibility */
.page-section {
    display: block;
    animation: fadeInPage 0.5s ease-out;
}

.page-section.hidden {
    display: none;
}

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

/* Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin-bottom: 8rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    min-height: 3.5em;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 3.75rem;
        min-height: 2.5em;
    }
}

.cursor {
    display: inline-block;
    width: 0.25em;
    background-color: var(--primary);
    margin-left: 0.25rem;
    animation: blink 1s infinite;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(var(--foreground), 0.7);
    opacity: 0;
    animation: fadeIn 0.8s forwards 2.5s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Generic Section Styling */
section {
    margin-bottom: 6rem;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

/* Grids */
.grid-3 {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.grid-2 {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
}

.grid-2-small {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

.grid-2-large {
    display: grid;
    gap: 4rem;
    grid-template-columns: 1fr;
}

.grid-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-2-large { grid-template-columns: 1fr 1fr; }
}

/* Cards */
.card {
    padding: 1.5rem;
    border-radius: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(var(--primary), 0.5);
    box-shadow: 0 0 20px -5px var(--primary);
    transform: scale(1.02);
}

.card-flat {
    padding: 1.25rem;
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.card-highlight {
    padding: 2rem;
    border-radius: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 0 30px -10px rgba(0, 245, 212, 0.1);
}

/* Service Cards */
.service-card .card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.875rem;
}

.service-card .card-footer span {
    color: var(--primary);
    font-weight: 600;
    margin-right: 0.25rem;
}

/* List Items */
.list-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.list-item:hover {
    background-color: var(--card-bg);
    border-color: var(--card-border);
}

.list-item strong {
    font-size: 1.125rem;
    font-weight: 500;
}

.list-item span {
    opacity: 0.6;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tags span {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    font-size: 0.875rem;
    font-weight: 500;
    transition: 0.2s;
}

.tags span:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.skill-group {
    margin-bottom: 1.5rem;
}

.skill-group h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(var(--foreground), 0.6);
    margin-bottom: 0.75rem;
}

/* Check List */
.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.check-list li {
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.check-list li::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary);
}

/* Timeline */
.process-timeline {
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 2.5rem;
    border-left: 2px solid var(--card-border);
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-number {
    position: absolute;
    left: -2.4rem;
    top: 0;
    font-family: monospace;
    font-weight: bold;
    color: var(--primary);
    font-size: 0.875rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.timeline-content {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    transition: 0.3s;
}

.timeline-content:hover {
    border-color: rgba(var(--primary), 0.5);
    box-shadow: 0 0 20px -5px var(--primary);
}

/* Contact Form */
.contact-form-container {
    padding: 2rem;
    border-radius: 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 0 30px -10px rgba(0, 245, 212, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background-color: var(--input-bg);
    border: 1px solid var(--card-border);
    color: inherit;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 209, 181, 0.2);
}

.btn-full {
    width: 100%;
    cursor: pointer;
    border: none;
    font-size: 1.125rem;
}

/* Links and Buttons */
.text-right {
    text-align: right;
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

.link-arrow {
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
}

.link-arrow:hover {
    text-decoration: underline;
}

.cta, .cta-box {
    text-align: center;
    padding: 3rem;
    border-radius: 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 5rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: #000;
    font-weight: 500;
    font-size: 1.125rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 0 20px -5px var(--primary);
}

.btn-primary:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Tech List */
.tech-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.contact-links {
    list-style: none;
    margin-bottom: 2rem;
}

.contact-links li {
    margin-bottom: 0.75rem;
}

.contact-links a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

.contact-links a:hover {
    color: var(--primary);
}

/* Mobile Menu Styles - Moved to end for specificity */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
        z-index: 1001;
        -webkit-appearance: none; /* Safari fix for buttons */
        appearance: none;
        -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    }

    .nav-links {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--nav-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        border-bottom: 1px solid var(--card-border);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px); /* Safari support */
        z-index: 1000;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        width: 100%; /* Ensure full width */
    }

    .nav-links.active {
        display: flex !important;
        animation: slideDown 0.3s ease-out forwards;
    }

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

    /* Remove Home link on mobile */
    .nav-links a[href="index.html"] {
        display: none !important;
    }
}
