/* ================================
   VARIABLES AND THEMING
================================= */
:root {
    /* Color Palette */
    --hue-primary: 220;
    --hue-secondary: 260;

    /* Default Dark Theme (Startup AI Style) */
    --bg-base: #0B0F19;
    --bg-surface: #151B2B;
    --bg-surface-hover: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --primary: hsl(var(--hue-primary), 80%, 60%);
    --primary-hover: hsl(var(--hue-primary), 80%, 50%);
    --secondary: hsl(var(--hue-secondary), 80%, 60%);

    --focus-ring: #FBBF24;
    --border-color: rgba(255, 255, 255, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 9999px;

    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);

    --base-font-size: 16px;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F1F5F9;
    --text-main: #0F172A;
    --text-muted: #475569;
    --border-color: #E2E8F0;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-contrast="high"] {
    --bg-base: #000000;
    --bg-surface: #000000;
    --bg-surface-hover: #000000;
    --text-main: #FFFFFF;
    --text-muted: #FFFFFF;
    --primary: #FFFF00;
    --primary-hover: #FFCC00;
    --secondary: #00FF00;
    --border-color: #FFFFFF;
    --focus-ring: #00FFFF;
}

[data-text="large"] {
    --base-font-size: 20px;
}

/* ================================
   RESET & BASE
================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: var(--base-font-size);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Accessibility: Focus visible styling */
:focus-visible {
    outline: 3px solid var(--focus-ring) !important;
    outline-offset: 4px;
    border-radius: 4px;
}

.skip-to-content {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    z-index: 10000;
    border-radius: var(--radius-pill);
    font-weight: bold;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: 20px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-main);
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

ul {
    list-style: none;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--primary-hover);
}

/* ================================
   BUTTONS
================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main) !important;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary) !important;
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff !important;
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

[data-contrast="high"] .btn-primary {
    background: var(--primary);
    color: #000 !important;
    border: 2px solid #FFF;
}

[data-contrast="high"] .btn-primary:hover {
    background: var(--primary-hover);
}

/* ================================
   HEADER & NAVIGATION
================================= */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(var(--bg-base-rgb), 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

/* Polyfill fallback for rgba using CSS custom properties structure */
.sticky-header {
    background-color: var(--bg-base);
    /* solid fallback */
}

@supports (backdrop-filter: blur(10px)) {
    .sticky-header {
        background-color: transparent;
        background-image: linear-gradient(to bottom, var(--bg-base), transparent);
    }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}

.accessibility-toolbar {
    display: flex;
    gap: 0.5rem;
}

.a11y-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.a11y-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ================================
   HERO SECTION
================================= */
.hero {
    position: relative;
    padding-top: 150px;
    padding-bottom: 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.gradient-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
}

.gradient-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--secondary);
    animation-delay: -5s;
}

[data-contrast="high"] .gradient-sphere {
    display: none;
}

.hero-content {
    max-width: 800px;
}

.big-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-contrast="high"] .gradient-text {
    background: none;
    -webkit-text-fill-color: var(--primary);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-bottom: 2.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ================================
   ABOUT SECTION
================================= */
.about-section {
    padding: 100px 0;
    background-color: var(--bg-surface);
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

/* ================================
   FEATURES SECTION
================================= */
.features-section {
    padding: 100px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-5px);
    box-shadow: var(--shadow-subtle);
    border-color: var(--primary);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

[data-contrast="high"] .feature-icon {
    background: transparent;
    border: 2px solid var(--primary);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.small-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.small-feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.small-feature-card:hover,
.small-feature-card:focus-within {
    transform: translateY(-5px);
    box-shadow: var(--shadow-subtle);
    border-color: var(--primary);
}

.small-feature-card .feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

[data-contrast="high"] .small-feature-card .feature-icon {
    background: transparent;
    border: 2px solid var(--primary);
}

.small-feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* Collapsed Grid State: Hide items after the 8th */
.small-features-grid.is-collapsed .small-feature-card:nth-child(n+9) {
    display: none;
}

.features-toggle-container {
    text-align: center;
    margin-top: 3rem;
    width: 100%;
}

/* ================================
   APPS SECTION
================================= */
.apps-section {
    padding: 100px 0;
    background-color: var(--bg-surface);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.app-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
}

.app-icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
}

.app-icon.future-icon {
    background: #475569;
}

.app-details {
    display: flex;
    flex-direction: column;
}

.app-details h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.app-details p {
    font-size: 0.95rem;
    flex-grow: 1;
}

.app-details .btn {
    align-self: flex-start;
    margin-top: 1rem;
}

/* ================================
   BUSINESS SECTION
================================= */
.business-section {
    padding: 100px 0;
    text-align: center;
}

.business-content {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid var(--border-color);
    padding: 4rem 2rem;
    border-radius: var(--radius-lg);
}

.business-lead {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.business-contact {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ================================
   CONTACT SECTION
================================= */
.contact-section {
    padding: 100px 0;
    background: var(--bg-surface);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.social-media-card h2,
.contact-form-card h2 {
    margin-bottom: 1.5rem;
}

.social-links {
    margin-top: 2rem;
}

.social-links li {
    margin-bottom: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    padding: 1rem;
    background: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: inherit;
    transition: border-color var(--transition-normal);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-submit {
    width: 100%;
    border: none;
    font-size: 1.1rem;
}

/* ================================
   FOOTER
================================= */
footer {
    background: var(--bg-base);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ================================
   ANIMATIONS
================================= */
@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-20px) scale(1.05);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in-up {
        opacity: 1;
        transform: none;
    }
}

/* ================================
   RESPONSIVE DESIGN (Mobile First adapted via max-width queries)
================================= */
@media (max-width: 900px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .app-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-surface);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding-top: 120px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}