/* ============================================
   TrustedSystems.net - Main Stylesheet
   ============================================ */

/* CSS Variables - Theme Colors (Mandatory Palette) */
:root {
    /* Background Colors */
    --bg-primary: #071423;
    --bg-secondary: #0B1E32;
    
    /* Accent Colors */
    --accent-primary: #14E3C2;
    --accent-secondary: #2FA7FF;
    
    /* Text Colors */
    --text-primary: #EAF2FF;
    --text-muted: #A9B7C9;
    
    /* Border */
    --border-soft: rgba(255, 255, 255, 0.08);
    
    /* Derived Colors for Cards/Overlays */
    --bg-card: rgba(11, 30, 50, 0.6);
    --bg-overlay: rgba(7, 20, 35, 0.85);
    --bg-overlay-light: rgba(7, 20, 35, 0.7);
    
    /* Shadows & Effects */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow-subtle: 0 0 15px rgba(20, 227, 194, 0.2);
    --shadow-glow-hover: 0 0 25px rgba(20, 227, 194, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --spacing-2xl: 6rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Header */
    --header-height: 76px;
    --header-height-mobile: 68px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(7, 20, 35, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 1000;
    transition: var(--transition-base);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo Wrapper */
.logo-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    padding: var(--spacing-xs) 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: rgba(7, 20, 35, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    transition: var(--transition-base);
    text-decoration: none;
}

.brand:hover {
    background-color: rgba(7, 20, 35, 0.85);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(20, 227, 194, 0.2);
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 12px rgba(20, 227, 194, 0.5));
    transition: var(--transition-base);
}

.brand:hover .logo {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 18px rgba(20, 227, 194, 0.7));
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-base);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: var(--transition-fast);
    position: relative;
    opacity: 0.85;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: var(--transition-base);
}

.nav-link:hover,
.nav-link:focus {
    color: var(--text-primary);
    opacity: 1;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 80%;
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-base);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    padding-top: var(--header-height);
    background-image: url('../assets/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(7, 20, 35, 0.85) 0%, rgba(11, 30, 50, 0.75) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 10;
}

.hero-content {
    padding: var(--spacing-xl) 0;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero-cta {
    position: relative;
    z-index: 10;
}

.hero-cta .btn {
    position: relative;
    z-index: 10;
}

.hero-headline {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    max-width: 800px;
}

.hero-subheadline {
    font-size: var(--font-size-xl);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 700px;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services {
    padding: var(--spacing-2xl) 0;
    background-color: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* Large desktop: 12-column grid for balanced 3x2 layout */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(12, 1fr);
    }
    
    .services-grid .service-card {
        grid-column: span 4;
    }
}

.service-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-hover);
    border-color: var(--accent-primary);
}

.service-image-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: var(--transition-base);
}

.service-card:hover .service-image {
    opacity: 0.9;
    transform: scale(1.05);
}

.service-content {
    padding: var(--spacing-sm) var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.service-description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    flex: 1;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-md);
    position: relative;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.service-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 600;
}

/* ============================================
   ABOUT & CONTACT SECTION (Combined)
   ============================================ */

.about-contact {
    position: relative;
    padding: var(--spacing-2xl) 0;
    background-image: url('../assets/about-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.about-contact-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(7, 20, 35, 0.9) 0%, rgba(11, 30, 50, 0.85) 100%);
    z-index: 1;
    pointer-events: none;
}

.about-contact .container {
    position: relative;
    z-index: 10;
}

.about-contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    align-items: start;
}

.about-column {
    color: var(--text-muted);
}

.about-story {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.about-why {
    margin-top: var(--spacing-lg);
}

.about-why-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.about-why-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-why-list li {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-md);
    position: relative;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.about-why-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 600;
}

.contact-column {
    color: var(--text-muted);
}

.contact-form {
    background-color: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: 8px;
    border: 1px solid var(--border-soft);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(7, 20, 35, 0.6);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(20, 227, 194, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: 4px;
    display: none;
}

.form-message.success {
    display: block;
    background-color: rgba(20, 227, 194, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.form-message.error {
    display: block;
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
}

.form-microcopy,
.form-email-note {
    margin-top: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

.form-email-fallback {
    margin-top: var(--spacing-xs);
}

.form-email-fallback a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.form-email-fallback a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--bg-primary);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--border-soft);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.footer-logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(20, 227, 194, 0.3));
}

.footer-tagline {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
}

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

.section-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-column .section-subtitle {
    font-size: 1rem;
    line-height: 1.7;
}

/* ============================================
   RESPONSIVE: MOBILE & TABLET
   ============================================ */

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
    }
    
    .header {
        height: var(--header-height-mobile);
    }
    
    .logo {
        height: 40px;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        right: 0;
        background-color: rgba(7, 20, 35, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-soft);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }
    
    .nav.active {
        max-height: 400px;
    }
    
    .nav-list {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
        align-items: stretch;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-sm);
        min-height: 44px;
        text-align: center;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .hero-headline {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subheadline {
        font-size: var(--font-size-lg);
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }
    
    .about-story {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    
    .contact-column .section-subtitle {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
        gap: var(--spacing-md);
    }
    
    .about-contact-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .contact-form {
        padding: var(--spacing-md);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Header & Logo - Mobile */
    .logo {
        height: 36px;
        max-height: 36px;
    }
    
    .brand {
        padding: 0.375rem 0.625rem;
        max-width: 100%;
    }
    
    .header-container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Container - Mobile */
    .container {
        padding: 0 var(--spacing-sm);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Hero Section - Mobile */
    .hero {
        padding-top: var(--header-height-mobile);
        padding-bottom: var(--spacing-lg);
        min-height: auto;
    }
    
    .hero-content {
        padding: var(--spacing-xl) var(--spacing-sm) var(--spacing-lg);
    }
    
    .hero-headline {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: var(--spacing-sm);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero-subheadline {
        font-size: var(--font-size-base);
        line-height: 1.6;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-md);
    }
    
    .hero-cta .btn {
        width: 100%;
        min-height: 44px;
        padding: 0.875rem 1.5rem;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sections - Mobile */
    .section-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
        line-height: 1.5;
    }
    
    .about-story {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    
    .contact-column .section-subtitle {
        font-size: 0.95rem;
        line-height: 1.65;
    }
    
    /* Services Grid - Mobile */
    .services {
        padding: var(--spacing-xl) 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .service-card {
        margin: 0;
    }
    
    .service-image-wrapper {
        height: 160px;
    }
    
    .service-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .service-title {
        font-size: var(--font-size-lg);
    }
    
    /* About & Contact - Mobile */
    .about-contact {
        padding: var(--spacing-xl) 0;
    }
    
    .about-contact-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .about-column {
        order: 1;
    }
    
    .contact-column {
        order: 2;
    }
    
    .contact-form {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .form-group input,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    /* Footer - Mobile */
    .footer {
        padding: var(--spacing-md) 0;
    }
    
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    * {
        max-width: 100%;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
