/* ========================================
   Casa Barrufi — Design System
   ======================================== */

:root {
  --ink: #2A321D;
  --ink-soft: #5F6258;
  --ink-muted: rgba(42, 50, 29, 0.72);
  --cream: #F3F2F0;
  --sand: #E4D2B5;
  --sage: #6B7358;
  --olive-deep: #1E2416;
  --surface: #FAF9F7;
  --white: #FFFFFF;
  --border: rgba(42, 50, 29, 0.14);
  --border-strong: rgba(42, 50, 29, 0.22);
  --accent: #2A321D;
  --accent-hover: #1E2416;
  --radius: 28px;
  --radius-sm: 22px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-delay: 0s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Urbanist', sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--surface);
  background-image: url('background.jpg');
  background-repeat: repeat;
  background-size: auto;
  background-position: top left;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  max-width: 18ch;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}

.section-head {
  max-width: 640px;
  margin-bottom: 3.5rem;
}

.section-head p:last-child {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 42ch;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(250, 249, 247, 0.88);
  border-bottom: 1px solid rgba(42, 50, 29, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 42px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}

.nav a:hover {
  color: var(--ink);
}

.nav-cta {
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream) !important;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: var(--cream) !important;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

body.nav-open .menu-toggle span:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

body.nav-open .menu-toggle span:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(42, 50, 29, 0.06);
}

.btn-whatsapp {
  gap: 0.65rem;
  background: #2A321D;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #1E2416;
  color: #fff;
}

.btn-whatsapp-accent,
.hero .btn-whatsapp {
  background: #25D366;
  color: #fff;
}

.btn-whatsapp-accent:hover,
.hero .btn-whatsapp:hover {
  background: #1ebe57;
  color: #fff;
}

.icon-whatsapp {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  object-fit: contain;
}

.section-cta {
  margin-top: 2rem;
}

.section-cta-center {
  display: flex;
  justify-content: center;
  margin-top: 2.75rem;
}

/* ========================================
   Media frames (images & video)
   ======================================== */

.media-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #F3F2F0;
  aspect-ratio: 4 / 3;
  box-shadow: 0 18px 48px rgba(42, 50, 29, 0.08);
}

.media-frame img,
.media-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.media-frame.is-hero {
  aspect-ratio: 2 / 3;
  max-height: min(78vh, 720px);
  margin-inline: auto;
  width: min(100%, 420px);
  border-radius: 32px;
}

.media-frame.is-video {
  background: #1a1f14;
}

.media-frame.is-video video {
  pointer-events: none;
}

.media-frame.is-card {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
}

.media-frame.is-small {
  aspect-ratio: 9 / 7;
  border-radius: var(--radius-sm);
}

/* Sections */
.section {
  padding: clamp(4.5rem, 10vw, 7.5rem) 0;
  position: relative;
  border-top: 1px solid rgba(95, 98, 88, 0.35);
}

/* Hero */
.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5.5rem);
  overflow: hidden;
  min-height: calc(100vh - 78px);
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(250, 249, 247, 0.42) 0%, transparent 50%),
    linear-gradient(135deg, rgba(42, 50, 29, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: center;
  width: min(100% - 2.5rem, var(--container));
}

.hero-lead {
  margin-top: 1.25rem;
  max-width: 36ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero-media {
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* About */
.about-grid,
.install-grid,
.benefits-grid,
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.about-copy p,
.install-copy > p,
.benefits-copy > p,
.cta-copy > p {
  margin-top: 1.15rem;
  color: var(--ink-soft);
  max-width: 42ch;
}

.about-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.about-list li {
  padding-left: 1.35rem;
  position: relative;
  font-weight: 500;
  color: var(--ink);
}

.about-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

/* Feature points (install + benefits icons) */
.feature-points {
  margin-top: 2.25rem;
  display: grid;
  gap: 1.15rem;
}

.feature-point {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.feature-point:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(228, 210, 181, 0.45), rgba(42, 50, 29, 0.08));
  border: 1px solid var(--border);
  color: var(--ink);
  flex-shrink: 0;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-point strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.feature-point p,
.feature-point span {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

.install {
  background: transparent;
}

/* Rooms */
.rooms-carousel {
  position: relative;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.rooms-controls {
  display: none;
}

.rooms-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.rooms-nav:hover {
  background: rgba(42, 50, 29, 0.05);
}

.rooms-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.rooms-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.rooms-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(42, 50, 29, 0.22);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.rooms-dot.is-active {
  background: var(--ink);
  transform: scale(1.25);
}

.room-item h3 {
  margin-top: 1.15rem;
  margin-bottom: 0.4rem;
}

.room-item p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 28ch;
}

/* Finishes */
.finishes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.finish-card {
  display: flex;
  flex-direction: column;
}

.finish-body {
  padding: 1.35rem 0.25rem 0;
}

.finish-body h3 {
  margin-bottom: 0.45rem;
}

.finish-body p {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* CTA final */
.cta-final {
  background:
    linear-gradient(135deg, rgba(42, 50, 29, 0.94), rgba(30, 36, 22, 0.96)),
    var(--olive-deep);
  color: var(--cream);
  border-top-color: rgba(95, 98, 88, 0.55);
}

.cta-final h2,
.cta-final .eyebrow {
  color: var(--cream);
}

.cta-final .eyebrow {
  color: var(--sand);
}

.cta-final .cta-copy > p {
  color: rgba(243, 242, 240, 0.78);
}

.cta-final .section-cta {
  margin-top: 2rem;
}

.cta-final .btn-whatsapp {
  background: #2A321D;
  color: #fff;
}

.cta-final .btn-whatsapp:hover {
  background: #1E2416;
}

.cta-final .media-frame {
  border-color: rgba(228, 210, 181, 0.28);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  background: var(--olive-deep);
  color: rgba(243, 242, 240, 0.65);
  text-align: center;
}

.footer-logo {
  height: 48px;
  width: auto;
  margin: 0 auto 1rem;
}

.footer-note {
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.footer-copy {
  font-size: 0.82rem;
}

.footer-credit {
  display: block;
  margin-top: 0.55rem;
}

.footer-credit a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: rgba(243, 242, 240, 0.9);
  transition: color 0.25s var(--ease);
}

.footer-credit a:hover {
  color: var(--sand);
}

/* WhatsApp flutuante */
.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25D366;
  box-shadow: 0 10px 28px rgba(30, 36, 22, 0.28);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.whatsapp-float:hover {
  transform: translateY(-3px) scale(1.04);
  background: #1ebe57;
  box-shadow: 0 14px 32px rgba(30, 36, 22, 0.34);
}

.whatsapp-float img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ========================================
   Elegant reveal motion
   ======================================== */

.reveal {
  opacity: 0;
  transition:
    opacity 0.9s var(--ease) var(--reveal-delay),
    transform 0.9s var(--ease) var(--reveal-delay),
    filter 0.9s var(--ease) var(--reveal-delay);
  will-change: opacity, transform;
}

.reveal-up {
  transform: translateY(40px);
}

.reveal-left {
  transform: translateX(-36px);
}

.reveal-right {
  transform: translateX(36px);
}

.reveal-scale {
  transform: translateY(28px) scale(0.96);
  filter: blur(4px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.hero .reveal.is-visible {
  transition-duration: 1.05s;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 0.9fr;
    gap: 2rem;
  }

  .media-frame.is-hero {
    width: min(100%, 360px);
    max-height: 62vh;
  }

  .rooms-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .finishes-grid {
    grid-template-columns: 1fr 1fr;
  }

  .finishes-grid .finish-card:last-child {
    grid-column: 1 / -1;
    max-width: 420px;
    justify-self: center;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: 0;
    align-items: stretch;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .media-frame.is-hero {
    width: min(100%, 320px);
    max-height: 52vh;
  }

  .reveal-left,
  .reveal-right {
    transform: translateY(32px);
  }

  .about-grid,
  .install-grid,
  .benefits-grid,
  .cta-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .install-media {
    order: -1;
  }
}

@media (max-width: 768px) {
  .logo img {
    height: 34px;
  }

  .nav {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.25rem 1.5rem;
    background: rgba(250, 249, 247, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
  }

  body.nav-open .nav {
    display: flex;
  }

  .nav a {
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid rgba(42, 50, 29, 0.08);
  }

  .nav-cta {
    margin-top: 0.75rem;
    text-align: center;
    border-bottom: 0 !important;
  }

  .menu-toggle {
    display: flex;
  }

  .media-frame {
    border-radius: 22px;
  }

  .finishes-grid {
    grid-template-columns: 1fr;
  }

  .finishes-grid .finish-card:last-child {
    max-width: none;
  }

  /* Ambientes: carrossel apenas no mobile */
  .rooms .container {
    width: 100%;
    padding-inline: 0;
  }

  .rooms .section-head {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
  }

  .rooms .section-cta {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
  }

  .rooms-carousel {
    overflow: hidden;
  }

  .rooms-grid {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-inline: 1.25rem;
  }

  .rooms-grid::-webkit-scrollbar {
    display: none;
  }

  .rooms-grid .room-item {
    flex: 0 0 min(86vw, 340px);
    scroll-snap-align: center;
    margin-right: 1rem;
  }

  .rooms-grid .room-item:last-child {
    margin-right: 1.25rem;
  }

  .rooms-grid .room-item.reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .rooms-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
    padding-inline: 1.25rem;
  }

  .rooms-controls[hidden] {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  h1 {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
