@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

/* Define Cascade Layers */
@layer reset, base, layout, components, utilities;

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

  html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    min-block-size: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.6;
    overflow-x: hidden;
  }

  img, picture, svg, video {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  input, button, textarea, select {
    font: inherit;
  }

  button {
    cursor: pointer;
    background: none;
    border: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

@layer base {
  :root {
    color-scheme: light dark;

    /* Theme colors using modern light-dark() */
    --bg-primary: light-dark(#FCFAF7, #111311);
    --bg-secondary: light-dark(#F3EFE9, #1B1E1B);
    --bg-card: light-dark(#FFFFFF, #1C1F1C);
    
    --text-primary: light-dark(#2C3531, #FCFAF7);
    --text-secondary: light-dark(#5C6B64, #C1CDC6);
    --text-accent: #CC681E; /* Sandalwood / Terracotta */
    --text-accent-hover: #E37B30;

    --brand-primary: #CC681E;
    --brand-secondary: #4E6E58; /* Sage Green */
    --brand-secondary-light: light-dark(rgba(78, 110, 88, 0.1), rgba(78, 110, 88, 0.2));

    --border-color: light-dark(#EAE3D8, #2E332F);
    --border-focus: #CC681E;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Outfit', 'Inter', system-ui, sans-serif;

    /* Sizes */
    --site-width: 1440px;
    --nav-height: 80px;

    /* Scrollbar customization */
    scrollbar-color: var(--brand-secondary) var(--bg-secondary);
    scrollbar-width: thin;
  }

  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Accessible outline-based focus states */
  *:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 4px;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    text-wrap: balance;
  }

  h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
  h2 { font-size: clamp(2rem, 1.25rem + 3vw, 3.25rem); }
  h3 { font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem); }
  p { text-wrap: pretty; }
}

@layer layout {
  .container {
    max-inline-size: var(--site-width);
    margin-inline: auto;
    padding-inline: 1rem;
  }

  /* Glassmorphic Navigation Header */
  .main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    block-size: var(--nav-height);
    background-color: light-dark(rgba(252, 250, 247, 0.8), rgba(17, 19, 17, 0.8));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
  }

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

  .main-header .container,
  .main-footer .container {
    max-inline-size: none;
    padding-inline: 3.5rem;
  }

  .logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
  }

  .logo-img {
    display: block;
    height: 24px;
    width: auto;
    object-fit: contain;
  }

  .logo-img-secondary {
    height: 26px;
  }

  .logo-text-wrapper {
    display: flex;
    flex-direction: column;
  }

  .logo-title {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .logo-subtitle {
    font-size: 0.65rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  /* Desktop Menu */
  .desktop-nav {
    display: flex;
    gap: 2rem;
    list-style: none;
  }

  .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding-block: 0.5rem;
    transition: color 0.3s;
  }

  .nav-link:hover, .nav-link.active {
    color: var(--brand-primary);
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nav-link:hover::after, .nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  /* Mobile Drawer Toggle Button */
  .drawer-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 30px;
    height: 24px;
    justify-content: center;
    z-index: 110;
  }

  .drawer-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform 0.3s, opacity 0.3s;
  }

  /* Mobile Side Drawer Overlay */
  .mobile-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: 280px;
    background-color: var(--bg-secondary);
    border-inline-start: 1px solid var(--border-color);
    z-index: 105;
    padding: 6rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-drawer.open {
    transform: translateX(0);
  }

  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 104;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.4s;
  }

  .mobile-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mobile-nav-link {
    font-size: 1.25rem;
    font-weight: 500;
    display: block;
    padding-block: 0.5rem;
    border-bottom: 1px solid var(--border-color);
  }

  /* Main Footer */
  .main-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding-block: 5rem 3rem;
    margin-block-start: 5rem;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 3rem;
    row-gap: 3rem;
    margin-block-end: 4rem;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .footer-logo img {
    height: 144px;
  }

  .footer-brand-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
  }

  .footer-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-inline-size: 400px;
  }

  .footer-links-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-block-end: 1.5rem;
  }

  .footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.2s;
  }

  .footer-link:hover {
    color: var(--brand-primary);
  }

  .footer-contact-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.75rem;
    margin-block-end: 0.75rem;
  }

  .footer-contact-item a:hover {
    color: var(--brand-primary);
  }

  .floating-actions {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .floating-action-button {
    inline-size: 3rem;
    block-size: 3rem;
    border-radius: 50%;
    border: 2px solid #fff;
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
  }

  .scroll-top-button {
    background-color: var(--brand-primary);
    font-size: 1.4rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
  }

  .scroll-top-button.visible,
  body.near-footer .scroll-top-button {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .whatsapp-button {
    background-color: #25d366;
    font-size: 1.2rem;
  }

  .floating-action-button:hover {
    transform: translateY(-2px);
  }

  .scroll-top-button:hover {
    background-color: var(--text-accent-hover);
  }

  .whatsapp-button:hover {
    background-color: #1ebe5d;
  }

  .footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-block-start: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
  }

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

  .social-icon-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.2s, transform 0.2s;
  }

  .social-icon-link:hover {
    color: var(--brand-primary);
    transform: translateY(-2px);
  }
}

@layer components {
  /* Premium CTA Button */
  .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    background-color: var(--brand-primary);
    color: #FCFAF7 !important;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  }

  .btn-primary:hover {
    background-color: var(--text-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }

  .btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
  }

  /* Custom Section Styling */
  .section-padding {
    padding-block: 6rem;
  }

  .section-header {
    text-align: center;
    margin-block-end: 4rem;
  }

  .section-title {
    margin-block-end: 1rem;
    position: relative;
    display: inline-block;
    padding-block-end: 0.75rem;
  }

  .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--brand-primary);
  }

  .section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-inline-size: 600px;
    margin-inline: auto;
  }

  /* Card Component */
  .premium-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
  }

  .premium-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-secondary-light);
  }

  .card-img-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
  }

  .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }

  .premium-card:hover .card-img {
    transform: scale(1.05);
  }

  .card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.75rem;
  }

  .card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }

  .card-title {
    font-size: 1.35rem;
    font-family: var(--font-sans);
    line-height: 1.3;
  }

  .card-title a:hover {
    color: var(--brand-primary);
  }

  .card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
  }

  .card-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-start: 0.5rem;
    transition: color 0.2s;
  }

  .card-link:hover {
    color: var(--text-accent-hover);
  }

  /* Testimonials/Reviews Grid */
  .reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }

  .review-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: var(--shadow-sm);
  }

  .review-quote-icon {
    font-size: 4rem;
    font-family: var(--font-serif);
    color: var(--brand-secondary-light);
    position: absolute;
    top: 1rem;
    inset-inline-start: 1.5rem;
    line-height: 1;
    pointer-events: none;
  }

  .review-text {
    position: relative;
    z-index: 2;
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-block-end: 2rem;
    line-height: 1.6;
  }

  .review-author {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--brand-secondary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--brand-secondary);
    border: 2px solid var(--border-color);
  }

  .review-info {
    display: flex;
    flex-direction: column;
  }

  .review-name {
    font-weight: 600;
    font-size: 1rem;
    font-family: Georgia, serif;
  }

  .review-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

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

  .faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
  }

  .faq-item h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    margin-block-end: 0.75rem;
  }

  .faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
  }

  /* Form Components with modern :user-invalid */
  .contact-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    max-inline-size: 650px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

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

  .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
  }

  .form-input, .form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .form-input:focus, .form-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(204, 104, 30, 0.15);
  }

  /* User-interactive input validation visual feedback */
  .form-input:user-invalid, .form-textarea:user-invalid {
    border-color: #E05A47;
    box-shadow: 0 0 0 3px rgba(224, 90, 71, 0.15);
  }

  .form-input:user-valid, .form-textarea:user-valid {
    border-color: #4E6E58;
  }

  .form-textarea {
    resize: vertical;
    min-block-size: 150px;
  }

  .form-error-msg {
    display: none;
    color: #E05A47;
    font-size: 0.8rem;
    font-weight: 500;
  }

  .form-input:user-invalid ~ .form-error-msg,
  .form-textarea:user-invalid ~ .form-error-msg {
    display: block;
  }

  .submit-success {
    display: none;
    background-color: light-dark(#EBF3EE, #1F2E23);
    color: light-dark(#2F5A3D, #90D3A6);
    border: 1px solid light-dark(#CDE0D4, #2D4C36);
    border-radius: 4px;
    padding: 1.25rem;
    margin-block-end: 1.5rem;
    text-align: center;
    font-weight: 500;
  }

  .submit-success.submit-error {
    background-color: light-dark(#FDEDEA, #351E1B);
    color: light-dark(#8A2C1F, #F0A193);
    border-color: light-dark(#F3C8C0, #6C3028);
  }

  .contact-form .btn-primary:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
  }

  /* Lightbox Modal styling */
  .lightbox-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(10, 11, 10, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(8px);
  }

  .lightbox-modal.active {
    display: flex;
    opacity: 1;
  }

  .lightbox-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
  }

  .lightbox-caption {
    color: #FCFAF7;
    margin-block-start: 1rem;
    font-size: 1rem;
    text-align: center;
  }

  .lightbox-btn {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.1);
    color: #FCFAF7;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background-color 0.2s, transform 0.2s;
    z-index: 1010;
  }

  .lightbox-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }

  .lightbox-close {
    top: -50px;
    right: 0;
  }

  .lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
  }
}

@layer utilities {
  /* Layout and spacing utilities */
  .grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 2rem;
  }

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

  .text-center { text-align: center; }
  
  .margin-top-lg { margin-block-start: 3rem; }
  .margin-bottom-lg { margin-block-end: 3rem; }

  /* Gradient Overlay */
  .gradient-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.7));
  }

  /* Fade-in transitions for sections */
  .fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Overrides (Media Queries) */
@media (max-width: 1024px) {
  .grid-3-col {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  .footer-brand {
    grid-column: span 2;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 768px) {
  .container {
    padding-inline: 0.75rem;
  }

  .logo-link {
    gap: 0.1rem;
  }

  .logo-img {
    height: 20px;
  }

  .logo-img-secondary {
    height: 21px;
  }

  .floating-actions {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.5rem;
  }

  .floating-action-button {
    inline-size: 2.4rem;
    block-size: 2.4rem;
  }

  .scroll-top-button {
    font-size: 1rem;
  }

  .whatsapp-button {
    font-size: 0.75rem;
  }

  .desktop-nav {
    display: none;
  }

  .drawer-toggle {
    display: flex;
  }

  /* Hamburger state change when drawer open */
  body:has(.mobile-drawer.open) .drawer-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  body:has(.mobile-drawer.open) .drawer-toggle span:nth-child(2) {
    opacity: 0;
  }
  body:has(.mobile-drawer.open) .drawer-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .grid-3-col, .grid-2-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .contact-form {
    padding: 1.75rem;
  }
}

/* Large / Ultra-Wide Screens Overrides */
@media (min-width: 1920px) {
  :root {
    --site-width: 1680px;
  }
  body {
    font-size: 17px;
  }
}

@media (min-width: 2560px) {
  :root {
    --site-width: 2200px;
  }
  body {
    font-size: 19px;
  }
}
