/* ============================================
   ELRICH Trading - Maritime Chandling Services
   Professional, industrial maritime aesthetic
   ============================================ */

:root {
    /* Maritime color palette */
    --color-deep-navy: #0a1628;
    --color-ocean: #0d2137;
    --color-steel: #1a365d;
    --color-harbor: #2c5282;
    --color-accent: #38bdf8;
    --color-accent-dim: #0ea5e9;
    --color-amber: #f59e0b;
    --color-slate: #64748b;
    --color-mist: #94a3b8;
    --color-foam: #e2e8f0;
    --color-white: #f8fafc;
    
    /* Typography */
    --font-primary: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing & Layout */
    --container-max: 1200px;
    --section-padding: 5rem 0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-foam);
    background: var(--color-deep-navy);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Improve touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-links a, .footer-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
}

/* ========== Header & Navigation ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    transition: var(--transition);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-white);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-mist);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    position: relative;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-foam);
    transition: var(--transition);
    display: block;
}

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

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

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

/* ========== Hero Section ========== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8rem 0 4rem;
}

@media (max-width: 768px) {
    .hero {
        padding: 6rem 0 3rem;
        min-height: 90vh;
        min-height: 90dvh;
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.25;
    filter: brightness(0.4) contrast(1.1);
}

@media (max-width: 768px) {
    .hero-image {
        opacity: 0.2;
        filter: brightness(0.3) contrast(1.1);
    }
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(14, 165, 233, 0.08), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-sm);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--color-white);
}

.hero-highlight {
    color: var(--color-accent);
    position: relative;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-mist);
    max-width: 520px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero-subtitle {
        font-size: 1rem;
    }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 480px) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
}

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

.btn-primary:hover {
    background: var(--color-accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

@media (hover: none) and (pointer: coarse) {
    .btn-primary:active {
        transform: scale(0.98);
    }
}

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

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-secondary:active {
    background: rgba(56, 189, 248, 0.15);
}

@media (hover: none) and (pointer: coarse) {
    .btn-secondary:active {
        transform: scale(0.98);
    }
}

.btn-full {
    width: 100%;
}

.hero-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--color-accent);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-slate);
    margin-top: 0.25rem;
}

/* ========== Section Styles ========== */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 0.75rem;
}

.section-desc {
    color: var(--color-mist);
}

/* ========== Services Section ========== */
.services {
    padding: var(--section-padding);
    background: var(--color-ocean);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.service-card {
    background: rgba(26, 54, 93, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.service-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .service-image-wrapper {
        height: 180px;
    }
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.service-card:hover .service-image,
.service-card:active .service-image {
    transform: scale(1.1);
}

@media (hover: none) and (pointer: coarse) {
    .service-card:active .service-image {
        transform: scale(1.05);
    }
}

.service-icon {
    font-size: 2rem;
    margin: 1.5rem 2rem 1rem 2rem;
    position: relative;
    z-index: 1;
}

.service-card h3 {
    padding: 0 2rem;
    margin-bottom: 0.5rem;
}

.service-card p {
    padding: 0 2rem 2rem;
    flex-grow: 1;
}

.service-card h3 {
    font-size: 1.25rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.service-card p {
    color: var(--color-mist);
    font-size: 0.95rem;
}

/* ========== About Section ========== */
.about {
    padding: var(--section-padding);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content .section-tag {
    margin-bottom: 0.75rem;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.about-content p {
    color: var(--color-mist);
    margin-bottom: 1rem;
}

.about-features {
    list-style: none;
    margin-top: 1.5rem;
}

.about-features li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-foam);
}

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

.about-features li strong {
    color: var(--color-white);
}

.about-mission-vision {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.mission-vision-card {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.6), rgba(44, 82, 130, 0.3));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.mission-vision-card .mv-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mission-vision-card p {
    color: var(--color-mist);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

.about-image-wrapper {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.about-image-wrapper:hover .about-image,
.about-image-wrapper:active .about-image {
    transform: scale(1.05);
}

@media (hover: none) and (pointer: coarse) {
    .about-image-wrapper:active .about-image {
        transform: scale(1.02);
    }
}

.about-card {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.8), rgba(44, 82, 130, 0.4));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.about-card-header {
    padding: 1rem 1.5rem;
    background: rgba(56, 189, 248, 0.1);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.about-card-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-accent);
}

.about-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 2rem;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--color-accent);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--color-slate);
}

/* ========== Why Us Section ========== */
.why-us {
    padding: var(--section-padding);
    background: var(--color-ocean);
}

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

.why-item {
    padding: 2rem;
    background: rgba(26, 54, 93, 0.4);
    border-radius: var(--radius-md);
    border: 1px solid rgba(56, 189, 248, 0.08);
    transition: all var(--transition);
}

.why-item:hover {
    border-color: rgba(56, 189, 248, 0.25);
}

.why-number {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-accent);
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.why-item h3 {
    font-size: 1.125rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.why-item p {
    font-size: 0.9rem;
    color: var(--color-mist);
}

/* ========== Contact Section ========== */
.contact {
    padding: var(--section-padding);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info .section-title {
    text-align: left;
    margin-bottom: 1rem;
}

.contact-info > p {
    color: var(--color-mist);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-map {
    margin-top: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.contact-map iframe {
    display: block;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    font-size: 1.25rem;
}

.contact-item strong {
    display: block;
    font-size: 0.8rem;
    color: var(--color-slate);
    margin-bottom: 0.25rem;
}

.contact-item a,
.contact-item span {
    color: var(--color-foam);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--color-accent);
}

.contact-form {
    background: rgba(26, 54, 93, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

@media (max-width: 480px) {
    .contact-form {
        padding: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-foam);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-white);
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 480px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

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

/* ========== Footer ========== */
.footer {
    padding: 3rem 0 1.5rem;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.footer-brand p {
    color: var(--color-slate);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-mist);
    text-decoration: none;
}

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

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(56, 189, 248, 0.08);
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--color-slate);
}

/* ========== Responsive Design ========== */

/* Tablet Landscape and smaller */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-mission-vision {
        grid-template-columns: 1fr;
    }
    
    .why-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    :root {
        --section-padding: 4rem 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: var(--color-ocean);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1rem;
        transition: right 0.3s ease;
        border-left: 1px solid rgba(56, 189, 248, 0.1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        width: 100%;
        font-size: 1.1rem;
    }
    
    /* Mobile menu overlay */
    .nav-links::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: -1;
    }
    
    .nav-links.active::before {
        opacity: 1;
        pointer-events: all;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .stat {
        width: 100%;
        text-align: center;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .service-card {
        padding: 0;
    }
    
    .about-card-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-image-wrapper {
        height: 250px;
    }
    
    .why-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
}

/* Mobile Landscape */
@media (max-width: 640px) {
    :root {
        --section-padding: 3.5rem 0;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    :root {
        --section-padding: 3rem 0;
    }
    
    .hero {
        padding: 5rem 0 2.5rem;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.65rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .service-card h3 {
        font-size: 1.1rem;
        padding: 0 1.5rem;
    }
    
    .service-card p {
        font-size: 0.9rem;
        padding: 0 1.5rem 1.5rem;
    }
    
    .service-icon {
        margin: 1.25rem 1.5rem 0.75rem;
        font-size: 1.75rem;
    }
    
    .about-content .section-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .about-content p {
        font-size: 0.95rem;
    }
    
    .about-image-wrapper {
        height: 220px;
    }
    
    .about-card-body {
        padding: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .why-item {
        padding: 1.5rem;
    }
    
    .why-item h3 {
        font-size: 1rem;
    }
    
    .why-item p {
        font-size: 0.85rem;
    }
    
    .contact-info .section-title {
        font-size: 1.75rem;
    }
    
    .contact-item {
        font-size: 0.95rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-brand p {
        font-size: 0.85rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .nav-links {
        width: 260px;
    }
}
