/* Modern design system for greenbit.io */

/* CSS Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* System Font Stack - Apple's approach */
:root {
    --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-secondary: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    
    /* Colors - Clean and minimal */
    --color-primary: #1d1d1f;
    --color-secondary: #86868b;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-background: #fbfbfd;
    --color-surface: #ffffff;
    --color-border: #d2d2d7;
    --color-success: #34c759;
    --color-error: #ff3b30;
    
    /* Alternating section backgrounds */
    --color-section-light: #fafbfc;  /* Very light grey for default sections */
    --color-section-dark: #f5f6f7;   /* Slightly darker grey for alternating sections */
    
    /* Brand greens from logo - only for buttons */
    --green-primary: #58B71D;
    --green-dark: #139501;
    --green-light: #6bc127;
    
    /* Spacing system */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;
    --space-xxxl: 6rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-primary);
    font-size: 17px;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--color-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
    font-size: 48px;
    line-height: 1.08349;
    font-weight: 600;
    letter-spacing: -0.003em;
}

h2 {
    font-size: 40px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: 0;
}

h3 {
    font-size: 28px;
    line-height: 1.14286;
    font-weight: 600;
    letter-spacing: 0.007em;
}

h4 {
    font-size: 21px;
    line-height: 1.19048;
    font-weight: 600;
    letter-spacing: 0.011em;
}

.text-secondary {
    color: var(--color-secondary);
}

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

/* Navigation - Modern Style */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
}

nav {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 32px;
    width: auto;
}

nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    margin: 0;
    padding: 0;
}

nav a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

nav a:hover {
    opacity: 1;
}

/* Container */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 22px;
}

/* Hero Section - Modern Style */
.hero {
    padding-top: calc(60px + var(--space-xxxl));
    padding-bottom: var(--space-xxxl);
    text-align: center;
    background: var(--color-background);
}

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

/* Video viewport using greenbit-leaf-port.svg as mask - larger size */
.video-viewport {
    width: 500px !important;
    height: 500px !important;
    margin: 0 auto 30px !important;
    position: relative;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.viewport-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    display: block;
}

/* Use the properly sized viewport SVG */
.video-container {
    mask: url('images/greenbit-leaf-viewport.svg') no-repeat center;
    mask-size: contain;
    -webkit-mask: url('images/greenbit-leaf-viewport.svg') no-repeat center;
    -webkit-mask-size: contain;
}

.hero h1 {
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, #1d1d1f 0%, #86868b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 21px;
    line-height: 1.381;
    color: var(--color-secondary);
    margin-bottom: var(--space-xl);
}

/* Industries Section */
.industries {
    padding: var(--space-xxxl) 0;
    background: var(--color-section-light);
}

.industries h2 {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.industry-points {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-xxl);
    align-items: stretch;
}

/* Smaller industry cards */
.industries .card-vertical {
    min-height: 400px;
}

.industries .card-vertical .card-content {
    padding: var(--space-lg);
}

.industries h3 {
    font-size: 24px;
    margin-bottom: var(--space-xs);
}

.industries p {
    font-size: 15px;
    line-height: 1.4;
}

/* Industry card images - smaller icons centered in bottom half */
.card-vertical.card-iot::after {
    background-image: url('images/iot.svg');
    background-size: 60px auto;
    background-position: center center;
}

.card-vertical.card-saas::after {
    background-image: url('images/k8s.svg');
    background-size: 60px auto;
    background-position: center center;
}

.card-vertical.card-aviation::after {
    background-image: url('images/airplane.svg');
    background-size: 60px auto;
    background-position: center center;
}

.card-vertical.card-semiconductors::after {
    background-image: url('images/chip.svg');
    background-size: 60px auto;
    background-position: center center;
}

/* Buttons - Modern Style with Greenbit Colors */
.button {
    display: inline-block;
    background: var(--green-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 400;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(88, 183, 29, 0.2);
}

.button:hover {
    background: var(--green-dark);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(88, 183, 29, 0.3);
}

.button-secondary {
    background: transparent;
    color: var(--green-primary);
    border: 2px solid var(--green-primary);
}

.button-secondary:hover {
    background: var(--green-primary);
    color: white;
    border-color: var(--green-primary);
}

.button-outline {
    background: transparent;
    color: var(--green-dark);
    border: 2px solid var(--green-dark);
}

.button-outline:hover {
    background: var(--green-dark);
    color: white;
    border-color: var(--green-dark);
}

/* Cards - Modern Style */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card.card-vertical {
    padding: 0;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    background: transparent;
}

.card h3 {
    margin-bottom: var(--space-sm);
}

.card p {
    color: var(--color-secondary);
    line-height: 1.58824;
}

/* Vertical card layout with background image */
.card-vertical {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    background: var(--color-surface);
}

/* Removed gradient fade - images now show clearly */

.card-vertical::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -1px;
    right: -1px;
    height: 50%;
    background-size: 100% auto;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Individual card images */
.card-vertical.card-beginnings::after {
    background-image: url('images/fragile-beginnings.png');
}

.card-vertical.card-growth::after {
    background-image: url('images/growth.png');
}

.card-vertical.card-production::after {
    background-image: url('images/robotic-arm.png');
}

.card-vertical .card-content {
    position: relative;
    z-index: 2;
    padding: var(--space-xl);
    height: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-vertical h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.card-vertical p {
    color: var(--color-secondary);
}

/* Grid Layout */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* About Section */
.about {
    padding: var(--space-xxxl) 0;
    background: var(--color-section-dark);
}

.about h2 {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.about-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xxl);
    align-items: stretch;
}

.point {
    height: 100%;
}

.point h3 {
    margin-bottom: var(--space-sm);
}

.point p {
    color: var(--color-secondary);
}

/* Services Section */
.services {
    padding: var(--space-xxxl) 0;
    background: var(--color-section-dark);
}

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

.section-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
}

.services h2 {
    margin-bottom: var(--space-xxl);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xxl);
}

.service-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.service-box:hover {
    border-color: var(--color-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.service-box h3 {
    font-size: 21px;
    margin-bottom: var(--space-sm);
}

.service-box p {
    color: var(--color-secondary);
    font-size: 16px;
    line-height: 1.5;
}

/* Testimonials */
.testimonials {
    padding: var(--space-xxxl) 0;
    background: var(--color-section-light);
}

.testimonials h2 {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.testimonial {
    background: #f5f5f7;
    border-radius: var(--radius-xl);
    padding: var(--space-xxl);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
}

.testimonial-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.testimonial-person-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-text {
    flex: 1;
}

.testimonial-text p {
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    font-style: italic;
}

.testimonial-person-name {
    color: var(--color-secondary);
    font-size: 14px;
    text-align: center;
}

.testimonial-person-name p {
    margin: 0;
    font-style: normal;
}

.testimonial-client-logo {
    height: 32px;
    width: auto;
    opacity: 1;
}

/* Contact Form - Modern Style */
.contact {
    padding: var(--space-xxxl) 0;
    background: var(--color-section-dark);
}

.contact h2 {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.contact > .container > p {
    text-align: center;
    color: var(--color-secondary);
    font-size: 21px;
    margin-bottom: var(--space-xxl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact form {
    max-width: 500px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: var(--space-xxl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.contact label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.contact input,
.contact textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--font-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-background);
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.contact input:focus,
.contact textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-surface);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.contact input.invalid,
.contact textarea.invalid {
    border-color: var(--color-error);
    background: #fff5f5;
}

.contact input.valid,
.contact textarea.valid {
    border-color: var(--color-success);
    background: rgba(52, 199, 89, 0.05);
}

.error-message {
    color: var(--color-error);
    font-size: 13px;
    margin-top: var(--space-xs);
    display: none;
}

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

.contact button[type="submit"] {
    width: 100%;
    margin-top: var(--space-md);
}

/* Footer */
footer {
    background: var(--color-primary);
    color: white;
    padding: var(--space-xl) 0;
    text-align: center;
}

footer .logo {
    width: 150px;
    height: auto;
    margin: 0 auto var(--space-md);
    display: flex;
    justify-content: center;
    align-items: center;
}

footer .logo img {
    width: 150px;
    height: auto;
    display: block;
}

footer p {
    font-size: 14px;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 21px;
    }
    
    .hero {
        padding-top: calc(60px + var(--space-xl));
        padding-bottom: var(--space-xl);
    }
    
    .hero p {
        font-size: 18px;
    }
    
    nav ul {
        gap: var(--space-lg);
    }
    
    .testimonial {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .testimonial-person {
        margin-bottom: var(--space-lg);
    }
    
    .contact form {
        padding: var(--space-lg);
    }
    
    .services-grid,
    .about-points,
    .industry-points {
        grid-template-columns: 1fr;
    }
    
    .card-vertical {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }
    
    .container,
    .container-wide {
        padding: 0 16px;
    }
    
    nav {
        padding: 0 16px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}