/* Spoorthy homepage — sujala.org inspired theme */

:root {
    --primary: #C62828;
    --primary-dark: #B71C1C;
    --primary-light: #FFEBEE;
    --accent: #F9A825;
    --accent-dark: #F57F17;
    --accent-light: #FFF8E1;

    --color-primary: var(--primary);
    --color-primary-light: #E53935;
    --color-primary-dark: var(--primary-dark);
    --color-secondary: var(--accent-dark);
    --color-accent: var(--accent);

    --text: #1a1a2e;
    --text-light: #546E7A;
    --text-main: var(--text);
    --text-muted: var(--text-light);
    --text-inverse: #ffffff;

    --bg: #FFFDF7;
    --bg-base: var(--bg);
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.92);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Poppins', var(--font-sans);

    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-sm: var(--shadow);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(198, 40, 40, 0.15);
    --shadow-glow: var(--shadow-hover);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --container-width: 1200px;
    --header-height: 72px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

body.nav-open { overflow: hidden; }

.hidden { display: none !important; }

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
}
.skip-link:focus { top: calc(1rem + var(--safe-top)); }

/* Subtle warm background — no dark blobs */
.background-effects { display: none; }

/* ── Top bar (sujala.org style) ── */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    padding: 7px 24px;
    padding-top: calc(7px + var(--safe-top));
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.top-bar-left { flex: 1; min-width: 200px; text-align: center; }
.top-bar-nav { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.top-bar-nav a {
    display: inline-block;
    padding: 4px 12px;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 6px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.top-bar-nav a:hover {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:focus-visible,
.btn:focus-visible,
.nav-toggle-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.text-gradient {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
}

.text-highlight { color: var(--accent-dark); }

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 max(1.25rem, var(--safe-left));
    padding-right: max(1.25rem, var(--safe-right));
}

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

.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    min-height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-inverse);
    box-shadow: 0 4px 14px rgba(198, 40, 40, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.45);
    background: linear-gradient(135deg, #D32F2F, var(--primary));
}

.btn-secondary {
    background: var(--white, #fff);
    color: var(--primary-dark);
    border: 2px solid var(--primary);
}
.btn-secondary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-primary-sm {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    min-height: 40px;
}
.btn-primary-sm:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-hover);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 55%, var(--accent-light) 100%);
    border-bottom: 4px solid;
    border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
    padding: 0.75rem 0;
    box-shadow: var(--shadow);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
    min-height: 48px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.brand-logo {
    height: 44px;
    width: auto;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    line-height: 1.25;
    color: var(--primary-dark);
    background: none;
    -webkit-text-fill-color: var(--primary-dark);
}

.brand-break { display: none; }

.nav-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.nav-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--white, #fff);
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 120;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-overlay { display: none; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.35rem 0;
    white-space: nowrap;
}
.nav-link:hover { color: var(--primary); }

.navbar-highlight {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

/* Hero */
.main-content { background: var(--bg); }

.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent-dark) 100%);
    color: var(--text-inverse);
    padding: clamp(3rem, 8vw, 5rem) 0;
    padding-bottom: clamp(2.5rem, 6vw, 4rem);
    position: relative;
    overflow: hidden;
    min-height: auto;
}

.hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.hero-title {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: var(--text-inverse);
}

.hero-title .text-gradient {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 2rem;
    max-width: 38rem;
    line-height: 1.75;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
}

.hero-cta .btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}
.hero-cta .btn-secondary:hover {
    background: white;
    color: var(--primary-dark);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-img {
    max-width: min(100%, 380px);
    height: auto;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.25));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1rem;
}

/* About */
.glass-section,
.about-section {
    padding: clamp(3rem, 7vw, 5rem) 0;
    scroll-margin-top: calc(var(--header-height) + 1rem);
    background: var(--bg);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 16px;
    background: var(--accent-light);
    border: 2px solid var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
}

.glow { display: none; }

.about-img {
    max-width: 70%;
    height: auto;
}

.about-content .section-title {
    text-align: left;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.about-content a {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 1px solid var(--accent);
}
.about-content a:hover {
    color: var(--accent-dark);
    border-bottom-color: var(--primary);
}

.lead {
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    color: var(--text);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.about-content p:not(.lead) {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: clamp(0.95rem, 2vw, 1rem);
    line-height: 1.75;
}

/* Applications */
.applications-section {
    padding: clamp(3rem, 7vw, 5rem) 0;
    scroll-margin-top: calc(var(--header-height) + 1rem);
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}

.section-header { margin-bottom: 2.5rem; }

.section-header .section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-light);
    font-size: 1rem;
}

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

.app-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border-top: 4px solid var(--primary);
    text-decoration: none;
    color: inherit;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-top-color: var(--accent);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: clamp(160px, 28vw, 190px);
    overflow: hidden;
    background: var(--primary-light);
    border-bottom: 1px solid #eee;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.app-card:hover .card-img { transform: scale(1.03); }

.card-overlay { display: none; }

.card-body {
    padding: clamp(1.25rem, 3vw, 1.5rem);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 3vw, 1.35rem);
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    line-height: 1.65;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: auto;
    min-height: 44px;
}
.card-link:hover {
    color: var(--accent-dark);
    gap: 0.75rem;
}
.card-link svg { transition: transform 0.3s ease; }
.card-link:hover svg { transform: translateX(4px); }

/* Footer */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.88);
    border-top: 4px solid var(--accent);
    padding: clamp(2.5rem, 6vw, 4rem) 0 calc(1.5rem + var(--safe-bottom));
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2.5rem;
}

.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo {
    height: 48px;
    width: auto;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.footer-desc {
    color: rgba(255, 255, 255, 0.75);
    max-width: 320px;
    font-size: 0.95rem;
}

.footer-heading {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
    font-weight: 700;
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-list a {
    color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    padding: 0.25rem 0;
    min-height: 40px;
    line-height: 1.8;
    font-size: 0.9rem;
}
.footer-list a:hover { color: var(--accent); }

.social-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.social-margin { margin-bottom: 1.5rem; }

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}
.social-icon:hover {
    background: var(--accent);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-social-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.footer-social-links a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    padding: 4px 8px;
    border-radius: 6px;
}
.footer-social-links a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .hero-container,
    .about-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-cta { justify-content: center; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-visual { order: -1; }
    .floating-img { max-width: min(65%, 260px); }
    .about-content .section-title { text-align: center; }
    .about-visual { margin-bottom: 0.5rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .brand-break { display: inline; }

    .nav-toggle-btn { display: flex; }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 105;
        transition: var(--transition);
        cursor: pointer;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(88vw, 320px);
        height: 100vh;
        height: 100dvh;
        padding: calc(5rem + var(--safe-top)) 1.5rem calc(2rem + var(--safe-bottom));
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        background: linear-gradient(180deg, #fff 0%, var(--primary-light) 100%);
        border-left: 3px solid var(--accent);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 110;
        overflow-y: auto;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        border-radius: 10px;
        font-size: 1rem;
        color: var(--text);
        white-space: normal;
    }
    .nav-link:hover { background: var(--accent-light); color: var(--primary-dark); }

    .main-nav .btn-primary-sm {
        text-align: center;
        margin-top: 0.5rem;
        min-height: 48px;
    }

    .nav-toggle:checked ~ .main-nav { transform: translateX(0); }
    .nav-toggle:checked ~ .nav-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-toggle:checked + .nav-toggle-btn .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle:checked + .nav-toggle-btn .nav-toggle-bar:nth-child(2) { opacity: 0; }
    .nav-toggle:checked + .nav-toggle-btn .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }

    .top-bar {
        justify-content: center;
        text-align: center;
        font-size: 0.72rem;
        padding: 6px 12px;
        padding-top: calc(6px + var(--safe-top));
    }
    .top-bar-nav { width: 100%; justify-content: center; }

    .hero-cta { flex-direction: column; width: 100%; }
    .hero-cta .btn { width: 100%; }

    .about-container { padding: 1.25rem; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .footer-brand-col,
    .footer-links-col,
    .footer-social-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-logo-link { justify-content: center; }
    .footer-desc { max-width: none; }
    .footer-list { align-items: center; }
    .cards-grid { grid-template-columns: 1fr; }
    .app-card:hover { transform: none; }
}

@media (max-width: 480px) {
    .brand-name { font-size: 0.88rem; }
    .brand-logo { height: 36px; }
    .badge { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
