:root {
  --pri: #2C5F2D; --sec: #D4A574; --acc: #1E3A8A;
  --text: #111827; --bg: #F9FAFB; --white: #FFF; --gray: #6B7280; --light: #E5E7EB;
  --f-h: 'Poppins', system-ui, sans-serif; --f-b: 'Roboto', system-ui, sans-serif;
  --pad: 1.25rem; --rad: 0.65rem; --shadow: 0 4px 14px rgba(0,0,0,.06);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { font-family: var(--f-b); color: var(--text); background: var(--bg); line-height: 1.5; overflow-x: hidden; padding-top: calc(62px + var(--safe-top)); padding-bottom: var(--safe-bot); }

.site-header { position: fixed; top: 0; left: 0; width: 100%; background: rgba(255,255,255,.98); backdrop-filter: blur(8px); z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding-top: var(--safe-top); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.6rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.logo h1 { font-family: var(--f-h); font-size: clamp(1.05rem, 3vw, 1.25rem); color: var(--pri); line-height: 1.1; }
.logo-sub { font-size: 0.75rem; color: var(--gray); margin-top: 1px; }
.lang-btn { background: var(--light); border: 2px solid transparent; border-radius: 2.5rem; padding: 0.25rem 0.5rem; display: flex; gap: 0.4rem; cursor: pointer; min-height: 48px; align-items: center; transition: 0.2s; touch-action: manipulation; }
.lang-btn:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.flag { font-size: 0.9rem; padding: 0.2rem 0.35rem; border-radius: 1.5rem; opacity: 0.5; transition: 0.2s; display: flex; align-items: center; background: rgba(255,255,255,.6); }
.flag.active { opacity: 1; background: var(--white); box-shadow: 0 2px 6px rgba(0,0,0,.12); transform: scale(1.1); border: 2px solid var(--sec); }

.hero { position: relative; width: 100%; min-height: 60dvh; display: flex; align-items: center; justify-content: center; background: #1a1a1a; color: var(--white); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity 0.6s ease; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(44,95,45,0.85)); }
.hero-content { position: relative; z-index: 2; text-align: center; padding: 2rem 1rem; max-width: 700px; }
.hero-content h2 { font-family: var(--f-h); font-size: clamp(1.8rem, 5.5vw, 2.8rem); margin-bottom: 0.5rem; line-height: 1.1; }
.hero-sub { font-size: clamp(1rem, 3vw, 1.15rem); opacity: 0.95; margin-bottom: 1.5rem; }
.cta-row { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.4rem; border-radius: var(--rad); font-weight: 500; text-decoration: none; transition: 0.2s; min-height: 50px; font-size: 1rem; border: none; cursor: pointer; touch-action: manipulation; }
.cta svg { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.cta.primary { background: var(--sec); color: #2a1a0e; }
.cta.secondary { background: var(--white); color: var(--pri); }
.cta:active { transform: scale(0.98); }
.indicators { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.6rem; z-index: 3; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: 0.2s; border: none; padding: 0; }
.dot.active { background: var(--sec); transform: scale(1.4); }

.pad { padding: 2.5rem 1.25rem; max-width: 100%; }
.section-title { font-family: var(--f-h); font-size: clamp(1.3rem, 4vw, 1.8rem); text-align: center; color: var(--pri); margin-bottom: 1.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0.85rem; }
.card { background: var(--white); padding: 1.5rem; border-radius: var(--rad); box-shadow: var(--shadow); text-align: center; border: 1px solid var(--light); transition: transform 0.2s; }
.card:hover { transform: translateY(-2px); }
.svc-icon { width: 2.5rem; height: 2.5rem; color: var(--pri); margin-bottom: 0.75rem; }
.card h3 { font-family: var(--f-h); margin-bottom: 0.35rem; font-size: 1.1rem; }
.card p { color: var(--gray); font-size: 0.95rem; }

.voice-container { background: var(--white); border-radius: var(--rad); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--light); }
.expand-btn { width: 100%; background: var(--white); border: 1px solid var(--light); padding: 0.85rem; border-radius: var(--rad); font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.65rem; justify-content: center; min-height: 52px; touch-action: manipulation; }
.expand-btn svg { width: 1.3rem; height: 1.3rem; }
.arrow { transition: transform 0.25s cubic-bezier(.4,0,.2,1); margin-left: auto; width: 1.2rem !important; }
.expand-btn.open .arrow { transform: rotate(180deg); }
.voice-panel { padding: 1rem; border-top: 1px solid var(--light); }
.hidden { display: none !important; }
.messages { min-height: 140px; max-height: 40vh; overflow-y: auto; background: var(--bg); border-radius: var(--rad); padding: 0.85rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.msg { padding: 0.7rem 0.9rem; border-radius: 0.8rem; max-width: 90%; font-size: 0.95rem; line-height: 1.4; word-break: break-word; }
.msg.bot { align-self: flex-start; background: var(--light); color: var(--text); }
.msg.user { align-self: flex-end; background: var(--sec); color: #2a1a0e; }
.voice-controls { display: flex; align-items: center; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.mic-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--pri); color: var(--white); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; box-shadow: 0 4px 12px rgba(44,95,45,0.25); touch-action: manipulation; }
.mic-btn svg { width: 1.6rem; height: 1.6rem; }
.mic-btn.listening { background: #DC2626; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.7); } 50% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } }
.status-text { font-size: 0.95rem; color: var(--gray); font-weight: 500; }
.offline-tag { background: #FEF3C7; color: #92400E; padding: 0.35rem 0.7rem; border-radius: 1.2rem; font-size: 0.8rem; }

.phrase-btn { background: var(--white); border: 1px solid var(--light); padding: 0.9rem; border-radius: var(--rad); text-align: left; cursor: pointer; transition: 0.2s; min-height: 56px; display: flex; flex-direction: column; gap: 0.25rem; touch-action: manipulation; width: 100%; }
.phrase-btn:active { background: var(--light); transform: scale(0.99); }
.p-en { font-weight: 500; color: var(--pri); }
.p-es { color: var(--gray); font-size: 0.9rem; }

.weather-box { background: var(--white); border-radius: var(--rad); padding: 1.5rem; box-shadow: var(--shadow); text-align: center; border: 1px solid var(--light); }
.w-loading, .w-error { padding: 1.2rem; color: var(--gray); font-weight: 500; }
.w-error { color: #DC2626; }
.w-loc { font-weight: 500; color: var(--pri); display: block; margin-bottom: 0.4rem; font-size: 1rem; }
.w-temp { font-size: clamp(2.8rem, 9vw, 3.5rem); font-weight: 700; color: var(--text); line-height: 1; display: inline-block; }
.w-cond { font-size: 1.15rem; color: var(--gray); display: block; margin: 0.3rem 0; }
.w-feel { font-size: 0.95rem; color: var(--gray); display: block; margin-bottom: 0.8rem; }
.w-forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; border-top: 1px solid var(--light); padding-top: 1rem; margin-top: 1rem; }
.fc-day { text-align: center; font-size: 0.95rem; }
.fc-day strong { display: block; margin-bottom: 0.2rem; color: var(--pri); }

.gallery { gap: 1rem; }
.g-item { background: var(--white); border-radius: var(--rad); overflow: hidden; box-shadow: var(--shadow); }
.g-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.g-item figcaption { padding: 0.65rem; text-align: center; font-size: 0.9rem; color: var(--gray); }

.foot-grid { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; text-align: center; }
.f-info h3 { font-family: var(--f-h); color: var(--pri); margin-bottom: 0.3rem; }
.f-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; color: var(--text); text-decoration: none; padding: 0.4rem 0.6rem; min-height: 44px; transition: 0.2s; border-radius: var(--rad); touch-action: manipulation; }
.f-link:hover { background: var(--bg); color: var(--pri); }
.f-link svg { width: 1em; height: 1em; }
.copy { text-align: center; color: var(--gray); font-size: 0.85rem; border-top: 1px solid var(--light); padding-top: 1.2rem; }

@media (min-width: 768px) {
  .hero { min-height: 70vh; }
  .pad { padding: 3.5rem 2rem; max-width: 1100px; margin: 0 auto; }
  .voice-controls { justify-content: flex-start; }
  .foot-grid { grid-template-columns: 1fr 1fr; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
