/* 
  ==========================================================================
    @author Pedro Silva
  ============================================================================
*/

/* ---- Typed custom properties for animation ---- */
@property --hue-rotate {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-pos {
  syntax: "<percentage>";
  initial-value: 0%;
  inherits: false;
}

@property --reveal-progress {
  syntax: "<number>";
  initial-value: 0;
  inherits: false;
}

/* ================================================================
   LAYER ORDER — controls cascade without specificity wars
   ================================================================ */
@layer reset, tokens, base, layout, components, utilities;

/* ---- RESET ---- */
@layer reset {

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

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

  :where(a) {
    text-decoration: none;
    color: inherit;
  }

  :where(ul, ol) {
    list-style: none;
  }

  :where(button) {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
  }
}

/* ---- DESIGN TOKENS ---- */
@layer tokens {
  :root {
    /* Enable animate to/from auto keyword sizes */
    interpolate-size: allow-keywords;

    /* Prevent scrollbar layout shift */
    scrollbar-gutter: stable;

    /* --- Palette (oklch wide-gamut) --- */
    --rose-light: oklch(0.92 0.03 10);
    --rose: oklch(0.78 0.08 12);
    --rose-deep: oklch(0.65 0.12 15);
    --cream: oklch(0.97 0.01 85);
    --cream-warm: oklch(0.95 0.02 75);
    --gold: oklch(0.75 0.12 75);
    --gold-light: oklch(0.85 0.08 80);
    --chocolate: oklch(0.35 0.06 50);
    --chocolate-light: oklch(0.45 0.05 55);
    --white: oklch(0.99 0 0);

    /* Semantic colors using light-dark() for automatic dark mode */
    --bg-primary: light-dark(var(--cream), oklch(0.15 0.02 50));
    --bg-surface: light-dark(var(--white), oklch(0.18 0.02 50));
    --bg-elevated: light-dark(var(--cream-warm), oklch(0.20 0.03 50));
    --text-primary: light-dark(oklch(0.25 0.04 50), oklch(0.92 0.01 80));
    --text-secondary: light-dark(oklch(0.38 0.03 55), oklch(0.75 0.02 70));
    --text-muted: light-dark(oklch(0.55 0.03 55), oklch(0.62 0.02 60));
    --border-subtle: light-dark(oklch(0.90 0.02 75), oklch(0.30 0.02 50));
    --chocolate-adaptive: light-dark(var(--chocolate), oklch(0.88 0.04 75));
    --rose-deep-adaptive: light-dark(var(--rose-deep), oklch(0.75 0.10 15));

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', system-ui, sans-serif;
    --font-accent: 'Cormorant Garamond', Georgia, serif;

    /* Spacing */
    --section-padding: clamp(4rem, 8vw, 8rem);
    --container-max: 1200px;
    --container-wide: 1400px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

/* ---- BASE ---- */
@layer base {
  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.7;
    overflow-x: hidden;
  }

  /* Accessible focus ring — only on keyboard */
  :focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }

  /* Respect user motion preferences */
  @media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---- LAYOUT ---- */
@layer layout {
  .container {
    max-inline-size: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 4vw, 3rem);
  }

  .container--wide {
    max-inline-size: var(--container-wide);
  }
}

/* ---- COMPONENTS ---- */
@layer components {

  /* ============================================
     SCROLL-DRIVEN REVEAL ANIMATION
     Replaces IntersectionObserver entirely
     ============================================ */
  @keyframes reveal-up {
    from {
      opacity: 0;
      translate: 0 40px;
    }

    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  .reveal {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

  /* Stagger children — uses sibling combinators */
  .reveal-stagger>* {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }

  .reveal-stagger> :nth-child(2) {
    animation-delay: 80ms;
  }

  .reveal-stagger> :nth-child(3) {
    animation-delay: 160ms;
  }

  .reveal-stagger> :nth-child(4) {
    animation-delay: 240ms;
  }

  .reveal-stagger> :nth-child(5) {
    animation-delay: 320ms;
  }

  .reveal-stagger> :nth-child(6) {
    animation-delay: 400ms;
  }

  /* ============================================
     NAVIGATION
     Uses :has() for scroll-aware styling,
     native nesting, logical properties
     ============================================ */
  .nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 100;
    padding-block: 1.25rem;
    transition: all 0.4s var(--ease-out);

    &.scrolled {
      background: color-mix(in oklch, var(--bg-primary), transparent 10%);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      padding-block: 0.75rem;
      box-shadow: 0 1px 0 color-mix(in oklch, var(--gold), transparent 85%);
    }

    /* Disable backdrop-filter when mobile menu is open —
       backdrop-filter creates a containing block for position: fixed
       descendants (per spec), trapping nav__links inside the nav bar */
    &.scrolled:has(.nav__links.open) {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      background: var(--bg-primary);
    }

    & .nav__inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      max-inline-size: var(--container-wide);
      margin-inline: auto;
      padding-inline: clamp(1.5rem, 4vw, 3rem);
    }

    & .nav__logo {
      font-family: var(--font-display);
      font-size: clamp(1.1rem, 2vw, 1.35rem);
      font-weight: 600;
      color: var(--chocolate-adaptive);
      letter-spacing: 0.02em;

      & span {
        color: var(--gold);
      }
    }

    & .nav__links {
      display: flex;
      align-items: center;
      gap: 2rem;

      & a {
        font-size: 0.95rem;
        font-weight: 400;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-secondary);
        transition: color 0.3s;
        position: relative;

        &::after {
          content: '';
          position: absolute;
          inset-block-end: -4px;
          inset-inline-start: 0;
          inline-size: 0;
          block-size: 1px;
          background: var(--gold);
          transition: inline-size 0.3s var(--ease-out);
        }

        &:hover,
        &.active {
          color: var(--chocolate-adaptive);

          &::after {
            inline-size: 100%;
          }
        }
      }
    }

    & .nav__cta {
      font-size: 0.8rem !important;
      font-weight: 500 !important;
      background: var(--chocolate-adaptive);
      color: var(--cream) !important;
      padding: 0.6rem 1.5rem;
      border-radius: 100px;
      transition: background 0.3s, translate 0.2s !important;

      &:hover {
        background: var(--rose-deep-adaptive) !important;
        translate: 0 -1px;
      }

      &::after {
        display: none !important;
      }
    }

    /* Mobile toggle */
    & .nav__toggle {
      display: none;
      inline-size: 32px;
      block-size: 24px;
      position: relative;
      z-index: 110;

      & span {
        display: block;
        inline-size: 100%;
        block-size: 2px;
        background: var(--chocolate-adaptive);
        position: absolute;
        inset-inline-start: 0;
        transition: all 0.3s var(--ease-out);

        &:nth-child(1) {
          inset-block-start: 0;
        }

        &:nth-child(2) {
          inset-block-start: 50%;
          translate: 0 -50%;
        }

        &:nth-child(3) {
          inset-block-end: 0;
        }
      }

      &.active {
        & span:nth-child(1) {
          inset-block-start: 50%;
          translate: 0 -50%;
          rotate: 45deg;
        }

        & span:nth-child(2) {
          opacity: 0;
        }

        & span:nth-child(3) {
          inset-block-end: 50%;
          translate: 0 50%;
          rotate: -45deg;
        }
      }
    }
  }

  /* ============================================
     HERO
     Uses @starting-style for entry animation,
     independent transforms, color-mix()
     ============================================ */
  .hero {
    min-block-size: 100dvh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(ellipse at 20% 50%, color-mix(in oklch, var(--rose-light), transparent 60%), transparent 60%),
      radial-gradient(ellipse at 80% 30%, color-mix(in oklch, var(--gold-light), transparent 80%), transparent 50%),
      var(--bg-primary);

    /* Decorative circle */
    &::before {
      content: '';
      position: absolute;
      inset-block-start: -20%;
      inset-inline-end: -10%;
      inline-size: 60vw;
      block-size: 60vw;
      max-inline-size: 800px;
      max-block-size: 800px;
      border-radius: 50%;
      background: radial-gradient(circle, color-mix(in oklch, var(--rose-light), transparent 70%), transparent 70%);
      animation: gentle-float 8s ease-in-out infinite;
    }

    /* Bottom gold line */
    &::after {
      content: '';
      position: absolute;
      inset-block-end: 0;
      inset-inline: 0;
      block-size: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    }
  }

  @keyframes gentle-float {

    0%,
    100% {
      translate: 0 0;
    }

    50% {
      translate: 0 -8px;
    }
  }

  .hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    padding-block: 8rem 6rem;
    max-inline-size: var(--container-wide);
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 4vw, 3rem);
  }

  /* Entry animation using @starting-style */
  .hero__content {
    @starting-style {
      opacity: 0;
      translate: -60px 0;
    }

    opacity: 1;
    translate: 0 0;
    transition: opacity 1s var(--ease-out) 0.2s,
    translate 1s var(--ease-out) 0.2s;
  }

  .hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-accent);
    font-size: 1rem;
    font-style: italic;
    color: light-dark(oklch(0.58 0.12 75), oklch(0.78 0.10 75));
    letter-spacing: 0.05em;
    margin-block-end: 1.5rem;

    &::before {
      content: '';
      inline-size: 40px;
      block-size: 1px;
      background: var(--gold);
    }
  }

  .hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 5.5vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--chocolate-adaptive);
    margin-block-end: 1.5rem;
    /* Modern text wrapping for headings */
    text-wrap: balance;

    & em {
      font-style: italic;
      color: var(--rose-deep-adaptive);
    }
  }

  .hero__desc {
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    color: var(--text-secondary);
    max-inline-size: 480px;
    margin-block-end: 2.5rem;
    line-height: 1.8;
    /* Prettier paragraph wrapping */
    text-wrap: pretty;
  }

  .hero__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
  }

  /* Hero visual — entry animation via @starting-style */
  .hero__visual {
    position: relative;

    @starting-style {
      opacity: 0;
      scale: 0.9;
    }

    opacity: 1;
    scale: 1;
    transition: opacity 1s var(--ease-out) 0.4s,
    scale 1s var(--ease-out) 0.4s;
  }

  .hero__mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    aspect-ratio: 1;
    max-inline-size: 550px;
    margin-inline-start: auto;
  }

  .hero__mosaic-item {
    border-radius: 20px;
    overflow: hidden;
    background: var(--rose-light);

    &:first-child {
      grid-row: span 2;
    }

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }

  .hero__float-badge {
    position: absolute;
    inset-block-end: 2rem;
    inset-inline-start: -1.5rem;
    background: var(--bg-surface);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 12px 40px oklch(0 0 0 / 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: gentle-float 6s ease-in-out infinite 1s;

    & svg {
      inline-size: 28px;
      block-size: 28px;
      color: var(--gold);
    }
  }

  .hero__float-badge-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--chocolate-adaptive);
    line-height: 1.3;

    & span {
      display: block;
      font-family: var(--font-accent);
      font-size: 0.85rem;
      font-weight: 300;
      font-style: italic;
      color: var(--text-muted);
    }
  }

  /* ============================================
     BUTTONS
     Uses color-mix() for hover states,
     independent transform: translate
     ============================================ */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1rem 2.25rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);

    &--primary {
      background: var(--chocolate-adaptive);
      color: var(--cream);

      &:hover {
        background: var(--rose-deep-adaptive);
        translate: 0 -2px;
        box-shadow: 0 8px 30px color-mix(in oklch, var(--rose-deep), transparent 75%);
      }
    }

    &--outline {
      background: transparent;
      color: var(--chocolate-adaptive);
      border: 1.5px solid var(--chocolate-adaptive);

      &:hover {
        background: var(--chocolate-adaptive);
        color: var(--cream);
        translate: 0 -2px;
      }
    }

    &--gold {
      background: linear-gradient(135deg, var(--gold), var(--gold-light));
      color: var(--chocolate);
      font-weight: 600;

      &:hover {
        translate: 0 -2px;
        box-shadow: 0 8px 30px color-mix(in oklch, var(--gold), transparent 70%);
      }
    }

    &--whatsapp {
      background: oklch(0.55 0.15 155);
      color: var(--white);

      &:hover {
        /* Darken with color-mix instead of a separate variable */
        background: color-mix(in oklch, oklch(0.55 0.15 155), black 15%);
        translate: 0 -2px;
        box-shadow: 0 8px 30px color-mix(in oklch, oklch(0.55 0.15 155), transparent 75%);
      }
    }
  }

  /* ============================================
     SECTION HEADERS
     text-wrap: balance for even line lengths
     ============================================ */
  .section-header {
    text-align: center;
    margin-block-end: clamp(3rem, 5vw, 4.5rem);
  }

  .section-label {
    font-family: var(--font-accent);
    font-size: 1.05rem;
    font-style: italic;
    color: light-dark(oklch(0.58 0.12 75), oklch(0.78 0.10 75));
    letter-spacing: 0.05em;
    margin-block-end: 0.75rem;
    display: block;
  }

  .section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--chocolate-adaptive);
    line-height: 1.2;
    text-wrap: balance;

    & em {
      font-style: italic;
      color: var(--rose-deep-adaptive);
    }
  }

  .section-divider {
    inline-size: 60px;
    block-size: 1px;
    background: var(--gold);
    margin-block-start: 1.5rem;
    margin-inline: auto;

    &--gold {
      background: var(--gold-light);
    }
  }

  /* ============================================
     GALLERY
     Container queries for responsive cards,
     scroll-driven reveal, :has() for hover
     ============================================ */
  .gallery {
    padding-block: var(--section-padding);
    background: var(--bg-surface);
    position: relative;
    /* Lazy render when off-screen */
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;

    &::before {
      content: '';
      position: absolute;
      inset-block-start: 0;
      inset-inline: 0;
      block-size: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    }
  }

  .gallery__filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-block-end: 2.5rem;
    flex-wrap: wrap;
  }

  .gallery__filter-btn {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.65rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.3s;

    &:hover,
    &.active {
      background: var(--chocolate-adaptive);
      color: var(--cream);
      border-color: var(--chocolate-adaptive);
    }
  }

  /* Gallery grid — container for queries */
  .gallery__grid {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .gallery__item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--rose-light);
    cursor: pointer;
    transition: translate 0.4s var(--ease-out), opacity 0.4s var(--ease-out), scale 0.4s var(--ease-out);

    &:nth-child(1) {
      grid-column: span 2;
      grid-row: span 2;
    }

    &:hover {
      translate: 0 -4px;
    }

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
      transition: scale 0.6s var(--ease-out);
    }

    /* :has() — when item has a hovered overlay, scale the image */
    &:has(:hover) img {
      scale: 1.05;
    }

    /* Gallery filter animation */
    &.gallery__item--hidden {
      opacity: 0;
      scale: 0.8;
      pointer-events: none;
      position: absolute;
      visibility: hidden;
    }
  }

  .gallery__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, oklch(0.25 0.04 50 / 0.7), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;

    .gallery__item:hover & {
      opacity: 1;
    }
  }

  .gallery__overlay-text {
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;

    & span {
      display: block;
      font-family: var(--font-body);
      font-size: 0.9rem;
      font-weight: 300;
      opacity: 0.85;
      margin-block-start: 0.25rem;
    }
  }

  /* Container query — gallery responds to its own width */
  @container (max-width: 700px) {
    .gallery__grid {
      grid-template-columns: 1fr 1fr;
    }

    .gallery__item:nth-child(1) {
      grid-column: span 2;
      grid-row: span 1;
      aspect-ratio: 16 / 10;
    }
  }

  @container (max-width: 400px) {
    .gallery__grid {
      grid-template-columns: 1fr;
    }

    .gallery__item:nth-child(1) {
      grid-column: span 1;
      aspect-ratio: 4 / 3;
    }
  }

  /* ============================================
     ABOUT
     Uses subgrid for feature alignment
     ============================================ */
  .about {
    padding-block: var(--section-padding);
    position: relative;
    background:
      radial-gradient(ellipse at 80% 20%, color-mix(in oklch, var(--rose-light), transparent 75%), transparent 50%),
      var(--bg-primary);
    content-visibility: auto;
    contain-intrinsic-size: auto 700px;
  }

  .about__inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: center;
  }

  .about__image-wrap {
    position: relative;
  }

  .about__image {
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--rose-light);

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }

  .about__image-accent {
    position: absolute;
    inset-block-start: -1.5rem;
    inset-inline-end: -1.5rem;
    inline-size: 100px;
    block-size: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--chocolate);
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 8px 30px color-mix(in oklch, var(--gold), transparent 75%);
  }

  .about__label {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-style: italic;
    color: var(--gold);
    letter-spacing: 0.05em;
    margin-block-end: 0.75rem;
  }

  .about__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 600;
    color: var(--chocolate-adaptive);
    line-height: 1.2;
    margin-block-end: 1.5rem;
    text-wrap: balance;

    & em {
      font-style: italic;
      color: var(--rose-deep-adaptive);
    }
  }

  .about__text {
    color: var(--text-secondary);
    margin-block-end: 1.25rem;
    font-size: 1rem;
    line-height: 1.8;
    text-wrap: pretty;
  }

  /* Features grid — uses subgrid on the feature items */
  .about__features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-block-start: 2rem;
  }

  .about__feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
  }

  .about__feature-icon {
    inline-size: 40px;
    block-size: 40px;
    border-radius: 12px;
    background: color-mix(in oklch, var(--rose-light), transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rose-deep-adaptive);
  }

  .about__feature-text {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;

    & span {
      display: block;
      font-size: 0.875rem;
      color: var(--text-muted);
      margin-block-start: 0.15rem;
    }
  }

  /* ============================================
     TESTIMONIALS
     Uses scroll-snap for horizontal scroll on mobile,
     dark section with light-dark() inversion
     ============================================ */
  .testimonials {
    padding-block: var(--section-padding);
    /* Force dark appearance in this section */
    background: var(--chocolate);
    color: var(--cream);
    position: relative;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(ellipse at 20% 80%, oklch(0.45 0.08 15 / 0.3), transparent 50%),
        radial-gradient(ellipse at 80% 20%, oklch(0.45 0.08 75 / 0.15), transparent 50%);
    }

    & .section-label {
      color: var(--gold-light);
    }

    & .section-title {
      color: var(--cream);
    }
  }

  .testimonials__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 1;
  }

  .testimonial-card {
    background: oklch(0.30 0.05 50 / 0.5);
    border: 1px solid oklch(0.50 0.05 50 / 0.15);
    border-radius: 20px;
    padding: 2rem;
    transition: translate 0.3s var(--ease-out);

    &:hover {
      translate: 0 -4px;
    }
  }

  .testimonial-card__stars {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-block-end: 1rem;
  }

  .testimonial-card__text {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.7;
    color: oklch(0.85 0.01 50);
    margin-block-end: 1.5rem;
    text-wrap: pretty;
  }

  .testimonial-card__author {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--cream);

    & span {
      display: block;
      font-weight: 300;
      font-size: 0.9rem;
      color: oklch(0.65 0.02 50);
      margin-block-start: 0.2rem;
    }
  }

  /* ============================================
     CTA
     ============================================ */
  .cta {
    padding-block: var(--section-padding);
    background: var(--bg-surface);
    text-align: center;
    position: relative;

    &::before {
      content: '';
      position: absolute;
      inset-block-start: 0;
      inset-inline: 0;
      block-size: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    }
  }

  .cta__box {
    background:
      radial-gradient(ellipse at 30% 50%, color-mix(in oklch, var(--rose-light), transparent 60%), transparent 50%),
      radial-gradient(ellipse at 70% 50%, color-mix(in oklch, var(--gold-light), transparent 80%), transparent 50%),
      var(--bg-elevated);
    border-radius: 32px;
    padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 32px;
      border: 1px solid color-mix(in oklch, var(--gold), transparent 80%);
      pointer-events: none;
    }
  }

  .cta__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--chocolate-adaptive);
    line-height: 1.2;
    margin-block-end: 1rem;
    text-wrap: balance;

    & em {
      font-style: italic;
      color: var(--rose-deep-adaptive);
    }
  }

  .cta__desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-inline-size: 550px;
    margin-inline: auto;
    margin-block-end: 2.5rem;
    line-height: 1.7;
    text-wrap: pretty;
  }

  .cta__buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  /* ============================================
     INSTAGRAM
     Uses scroll-snap for the mini grid
     ============================================ */
  .instagram {
    padding-block: clamp(3rem, 5vw, 5rem);
    text-align: center;
    background: var(--bg-primary);
  }

  .instagram__link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
    color: var(--chocolate-adaptive);
    transition: color 0.3s;
    margin-block-start: 1.5rem;

    &:hover {
      color: var(--rose-deep-adaptive);
    }

    & svg {
      inline-size: 32px;
      block-size: 32px;
    }
  }

  .instagram__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-block-start: 2.5rem;

    /* Scroll-snap on small containers */
    @media (max-width: 600px) {
      grid-template-columns: repeat(6, 70vw);
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      overscroll-behavior-x: contain;
      scrollbar-width: none;

      &::-webkit-scrollbar {
        display: none;
      }
    }
  }

  .instagram__grid-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--rose-light);
    transition: scale 0.3s var(--ease-out);
    scroll-snap-align: start;

    &:hover {
      scale: 1.05;
    }

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }

  /* ============================================
     FOOTER
     Logical properties throughout
     ============================================ */
  .footer {
    background: var(--chocolate);
    color: oklch(0.85 0.01 50);
    padding-block: clamp(3rem, 5vw, 4rem) 2rem;
  }

  .footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    margin-block-end: 3rem;
  }

  .footer__brand-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--cream);
    margin-block-end: 1rem;

    & span {
      color: var(--gold);
    }
  }

  .footer__brand-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: oklch(0.65 0.02 50);
    max-inline-size: 300px;
    text-wrap: pretty;
  }

  .footer__social {
    display: flex;
    gap: 0.75rem;
    margin-block-start: 1.5rem;

    & a {
      inline-size: 40px;
      block-size: 40px;
      border-radius: 50%;
      border: 1px solid oklch(0.50 0.05 50 / 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      color: oklch(0.75 0.02 50);
      transition: all 0.3s;

      &:hover {
        background: var(--gold);
        color: var(--chocolate);
        border-color: var(--gold);
      }
    }
  }

  .footer__heading {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cream);
    margin-block-end: 1.25rem;
  }

  .footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    & a {
      font-size: 0.95rem;
      color: oklch(0.75 0.02 50);
      transition: color 0.3s;

      &:hover {
        color: var(--gold);
      }
    }
  }

  .footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: oklch(0.75 0.02 50);
    margin-block-end: 0.75rem;

    & svg {
      inline-size: 16px;
      block-size: 16px;
      flex-shrink: 0;
      margin-block-start: 2px;
      color: var(--gold);
    }
  }

  .footer__bottom {
    border-block-start: 1px solid oklch(0.50 0.05 50 / 0.15);
    padding-block-start: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: oklch(0.68 0.02 50);
  }

  /* ============================================
     SABORES
     Two-column flavor menu cards
     ============================================ */
  .sabores {
    padding-block: var(--section-padding);
    background: var(--bg-primary);
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
  }

  .sabores__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .sabores__category {
    background: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    padding: 2rem;
  }

  .sabores__category-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--chocolate-adaptive);
    padding-block-end: 1rem;
    margin-block-end: 1.25rem;
    border-block-end: 1px solid var(--border-subtle);
  }

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

  .sabores__item-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  .sabores__item-desc {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-block-start: 0.15rem;
    line-height: 1.5;
  }

  .sabores__note {
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-block-start: 2rem;
  }

  /* ============================================
     PREÇOS
     Pricing grid with tables
     ============================================ */
  .precos {
    padding-block: var(--section-padding);
    background: var(--bg-surface);
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: auto 700px;

    &::before {
      content: '';
      position: absolute;
      inset-block-start: 0;
      inset-inline: 0;
      block-size: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    }
  }

  .precos__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .precos__card {
    background: var(--bg-elevated);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    padding: 2rem;

    &--featured {
      grid-column: span 2;
    }
  }

  .precos__card-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--chocolate-adaptive);
    margin-block-end: 0.25rem;
  }

  .precos__card-subtitle {
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-style: italic;
    color: light-dark(oklch(0.58 0.12 75), oklch(0.78 0.10 75));
    margin-block-end: 1.25rem;
  }

  .precos__table {
    inline-size: 100%;
    border-collapse: collapse;

    & th,
    & td {
      padding: 0.6rem 0.75rem;
      font-size: 0.9rem;
      text-align: start;
      border-block-end: 1px solid var(--border-subtle);
    }

    & th {
      font-family: var(--font-body);
      font-weight: 500;
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
    }

    & td:last-child,
    & th:last-child {
      text-align: end;
    }

    & td:last-child {
      font-weight: 500;
      color: var(--chocolate-adaptive);
    }

    & tbody tr:last-child td {
      border-block-end: none;
    }
  }

  .precos__note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-block-start: 1rem;
    line-height: 1.6;
    text-wrap: pretty;
  }

  .precos__extras {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .precos__extras-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    font-size: 0.9rem;
    border-block-end: 1px solid var(--border-subtle);

    &:last-child {
      border-block-end: none;
    }

    & span:last-child {
      font-weight: 500;
      color: var(--chocolate-adaptive);
    }
  }

  /* CTA note for reservation info */
  .cta__note {
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 600;
    color: var(--text-muted);
    margin-block-end: 2rem;
  }

  /* ============================================
     DARK MODE ADJUSTMENTS
     Ensures proper contrast and readability
     ============================================ */
  @media (prefers-color-scheme: dark) {
    .hero {
      background:
        radial-gradient(ellipse at 20% 50%, color-mix(in oklch, oklch(0.35 0.06 15), transparent 70%), transparent 60%),
        radial-gradient(ellipse at 80% 30%, color-mix(in oklch, oklch(0.35 0.08 75), transparent 85%), transparent 50%),
        var(--bg-primary);

      &::before {
        background: radial-gradient(circle, color-mix(in oklch, oklch(0.30 0.05 15), transparent 80%), transparent 70%);
      }
    }

    .hero__mosaic-item {
      background: oklch(0.25 0.03 50);
    }

    .gallery {
      &::before {
        background: linear-gradient(90deg, transparent, oklch(0.35 0.06 75 / 0.4), transparent);
      }
    }

    .gallery__item {
      background: oklch(0.25 0.03 50);
    }

    .gallery__filter-btn {
      border-color: oklch(0.35 0.03 50);

      &:hover,
      &.active {
        background: oklch(0.85 0.04 75);
        color: oklch(0.20 0.04 50);
        border-color: oklch(0.85 0.04 75);
      }
    }

    .sabores__category {
      background: oklch(0.18 0.02 50);
      border-color: oklch(0.30 0.02 50);
    }

    .precos__card {
      background: oklch(0.18 0.02 50);
      border-color: oklch(0.30 0.02 50);
    }

    .precos {
      &::before {
        background: linear-gradient(90deg, transparent, oklch(0.35 0.06 75 / 0.4), transparent);
      }
    }

    .about {
      background:
        radial-gradient(ellipse at 80% 20%, color-mix(in oklch, oklch(0.30 0.05 15), transparent 80%), transparent 50%),
        var(--bg-primary);
    }

    .about__image {
      background: oklch(0.25 0.03 50);
    }

    .about__image-accent {
      background: linear-gradient(135deg, oklch(0.55 0.10 75), oklch(0.45 0.08 75));
    }

    .about__feature-icon {
      background: oklch(0.25 0.04 15 / 0.5);
    }

    .cta__box {
      background:
        radial-gradient(ellipse at 30% 50%, color-mix(in oklch, oklch(0.30 0.05 15), transparent 70%), transparent 50%),
        radial-gradient(ellipse at 70% 50%, color-mix(in oklch, oklch(0.30 0.06 75), transparent 85%), transparent 50%),
        var(--bg-elevated);

      &::before {
        border-color: oklch(0.40 0.06 75 / 0.3);
      }
    }

    .cta {
      &::before {
        background: linear-gradient(90deg, transparent, oklch(0.35 0.06 75 / 0.4), transparent);
      }
    }

    .instagram__grid-item {
      background: oklch(0.25 0.03 50);
    }

    .hero__float-badge {
      box-shadow: 0 12px 40px oklch(0 0 0 / 0.3);
    }

    .order-modal .order-modal__inner {
      background: oklch(0.18 0.02 50);
    }

    .order-modal .form-group {

      & input,
      & select,
      & textarea {
        background: oklch(0.22 0.02 50);
        border-color: oklch(0.35 0.02 50);
      }
    }

    .btn--primary {
      background: oklch(0.85 0.04 75);
      color: oklch(0.20 0.04 50);

      &:hover {
        background: oklch(0.75 0.10 15);
        color: oklch(0.95 0.01 80);
      }
    }

    .btn--outline {
      border-color: oklch(0.70 0.03 50);
      color: oklch(0.85 0.02 50);

      &:hover {
        background: oklch(0.85 0.04 75);
        color: oklch(0.20 0.04 50);
      }
    }
  }
}

/* ---- UTILITIES ---- */
/* ============================================
     ORDER MODAL (DIALOG)
     ============================================ */
.order-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-inline-size: min(90vw, 600px);
  max-block-size: 90vh;
  margin: auto;
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px oklch(0 0 0 / 0.25);
  transition: all 0.3s var(--ease-out);

  &::backdrop {
    background: oklch(0 0 0 / 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s var(--ease-out);
  }

  &[open] {
    animation: modal-appear 0.4s var(--ease-out) forwards;
  }

  & .order-modal__inner {
    background: var(--bg-surface);
    padding: 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-block-size: inherit;
  }

  & .order-modal__close {
    position: absolute;
    inset-block-start: 1.5rem;
    inset-inline-end: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s;

    &:hover {
      color: var(--chocolate-adaptive);
    }
  }

  & .order-modal__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: var(--chocolate-adaptive);
    margin-block-end: 0.5rem;
  }

  & .order-modal__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }

  & .order-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  & .order-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  & .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;

    & label {
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-primary);
    }

    & input,
    & select,
    & textarea {
      padding: 0.8rem 1rem;
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      font-family: var(--font-body);
      font-size: 0.95rem;
      background: var(--bg-elevated);
      color: var(--text-primary);
      transition: border-color 0.2s, ring 0.2s;

      &:focus {
        outline: none;
        border-color: var(--rose);
        box-shadow: 0 0 0 3px color-mix(in oklch, var(--rose), transparent 80%);
      }
    }
  }

  & .order-modal__preview {
    background: var(--bg-elevated);
    border: 1px dashed var(--border-subtle);
    border-radius: 16px;
    padding: 1.25rem;
    margin-block: 0.5rem;
  }

  & .order-modal__preview-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-block-end: 0.75rem;
  }

  & .order-modal__preview-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-style: italic;
    line-height: 1.6;
  }
}

@keyframes modal-appear {
  from {
    opacity: 0;
    translate: 0 20px;
    scale: 0.98;
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

.btn--full {
  inline-size: 100%;
  justify-content: center;
  gap: 0.75rem;
}

/* Responsive adjustments for modal grid */
@media (max-width: 600px) {
  .order-modal .order-modal__grid {
    grid-template-columns: 1fr;
  }

  .order-modal .order-modal__inner {
    padding: 1.5rem;
  }

  .order-modal {
    max-inline-size: 95vw;
    border-radius: 20px;
  }
}

@layer utilities {
  .sr-only {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ============================================
   RESPONSIVE — @media for viewport-level stuff
   (component-level responsiveness uses @container)
   ============================================ */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero__desc {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__mosaic {
    max-inline-size: 450px;
    margin-inline: auto;
  }

  .hero__float-badge {
    inset-inline-start: 50%;
    translate: -50% 0;
    inset-block-end: -1rem;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about__image-wrap {
    max-inline-size: 450px;
    margin-inline: auto;
  }

  .about__content {
    text-align: center;
  }

  .about__features {
    max-inline-size: 400px;
    margin-inline: auto;
  }

  .sabores__grid {
    grid-template-columns: 1fr;
  }

  .precos__grid {
    grid-template-columns: 1fr;
  }

  .precos__card--featured {
    grid-column: span 1;
  }

  .testimonials__grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 768px) {

  /* Increase gallery filter spacing for touch */
  .gallery__filters {
    gap: 1rem 0.75rem;
  }

  /* Stack CTA buttons */
  .cta__buttons {
    flex-direction: column;
    align-items: center;
  }

  /* Mobile nav overlay — cross-browser compatible */
  .nav .nav__links {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 105;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.3s var(--ease-out),
      visibility 0.3s;

    &.open {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    & li {
      opacity: 0;
      translate: 0 12px;
      transition: opacity 0.3s var(--ease-out), translate 0.3s var(--ease-out);
    }

    &.open li {
      opacity: 1;
      translate: 0 0;
    }

    &.open li:nth-child(1) {
      transition-delay: 0.05s;
    }

    &.open li:nth-child(2) {
      transition-delay: 0.1s;
    }

    &.open li:nth-child(3) {
      transition-delay: 0.15s;
    }

    &.open li:nth-child(4) {
      transition-delay: 0.2s;
    }

    &.open li:nth-child(5) {
      transition-delay: 0.25s;
    }

    &.open li:nth-child(6) {
      transition-delay: 0.3s;
    }

    & a {
      font-size: 1.2rem;
      transition: color 0.3s;
    }
  }

  /* Lock body scroll when mobile menu is open */
  body:has(.nav__links.open) {
    overflow: hidden;
  }

  .nav .nav__toggle {
    display: block;
  }

  .testimonials__grid {
    /* Horizontal scroll-snap on mobile */
    grid-template-columns: repeat(3, 85vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  .testimonial-card {
    scroll-snap-align: center;
  }

  .precos__table {
    font-size: 0.85rem;
  }

  .about__features {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__brand-desc {
    max-inline-size: none;
  }

  .footer__social {
    justify-content: center;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    inline-size: 100%;
  }

  .btn {
    inline-size: 100%;
    justify-content: center;
  }

  .cta__buttons {
    flex-direction: column;
    align-items: center;
  }
}