/* ============================================================
   Terreno Digital — estilos compartidos por todas las paginas
   (nav, botones, tipografia base, modales, footer, menu mobile)
   Lo especifico de cada pagina (hero, grillas de contenido, etc.)
   va en el <style> propio de cada archivo .html.
   ============================================================ */

:root {
  --espresso: #1E140E;
  --nogal: #4A2F1F;
  --crema: #F5F0EA;
  --blanco: #FFFFFF;
  --negro: #111111;
  --rosa-polvo: #E9CFC6;
  --salvia: #7F8F72;

  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  --nav-h: 80px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--espresso);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

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

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

.shell {
  width: min(1320px, calc(100% - 96px));
  margin: 0 auto;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= NAV ================= */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
  border-bottom: 1px solid transparent;
}

.site-nav.is-scrolled {
  background: rgba(245, 240, 234, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 20, 14, 0.08);
}

.site-nav.is-scrolled .nav-link,
.site-nav.is-scrolled .nav-signin,
.site-nav.is-scrolled .brand span {
  color: var(--espresso);
}

.site-nav.is-scrolled .brand-mark {
  filter: none;
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.brand span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--blanco);
  white-space: nowrap;
  transition: color 300ms var(--ease);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--blanco);
  cursor: pointer;
  padding: 10px 0;
  transition: color 300ms var(--ease), opacity 200ms ease;
}

.nav-link:hover {
  opacity: 0.72;
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 220ms ease;
}

.nav-item.is-open .chevron {
  transform: rotate(225deg) translateY(1px);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 240px;
  padding: 10px;
  background: var(--blanco);
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.16);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}

.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--espresso);
  border-radius: 2px;
  transition: background 160ms ease;
}

.nav-dropdown a:hover {
  background: var(--crema);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 0 0 auto;
}

.nav-signin {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--blanco);
  cursor: pointer;
  transition: color 300ms var(--ease), opacity 200ms ease;
  white-space: nowrap;
}

.nav-signin:hover {
  opacity: 0.72;
}

.nav-account {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-account[hidden],
.nav-right [hidden],
.mobile-nav [hidden] {
  display: none;
}

.nav-account-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blanco);
  white-space: nowrap;
}

.site-nav.is-scrolled .nav-account-name {
  color: var(--espresso);
}

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.hamburger span {
  width: 22px;
  height: 1.4px;
  background: var(--blanco);
  transition: background 300ms var(--ease), transform 260ms var(--ease), opacity 200ms ease;
}

.site-nav.is-scrolled .hamburger span {
  background: var(--espresso);
}

/* mobile nav panel */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--espresso);
  display: flex;
  flex-direction: column;
  padding: 100px 40px 40px;
  transform: translateY(-100%);
  transition: transform 380ms var(--ease);
}

body.nav-open .mobile-nav {
  transform: translateY(0);
}

.mobile-nav a {
  font-size: 26px;
  font-weight: 400;
  color: var(--blanco);
  padding: 16px 0;
  border-bottom: 1px solid rgba(245, 240, 234, 0.12);
}

.mobile-nav .btn {
  margin-top: 32px;
  align-self: flex-start;
}

.close-mobile {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  cursor: pointer;
}

.close-mobile span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1.4px;
  background: var(--blanco);
}

.close-mobile span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.close-mobile span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

/* ================= BUTTONS ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 18px 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blanco);
  color: var(--negro);
}

.btn-primary:hover {
  background: var(--crema);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--espresso);
  color: var(--crema);
}

.btn-dark:hover {
  background: var(--nogal);
  transform: translateY(-1px);
}

/* ================= TIPOGRAFIA / SECCIONES GENERICAS ================= */

.eyebrow {
  margin: 0 0 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rosa-polvo);
}

.section {
  padding: 130px 0;
}

.section.tight {
  padding: 90px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 64px;
}

.kicker {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nogal);
}

h2 {
  margin: 0;
  max-width: 640px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--espresso);
}

h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.section-copy {
  max-width: 340px;
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(30, 20, 14, 0.62);
}

.section-dark {
  background: var(--espresso);
  color: var(--crema);
}

.section-dark .kicker {
  color: var(--rosa-polvo);
}

.section-dark h2 {
  color: var(--blanco);
}

.section-dark .section-copy {
  color: rgba(245, 240, 234, 0.62);
}

/* ---- pagina interior: encabezado tipo "mini hero" para subpaginas ---- */

.page-header {
  position: relative;
  padding: calc(var(--nav-h) + 90px) 0 70px;
  background: linear-gradient(120deg, #241811 0%, #1E140E 46%, #150D08 100%);
  color: var(--crema);
}

.page-header h1 {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--blanco);
}

.page-header h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.page-header-copy {
  margin: 22px 0 0;
  max-width: 560px;
  font-size: 16.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.page-placeholder {
  padding: 32px;
  border: 1px dashed rgba(30, 20, 14, 0.25);
  color: rgba(30, 20, 14, 0.55);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ---- footer ---- */

footer {
  padding: 40px 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 12.5px;
  color: rgba(30, 20, 14, 0.5);
  flex-wrap: wrap;
}

footer .foot-links {
  display: flex;
  gap: 24px;
}

/* ---- scroll reveal ----
   Solo se ocultan si el JS realmente corrio (clase .js en <html>);
   sin JS, el contenido queda visible de entrada en vez de escondido. */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js .stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 650ms var(--ease), transform 650ms var(--ease);
}

.stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger.is-visible > *:nth-child(2) { transition-delay: 90ms; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 180ms; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= MODALES (login / registro) ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 12, 8, 0.7);
  backdrop-filter: blur(6px);
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--crema);
  padding: 48px 40px 40px;
  animation: fadeInUp 380ms var(--ease) both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--espresso);
  cursor: pointer;
}

.modal-card .kicker {
  margin: 0 0 8px;
}

.modal-card h3 {
  margin: 0 0 28px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--espresso);
}

.modal-card label {
  display: block;
  margin-bottom: 18px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(30, 20, 14, 0.62);
}

.modal-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid rgba(30, 20, 14, 0.18);
  background: var(--blanco);
  font-family: inherit;
  font-size: 15px;
  color: var(--espresso);
  transition: border-color 200ms ease;
}

.modal-card input:focus {
  outline: none;
  border-color: var(--nogal);
}

.modal-password-hint {
  margin: -8px 0 18px;
  font-size: 12px;
  color: var(--salvia);
}

.modal-error {
  min-height: 18px;
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: #B3261E;
}

.modal-error:empty {
  margin: 0 0 0;
  min-height: 0;
}

.modal-submit {
  width: 100%;
  border: 0;
}

.modal-submit[disabled] {
  opacity: 0.6;
  cursor: default;
}

.modal-switch {
  margin: 22px 0 0;
  font-size: 13px;
  text-align: center;
  color: rgba(30, 20, 14, 0.6);
}

.modal-switch a {
  color: var(--nogal);
  text-decoration: underline;
  cursor: pointer;
}

/* ================= RESPONSIVE (compartido) ================= */

@media (max-width: 980px) {
  .shell { width: min(100% - 48px, 1320px); }

  .nav-center { display: none; }
  .nav-signin { display: none; }
  .nav-right .btn-primary { display: none; }
  .nav-right { gap: 0; }
  .hamburger { display: flex; }

  .section-head { flex-direction: column; align-items: flex-start; }
  .section-copy { max-width: 100%; }
}

@media (max-width: 560px) {
  .nav-inner { padding: 0 24px; }
}
