/* Green Automation — Design Tokens & Base */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  /* Brand palette */
  --color-navy: #0E2023;
  --color-off-white: #EBF3EC;
  --color-sage: #D1DDCB;
  --color-lime: #90EA67;
  --color-dark-green: #164F3B;

  /* Functional tokens */
  --color-primary: #164F3B;
  --color-primary-dark: #0E2023;
  --color-primary-light: #90EA67;
  --color-accent: #90EA67;
  --color-secondary: #90EA67;
  --color-secondary-dark: #164F3B;
  --color-bg: #EBF3EC;
  --color-bg-alt: #D1DDCB;
  --color-bg-dark: #0E2023;
  --color-text: #0E2023;
  --color-text-muted: var(--surface-text-muted);
  --color-text-on-dark: #EBF3EC;
  --color-border: #B8C9B0;
  --color-success: #164F3B;
  --color-error: #EF4444;
  --color-whatsapp: #b8e879;

  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);

  /* Typography scale */
  --type-display: clamp(2.25rem, 4.5vw, 3.25rem);
  --type-h1: clamp(2rem, 4vw, 3rem);
  --type-h2: clamp(1.75rem, 3.25vw, 2.5rem);
  --type-h3: clamp(1.125rem, 2vw, 1.375rem);
  --type-h4: 1.0625rem;
  --type-lead: 1.0625rem;
  --type-body: 1rem;
  --type-body-sm: 0.9375rem;
  --type-caption: 0.8125rem;
  --type-micro: 0.75rem;
  --type-eyebrow: 0.8125rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-display: 1.12;
  --leading-heading: 1.2;
  --leading-title: 1.3;
  --leading-body: 1.7;
  --leading-snug: 1.55;

  --tracking-tight: -0.02em;
  --tracking-eyebrow: 0.08em;

  /* Text on light surfaces */
  --surface-text: #0E2023;
  --surface-text-muted: rgba(14, 32, 35, 0.65);
  --surface-text-subtle: rgba(14, 32, 35, 0.78);
  --surface-accent: #164F3B;
  --surface-eyebrow: #164F3B;

  /* Text on dark surfaces */
  --surface-dark-text: #ffffff;
  --surface-dark-text-muted: rgba(235, 243, 236, 0.78);
  --surface-dark-text-subtle: rgba(235, 243, 236, 0.65);
  --surface-dark-accent: #90EA67;
  --surface-dark-eyebrow: #90EA67;

  --section-header-gap: 0.75rem;
  --section-header-margin: clamp(2rem, 4vw, 3rem);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(14, 32, 35, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(14, 32, 35, 0.08), 0 2px 4px -2px rgba(14, 32, 35, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(14, 32, 35, 0.1), 0 4px 6px -4px rgba(14, 32, 35, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(14, 32, 35, 0.12), 0 8px 10px -6px rgba(14, 32, 35, 0.06);

  --header-height: 80px;
  --container-max: 1440px;
  --section-padding: 5rem;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--surface-text);
  background: var(--color-bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-dark-green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-navy);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  color: var(--surface-text);
}

h1 {
  font-size: var(--type-h1);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--type-h2);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--type-h3);
  line-height: var(--leading-title);
}

h4 {
  font-size: var(--type-h4);
  line-height: var(--leading-title);
  font-weight: var(--weight-semibold);
}

p {
  margin-bottom: 1rem;
  font-size: var(--type-body);
  line-height: var(--leading-body);
  color: var(--surface-text-subtle);
}

p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--type-lead);
  line-height: var(--leading-body);
  color: var(--surface-text-subtle);
}

.body-sm {
  font-size: var(--type-body-sm);
  line-height: var(--leading-snug);
}

.caption {
  font-size: var(--type-caption);
  line-height: var(--leading-snug);
  color: var(--surface-text-muted);
}

ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: var(--section-padding) 0;
}

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

.section-dark,
.hero-dark,
.page-hero,
.banner-cta,
.site-footer {
  --surface-text: var(--surface-dark-text);
  --surface-text-muted: var(--surface-dark-text-muted);
  --surface-text-subtle: var(--surface-dark-text-muted);
  --surface-accent: var(--surface-dark-accent);
  --surface-eyebrow: var(--surface-dark-eyebrow);
}

.section-dark {
  background: var(--color-navy);
  color: var(--surface-dark-text-muted);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.hero-dark h1,
.page-hero h1,
.banner-cta h2,
.banner-cta h3 {
  color: var(--surface-dark-text);
}

.section-dark p,
.hero-dark p,
.page-hero p,
.banner-cta p {
  color: var(--surface-dark-text-muted);
}

.section-header,
.section-intro {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto var(--section-header-margin);
}

.section-header h2,
.section-intro h2,
.section-header .letter-title,
.section-intro .letter-title {
  color: var(--surface-text);
  margin-bottom: var(--section-header-gap);
}

.section-header .text-muted,
.section-intro .text-muted,
.section-header p,
.section-intro p {
  font-size: var(--type-body);
  color: var(--surface-text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* Unified section eyebrow / label */
.section-eyebrow,
.section-label,
.about-preview__label,
.why-choose__label,
.process-showcase__label,
.faq-showcase__label,
.contact-showcase__label,
.pdp-section__head span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--type-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--surface-eyebrow);
  margin-bottom: 1rem;
}

.section-label {
  display: inline-block;
  letter-spacing: 0.05em;
  margin-bottom: var(--section-header-gap);
}

.about-preview__label::before,
.why-choose__label::before,
.process-showcase__label::before,
.faq-showcase__label::before,
.contact-showcase__label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  flex-shrink: 0;
}

/* Unified section titles */
.section-title,
.why-choose__content h2,
.process-showcase__intro h2,
.faq-showcase__intro h2,
.contact-showcase__content h2,
.section-header h2,
.section-intro h2,
.pdp-section__head h2 {
  font-family: var(--font-heading);
  font-size: var(--type-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
  color: var(--surface-text);
}

.section-dark .section-label,
.section-dark .section-eyebrow {
  color: var(--surface-dark-eyebrow);
}

.section-dark .letter-title .lt-char.accent,
.hero-dark .letter-title .lt-char.accent,
.page-hero .letter-title .lt-char.accent {
  color: var(--surface-dark-accent);
}

/* Accent highlights in titles (light surfaces) */
.why-choose__content .letter-title .lt-char.accent,
.process-showcase__intro .letter-title .lt-char.accent,
.faq-showcase__intro .letter-title .lt-char.accent,
.contact-showcase__content .letter-title .lt-char.accent,
.section-header .letter-title .lt-char.accent {
  color: var(--surface-accent);
}

.text-muted {
  color: var(--surface-text-muted);
}

.section-dark .text-muted {
  color: var(--surface-dark-text-muted);
}

.text-center { text-align: center; }

.grid {
  display: grid;
  gap: 1.5rem;
}

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Placeholder product images */
.product-img-placeholder {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
  font-size: 3rem;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
}

.hero-img-placeholder {
  background: linear-gradient(145deg, #0E2023 0%, #164F3B 55%, #90EA67 100%);
  border-radius: var(--radius-lg);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-icon {
  font-size: 5rem;
  opacity: 0.9;
  z-index: 1;
}

/* ── Scroll animation system (Tropitri-style) ── */

/* 2. Scroll reveal */
.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 3. Staggered children */
.reveal-stagger > .reveal,
.reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}

.reveal-stagger.in > .reveal,
.reveal-stagger.in > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* 1. Letter-by-letter text reveal */
html.js .letter-title:not(.is-ready),
html.js .scroll-text-reveal:not(.is-ready) {
  opacity: 0;
}

html.js .scroll-text-reveal.is-ready {
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}

.letter-title {
  max-width: 100%;
  word-spacing: normal;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
}

.letter-title .line {
  display: block;
  line-height: inherit;
}

.letter-title .line + .line {
  margin-top: 0.05em;
}

.letter-title .lt-word {
  display: inline;
  white-space: normal;
  margin-right: 0.28em;
}

.letter-title .lt-word:last-child {
  margin-right: 0;
}

.letter-title .lt-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: 1;
  height: 1.05em;
  position: relative;
}

.letter-title .lt-char {
  display: block;
  line-height: 1;
  height: 1em;
  opacity: 0;
  transform: translate3d(0, 110%, 0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.letter-title.in .lt-char {
  animation: letterSlideIn 0.7s var(--ease) both;
}

@keyframes letterSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 110%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Hero CTA entrance */
.hero-ctas {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
}

.hero-ctas.in {
  animation: riseIn 0.8s var(--ease) 0.5s both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

  .reveal,
  .reveal-stagger > .reveal,
  .reveal-stagger > *,
  html.js .letter-title:not(.is-ready),
  .hero-ctas {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .letter-title.in .lt-char {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-text-reveal .str-char {
    color: var(--color-navy);
    text-shadow: none;
    transition: none;
  }

  .scroll-text-reveal .str-char.str-accent {
    color: var(--color-dark-green);
  }
}
