/* ═══════════════════════════════════════════════════════════════════════════
   K9Port - Main Stylesheet
   Version: 1.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* Colors - Primary */
    --color-primary: #0c1929;
    --color-primary-light: #1a2d42;
    --color-primary-dark: #060d14;
    
    /* Colors - Secondary (Teal) */
    --color-secondary: #0d9488;
    --color-secondary-light: #14b8a6;
    --color-secondary-dark: #0a756b;
    
    /* Colors - Accent (Gold) */
    --color-accent: #d97706;
    --color-accent-light: #f59e0b;
    --color-accent-dark: #b45309;
    
    /* Colors - Neutrals */
    --color-background: #fafaf9;
    --color-surface: #f5f5f4;
    --color-surface-dark: #e7e5e4;
    --color-border: #d6d3d1;
    
    /* Colors - Text */
    --color-text: #1c1917;
    --color-text-muted: #78716c;
    --color-text-light: #a8a29e;
    
    /* Colors - Semantic */
    --color-white: #ffffff;
    --color-black: #000000;
    --color-success: #16a34a;
    --color-success-light: #22c55e;
    --color-error: #dc2626;
    --color-error-light: #ef4444;
    --color-warning: #f59e0b;
    
    /* Typography */
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    
    /* 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;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-slower: 500ms ease;
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    
    /* Container */
    --container-max: 1200px;
    --container-narrow: 800px;
    --container-wide: 1400px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CSS RESET
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -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-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-primary);
    text-wrap: balance;
}

p {
    color: var(--color-text-muted);
    text-wrap: pretty;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */
h1 { font-size: clamp(2.5rem, 5vw, var(--text-6xl)); }
h2 { font-size: clamp(2rem, 4vw, var(--text-5xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-3xl)); }
h4 { font-size: clamp(1.25rem, 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.text-gradient {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.container-wide {
    max-width: var(--container-wide);
}

.section {
    padding: var(--space-24) 0;
}

.section-sm {
    padding: var(--space-16) 0;
}

.section-lg {
    padding: var(--space-32) 0;
}

/* Section Variants */
.section-dark {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--color-white);
}

.section-dark p {
    color: rgba(255, 255, 255, 0.8);
}

.section-surface {
    background-color: var(--color-surface);
}

.section-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
}

.section-gradient h1,
.section-gradient h2,
.section-gradient h3 {
    color: var(--color-white);
}

.section-gradient p {
    color: rgba(255, 255, 255, 0.8);
}

/* Grid Pattern Background */
.bg-grid {
    position: relative;
}

.bg-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(12, 25, 41, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
}

.section-dark.bg-grid::before,
.section-gradient.bg-grid::before {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Buttons
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    color: var(--color-white);
    border-color: transparent;
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(13, 148, 136, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px 0 rgba(13, 148, 136, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-surface-dark);
}

.btn-secondary:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

/* Accent Button */
.btn-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    color: var(--color-white);
    border-color: transparent;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px 0 rgba(217, 119, 6, 0.3);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--color-surface);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
}

.btn-xl {
    padding: var(--space-6) var(--space-12);
    font-size: var(--text-xl);
}

/* Full Width */
.btn-block {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Cards
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

.card-bordered {
    border: 1px solid var(--color-surface-dark);
}

.card-flat {
    box-shadow: none;
}

.card-flat:hover {
    transform: none;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Forms
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
    padding: var(--space-4);
    border: 2px solid var(--color-surface-dark);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--color-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 44px;
}

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

.form-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Header / Navigation
   ═══════════════════════════════════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-surface-dark);
    transition: all var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-2xl);
    color: var(--color-primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 700;
    font-size: var(--text-sm);
}

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

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-links {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-secondary);
    border-radius: var(--radius-full);
}

.nav-cta {
    display: flex;
    gap: var(--space-4);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    transition: all var(--transition-fast);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-white);
    padding: var(--space-6);
    z-index: var(--z-modal);
}

.mobile-nav.open {
    display: block;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.mobile-nav-link {
    font-size: var(--text-lg);
    font-weight: 500;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--color-surface);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Footer
   ═══════════════════════════════════════════════════════════════════════════ */
.footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: var(--space-4);
}

.footer-brand .logo-icon {
    background: rgba(255, 255, 255, 0.1);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
}

.footer-column h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-4);
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-secondary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal {
    display: flex;
    gap: var(--space-8);
}

.footer-legal a {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--color-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Badges
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-secondary);
}

.badge-accent {
    background: rgba(217, 119, 6, 0.1);
    color: var(--color-accent);
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--color-success);
}

.badge-white {
    background: var(--color-white);
    color: var(--color-secondary);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Section Headers
   ═══════════════════════════════════════════════════════════════════════════ */
.section-header {
    max-width: 700px;
    margin: 0 auto var(--space-12);
    text-align: center;
}

.section-header h2 {
    margin-bottom: var(--space-4);
}

.section-header p {
    font-size: var(--text-lg);
}

.section-header-left {
    text-align: left;
    margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE - Hero Sections
   ═══════════════════════════════════════════════════════════════════════════ */
.hero {
    padding-top: calc(72px + var(--space-16));
    padding-bottom: var(--space-16);
    position: relative;
    overflow: hidden;
}

.hero-gradient {
    background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 100%);
}

.page-hero {
    padding-top: calc(72px + var(--space-16));
    padding-bottom: var(--space-12);
    text-align: center;
    background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 100%);
}

.page-hero h1 {
    margin-bottom: var(--space-4);
}

.page-hero p {
    font-size: var(--text-xl);
    max-width: 600px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-slow) ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 4s ease-in-out infinite;
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slower), transform var(--transition-slower);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
}

@media (max-width: 768px) {
    .nav-links,
    .nav-cta {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .section {
        padding: var(--space-16) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-8);
    }
}

@media (max-width: 480px) {
    :root {
        --space-6: 1rem;
    }
    
    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }
    
    .hero {
        padding-top: calc(72px + var(--space-8));
        padding-bottom: var(--space-8);
    }
}
