/* 
   Whevar Innovations Ltd - No-Scroll Coming Soon Page
*/

:root {
    /* Colors */
    --color-orange: #e57d21;
    --color-orange-hover: #d16b17;
    --color-whatsapp: #25D366;
    --color-charcoal: #2e2926;
    --color-terracotta: #300d0f;
    --color-peach: #fff5eb;
    --color-footer-bg: #f2e8dc; /* Slightly darker than peach */
    
    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden; /* Enforce single-screen, no scrolling */
    background-color: var(--color-peach);
    color: var(--color-charcoal);
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* Woven Texture Background layered on a pseudo-element for animation */
.pattern-bg {
    position: absolute;
    inset: 0;
    background-color: var(--color-peach);
    background-image:
        repeating-linear-gradient(45deg,
            rgba(229, 125, 33, 0.15) 0px,
            rgba(229, 125, 33, 0.15) 2px,
            transparent 2px,
            transparent 14px),
        repeating-linear-gradient(-45deg,
            rgba(46, 41, 38, 0.08) 0px,
            rgba(46, 41, 38, 0.08) 2px,
            transparent 2px,
            transparent 14px);
    background-size: 28px 28px;
    /* Animated in via CSS */
}

/* Typography Base */
h1, h2, .eyebrow {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

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

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
    width: 100%;
    padding: clamp(1rem, 3vh, 2.5rem) clamp(1.5rem, 5vw, 4rem) 0 clamp(1.5rem, 5vw, 4rem);
    max-width: 1600px;
    margin: 0 auto;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
}

.logo img {
    height: clamp(32px, 5vh, 48px);
    width: auto;
}

.nav-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: var(--color-charcoal);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: transform 0.15s ease;
}

.nav-btn:hover, .nav-btn:focus-visible {
    transform: translateY(-1px);
    color: var(--color-orange);
}

/* Hero Section */
.hero {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

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

.eyebrow {
    display: block;
    font-size: clamp(0.75rem, 1.5vh, 0.875rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-orange);
    margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw + 2vh, 6rem);
    margin-bottom: clamp(1rem, 3vh, 2rem);
}

.subheadline {
    font-size: clamp(1rem, 2vw + 1vh, 1.35rem);
    line-height: 1.5;
    margin-bottom: clamp(1.5rem, 4vh, 3rem);
    max-width: 650px;
}

.hero-ctas {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 1.5vh, 1rem) clamp(1.5rem, 3vw, 2rem);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    border-radius: 4px; /* Fix 9: Sharper corners */
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-orange);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--color-orange-hover);
    transform: translateY(-1px);
}

.hero-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    position: relative;
    padding-bottom: 2px;
}

.hero-link:hover, .hero-link:focus-visible {
    transform: translateY(-1px);
}

/* Capability Strip */
.capability-strip {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(1rem, 2vw, 3rem);
    padding: clamp(1.5rem, 3vh, 2.5rem) 0;
    margin-bottom: clamp(1rem, 2vh, 2rem);
}

.capability-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.capability-item:hover {
    opacity: 0.8;
}

.cap-icon {
    width: clamp(16px, 2vw, 24px);
    height: auto;
    border-radius: 2px; /* Fix 9: sharp corners */
}

.capability-item p {
    font-size: clamp(0.85rem, 1vw + 0.5vh, 1.125rem);
    line-height: 1.4;
    opacity: 0.9;
}

.capability-item strong {
    font-weight: 600;
    color: var(--color-charcoal);
}

/* Footer (Fix 7, 8) */
.footer {
    flex: 0 0 auto;
    width: 100%;
    background-color: var(--color-footer-bg);
    padding: clamp(0.75rem, 1.5vh, 1.25rem) clamp(1.5rem, 5vw, 4rem);
    font-size: clamp(0.75rem, 1vh + 0.5vw, 0.875rem);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.footer-link, .copyright {
    color: var(--color-charcoal);
    font-weight: 500;
}

.divider, .copyright {
    opacity: 0.65;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.social-link-text {
    color: var(--color-charcoal);
    opacity: 0.7;
    font-weight: 500;
    transition: opacity 0.15s, color 0.15s, transform 0.15s;
    display: inline-block;
}

.social-link-text:hover, .social-link-text:focus-visible {
    opacity: 1;
    color: var(--color-orange);
    transform: translateY(-1px);
}

.slash {
    opacity: 0.4;
    margin: 0 0.25rem;
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: clamp(1.5rem, 4vh, 2rem);
    right: clamp(1.5rem, 4vw, 2rem);
    width: 48px;
    height: 48px;
    background-color: #fff;
    color: var(--color-charcoal);
    border-radius: 4px; /* Sharp corner constraint */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(46, 41, 38, 0.1);
    z-index: 50;
}

/* Breathing animation for FAB */
.wa-fab {
    animation: breathing 4s infinite ease-in-out;
}

@keyframes breathing {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

.fab:hover, .fab:focus-visible {
    color: var(--color-whatsapp);
    animation: none; /* Stop breathing on focus */
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 41, 38, 0.15);
}

/* Modal / Drawer UI */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Let clicks pass through when hidden */
}

/* Handle aria-hidden manually */
.modal[aria-hidden="true"] .modal-backdrop,
.modal[aria-hidden="true"] .modal-content {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}

/* State: Open */
.modal[aria-hidden="false"] {
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(46, 41, 38, 0.45);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease-out;
}

.modal-content {
    position: relative;
    background-color: var(--color-peach);
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: 8px; /* Fix 9 */
    width: 90%;
    max-width: 440px; /* Fix 10: Fixed max-width */
    max-height: 80dvh; /* Never taller than 80% */
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(46, 41, 38, 0.15);
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.modal[aria-hidden="true"] .modal-content {
    transform: scale(0.97); /* Subtle scale per Fix 11 */
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--color-charcoal);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
    padding: 0.5rem;
    border-radius: 4px;
}

.modal-close:hover, .modal-close:focus-visible {
    opacity: 1;
    color: var(--color-orange);
}

.modal-content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
}

.modal-content .subtext {
    font-size: clamp(0.9rem, 2vw, 1rem);
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 1px solid rgba(46, 41, 38, 0.2);
    background-color: #fff;
    border-radius: 4px; /* Fix 9 */
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-charcoal);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(229, 125, 33, 0.15);
}

.form-message {
    margin-top: 1rem;
    font-weight: 500;
}

.success-msg {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 4px;
}

.error-msg {
    color: #c62828;
    background: #ffebee;
    padding: 1rem;
    border-radius: 4px;
}

/* Animations Triggered Automatically on Load */
.eyebrow {
    animation: fadeSlideUp 0.4s ease-out 0.1s both;
}
.hero h1 {
    animation: fadeSlideUp 0.4s ease-out 0.2s both;
}
.subheadline {
    animation: fadeSlideUp 0.4s ease-out 0.3s both;
}
.hero-ctas {
    animation: fadeSlideUp 0.4s ease-out 0.4s both;
}
.capability-strip {
    animation: fadeSlideUp 0.4s ease-out 0.5s both;
}
.pattern-bg {
    animation: fadeInBg 0.8s ease-out 0.3s both;
}

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

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

/* Responsive constraints */
@media (max-width: 768px) {
    .capability-strip {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem 0;
    }
    
    .capability-item {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    
    .capability-item p {
        font-size: clamp(0.85rem, 2.5vw, 1rem);
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hidden-mobile {
        display: none;
    }
    
    .fab {
        bottom: calc(1rem + env(safe-area-inset-bottom));
        right: 1rem;
    }
    
    /* Drawer styling for mobile */
    .modal {
        align-items: flex-end;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90dvh;
        border-radius: 12px 12px 0 0; /* Fix 9 */
        padding-bottom: max(2rem, env(safe-area-inset-bottom)); /* Fix 10 */
        margin: 0;
        transform: translateY(0);
        transition: opacity 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    }

    .modal[aria-hidden="true"] .modal-content {
        transform: translateY(100%);
    }
}

/* Handle Short Viewports */
@media (max-height: 550px) {
    .capability-strip {
        display: none;
    }
    .layout-wrapper {
        justify-content: center;
        gap: clamp(1.5rem, 4vh, 3rem);
        padding-bottom: 4rem; /* leave room for absolute footer */
    }
    .hero {
        flex: 0 1 auto;
    }
    .footer {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
    }
    .fab {
        display: none; /* Hide on super short to avoid collision */
    }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .pattern-bg, .eyebrow, h1, .subheadline, .hero-ctas, .capability-strip {
        opacity: 1;
        transform: none;
    }
    .modal[aria-hidden="true"] .modal-backdrop,
    .modal[aria-hidden="true"] .modal-content {
        visibility: hidden;
        opacity: 0;
        transform: none;
    }
    .fab {
        animation: none;
    }
}
