/* ==========================================================================
   Keder Marketing Website - Base Styles
   Industrial Precision meets Modern SaaS
   ========================================================================== */

/* CSS Custom Properties */
:root {
    /* Colors - Industrial Precision (from Keder logo) */
    /* Light straw/cream base with strong navy contrast */
    --color-bg: #f5f3ea;
    --color-bg-elevated: #ffffff;
    --color-bg-subtle: #ebe9e0;
    --color-bg-muted: #dedad0;
    --color-bg-dark: #0d1b2a;

    /* Text - Strong contrast navy */
    --color-text: #0d1b2a;
    --color-text-secondary: #2b4257;
    --color-text-muted: #5a7184;

    /* Primary: Blue from logo gradient - adjusted for better contrast */
    --color-primary: #3d7ab8;
    --color-primary-light: #5b9bd5;
    --color-primary-dark: #2a5c8f;
    --color-primary-muted: rgba(61, 122, 184, 0.1);

    /* Accent: Deep navy from logo chevron */
    --color-accent: #0d1b2a;
    --color-accent-light: #1a3347;

    /* Technical accent - industrial amber for warnings/highlights */
    --color-technical: #c77b1a;
    --color-technical-muted: rgba(199, 123, 26, 0.1);

    /* Success/Error states */
    --color-success: #1a7a4c;
    --color-error: #c23b3b;

    /* Gradient for the "rail" visual */
    --gradient-rail: linear-gradient(90deg, #5b9bd5 0%, #3d7ab8 50%, #2a5c8f 100%);
    --gradient-blue: linear-gradient(135deg, #a8c8e8 0%, #5b9bd5 50%, #3d7ab8 100%);

    /* Borders - more defined for engineering precision */
    --color-border: rgba(13, 27, 42, 0.15);
    --color-border-subtle: rgba(13, 27, 42, 0.08);
    --color-border-strong: rgba(13, 27, 42, 0.25);

    /* Typography */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', 'Monaco', monospace;

    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
    --text-sm: clamp(0.8125rem, 0.75rem + 0.3125vw, 0.9375rem);
    --text-base: clamp(0.9375rem, 0.875rem + 0.3125vw, 1.0625rem);
    --text-lg: clamp(1.0625rem, 1rem + 0.3125vw, 1.1875rem);
    --text-xl: clamp(1.1875rem, 1.1rem + 0.4375vw, 1.375rem);
    --text-2xl: clamp(1.375rem, 1.25rem + 0.625vw, 1.75rem);
    --text-3xl: clamp(1.75rem, 1.5rem + 1.25vw, 2.5rem);
    --text-4xl: clamp(2rem, 1.625rem + 1.875vw, 3.25rem);
    --text-5xl: clamp(2.5rem, 2rem + 2.5vw, 4.25rem);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Layout */
    --container-max: 1280px;
    --container-narrow: 960px;
    --container-tight: 720px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;

    /* Shadows - crisp, technical shadows */
    --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.1);
    --shadow-md: 0 4px 8px -2px rgba(13, 27, 42, 0.12), 0 2px 4px -2px rgba(13, 27, 42, 0.08);
    --shadow-lg: 0 12px 20px -4px rgba(13, 27, 42, 0.15), 0 4px 8px -4px rgba(13, 27, 42, 0.1);
    --shadow-xl: 0 24px 32px -8px rgba(13, 27, 42, 0.18), 0 8px 12px -6px rgba(13, 27, 42, 0.1);
    --shadow-glow: 0 0 30px rgba(61, 122, 184, 0.25);
    --shadow-inset: inset 0 1px 2px rgba(13, 27, 42, 0.06);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

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

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

@media (min-width: 768px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

/* Section Labels & Titles */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: var(--color-primary-muted);
    border: 1px solid rgba(61, 122, 184, 0.2);
    border-left: 3px solid var(--color-primary);
}

.section-label::before {
    content: '//';
    opacity: 0.5;
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
    max-width: 800px;
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 640px;
    margin-bottom: var(--space-12);
}

/* Buttons - Industrial precision */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

.btn--primary {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.2);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 27, 42, 0.25);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.2);
}

.btn--secondary {
    background: var(--color-bg-elevated);
    color: var(--color-text);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-inset);
}

.btn--secondary:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(61, 122, 184, 0.15);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn--ghost:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

.btn--lg {
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
}

.btn--sm {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
}

/* Technical number styling */
.tech-number {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: rgba(245, 243, 234, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.nav--scrolled {
    background: rgba(245, 243, 234, 0.98);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--color-border-strong);
}

.nav__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
}

@media (min-width: 768px) {
    .nav__container {
        padding: var(--space-4) var(--space-8);
    }
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.nav__logo:hover {
    color: var(--color-text);
}

.nav__logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.nav__logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    z-index: var(--z-modal);
}

.nav__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-base);
    transform-origin: center;
}

.nav__toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.nav__toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
    .nav__toggle {
        display: none;
    }
}

.nav__menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-8);
}

.nav__menu.active {
    display: flex;
}

@media (min-width: 1024px) {
    .nav__menu {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        padding: 0;
        gap: var(--space-8);
    }
}

.nav__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

@media (min-width: 1024px) {
    .nav__links {
        flex-direction: row;
        gap: var(--space-6);
    }
}

.nav__link {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

@media (min-width: 1024px) {
    .nav__link {
        font-size: var(--text-sm);
    }
}

.nav__link:hover,
.nav__link--active {
    color: var(--color-text);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary-dark);
    transition: width var(--transition-fast);
}

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

.nav__cta {
    margin-top: var(--space-4);
}

@media (min-width: 1024px) {
    .nav__cta {
        margin-top: 0;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
    display: grid;
    gap: var(--space-12);
}

@media (min-width: 768px) {
    .footer__grid {
        grid-template-columns: 1fr 2fr;
        gap: var(--space-16);
    }
}

.footer__brand {
    max-width: 320px;
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: var(--space-4);
}

.footer__logo:hover {
    color: var(--color-text);
}

.footer__logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.footer__logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.footer__tagline {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.footer__links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
}

@media (min-width: 640px) {
    .footer__links {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer__column h4 {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer__column ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer__column a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.footer__column a:hover {
    color: var(--color-text);
}

.footer__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

@media (min-width: 640px) {
    .footer__bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer__copyright {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.footer__legal {
    display: flex;
    gap: var(--space-6);
}

.footer__legal a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer__legal a:hover {
    color: var(--color-text);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Status badges - Technical precision */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status--validated {
    background: rgba(26, 122, 76, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(26, 122, 76, 0.2);
}

.status--production {
    background: var(--color-primary-muted);
    color: var(--color-primary-dark);
    border: 1px solid rgba(61, 122, 184, 0.2);
}

.status--shipped {
    background: rgba(13, 27, 42, 0.08);
    color: var(--color-accent);
    border: 1px solid rgba(13, 27, 42, 0.15);
}

.status--pending {
    background: var(--color-technical-muted);
    color: var(--color-technical);
    border: 1px solid rgba(199, 123, 26, 0.2);
}

/* Engineering spec notation */
.spec-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-primary-dark);
    background: var(--color-bg-subtle);
    padding: 0.125em 0.375em;
    border-radius: 2px;
    border: 1px solid var(--color-border-subtle);
}

/* Technical card styling */
.tech-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tech-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.tech-card__body {
    padding: var(--space-4);
}

/* Animation utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

/* Stagger delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ==========================================================================
   Scroll-Triggered Animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Micro-interactions - Precision Engineering
   ========================================================================== */

/* Card hover lift effect */
.card-hover {
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                border-color var(--transition-fast);
}

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

/* Technical highlight on hover */
.tech-highlight {
    position: relative;
}

.tech-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--color-primary);
    transition: height var(--transition-fast);
}

.tech-highlight:hover::before {
    height: 100%;
}

/* Link underline animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width var(--transition-base);
}

.link-underline:hover::after {
    width: 100%;
}

/* Focus states */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-subtle) 25%,
        var(--color-bg-muted) 50%,
        var(--color-bg-subtle) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }

    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .nav,
    .footer,
    .btn,
    .hero__visual {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero__title,
    .section-title {
        color: black;
    }
}
