:root {
    /* Light Mode - Base colors */
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    
    /* Electric Blue Accent */
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.4);
    
    /* Utility */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --grid-color: rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
    /* Dark Mode - Base colors */
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    
    /* Electric Blue Accent */
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.2);
    
    /* Utility */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    
    --grid-color: rgba(255, 255, 255, 0.03);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.glow-1 {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background-color: var(--accent-glow);
    animation: glowFloat 14s ease-in-out infinite alternate;
}

.glow-2 {
    bottom: 20%;
    right: -100px;
    width: 300px;
    height: 300px;
    background-color: var(--accent-glow);
    animation: glowFloatAlt 18s ease-in-out infinite alternate;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    transition: padding 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.navbar.scrolled {
    padding: 14px 0;
    box-shadow: var(--shadow-md);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--accent);
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo:hover .logo-accent {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    position: relative;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
    color: var(--accent);
    background-color: var(--surface-hover);
    transform: rotate(15deg) scale(1.06);
}

.theme-toggle:active {
    transform: rotate(35deg) scale(0.94);
}

/* Hero Section */
.hero {
    padding: 180px 24px 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: inline-block;
    animation: heroFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
    animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.highlight {
    background: linear-gradient(135deg, var(--accent), #818cf8, var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
    animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

.cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both;
}

.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.btn:active {
    transform: translateY(0) scale(0.97);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-primary:hover::before {
    left: 130%;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -2px var(--accent-glow);
}

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

.btn-secondary:hover {
    background-color: var(--surface-hover);
    transform: translateY(-2px);
}

/* Apps Section */
.apps-section {
    padding: 80px 24px;
    max-width: 980px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
}

.projects-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .projects-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.app-card {
    position: relative;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s ease, border-color 0.3s ease;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), #818cf8, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-glow);
    border-color: var(--accent);
}

.app-card:hover::before {
    opacity: 1;
}

.app-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.14);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 14px 26px rgba(0,0,0,0.18);
}

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

.app-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.app-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0;
}

.app-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.22);
}

[data-theme="dark"] .app-type-badge {
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.28);
}

.app-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.feature-tag {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.app-card:hover .feature-tag {
    border-color: rgba(14, 165, 233, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
    padding: 60px 0 24px;
    margin-top: 100px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 16px;
    max-width: 300px;
}

.footer h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover, .contact-email:hover {
    color: var(--accent);
}

.contact-email {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Privacy Page Specifics */
.content-page {
    padding: 140px 24px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.content-page h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.last-updated {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.9rem;
}

.prose h2 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.prose p, .prose ul {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.prose ul {
    padding-left: 24px;
}

.prose li {
    margin-bottom: 8px;
}

/* User-friendly Link Styles */
.prose a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
}

.prose a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
    border-radius: 2px;
}

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

.prose a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
    background-color: var(--accent-hover);
}

/* --- New Updates --- */

.app-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.icon-surface {
    background: #ffffff;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.icon-surface .app-img,
.icon-surface-navy .app-img {
    object-fit: contain;
    border-radius: 10px;
}

.icon-surface-navy {
    background: linear-gradient(135deg, #02060F 0%, #011441 55%, #0061B6 100%);
    padding: 10px;
    border: 1px solid rgba(0, 194, 215, 0.25);
}

.playstore-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.external-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover .external-icon {
    transform: translate(2px, -2px);
}

.app-action {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin-top: auto;
}

.app-action .btn {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.92rem;
    white-space: nowrap;
}

/* Footer Fonts Adjustment */
.footer p, 
.footer-links ul a,
.contact-email,
.footer-bottom {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
}

.footer h4 {
    /* Headings stay proportionate and use Inter */
    font-family: 'Inter', sans-serif;
}

/* Modal */
.modal {
    display: block;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#galleryModal {
    z-index: 1050;
}

.modal.show {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.modal-content {
    background-color: var(--surface-color);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.close-btn {
    color: var(--text-secondary);
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg) scale(1.1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-app-icon {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-app-icon.icon-surface,
.modal-app-icon.icon-surface-navy {
    padding: 6px;
    object-fit: contain;
}

.modal-highlights {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0 24px;
}

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

.modal-highlight-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.modal-highlight-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.modal-highlight-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-highlight-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.modal-desc {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.modal-hero-img {
    width: 100%;
    height: 100%;
    max-height: 400px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.modal-icons {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-icons img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.modal-screenshots {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.modal-screenshots img {
    height: 350px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.modal-screenshots img:hover {
    transform: scale(1.05);
}

.modal-screenshots.web-screenshots img {
    height: 240px;
    border: 1px solid var(--border-color);
    background: #ffffff;
}

/* Gallery Modal specific styles */
.gallery-content {
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 900px;
    height: 100%;
    min-height: 100vh;
    padding: 20px 0;
}

.gallery-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal.show .gallery-img {
    transform: scale(1);
    opacity: 1;
}

.nav-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    background: rgba(0,0,0,0.4);
    border: none;
    border-radius: 8px;
    transition: 0.3s ease;
    z-index: 1001;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.8);
}

.nav-btn.prev {
    left: 10px;
}

.nav-btn.next {
    right: 10px;
}

.gallery-footer {
    margin-top: 24px;
    z-index: 1001;
}

/* Animations & Scroll Reveals */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes glowFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(36px, 28px) scale(1.1);
    }
}

@keyframes glowFloatAlt {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(-32px, -24px) scale(1.12);
    }
}

.reveal-init {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
        box-shadow 0.32s ease,
        border-color 0.3s ease;
}

.reveal-init.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-card.reveal-init.reveal-visible:hover {
    transform: translateY(-6px);
    transition-delay: 0ms;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-init {
        opacity: 1;
        transform: none;
    }
}

