/* Custom Premium Design System for Triviasoft.com */

:root {
    /* Color Palette (Deep Space Theme) */
    --bg-dark: hsl(230, 25%, 6%);
    --bg-darker: hsl(230, 30%, 4%);
    --bg-card: hsla(230, 25%, 9%, 0.45);
    
    --accent-primary: hsl(190, 95%, 50%); /* Bright Cyan */
    --accent-secondary: hsl(265, 90%, 65%); /* Neon Purple */
    --accent-tertiary: hsl(215, 90%, 60%); /* Electric Blue */
    
    --text-main: hsl(220, 20%, 94%);
    --text-muted: hsl(225, 12%, 68%);
    --text-dark: hsl(230, 10%, 40%);
    
    /* Layout & Glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-glow: rgba(138, 75, 255, 0.12);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-darker);
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    background-color: transparent;
}

/* Inline SVG icons (sprite in index.html): sized and coloured like icon-font glyphs */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* Canvas Background */
#cosmic-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none; /* Let click events reach other page elements */
    /* Central cosmic glow (static, so it lives in CSS instead of being repainted every frame) */
    background:
        radial-gradient(circle closest-side at 50% 50%, rgba(30, 20, 50, 0.2) 0%, rgba(15, 10, 35, 0.08) 35%, rgba(0, 0, 0, 0) 70%),
        radial-gradient(circle at 50% 50%, hsl(230, 25%, 9%) 0%, hsl(230, 30%, 3%) 100%);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: hsl(230, 20%, 15%);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Header & Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    background-color: rgba(6, 8, 15, 0.65);
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    background-color: rgba(4, 5, 10, 0.85);
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
}

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

.logo-s {
    color: var(--accent-secondary);
    font-weight: 900;
}

.logo:hover {
    transform: scale(1.02);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 5px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-secondary);
    color: var(--text-main);
    background: rgba(138, 75, 255, 0.1);
    box-shadow: 0 0 15px rgba(138, 75, 255, 0.15);
}

.nav-btn:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    box-shadow: 0 0 20px rgba(138, 75, 255, 0.35);
    border-color: transparent;
    transform: translateY(-2px);
}

.nav-btn::after {
    display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh; /* accounts for mobile browser toolbars so the CTA isn't clipped */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 2;
}

.typing-container {
    min-height: 180px; /* Prevent layout shift during typing */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.typing-text {
    font-family: 'Fira Code', monospace;
    font-size: 2.2rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-main);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    word-break: keep-all;
}

.typing-text span.world-highlight {
    color: #ffffff;
    font-weight: 700;
}

.typing-text span.simple-highlight {
    color: transparent;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 700;
    text-shadow: none;
}

.typing-text span.valuable-highlight {
    color: transparent;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 700;
    text-shadow: none;
}

.typing-cursor {
    display: inline-block;
    /* 'ch' matches one monospace glyph's width in Fira Code, so the cursor reads as a character cell (halved) */
    width: 0.275ch;
    height: 1em;
    background: var(--text-muted);
    margin-left: 2px;
    vertical-align: baseline;
    animation: cursor-blink 0.8s infinite;
    border-radius: 1px;
}

.hero-cta-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-cta-container.show {
    opacity: 1;
    transform: translateY(0);
}

.explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    border-radius: 40px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.explore-btn .icon {
    transition: var(--transition-smooth);
    color: var(--accent-primary);
}

.explore-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
}

.explore-btn:hover .icon {
    transform: translateY(4px);
    color: var(--accent-secondary);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.mouse-scroll {
    width: 26px;
    height: 44px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
    opacity: 0.6;
    animation: float 2.5s ease-in-out infinite;
}

.mouse-scroll::before {
    content: '';
    width: 4px;
    height: 8px;
    background-color: var(--accent-primary);
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
    animation: scroll-wheel 1.8s infinite;
}

/* Sections Styling */
.section {
    padding: 120px 20px;
    position: relative;
    width: 100%;
    z-index: 2;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-badge {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    font-weight: 700;
    background: rgba(0, 229, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(0, 229, 255, 0.15);
}

.section-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 60px;
    text-align: center;
    max-width: 600px;
}

/* Glass Card Definition */
/* No backdrop-filter here: blurring the animated galaxy canvas behind large cards
   forces a full re-blur every frame. A layered translucent gradient + top-edge
   highlight gives the frosted-glass look at a fraction of the cost. */
.glass-card {
    background:
        linear-gradient(160deg, hsla(230, 30%, 15%, 0.72) 0%, hsla(230, 28%, 8%, 0.82) 60%, hsla(232, 30%, 6%, 0.86) 100%);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255, 255, 255, 0.05), transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-6px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--glass-glow);
}

/* Philosophy Section Grid */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.philosophy-card {
    padding: 40px 30px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    background: rgba(138, 75, 255, 0.1);
    border: 1px solid rgba(138, 75, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--accent-secondary);
    transition: var(--transition-smooth);
}

.philosophy-card:hover .card-icon {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    color: var(--text-main);
    box-shadow: 0 0 20px rgba(138, 75, 255, 0.4);
    transform: scale(1.08) rotate(5deg);
}

.philosophy-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

.philosophy-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* Solutions Section Grid */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.solution-card {
    padding: 50px 40px;
    position: relative;
}

.solution-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 100%;
}

.solution-num {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 229, 255, 0.3);
    transition: var(--transition-smooth);
}

.solution-card:hover .solution-num {
    color: var(--accent-primary);
    -webkit-text-stroke: 1px transparent;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.solution-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.solution-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    flex-grow: 1;
}

/* Connect Section Layout */
.connect-wrapper {
    width: 100%;
    max-width: 800px;
    padding: 50px 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.form-group input,
.form-group textarea {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(138, 75, 255, 0.15);
}

.form-group:focus-within label {
    color: var(--accent-secondary);
}

.submit-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    border-radius: 40px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-darker);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 5px 20px rgba(0, 229, 255, 0.25);
}

.submit-btn .icon {
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.45);
    background: linear-gradient(135deg, hsl(190, 100%, 55%), hsl(215, 100%, 65%));
}

.submit-btn:hover .icon {
    transform: translate(4px, -4px);
}

/* Footer Section styling */
.footer {
    border-top: 1px solid var(--glass-border);
    background-color: rgba(4, 5, 10, 0.9);
    padding: 80px 20px 30px;
    position: relative;
    z-index: 2;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 320px;
}

.footer-links, .footer-social {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-links h4, .footer-social h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    align-self: flex-start;
}

.footer-links a:hover {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.25);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.footer-bottom p {
    color: var(--text-muted);
}

.footer-legal-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-legal-link:hover {
    color: var(--accent-primary);
}

/* Animations */
@keyframes cursor-blink {
    50% { opacity: 0; }
}

@keyframes scroll-wheel {
    0% { opacity: 0; transform: translate(-50%, 0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 14px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Intersection Observer Animations */
.section-container {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .philosophy-grid, .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }
    .typing-text {
        font-size: 1.6rem;
    }
    .typing-container {
        min-height: 220px;
    }
    
    /* Responsive Menu */
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        /* 96% opaque: a backdrop blur would be invisible but still cost a full re-blur per frame */
        background: rgba(6, 8, 15, 0.96);
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        padding: 50px;
        transition: var(--transition-smooth);
        border-left: 1px solid var(--glass-border);
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .menu-toggle.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .philosophy-grid, .solutions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Narrow smartphones (e.g. iPhone SE, most Android phones in portrait) */
@media (max-width: 480px) {
    .nav-container {
        padding: 14px 16px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .hero-section {
        padding: 16px;
    }

    .typing-text {
        font-size: 1.3rem;
    }

    .typing-container {
        min-height: 240px;
    }

    .explore-btn {
        padding: 14px 26px;
        font-size: 0.95rem;
    }

    .section {
        padding: 80px 16px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 40px;
    }

    .philosophy-card {
        padding: 30px 22px;
    }

    .solution-card {
        padding: 36px 24px;
    }

    .solution-num {
        font-size: 2.4rem;
    }

    .connect-wrapper {
        padding: 32px 22px;
    }

    .footer {
        padding: 60px 16px 24px;
    }
}
