/* 
    කපිල බේකර්ස් - Luxury Redesign (Apple-style Minimal)
    Design Tokens: Premium, Minimalist, Elegant
*/

:root {
    /* Color Palette */
    --gold: #C5A059;
    --gold-subtle: rgba(197, 160, 89, 0.1);
    --charcoal: #111111;
    --near-black: #050505;
    --pearl: #FBFAF8;
    --cream: #F7F3EE;
    --sand: #E8E2D6;
    
    /* Text Colors */
    --text-primary: #1d1d1f; /* Apple's near-black */
    --text-secondary: #424245;
    --text-tertiary: #86868b;
    --text-white: #ffffff;
    
    /* Spacing & Borders */
    --space-unit: 8px;
    --radius-section: 32px;
    --radius-card: 22px;
    --radius-button: 100px;
    
    /* Animation & Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.25s var(--ease);
    --transition-slow: all 0.5s var(--ease);
    
    /* Shadows & Effects */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.04);
    --blur-glass: blur(25px) saturate(190%);
    --border-subtle: 1px solid rgba(0, 0, 0, 0.06);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans Sinhala', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--pearl);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.main-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 32px);
}

/* Standard Section Padding - Reduced for better density */
.section {
    padding: clamp(40px, 8vw, 60px) 0;
}

.bg-cream { background-color: var(--cream); }
.bg-sand { background-color: var(--sand); }
.text-center { text-align: center; }

/* Luxury Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: clamp(24px, 4vw, 32px);
    line-height: 1.1;
    font-weight: 800;
}

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

.luxury-text {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    line-height: 1.7;
    opacity: 0.9;
    color: var(--text-secondary);
}

/* Buttons (Apple Style) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 1.5vw, 16px) clamp(24px, 3vw, 36px);
    border-radius: var(--radius-button);
    font-weight: 600;
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--charcoal);
    color: var(--white);
    color: white;
}

.btn-primary:hover {
    background-color: #333;
    transform: scale(1.02);
}

.btn-secondary {
    background-color: #25D366; /* WhatsApp stays brand-accurate */
    color: white;
}

.btn-secondary:hover {
    background-color: #1eb956;
    transform: scale(1.02);
}

.btn-outline {
    border: 1.5px solid var(--text-primary);
    background: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--text-primary);
    color: white;
}

.btn-full { width: 100%; margin-bottom: 16px;}

/* Header / Glassmorphism */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: clamp(12px, 2.5vw, 24px) 0; /* More balanced padding for larger logo */
    transition: var(--transition-fast);
    background: rgba(251, 250, 248, 0); /* Start transparent */
}

.header.scrolled {
    padding: clamp(10px, 1.5vw, 15px) 0; /* Keep scrolled state breathable for the logo */
    background: rgba(251, 250, 248, 0.95);
    backdrop-filter: var(--blur-glass);
    border-bottom: var(--border-subtle);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-fast);
    /* Subtle filter to improve visibility on dark background if necessary */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo img {
    height: clamp(72px, 6vw, 92px); /* High-end brand size */
    width: auto;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    display: block;
    transition: var(--transition-fast);
    will-change: transform;
}

@media (max-width: 992px) {
    .logo img {
        height: clamp(62px, 8vw, 75px); /* Tablet Size */
    }
}

@media (max-width: 600px) {
    .logo img {
        height: clamp(52px, 15vw, 62px); /* Strong Mobile Presence */
    }
}

.logo:hover {
    transform: scale(1.02);
}

.logo-text {
    display: none; /* In case it's still in the HTML somewhere */
}

.nav-menu {
    display: flex;
    gap: clamp(20px, 3vw, 40px);
}

.nav-link {
    text-decoration: none;
    color: var(--text-white); /* White text for dark background */
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    opacity: 0.85;
}

.header.scrolled .nav-link {
    color: var(--text-primary); /* Dark text for white background */
}

.nav-link:hover {
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--gold);
    transition: var(--transition-fast);
}

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

/* Hero Section - The Masterpiece */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: var(--charcoal);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65) contrast(1.05); /* Increased contrast + dimming for readability */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    width: 100%;
    max-width: 880px;
}

.hero-title {
    font-size: clamp(2.4rem, 8vw, 4.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: clamp(10px, 2vw, 16px);
    color: white;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--gold);
    font-weight: 600;
    margin-bottom: clamp(12px, 2vw, 20px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-desc {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    opacity: 0.95;
    max-width: 620px;
    margin: 0 auto clamp(28px, 4vw, 44px);
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: clamp(12px, 2vw, 18px);
    justify-content: center;
    flex-wrap: wrap;
}

/* Feature Grid */
.grid {
    display: grid;
    gap: clamp(20px, 3vw, 32px);
}

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

@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

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

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Luxury Cards */
.card-premium {
    background: white;
    border-radius: var(--radius-card);
    padding: clamp(24px, 4vw, 36px) clamp(16px, 3vw, 28px);
    border: var(--border-subtle);
    transition: var(--transition-slow);
    text-align: center;
}

.card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(0,0,0,0.07);
}

.card-icon {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: clamp(16px, 2.5vw, 22px);
    display: block;
}

/* Editorial Menu Section */
.menu-item {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--sand); /* Placeholder */
}

.menu-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    opacity: 0.85;
}

.menu-item:hover img {
    transform: scale(1.1);
    opacity: 0.7;
}

.menu-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: clamp(20px, 3vw, 32px);
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    transform: translateY(16px);
    transition: var(--transition-fast);
}

.menu-item:hover .menu-overlay {
    transform: translateY(0);
}

.menu-title {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 6px;
    color: white;
}

.menu-price {
    color: var(--gold);
    font-weight: 600;
    font-size: clamp(0.85rem, 2vw, 1rem);
    opacity: 0.9;
}

/* Premium Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, clamp(200px, 22vw, 280px));
    gap: clamp(12px, 2vw, 20px);
}

.gallery-item {
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--cream);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Larger gallery items for visual rhythm */
.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, clamp(180px, 28vw, 250px));
    }
    .gallery-item.large { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        grid-auto-rows: clamp(140px, 40vw, 200px);
    }
    .gallery-item.large { grid-column: span 2; grid-row: span 1; }
}

/* Contact Overhaul */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    background: white;
    border-radius: var(--radius-section);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: var(--border-subtle);
}

.contact-info {
    padding: clamp(32px, 5vw, 60px);
    background: var(--cream);
}

.contact-block {
    margin-bottom: clamp(24px, 4vw, 36px);
}

.contact-label {
    display: block;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.contact-value {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.5;
}

.contact-map {
    width: 100%;
    height: 100%;
    min-height: clamp(300px, 40vw, 480px);
    filter: grayscale(1) contrast(1.1) opacity(0.85);
    display: block;
}

@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    .contact-map {
        min-height: 300px;
    }
}

/* Footer (Apple Style) */
.footer {
    padding: clamp(40px, 7vw, 64px) 0 clamp(24px, 4vw, 40px);
    background: var(--charcoal);
    color: white;
    border-radius: var(--radius-section) var(--radius-section) 0 0;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.footer-logo img {
    height: clamp(70px, 9vw, 100px);
    width: auto;
    object-fit: contain;
    display: block;
}

.footer-tagline {
    opacity: 0.6;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    gap: clamp(16px, 3vw, 32px);
    justify-content: center;
    flex-wrap: wrap;
    margin: clamp(24px, 4vw, 36px) 0;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: clamp(20px, 3vw, 32px);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.82rem;
    text-align: center;
}

/* Mobile Nav Toggle */
.hamburger {
    cursor: pointer;
    display: none;
    z-index: 1100;
}

.bar {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 6px 0;
    transition: var(--transition-fast);
    border-radius: 2px;
}

.header:not(.scrolled) .bar {
    background: white; /* Contrast on hero */
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: clamp(24px, 5vh, 40px);
        transition: var(--transition-slow);
        z-index: 1050;
    }
    .nav-menu.active { right: 0; }
    .nav-link {
        font-size: 1.5rem;
        color: var(--text-primary);
    }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 480px) {
    .section { padding: 48px 0; }
    .hero {
        align-items: flex-start;
        padding-top: clamp(160px, 45vw, 240px); /* Content moved significantly higher on mobile */
        padding-bottom: 80px;
    }
    .hero-content {
        padding: 0 20px;
        text-align: center;
    }
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
        margin-bottom: 14px;
        line-height: 1.2;
    }
    .hero-desc {
        font-size: 1rem;
        margin-bottom: 32px;
    }
    .hero-buttons .btn {
        width: 100%;
        max-width: none;
        padding: 16px 28px;
        font-size: 0.95rem;
    }
    .contact-container {
        border-radius: 24px;
    }
    .footer {
        border-radius: 24px 24px 0 0;
        padding: 60px 0 40px;
    }
}

/* WhatsApp Float (Refined) */
.whatsapp-float {
    position: fixed;
    bottom: clamp(20px, 4vw, 40px);
    right: clamp(16px, 3vw, 40px);
    width: clamp(52px, 7vw, 64px);
    height: clamp(52px, 7vw, 64px);
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition-fast);
}

.whatsapp-float:hover {
    transform: scale(1.08) rotate(4deg);
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
}

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

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