/* ============================================
   TechBasi Design System - LockStepper
   Indigo — Light/Dark mode support
   ============================================ */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CSS Variables - Light Mode (Default)
   ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #FAFAF8;
    --bg-secondary: #F5F3EF;
    --bg-tertiary: #ECEAE4;
    --bg-card: #FFFFFF;

    /* Text */
    --text-primary: #1C1917;
    --text-secondary: #57534E;
    --text-muted: #A8A29E;

    /* Borders */
    --border-light: #E7E5E4;
    --border-medium: #D6D3D1;

    /* Accent - Orange */
    --accent-primary: #EA580C;
    --accent-secondary: #F97316;
    --accent-hover: #C2410C;
    --accent-light: #FFF7ED;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.07), 0 2px 4px -2px rgba(28, 25, 23, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.08);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --header-height: 70px;
}

/* ============================================
   Dark Mode Variables
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #1C1917;
        --bg-secondary: #292524;
        --bg-tertiary: #3D3835;
        --bg-card: #292524;

        --text-primary: #FAFAF9;
        --text-secondary: #D6D3D1;
        --text-muted: #A8A29E;

        --border-light: #3D3835;
        --border-medium: #57534E;

        --accent-primary: #FB923C;
        --accent-secondary: #FDBA74;
        --accent-hover: #F97316;
        --accent-light: #431407;

        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
    }
}

/* Manual dark mode override */
[data-theme="dark"] {
    --bg-primary: #1C1917;
    --bg-secondary: #292524;
    --bg-tertiary: #3D3835;
    --bg-card: #292524;

    --text-primary: #FAFAF9;
    --text-secondary: #D6D3D1;
    --text-muted: #78716C;

    --border-light: #3D3835;
    --border-medium: #57534E;

    --accent-primary: #FB923C;
    --accent-secondary: #FDBA74;
    --accent-hover: #F97316;
    --accent-light: #431407;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
}

/* Manual light mode override */
[data-theme="light"] {
    --bg-primary: #FAFAF8;
    --bg-secondary: #F5F3EF;
    --bg-tertiary: #ECEAE4;
    --bg-card: #FFFFFF;

    --text-primary: #1C1917;
    --text-secondary: #57534E;
    --text-muted: #A8A29E;

    --border-light: #E7E5E4;
    --border-medium: #D6D3D1;

    --accent-primary: #EA580C;
    --accent-secondary: #F97316;
    --accent-hover: #C2410C;
    --accent-light: #FFF7ED;

    --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.07), 0 2px 4px -2px rgba(28, 25, 23, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.08);
}

/* ============================================
   Base Styles
   ============================================ */
body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ============================================
   Skip to Content Link
   ============================================ */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
    padding: 1rem 2rem;
    background: var(--accent-primary);
    color: #FAFAF8;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

/* ============================================
   Focus Styles (Keyboard Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

#theme-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-color: var(--accent-primary);
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.cta-button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.email-link:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   Header
   ============================================ */
header {
    background: rgba(250, 250, 248, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, height 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(28, 25, 23, 0.85);
}

header.scrolled {
    height: 60px;
    box-shadow: 0 1px 0 var(--border-light);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo with breadcrumb */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

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

.divider {
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 300;
}

.logo h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}

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

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

#theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

#theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#theme-toggle:hover svg {
    transform: rotate(15deg);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sun-icon { display: block; }
    :root:not([data-theme="light"]) .moon-icon { display: none; }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

section {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

/* ============================================
   Hero Section
   ============================================ */
@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    padding: 180px 0 120px;
    text-align: center;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-light) 0%, var(--bg-primary) 100%);
}

.hero-content {
    position: relative;
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    animation: heroReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-content .highlight {
    color: var(--accent-primary);
    position: relative;
}

.hero-content .highlight::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    opacity: 0.3;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: heroReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 16px 36px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(234, 88, 12, 0.35);
}

.cta-button:active {
    transform: translateY(0);
}

/* Hero Buttons / App Store Badges */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    align-items: center;
    animation: heroReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.app-badge {
    height: 60px;
    width: auto;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.2));
}

.app-badge:hover {
    transform: translateY(-3px) scale(1.05);
    filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: 100px 0;
    background: var(--bg-primary);
}

.features h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
}

.feature-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(28, 25, 23, 0.12);
    border-color: var(--border-medium);
}

[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .feature-card:hover {
        box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
    }
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--accent-light);
    border-radius: 12px;
}

.feature-icon svg {
    stroke: var(--accent-primary);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Pro badge on feature cards */
.pro-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
    border-radius: 100px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.85;
}

/* ============================================
   About Section
   ============================================ */
.about {
    padding: 100px 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.about .lead {
    font-size: 1.25rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.about p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    padding: 100px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.contact h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.contact-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.email-link {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 1.5px solid var(--border-medium);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.email-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #FAFAF8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(234, 88, 12, 0.35);
}

/* ============================================
   Footer
   ============================================ */
footer {
    background: var(--bg-primary);
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-nav {
    display: flex;
    gap: 2rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s ease;
}

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

/* ============================================
   Legal Pages (Privacy, Terms)
   ============================================ */
.legal-page {
    padding: 120px 0 80px;
    background: var(--bg-primary);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.legal-content .last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-content ul {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* ============================================
   Reduced Motion
   ============================================ */
@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;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    nav.open {
        transform: translateY(0);
    }

    nav ul {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    nav ul li:last-child {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        padding: 140px 0 80px;
    }

    .hero-content h2 {
        font-size: 2.4rem;
    }

    .hero-content p {
        font-size: 1.05rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .app-badge {
        height: 50px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .features, .about, .contact {
        padding: 80px 0;
    }

    .logo {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .logo-text {
        font-size: 0.95rem;
    }

    .features h2, .about h2, .contact h2 {
        font-size: 2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .legal-page {
        padding: 100px 0 60px;
    }

    .legal-content h1 {
        font-size: 1.8rem;
    }
}
