:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --surface-muted: #edf3f1;
  --surface-alt: #e3ece8;
  --text: #21313a;
  --muted: #58707a;
  --line: #d4ddd9;
  --brand: #557c72;
  --brand-deep: #35544d;
  --accent: #8cae9f;
  --shadow: 0 20px 45px rgba(33, 49, 58, 0.08);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --content: 74rem;
  --nav-height: 5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto Flex", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body.site-v2 {
  background:
    linear-gradient(180deg, rgba(244, 241, 235, 0.96), rgba(244, 241, 235, 0.98)),
    url("../images/alentejo-fields.png") center top / cover fixed no-repeat;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--brand-deep);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(244, 241, 235, 0.92);
  border-bottom: 1px solid rgba(212, 221, 217, 0.9);
}

.nav-shell,
.section-inner,
.footer-inner {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
}

.nav-shell {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 0.875rem;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 700;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy span {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--text);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu a {
  padding: 0.75rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible,
.nav-menu a[aria-current="page"] {
  background: rgba(85, 124, 114, 0.12);
  color: var(--brand-deep);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button {
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 10px 24px rgba(53, 84, 77, 0.18);
}

.button:hover,
.button:focus-visible,
.button-secondary:hover,
.button-secondary:focus-visible {
  transform: translateY(-1px);
}

.button-secondary {
  background: rgba(85, 124, 114, 0.12);
  color: var(--brand-deep);
}

main {
  display: block;
}

.hero {
  padding: 4.5rem 0 2rem;
}

.hero.hero-rich {
  position: relative;
  overflow: clip;
  min-height: 42rem;
  padding: 5rem 0 3rem;
  background:
    linear-gradient(90deg, rgba(244, 241, 235, 0.92), rgba(244, 241, 235, 0.72) 55%, rgba(244, 241, 235, 0.5)),
    url("../images/alentejo-fields.png") center center / cover no-repeat;
}

.hero-webgl {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

.hero.hero-rich .section-inner {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(85, 124, 114, 0.12);
  color: var(--brand-deep);
  font-size: 0.95rem;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0 0 1rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.6rem);
}

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

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.lead {
  font-size: 1.125rem;
  max-width: 38rem;
}

.hero-actions,
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card img,
.media-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card img {
  min-height: 28rem;
}

.hero.hero-rich .hero-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.hero-note {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.stats-grid,
.card-grid,
.service-grid,
.team-grid,
.faq-grid,
.contact-grid {
  display: grid;
  gap: 1.2rem;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}

.stat,
.card,
.service-card,
.quote-card,
.faq-item,
.contact-card,
.form-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid rgba(212, 221, 217, 0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.stat {
  padding: 1.4rem;
}

.stat strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 2rem;
  color: var(--brand-deep);
}

.section {
  padding: 4.5rem 0;
}

.section.alt {
  background: var(--surface-alt);
}

.section.soft {
  background: var(--surface-muted);
}

.section.with-landscape {
  position: relative;
  overflow: clip;
  background: transparent;
}

.section.with-landscape::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(237, 243, 241, 0.92), rgba(237, 243, 241, 0.94)),
    var(--landscape-image, url("../images/alentejo-road.png")) center center / cover no-repeat;
  z-index: 0;
  transform: translateY(calc(var(--parallax-y, 0) * 1px));
  will-change: transform;
}

.section.with-landscape .section-inner {
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-header p {
  max-width: 38rem;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.service-card,
.quote-card,
.faq-item,
.contact-card {
  padding: 1.5rem;
}

.card-icon {
  width: 3rem;
  height: 3rem;
  display: inline-grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 0.85rem;
  background: rgba(85, 124, 114, 0.14);
  color: var(--brand-deep);
  font-weight: 700;
}

.media-split,
.about-grid,
.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.media-panel {
  overflow: hidden;
  min-height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.media-panel img {
  min-height: 22rem;
}

.media-panel.warm img,
.hero-card.warm img {
  filter: saturate(0.95) contrast(1.02);
}

.check-list,
.meta-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.check-list li,
.meta-list li {
  display: flex;
  gap: 0.75rem;
  align-items: start;
}

.check-list li::before,
.meta-list li::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
}

.service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(85, 124, 114, 0.12);
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.team-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(212, 221, 217, 0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.team-card img {
  width: 100%;
  aspect-ratio: 4 / 4.4;
  object-fit: cover;
}

.team-card .copy {
  padding: 1.35rem;
}

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

.quote-card strong {
  color: var(--brand-deep);
}

.faq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-item p:last-child,
.card p:last-child,
.service-card p:last-child,
.contact-card p:last-child,
.detail-panel p:last-child {
  margin-bottom: 0;
}

.detail-panel,
.form-panel {
  padding: 1.5rem;
}

.contact-stack {
  display: grid;
  gap: 1rem;
}

.contact-card strong,
.detail-panel strong {
  display: block;
  margin-bottom: 0.35rem;
}

.map-placeholder {
  min-height: 15rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(85, 124, 114, 0.12), rgba(140, 174, 159, 0.2)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.5) 0 30px,
      rgba(227, 236, 232, 0.65) 30px 60px
    );
  text-align: center;
  color: var(--brand-deep);
  font-weight: 600;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.map-grid article {
  background: var(--surface);
  border: 1px solid rgba(212, 221, 217, 0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.map-grid h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.map-address {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.map-embed {
  width: 100%;
  height: 18rem;
  border: 0;
  border-radius: var(--radius-sm);
}

@media (max-width: 64rem) {
  .map-grid {
    grid-template-columns: 1fr;
  }
}

form {
  display: grid;
  gap: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
  color: var(--text);
}

input:focus,
textarea:focus,
.nav-toggle:focus-visible,
.button:focus-visible,
.button-secondary:focus-visible,
.nav-menu a:focus-visible {
  outline: 3px solid rgba(85, 124, 114, 0.28);
  outline-offset: 2px;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-note {
  font-size: 0.92rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  background: #e7ede9;
  border-top: 1px solid rgba(212, 221, 217, 0.7);
}

body.site-v2 .site-footer {
  background:
    linear-gradient(180deg, rgba(231, 237, 233, 0.95), rgba(231, 237, 233, 0.98)),
    url("../images/alentejo-road.png") center bottom / cover no-repeat;
}

.doc-list,
.link-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.doc-list a,
.link-list a {
  color: var(--brand-deep);
  font-weight: 600;
}

.doc-list li,
.link-list li {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(212, 221, 217, 0.7);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.doc-list span,
.link-list span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-intro {
  max-width: 46rem;
}

.notice {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(140, 174, 159, 0.15);
  color: var(--text);
}

.immersive-band {
  position: relative;
  padding: 5rem 0;
}

.immersive-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(53, 84, 77, 0.62), rgba(53, 84, 77, 0.28)),
    url("../images/alentejo-road.png") center center / cover no-repeat;
  z-index: 0;
}

.immersive-band .section-inner {
  position: relative;
  z-index: 1;
}

.immersive-band h2,
.immersive-band p,
.immersive-band .eyebrow {
  color: #f8fbf9;
}

.immersive-band .eyebrow {
  background: rgba(255, 255, 255, 0.14);
}

body.site-v2 .stat,
body.site-v2 .card,
body.site-v2 .service-card,
body.site-v2 .quote-card,
body.site-v2 .faq-item,
body.site-v2 .contact-card,
body.site-v2 .form-panel,
body.site-v2 .detail-panel,
body.site-v2 .doc-list li,
body.site-v2 .link-list li {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links,
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 650ms cubic-bezier(0.22, 1, 0.36, 1), transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal="left"] {
  transform: translateX(-40px);
}

[data-reveal="right"] {
  transform: translateX(40px);
}

[data-reveal="scale"] {
  transform: scale(0.92);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Staggered children inside grids */
.card-grid [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.card-grid [data-reveal]:nth-child(2) { transition-delay: 100ms; }
.card-grid [data-reveal]:nth-child(3) { transition-delay: 200ms; }

.service-grid [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.service-grid [data-reveal]:nth-child(2) { transition-delay: 100ms; }
.service-grid [data-reveal]:nth-child(3) { transition-delay: 200ms; }
.service-grid [data-reveal]:nth-child(4) { transition-delay: 300ms; }

.stats-grid [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.stats-grid [data-reveal]:nth-child(2) { transition-delay: 120ms; }
.stats-grid [data-reveal]:nth-child(3) { transition-delay: 240ms; }

.about-grid > [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.about-grid > [data-reveal]:nth-child(2) { transition-delay: 150ms; }

.media-split > [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.media-split > [data-reveal]:nth-child(2) { transition-delay: 150ms; }

/* Parallax-ready landscape sections */
.section.with-landscape::before {
  will-change: transform;
}

.hero-webgl {
  will-change: transform;
}

@media (max-width: 64rem) {
  .hero-grid,
  .media-split,
  .about-grid,
  .contact-grid,
  .card-grid,
  .team-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 52rem) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-actions .button-secondary {
    display: none;
  }

  .nav-menu {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.5rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    border: 1px solid rgba(212, 221, 217, 0.9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    border-radius: 0.7rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .stats-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
