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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
    font-size: 16px;
    font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #000000;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1.5rem;
    color: #333333;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 500;
    color: #000000;
    margin: 0;
}

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

.nav-menu a {
    text-decoration: none;
    color: #333333;
    font-weight: 400;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: #000000;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #000000;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    /* Fallback for browsers without clamp and vh support */
    min-height: 100vh;
    padding: 8rem 2rem 4rem;
    /* Progressive enhancement with clamp and responsive units */
    min-height: clamp(70vh, 85vh, 100vh);
    padding-top: calc(clamp(4rem, 12vh, 8rem) + 4.5rem);
    padding-bottom: clamp(2rem, 8vh, 4rem);
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #ffffff;
    
    /* Performance optimizations */
    will-change: padding, min-height;
    contain: layout style;
}

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

.hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    /* Fallback for browsers without clamp support */
    font-size: 3rem;
    font-size: clamp(1.8rem, 8vw, 5rem);
    font-weight: 300;
    font-style: italic;
    /* Fallback line-height for older browsers */
    line-height: 1.2;
    line-height: clamp(1.1, 1.2, 1.3);
    /* Fallback letter-spacing for older browsers */
    letter-spacing: 0;
    letter-spacing: clamp(-0.02em, 0.01em, 0.02em);
    margin-bottom: 1.5rem;
    color: #000000;
    /* Optimize text rendering for better performance */
    text-rendering: optimizeLegibility;
    /* Prevent text selection for better UX */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Ensure consistent rendering across browsers */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #555555;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border: 2px solid #000000;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.cta-button:hover,
.cta-button:focus {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: #000000;
}

/* Video Section */
.video-section {
    background-color: #fafafa;
}

.video-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.video-placeholder {
    width: 100%;
    height: 450px;
    background-color: #f0f0f0;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    border-color: #cccccc;
    background-color: #eeeeee;
}

.video-content {
    text-align: center;
}

.play-button {
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.video-placeholder:hover .play-button {
    transform: scale(1.1);
}

.video-text {
    font-size: 1.1rem;
    color: #666666;
    margin: 0;
}

.video-caption {
    font-style: italic;
    color: #777777;
    font-size: 0.95rem;
    text-align: center;
    margin: 0;
}

/* Philosophy Section */
.philosophy-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.philosophy-item {
    text-align: center;
    padding: 2rem;
}

.philosophy-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #000000;
}

.philosophy-text {
    color: #555555;
    line-height: 1.8;
    font-size: 1rem;
}

/* Testimonials Section */
.testimonials-section {
    background-color: #fafafa;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.testimonial-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border: 1px solid #e0e0e0;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.testimonial-quote {
    margin-bottom: 2rem;
}

.testimonial-quote p {
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444444;
    margin: 0;
}

.testimonial-author {
    display: block;
    text-align: center;
}

.author-name {
    display: block;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.25rem;
}

.author-detail {
    display: block;
    font-size: 0.9rem;
    color: #777777;
}

/* Contact Section */
.contact-content {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.contact-info {
    text-align: center;
}

.contact-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #000000;
}

.contact-description {
    color: #555555;
    line-height: 2.0;
    margin-bottom: 2.5rem;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    text-wrap: balance; /* Modern browsers */
    orphans: 2;
    widows: 2;
}

.contact-thought {
    margin: 0 0 1rem 0;
    color: inherit;
    line-height: inherit;
}

.contact-thought:last-child {
    margin-bottom: 0;
}

.social-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #000000;
    font-weight: 500;
}

.social-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #333333;
    font-size: 1rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.social-link:hover,
.social-link:focus {
    color: #000000;
}

.social-icon {
    font-size: 1.2rem;
}

/* Contact Form */
.contact-form {
    background-color: #fafafa;
    padding: 2.5rem;
    border: 1px solid #e0e0e0;
}

.form-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #000000;
    text-align: center;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333333;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cccccc;
    background-color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

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

.form-submit {
    width: 100%;
    padding: 1rem;
    background-color: #000000;
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.form-submit:hover,
.form-submit:focus {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Footer */
.site-footer {
    background-color: #000000;
    color: #ffffff;
    padding: 3rem 0 2rem;
}

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

.footer-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.footer-subtitle {
    color: #cccccc;
    font-size: 0.95rem;
    margin: 0;
}

.footer-text {
    color: #cccccc;
    font-size: 0.9rem;
    margin: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333333;
}

.copyright {
    color: #999999;
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive Design */
/* Tablet-specific optimizations for intermediate screen sizes */
@media (min-width: 481px) and (max-width: 1024px) {
    .hero-section {
        /* Tablet-specific spacing with smooth transitions */
        padding-top: calc(clamp(3.5rem, 11vh, 7rem) + 5.5rem);
        padding-bottom: clamp(1.8rem, 7vh, 3.5rem);
        padding-left: clamp(1.5rem, 3.5vw, 2rem);
        padding-right: clamp(1.5rem, 3.5vw, 2rem);
        min-height: clamp(65vh, 80vh, 90vh);
    }
    
    /* Landscape tablet optimizations */
    @media (orientation: landscape) {
        .hero-section {
            min-height: clamp(80vh, 90vh, 100vh);
            padding-top: calc(clamp(2.5rem, 8vh, 5rem) + 5rem);
            padding-bottom: clamp(1.5rem, 5vh, 2.5rem);
        }
    }
    
    /* Tablet video spacing optimization */
    .video-placeholder {
        margin-bottom: 1.25rem; /* Intermediate spacing for tablet devices */
    }
    
    .video-container {
        padding-bottom: 1rem; /* Moderate container padding for tablets */
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
    }
    
    .hero-section {
        /* More aggressive spacing reduction for tablets */
        /* Adjust for potentially taller mobile navigation */
        padding-top: calc(clamp(3rem, 10vh, 6rem) + 6rem);
        padding-bottom: clamp(1.5rem, 6vh, 3rem);
        padding-left: clamp(1rem, 3vw, 1.5rem);
        padding-right: clamp(1rem, 3vw, 1.5rem);
        min-height: clamp(60vh, 75vh, 85vh);
    }
    
    .hero-title {
        /* Optimized scaling for tablet range */
        font-size: clamp(2.5rem, 6vw, 3.5rem);
        line-height: clamp(1.15, 1.2, 1.25);
    }
    
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .philosophy-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .social-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }
    
    .video-placeholder {
        height: 300px;
        margin-bottom: 1rem; /* Reduced from 1.5rem for better mobile spacing */
    }
    
    .video-container {
        padding-bottom: 0.5rem; /* Ensure consistent bottom spacing on mobile */
    }
    
    /* Fix actual video section spacing on mobile */
    .video-section .section-title {
        margin-bottom: 0.1rem; /* Extremely tight title to video spacing */
    }
    
    .video-embed {
        margin-bottom: 0.05rem; /* Almost no video to caption spacing */
    }
}

@media (max-width: 480px) {
    .hero-section {
        /* Maximum spacing reduction for mobile */
        padding-top: calc(clamp(2.5rem, 8vh, 5rem) + 5rem);
        padding-bottom: clamp(1rem, 4vh, 2rem);
        padding-left: clamp(1rem, 2vw, 1.5rem);
        padding-right: clamp(1rem, 2vw, 1.5rem);
        min-height: clamp(50vh, 65vh, 75vh);
    }
    
    /* Portrait mobile optimization */
    @media (orientation: portrait) {
        .hero-section {
            /* Slightly more compact for portrait mobile */
            min-height: clamp(55vh, 70vh, 80vh);
            padding-bottom: clamp(1.2rem, 5vh, 2.5rem);
        }
    }
    
    /* Landscape mobile optimization */
    @media (orientation: landscape) {
        .hero-section {
            /* More compact for landscape mobile due to limited height */
            min-height: clamp(70vh, 85vh, 95vh);
            padding-top: calc(clamp(2rem, 6vh, 4rem) + 4rem);
            padding-bottom: clamp(0.8rem, 3vh, 1.5rem);
        }
    }
    
    .hero-title {
        /* Fallback for browsers without clamp support */
        font-size: 2rem;
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        /* Ensure minimum readability on very small screens */
        min-height: auto;
        /* Tighter line height for mobile */
        line-height: clamp(1.1, 1.15, 1.2);
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
    }
    
    .testimonial-card,
    .contact-form {
        padding: 1.5rem;
    }
    
    .philosophy-item {
        padding: 1rem;
    }
    
    .video-placeholder {
        height: 250px;
        margin-bottom: 0.75rem; /* Further reduced for smaller mobile screens */
    }
    
    /* More aggressive video section spacing for smaller mobile */
    .video-section .section-title {
        margin-bottom: 0.05rem; /* Extremely tight title to video spacing */
    }
    
    .video-embed {
        margin-bottom: 0.02rem; /* Almost zero video to caption spacing */
    }
    
    .contact-description {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
        line-height: 1.6;
        word-spacing: -0.05em; /* Slightly tighter word spacing */
    }
    
    .contact-thought {
        margin-bottom: 1.2rem;
    }
}

/* Mid-range mobile screens */
@media (max-width: 375px) {
    .contact-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .contact-thought {
        margin-bottom: 1rem;
    }
}

/* Very narrow screens - ensure minimum readability */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.1 !important;
    }
    
    .contact-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .video-placeholder {
        margin-bottom: 0.5rem; /* Minimum spacing for very small screens */
    }
}

/* Desktop screens - preserve original video spacing */
@media (min-width: 1025px) {
    .video-placeholder {
        margin-bottom: 1.5rem; /* Original desktop spacing preserved */
    }
    
    .video-container {
        padding-bottom: 0; /* Reset container padding for desktop */
    }
}

/* Large desktop screens - prevent oversized text */
@media (min-width: 1400px) {
    .hero-title {
        font-size: clamp(4rem, 4vw, 5rem);
        line-height: clamp(1.2, 1.25, 1.3);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-title {
        /* Disable smooth scaling for users who prefer reduced motion */
        font-size: 3rem !important;
    }
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Edge Case Handling for Extreme Viewport Sizes */
/* Very short screens - ensure minimum content visibility */
@media (max-height: 500px) {
    .hero-section {
        min-height: 90vh;
        padding-top: calc(clamp(2rem, 6vh, 4rem) + 4rem);
        padding-bottom: clamp(0.5rem, 2vh, 1rem);
    }
}

/* Very large screens - prevent excessive spacing */
@media (min-height: 1200px) {
    .hero-section {
        max-height: 100vh;
        padding-top: calc(clamp(6rem, 10vh, 8rem) + 4.5rem);
        padding-bottom: clamp(3rem, 6vh, 4rem);
    }
}

/* Very narrow screens - ensure minimum spacing */
@media (max-width: 320px) {
    .hero-section {
        padding-top: calc(2rem + 4rem) !important;
        padding-bottom: 1rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        min-height: 60vh !important;
    }
}

/* Very wide screens - prevent oversized spacing */
@media (min-width: 1400px) {
    .hero-section {
        padding-left: clamp(2rem, 8vw, 4rem);
        padding-right: clamp(2rem, 8vw, 4rem);
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* Browser Compatibility Fallbacks */
/* Fallback for browsers without clamp support */
@supports not (font-size: clamp(1rem, 2vw, 3rem)) {
    .hero-section {
        padding: 6rem 2rem 3rem; /* Static fallback */
        min-height: 80vh;
    }
    
    @media (max-width: 768px) {
        .hero-section {
            padding: 5rem 1rem 2rem;
            min-height: 70vh;
        }
    }
    
    @media (max-width: 480px) {
        .hero-section {
            padding: 4rem 1rem 1.5rem;
            min-height: 60vh;
        }
    }
}

/* Fallback for browsers without viewport height (vh) support */
@supports not (height: 1vh) {
    .hero-section {
        min-height: 600px;
        padding-top: 4rem;
        padding-bottom: 2rem;
    }
    
    @media (max-width: 768px) {
        .hero-section {
            min-height: 500px;
            padding-top: 3rem;
            padding-bottom: 1.5rem;
        }
    }
    
    @media (max-width: 480px) {
        .hero-section {
            min-height: 400px;
            padding-top: 2.5rem;
            padding-bottom: 1rem;
        }
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-title {
        color: #000000;
        font-weight: 400;
    }
    
    .video-placeholder {
        border-width: 3px;
    }
    
    .testimonial-card {
        border-width: 2px;
    }
    
    .contact-form {
        border-width: 2px;
    }
}