/* =========================================
   WhatsApp Brand Landing - Global Styles
   Design System: Morandi Low-Saturation + Ample Whitespace
   Typography: Serif Headings / Sans-Serif Body
   ========================================= */

:root {
  /* Palette: Morandi Earth Tones */
  --color-bg: #F7F5F3;
  --color-surface: #FFFFFF;
  --color-primary: #7A948D;
  --color-primary-hover: #68837D;
  --color-accent: #C4B5A4;
  --color-text: #2D2B28;
  --color-text-muted: #6E6A66;
  --color-border: #E6E2DD;
  --color-highlight: #EBE5DF;

  /* Spacing & Layout */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --container-max: 1120px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 20px rgba(45, 43, 40, 0.06);
  --shadow-card: 0 2px 12px rgba(45, 43, 40, 0.08);

  /* Typography */
  --font-heading: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --line-height: 1.65;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
a:hover { color: var(--color-primary-hover); }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 2px; }

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-lg) 0;
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bento { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--color-text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--space-sm); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text); }
.text-muted { color: var(--color-text-muted); }

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}
nav a {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  margin-top: auto;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  list-style: none;
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-secondary:hover {
  background: var(--color-highlight);
  border-color: var(--color-accent);
}

/* Components: Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}
.card-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  display: block;
}

/* Components: Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  background: var(--color-highlight);
  font-weight: 600;
  color: var(--color-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { font-weight: 500; color: var(--color-text); }

/* Components: FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s ease;
}
details:hover { box-shadow: var(--shadow-card); }
summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  padding-right: 2rem;
  outline: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: translateY(-40%) rotate(-135deg); }
details p { margin-top: 0.75rem; color: var(--color-text-muted); }

/* Components: Hero & Sections */
.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--space-md);
}
.hero-content { max-width: 600px; }
.hero-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); flex-wrap: wrap; }
.hero-svg { width: 100%; max-width: 480px; margin: 0 auto; }

.feature-block {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px dashed var(--color-border);
}
.feature-block:last-child { border-bottom: none; margin-bottom: 0; }
.feature-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-accent);
  line-height: 1;
  min-width: 2ch;
}

.download-area {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}
.install-steps {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-highlight);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* SVG Animation Base */
.svg-canvas { width: 100%; height: auto; overflow: visible; }
.flow-path { fill: none; stroke: var(--color-accent); stroke-width: 2; opacity: 0.6; }
.flow-node { fill: var(--color-primary); opacity: 0.8; }

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes moveAlong {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.flow-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 5s ease-in-out infinite alternate;
}
.dot-flow {
  fill: var(--color-primary);
  animation: moveAlong 6s linear infinite;
  offset-path: path("M 40 60 L 120 40 L 200 80 L 280 30");
}
.dot-flow-delayed {
  fill: var(--color-accent);
  animation: moveAlong 6s linear infinite 3s;
  offset-path: path("M 40 60 L 120 40 L 200 80 L 280 30");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .install-steps { flex-direction: column; gap: 1.5rem; }
  nav ul { display: none; } /* Simplified for static build, relies on semantic structure */
  .grid-2, .grid-3, .bento { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}
