*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* PALETA LUMINOSA Y CÁLIDA */
  --ds-bg: #F9F7F5; /* Fondo muy claro, arena */
  --ds-bg-alt: #EFEBE8; /* Fondo alternativo sutil */
  --ds-surface: #FFFFFF;
  --ds-card: #FFFFFF;
  --ds-card-soft: #F9F9F9;
  --ds-border-subtle: rgba(148, 163, 184, 0.25);
  --ds-text: #1F2937; /* Gris oscuro principal */
  --ds-muted: #6B7280; /* Gris secundario */
  --ds-accent: #5C774F; /* Verde Olivo/Sierra (Acento principal) */
  --ds-accent-soft: rgba(92, 119, 79, 0.1);
  --ds-accent-strong: #36291C; /* Marrón oscuro del logo */
  --ds-cordoba-terra: #C79A7A; /* Tono Tierra/Arena (Acento secundario) */
  --ds-danger: #ef4444;
  --ds-radius-lg: 14px;
  --ds-radius-xl: 20px;
  --ds-radius-full: 999px;
  --ds-shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --ds-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
  --ds-blur: 10px;
  --ds-max-width: 1120px;
  --ds-transition: 220ms ease;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--ds-text);
  background: var(--ds-bg); /* Fondo limpio y claro */
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Layout */

.nav {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ds-text);
}

header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 20;
  backdrop-filter: blur(var(--ds-blur));
  /* Header semi-transparente sobre la imagen */
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--ds-border-subtle);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 150px; 
  height: 40px; 
  flex-shrink: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-title {
  display: none; 
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--ds-text);
  opacity: 0.85;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--ds-accent);
}

.nav-cta {
  padding: 8px 16px;
  border-radius: var(--ds-radius-full);
  border: 1px solid var(--ds-accent);
  background: var(--ds-accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(92, 119, 79, 0.3);
  transition: all 0.2s ease;
}

.nav-cta:hover {
    background: #4A6041;
    border-color: #4A6041;
}

.nav-cta span.icon {
  font-size: 1.05rem;
}

/* HERO */

.hero {
  position: relative;
  min-height: 90vh; /* Hacemos el hero un poco más pequeño */
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  overflow: hidden;
  padding-top: 60px; /* Para acomodar el header fijo */
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg picture, .hero-bg img {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-bg img {
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* Overlay blanco sutil para asegurar el texto oscuro */
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.35));
  mix-blend-mode: normal;
  z-index: -1;
}

.hero-inner {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: 60px 18px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--ds-radius-full);
  background: var(--ds-accent-soft); 
  border: 1px solid var(--ds-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  color: var(--ds-accent);
  font-weight: 600;
}

.hero-kicker span.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-accent);
  box-shadow: 0 0 0 4px rgba(92, 119, 79, 0.2);
}

.hero-title {
  font-size: clamp(2.3rem, 4vw, 3.1rem);
  line-height: 1.05;
  margin-bottom: 18px;
  color: var(--ds-text); /* Texto oscuro sobre la imagen */
}

.hero-title span.accent {
  color: var(--ds-accent);
}

.hero-text {
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 480px;
  color: var(--ds-muted); /* Texto secundario oscuro */
  opacity: 1;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-primary {
  padding: 11px 20px;
  border-radius: var(--ds-radius-full);
  background: var(--ds-accent-strong); /* Marrón del logo */
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(54, 41, 28, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(54, 41, 28, 0.35);
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: var(--ds-radius-full);
  border: 1px solid var(--ds-border-subtle);
  background: transparent;
  color: var(--ds-text);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--ds-bg-alt);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.8rem;
  color: var(--ds-muted);
}

.hero-meta strong {
  color: var(--ds-text);
}

.hero-right {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.hero-card {
  width: 100%;
  max-width: 360px;
  padding: 18px 18px 16px;
  border-radius: var(--ds-radius-lg);
  /* Fondo limpio y blanco */
  background: var(--ds-surface); 
  border: 1px solid var(--ds-border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.87rem;
}

.hero-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ds-muted);
}

.hero-card-title {
  font-weight: 600;
  color: var(--ds-accent-strong);
}

.hero-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}

.tag-chip {
  padding: 4px 8px;
  border-radius: var(--ds-radius-full);
  background: var(--ds-card-soft);
  border: 1px solid var(--ds-border-subtle);
  font-size: 0.72rem;
  color: var(--ds-muted);
}

.hero-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ds-muted);
  margin-top: 8px;
}

.hero-card-footer span.highlight {
  color: var(--ds-accent);
  font-weight: 600;
}

/* GENERAL SECTIONS */

section {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: 72px 18px;
  background: var(--ds-bg); 
}

section h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

section p.lead {
  font-size: 0.98rem;
  color: var(--ds-muted);
  max-width: 520px;
  margin-bottom: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.card {
  padding: 18px 18px 20px;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-card);
  border: 1px solid var(--ds-border-subtle);
  box-shadow: var(--ds-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--ds-accent);
}

.card p {
  font-size: 0.9rem;
  color: var(--ds-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--ds-radius-full);
  font-size: 0.75rem;
  background: var(--ds-accent-soft);
  color: var(--ds-accent);
  font-weight: 600;
  margin-bottom: 8px;
}

/* STORYTELLING SCROLL */

.story-strip {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: 40px 18px 10px;
  display: grid;
  gap: 10px;
}

.story-line {
  font-size: 1rem;
  color: var(--ds-muted);
  opacity: 0.9;
}

.story-line strong {
  color: var(--ds-text);
}

/* SOBRE DIGITAL SERRANO */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: flex-start;
}

.about-text {
  font-size: 0.96rem;
  color: var(--ds-muted);
  line-height: 1.7;
  white-space: pre-line;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clima-widget {
  padding: 14px 16px;
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-border-subtle);
  background: var(--ds-card-soft);
  font-size: 0.88rem;
  color: var(--ds-muted);
}

.clima-widget strong {
  color: var(--ds-text);
}

.audio-toggle {
  padding: 8px 12px;
  border-radius: var(--ds-radius-full);
  border: 1px solid var(--ds-border-subtle);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: var(--ds-card);
  color: var(--ds-text);
}

/* DEMO INTERACTIVA */

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
}

.demo-device {
  border-radius: 30px;
  border: 1px solid var(--ds-border-subtle);
  padding: 14px 10px;
  max-width: 320px;
  background: var(--ds-bg-alt);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.demo-screen {
  border-radius: 22px;
  background: var(--ds-surface);
  padding: 10px 10px 14px;
}

.demo-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.demo-tab {
  flex: 1;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  text-align: center;
  cursor: pointer;
  background: var(--ds-card-soft);
  color: var(--ds-muted);
}

.demo-tab.active {
  background: var(--ds-accent);
  color: #FFFFFF;
  border-color: var(--ds-accent);
}

.demo-content-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ds-text);
}

.demo-content-text {
  font-size: 0.78rem;
  color: var(--ds-muted);
  margin-bottom: 10px;
}

.demo-list {
  font-size: 0.75rem;
  color: var(--ds-muted);
  list-style: none;
  padding-left: 0;
}

.demo-list li + li { margin-top: 3px; }

/* CONTACTO */

.contact-box {
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-border-subtle);
  padding: 22px 18px;
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: flex-start;
}

.contact-box ul {
  list-style: none;
  font-size: 0.92rem;
  color: var(--ds-muted);
}

.contact-box li + li { margin-top: 6px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
}

.contact-form label {
  font-weight: 500;
  color: var(--ds-text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--ds-border-subtle);
  font-family: inherit;
  font-size: 0.86rem;
  background: var(--ds-card-soft);
  color: var(--ds-text);
}

.contact-form textarea {
  min-height: 90px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-end;
}

/* FOOTER */

footer {
  border-top: 1px solid var(--ds-border-subtle);
  padding: 16px 18px 26px;
  font-size: 0.8rem;
  color: var(--ds-muted);
  text-align: center;
  background: var(--ds-bg-alt);
}

/* MATE VIRTUAL OVERLAY */

.mate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.3); /* Overlay más claro */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.mate-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.mate-card {
  max-width: 380px; 
  width: 90%;
  /* Fondo blanco / arena suave */
  background: var(--ds-surface); 
  color: var(--ds-text);
  border-radius: var(--ds-radius-lg);
  padding: 20px 20px 18px;
  border: 1px solid var(--ds-border-subtle); 
  box-shadow: var(--ds-shadow-card);
  text-align: left;
  font-size: 0.9rem;
  overflow: hidden; 
}

/* Contenedor para la imagen estática del mate (si no hay video) */
.mate-media-container {
    height: 150px; 
    border-radius: 12px;
    margin: -10px -10px 15px -10px; 
    position: relative;
    overflow: hidden;
    /* Usamos la imagen subida RG6SZYZBVOGFPUQL627JSKPUDU.jpg renombrada a mate.jpg */
    background: url('img/mate.jpg') center/cover no-repeat; 
}

/* Capa oscura (opcional sobre imagen clara, pero la mantenemos para consistencia) */
.mate-media-container::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Gradiente sutil y oscuro para el texto sobre la imagen */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 60%); 
}

.mate-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mate-emoji {
  font-size: 1.7rem;
}

.mate-title {
  font-weight: 600;
  font-size: 1.05rem; 
  color: var(--ds-accent-strong); /* Marrón del logo */
}

.mate-text {
  font-size: 0.88rem;
  color: var(--ds-muted);
  margin-bottom: 12px;
}

.mate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.mate-btn {
  padding: 7px 12px;
  border-radius: var(--ds-radius-full);
  border: 1px solid var(--ds-border-subtle);
  background: transparent;
  color: var(--ds-text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mate-btn:hover {
    background: var(--ds-bg-alt);
}

.mate-btn.primary {
  background: var(--ds-accent); /* Verde de sierra */
  color: #FFFFFF;
  border-color: var(--ds-accent);
  font-weight: 600;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .nav-links { display: none; }

  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 110px;
  }

  .hero-right {
    justify-content: flex-start;
  }

  .hero-card {
    max-width: 100%;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .about,
  .demo,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .story-strip {
    padding-top: 26px;
  }
}