/* 
   PHADD TRANSPORT - PREMIUM DESIGN SYSTEM 
   A bespoke visual language focused on excellence and storytelling.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Sophisticated Color Palette */
    --color-onyx: #0A111F;      /* Deep Midnight Blue */
    --color-bronze: #B49157;    /* Sophisticated Bronze/Gold */
    --color-bronze-light: #D4BC8E;
    --color-alabaster: #F9F7F2; /* Warm Off-white */
    --color-snow: #FFFFFF;
    --color-graphite: #374151;
    --color-silver: #E5E7EB;
    
    /* Design Tokens */
    --primary: var(--color-onyx);
    --secondary: var(--color-bronze);
    --bg: var(--color-alabaster);
    --surface: var(--color-snow);
    --text-main: var(--color-onyx);
    --text-muted: var(--color-graphite);
    
    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    
    /* Spacing & Layout */
    --space-unit: 1rem;
    --section-gap: clamp(5rem, 10vw, 10rem);
    --border-radius: 2px; /* Sharp, premium corners */
    
    /* Effects */
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-premium: 0 20px 40px rgba(10, 17, 31, 0.05);
    --shadow-hover: 0 30px 60px rgba(10, 17, 31, 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent overflow on all sections */
section, .container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 8vw, 5.5rem); }
h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); }

p {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    max-width: 65ch;
}

.text-bronze { color: var(--secondary); }
.serif-italic { font-family: var(--font-serif); font-style: italic; }

/* Custom UI Components */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.section-padding {
    padding: var(--section-gap) 0;
    position: relative;
    background-color: var(--bg);
    z-index: 10;
}

/* Buttons - Premium Style with Enhanced Interactions */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 2.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--color-snow);
    box-shadow: 0 4px 15px rgba(10, 17, 31, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 17, 31, 0.3);
}

.btn-primary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--secondary);
    transition: var(--transition-smooth);
    z-index: -1;
}

.btn-primary:hover::after {
    height: 100%;
}

.btn-outline {
    border-color: var(--primary);
    background: transparent;
    color: var(--primary);
    position: relative;
}

.btn-outline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: var(--transition-smooth);
    z-index: -1;
}

.btn-outline:hover {
    color: var(--color-snow);
    transform: translateY(-2px);
}

.btn-outline:hover::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    background: rgba(180, 145, 87, 0.1);
}

.mobile-menu-btn i {
    font-size: 1.5rem;
    color: var(--primary);
    transition: color 0.3s ease;
}

.mobile-menu-btn:hover i {
    color: var(--secondary);
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(10, 17, 31, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}

.logo img {
    height: 45px;
    filter: grayscale(1) brightness(0.2);
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    color: var(--primary);
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--secondary);
}

/* Navigation CTA Button */
.nav-cta {
    display: block;
}

/* Mobile Menu Overlay/Styles */
.nav-links.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    gap: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-links.active li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-links.active li:last-child {
    border-bottom: none;
}

.nav-links.active a {
    display: block;
    padding: 1rem 0;
    width: 100%;
}

/* Hero Section Refinement */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    background-color: transparent;
    color: var(--color-snow);
    z-index: 5;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 30%, transparent 100%);
    z-index: 1;
}

.hero-img {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    margin-bottom: 2rem;
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.8;
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Premium Cards with Enhanced Interactions */
.card {
    background: var(--surface);
    padding: 3rem;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    /* Prevent horizontal overflow on hover */
    max-width: 100%;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(180, 145, 87, 0.1), transparent);
    transition: left 0.6s;
    pointer-events: none;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary);
}

.card h3 {
    transition: color 0.3s ease;
}

.card:hover h3 {
    color: var(--secondary);
}

/* Service Grid - Custom Layout */
.services-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 100%;
    overflow: hidden;
}

.service-item {
    grid-column: span 4;
    min-width: 0; /* Prevent grid blowout */
}

.service-item:nth-child(even) {
    margin-top: 4rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-smooth);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: var(--transition-smooth);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: var(--transition-smooth);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(180, 145, 87, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Page Load Animation */
body {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Staggered Animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Form Enhancements */
input, textarea, select {
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    background: var(--surface);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(180, 145, 87, 0.1);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    transition: var(--transition-smooth);
    pointer-events: none;
    color: var(--text-muted);
}

.form-group.focused label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    background: var(--surface);
    padding: 0 0.5rem;
    color: var(--secondary);
}

/* Image Hover Effects */
img {
    transition: var(--transition-smooth);
}

img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Image Handling & Performance */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img.loading {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

img.loaded {
    filter: blur(0);
}

img[src$=".png"] {
    image-rendering: -webkit-optimize-contrast;
}

/* Error State for Images */
img.error {
    background: #f0f0f0;
    position: relative;
    min-height: 100px;
}

img.error::after {
    content: 'Image unavailable';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive Image Container */
.responsive-img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.responsive-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer & Social Links */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition-smooth);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-bronze-light);
}

/* Selection Color */
::selection {
    background: var(--secondary);
    color: var(--color-snow);
}

/* Focus States for Accessibility */
.btn:focus,
.nav-links a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Footer - Architectural Design */
footer {
    background: var(--primary);
    color: var(--color-snow);
    padding: 10rem 0 4rem;
    position: relative;
    z-index: 10;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 6rem;
    margin-bottom: 8rem;
}

.footer-col h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--secondary);
    margin-bottom: 2.5rem;
}

.footer-col ul li {
    margin-bottom: 1.2rem;
}

.footer-col a {
    opacity: 0.6;
}

.footer-col a:hover {
    opacity: 1;
    color: var(--secondary);
}

.footer-bottom {
    padding-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.4;
}

/* Responsive Excellence */
@media (max-width: 1200px) {
    .container {
        padding: 0 clamp(1.5rem, 4vw, 3rem);
    }
    
    .hero-img {
        width: 70%;
    }
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    .service-item {
        grid-column: span 6;
    }
    .service-item:nth-child(even) {
        margin-top: 0;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .hero-img {
        width: 80%;
    }

    .storytelling > .container > div {
        gap: 4rem;
    }

    .service-block {
        gap: 4rem !important;
        margin-bottom: 6rem !important;
    }

    /* Improve tablet navigation */
    .nav-links {
        gap: 2rem;
    }

    .nav-cta {
        display: block;
    }

    /* Card padding adjustments */
    .card {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .service-item {
        grid-column: span 12;
    }

    /* Remove the even child margin on mobile for cleaner layout */
    .service-item:nth-child(even) {
        margin-top: 0;
    }

    /* Hero Section */
    .hero {
        min-height: 80vh;
        text-align: center;
        padding-top: 100px;
    }

    .hero-img {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        opacity: 0.3;
        z-index: 0;
        object-fit: cover;
    }

    .hero-overlay {
        background: linear-gradient(180deg, var(--primary) 0%, rgba(10, 17, 31, 0.85) 100%);
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
        position: relative;
        z-index: 2;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 300px;
    }

    .hero-btns .btn-outline {
        margin-left: 0 !important;
    }

    /* Cookie Consent */
    .cookie-consent {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        padding: 1.5rem;
    }

    /* Storytelling Section */
    .storytelling > .container > div {
        flex-direction: column;
        gap: 2rem;
    }

    .storytelling > .container > div > div {
        min-width: 100% !important;
    }

    /* Service Block */
    .service-block {
        flex-direction: column !important;
        gap: 2rem !important;
        margin-bottom: 4rem !important;
    }

    .service-block > div {
        min-width: 100% !important;
        order: unset !important;
    }

    .section-padding {
        padding: clamp(3rem, 8vw, 6rem) 0;
    }

    /* Card improvements */
    .card {
        padding: 2rem;
    }

    /* Fix overflow issues */
    .card:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 480px) {
    h1 { font-size: clamp(1.8rem, 10vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
    h3 { font-size: clamp(1.2rem, 4vw, 1.5rem); }

    .card {
        padding: 1.5rem;
    }

    .btn {
        padding: 1rem 2rem;
        font-size: 0.85rem;
    }

    nav {
        height: 70px;
    }

    .logo img {
        height: 35px;
    }

    /* Footer improvements */
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .social-links {
        margin-left: 0 !important;
    }

    /* Container padding adjustment */
    .container {
        padding: 0 1rem;
    }

    /* Cookie consent further optimization */
    .cookie-consent {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        padding: 1.5rem;
    }

    /* Button full width on small mobile */
    .hero-btns .btn {
        max-width: 100%;
    }
}

/* Cookie Consent - Minimalist */
.cookie-consent {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-width: calc(100vw - 4rem);
    background: var(--surface);
    padding: 2.5rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
    z-index: 2000;
    border: 1px solid var(--secondary);
    display: none;
}

.cookie-consent.show {
    display: block;
    animation: fadeInUp 0.8s var(--transition-smooth);
}

.cookie-consent h3 {
    margin-bottom: 1rem;
}

.cookie-consent p {
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.cookie-consent a {
    color: var(--secondary);
    text-decoration: underline;
}
