/* ==========================================================================
   Art d'Eco - Custom Stylesheet
   ========================================================================== */

/* Define cascade layers */
@layer reset, base, theme, components, utilities;

@layer reset {
  /* Box sizing rules */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  /* Prevent font size inflation */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
  }

  /* Remove default margin and padding */
  body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
    padding: 0;
  }

  /* Remove list styles on ul, ol elements */
  ul, ol {
    list-style: none;
  }

  /* Set core body defaults */
  body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
  }

  /* A elements that don't have a class get default styles */
  a:not([class]) {
    text-decoration-skip-ink: auto;
  }

  /* Make images easier to work with */
  img, picture {
    max-width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
  }

  /* Inherit fonts for inputs and buttons */
  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }

  /* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
  @media (prefers-reduced-motion: reduce) {
    html:focus-within {
      scroll-behavior: auto;
    }
    
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer base {
  :root {
    /* Color Tokens - Elegant Warm Neutrals */
    --color-bg-main: #FAF9F5;      /* Ultra clean warm off-white */
    --color-bg-subtle: #F2EFE8;    /* Soft beige / warm gray */
    --color-text-main: #1C1B19;    /* Dark charcoal for high readability */
    --color-text-muted: #5E5A54;   /* Soft slate-brown for secondary texts */
    
    --color-primary: #151515;      /* Bold black accents */
    --color-accent: #C2A278;       /* Muted gold / warm brass tone */
    --color-accent-hover: #A3845A; /* Darker gold for hovers */
    --color-border: #E5E1D5;       /* Soft outline border */
    --color-white: #FFFFFF;
    
    /* Typography Tokens */
    --font-family-body: 'Outfit', sans-serif;
    --font-family-serif: 'Playfair Display', serif;
    
    /* Header Heights */
    --header-height-large: 90px;
    --header-height-small: 64px;
    
    /* Layout Spacing */
    --container-width: 1200px;
    --section-padding-desktop: 100px;
    --section-padding-mobile: 60px;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: all 0.2s ease;
  }

  body {
    font-family: var(--font-family-body);
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Custom selection color */
  ::selection {
    background-color: var(--color-accent);
    color: var(--color-white);
  }

  /* Custom Scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--color-bg-main);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
  }

  /* Typography defaults */
  h1, h2, h3, h4 {
    font-family: var(--font-family-serif);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--color-primary);
  }
  
  h1 {
    font-size: clamp(2.5rem, 4vw + 1rem, 4.5rem);
    text-wrap: balance;
  }

  h2 {
    font-size: clamp(1.8rem, 2.5vw + 1rem, 2.8rem);
    text-wrap: balance;
  }

  p {
    font-size: clamp(1rem, 0.2vw + 0.95rem, 1.15rem);
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-muted);
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
  }

  /* Accessibility focus ring */
  a:focus-visible, 
  button:focus-visible, 
  input:focus-visible, 
  textarea:focus-visible, 
  select:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
  }
}

@layer components {
  /* Containers */
  .container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
  }

  /* Grid Layouts */
  .grid-two-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
  }

  @media (min-width: 768px) {
    .grid-two-columns {
      grid-template-columns: 1fr 1fr;
      gap: 80px;
    }
  }

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

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-block-size: 48px; /* Touch target size */
  }

  .btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg-main);
  }

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

  .btn-secondary {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
  }

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

  .btn.full-width {
    width: 100%;
  }

  /* ==========================================
     Header & Nav
     ========================================== */
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height-large);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
    border-bottom: 1px solid transparent;
  }

  /* Header style for scrolled state */
  header.scrolled {
    height: var(--header-height-small);
    background-color: rgba(250, 249, 245, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--color-border);
  }

  /* Native CSS Scroll-driven header animation */
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    @keyframes header-shrink {
      to {
        height: var(--header-height-small);
        background-color: rgba(250, 249, 245, 0.85);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-bottom: 1px solid var(--color-border);
      }
    }
    
    header {
      animation: header-shrink auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 100px;
    }
  }

  .header-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo-link {
    display: flex;
    align-items: center;
    font-family: var(--font-family-serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    min-block-size: 44px;
  }

  .nav-list {
    display: flex;
    gap: 32px;
  }

  .nav-link {
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 8px 0;
    position: relative;
  }

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

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

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

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

  /* Hamburger Menu Button */
  .nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
    min-block-size: 44px;
    min-inline-size: 44px;
  }

  .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-primary);
    position: relative;
    transition: var(--transition-fast);
  }

  .hamburger::before,
  .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-primary);
    left: 0;
    transition: var(--transition-fast);
  }

  .hamburger::before { top: -6px; }
  .hamburger::after { bottom: -6px; }

  /* Mobile menu active states */
  .nav-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
  }

  .nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
  }

  .nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
  }

  @media (max-width: 767px) {
    .nav-toggle {
      display: block;
    }

    .nav-menu {
      position: fixed;
      top: 0;
      right: -100%;
      width: 100%;
      height: 100vh;
      background-color: var(--color-bg-main);
      padding: 120px 40px 40px;
      display: flex;
      flex-direction: column;
      transition: var(--transition-smooth);
      z-index: 1050;
      box-shadow: -10px 0 30px rgba(0,0,0,0.02);
    }

    .nav-menu.active {
      right: 0;
    }

    .nav-list {
      flex-direction: column;
      gap: 24px;
    }

    .nav-link {
      font-size: 1.2rem;
    }
  }

  /* ==========================================
     Hero Section
     ========================================== */
  .hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height-large);
    text-align: center;
    overflow: hidden;
  }

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

  .hero-bg-image {
    width: 100%;
    height: 100%;
    background-image: url('images/photo7.jpg');
    background-size: cover;
    background-position: center;
    /* Elegant soft fallback background gradient if image is not loaded yet */
    background-color: var(--color-bg-subtle);
    background-image: url('images/photo7.jpg'), 
                      linear-gradient(135deg, #EFECE6 0%, #D8D2C4 100%);
    background-blend-mode: normal;
    transition: transform 10s ease-out;
  }

  .hero-section:hover .hero-bg-image {
    transform: scale(1.05);
  }

  .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Soft warm light/shade overlay to make text highly readable */
    background: radial-gradient(circle, rgba(250, 249, 245, 0.4) 0%, rgba(250, 249, 245, 0.7) 100%);
    z-index: 2;
  }

  .hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .hero-title {
    font-size: clamp(2rem, 3.5vw + 1rem, 3.8rem);
    font-weight: 400;
    color: var(--color-primary);
  }

  .hero-subtitle {
    font-size: clamp(1rem, 0.8vw + 0.9rem, 1.3rem);
    color: var(--color-text-muted);
    font-weight: 300;
    max-width: 600px;
    line-height: 1.6;
  }

  .hero-actions {
    margin-top: 10px;
  }

  /* ==========================================
     Philosophy Section
     ========================================== */
  .philosophy-section {
    padding: var(--section-padding-desktop) 0;
    background-color: var(--color-bg-main);
    border-bottom: 1px solid var(--color-border);
  }

  .section-title-centered {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
  }

  .section-title-centered::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--color-accent);
    margin: 16px auto 0;
  }

  .philosophy-lead {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    font-size: clamp(1.1rem, 0.4vw + 1rem, 1.35rem);
    line-height: 1.7;
    font-weight: 300;
  }

  /* ==========================================
     Alternating Service Blocks
     ========================================== */
  .services-wrapper {
    background-color: var(--color-bg-main);
  }

  .service-block {
    padding: var(--section-padding-desktop) 0;
    border-bottom: 1px solid var(--color-border);
  }

  /* Alternate background color for blocks */
  .service-block:nth-child(even) {
    background-color: var(--color-bg-subtle);
  }

  .block-title {
    margin-bottom: 24px;
  }

  .block-description {
    margin-bottom: 32px;
    font-weight: 300;
    line-height: 1.7;
  }

  .block-image-container {
    width: 100%;
    position: relative;
  }

  .block-image-container.double-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .block-image-container.triple-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .triple-images .block-image-wrapper {
    aspect-ratio: 3/4;
  }

  .triple-images .block-image {
    min-height: auto;
  }

  @media (max-width: 576px) {
    .block-image-container.double-images {
      grid-template-columns: 1fr;
      gap: 12px;
    }
    .block-image-container.triple-images {
      grid-template-columns: 1fr;
      gap: 12px;
    }
  }

  .block-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
  }

  /* Alternate column orders on desktop */
  @media (min-width: 768px) {
    .alternating-layout.reverse .grid-two-columns > :first-child {
      order: 2;
    }
    .alternating-layout.reverse .grid-two-columns > :last-child {
      order: 1;
    }
  }

  .block-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    background-color: var(--color-bg-subtle);
    /* elegant image fallback: solid neutral color with centered text icon via CSS if missing */
    min-height: 350px;
  }

  .block-image:hover {
    transform: scale(1.03);
  }

  /* ==========================================
     Projects Showcase Section
     ========================================== */
  .projects-section {
    padding: var(--section-padding-desktop) 0;
    background-color: var(--color-bg-main);
    border-bottom: 1px solid var(--color-border);
  }

  .section-header {
    margin-bottom: 60px;
  }

  .section-title {
    margin-bottom: 16px;
  }

  .section-subtitle {
    max-width: 600px;
  }

  .projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  @media (min-width: 768px) {
    .projects-grid {
      grid-template-columns: repeat(3, 1fr);
      gap: 24px;
    }
  }

  .project-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    cursor: pointer;
  }

  .project-image-wrapper {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-subtle);
  }

  .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    background-color: var(--color-bg-subtle);
  }

  .project-card:hover .project-image {
    transform: scale(1.05);
  }

  .project-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 21, 21, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .project-card:hover .project-hover-overlay {
    opacity: 1;
  }

  .project-category {
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-white);
    padding-bottom: 4px;
  }

  .project-info {
    padding: 20px 0 0;
  }

  .project-title {
    font-family: var(--font-family-body);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-primary);
  }

  .project-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }

  /* ==========================================
     Contact / Form Section
     ========================================== */
  .contact-section {
    padding: var(--section-padding-desktop) 0;
    background-color: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
  }

  .contact-details {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .contact-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--color-white);
    border-radius: 50%;
    border: 1px solid var(--color-border);
  }

  .contact-text {
    font-size: 1rem;
    color: var(--color-primary);
    font-weight: 400;
  }

  .contact-link {
    border-bottom: 1px solid transparent;
  }

  .contact-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
  }

  .contact-phone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    color: var(--color-bg-main) !important;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    transition: var(--transition-smooth);
    text-decoration: none;
    border: 1px solid transparent;
    letter-spacing: 0.05em;
  }

  .contact-phone-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-white) !important;
  }

  .contact-info-block.centered {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .contact-info-block.centered .contact-details {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 30px;
  }

  @media (max-width: 767px) {
    .contact-info-block.centered .contact-details {
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
    }
  }

  /* ==========================================
     Footer
     ========================================== */
  footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 80px 0 0;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  @media (min-width: 768px) {
    .footer-grid {
      grid-template-columns: 2fr 1fr 1fr;
      gap: 80px;
    }
  }

  .footer-logo {
    display: block;
    font-family: var(--font-family-serif);
    font-size: 1.8rem;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
  }

  .footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    font-size: 0.95rem;
  }

  .footer-siret {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    font-size: 0.8rem;
    margin-top: 8px;
  }

  .footer-heading {
    font-family: var(--font-family-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    color: var(--color-accent);
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .footer-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 300;
  }

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

  .footer-bottom {
    padding: 24px 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
  }

  .footer-admin-link {
    color: inherit;
    border-bottom: 1px solid transparent;
  }

  .footer-admin-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
  }

  .footer-bottom-flex {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
  }

  @media (min-width: 768px) {
    .footer-bottom-flex {
      flex-direction: row;
      justify-content: space-between;
      text-align: left;
    }
  }
}

@layer utilities {
  /* Scroll reveal animations (applied via JS IntersectionObserver) */
  .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  }

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

  /* Centering utility */
  .text-center {
    text-align: center;
  }

  /* Spacing helpers */
  .mt-20 { margin-top: 20px; }
  .mb-40 { margin-bottom: 40px; }
}
