@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-800.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('../fonts/dm-sans-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-700.woff2') format('woff2');
}

:root {
  --color-page: #FFF7D6;
  --color-card: #FFFFFF;
  --color-ink: #1D2B3A;
  --color-muted: #5E6B78;

  --color-fin: #0B7A62;
  --color-fin-tint: #D8F1E8;
  --color-fin-tint-deep: #C1E5D5;

  --color-eco: #D6336C;
  --color-eco-tint: #FBDDE8;
  --color-eco-tint-deep: #F5C3D7;

  --color-tec: #0094B8;
  --color-tec-tint: #D3F0F8;
  --color-tec-tint-deep: #B7E4F0;

  --font-display: 'Bricolage Grotesque', 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-body);
}

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

button { font-family: inherit; border: none; background: none; cursor: pointer; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-fin), var(--color-eco), var(--color-tec));
  z-index: 80;
  transition: width 0.12s linear;
}

/* ---------- Masthead ---------- */

.masthead-wrap {
  position: relative;
  overflow: hidden;
  padding-bottom: 2.25rem;
  background: var(--color-page);
}

.masthead-ribbon {
  position: relative;
  width: 114vw;
  margin-left: -7vw;
  margin-right: -7vw;
  transform: rotate(-3deg);
  background: var(--color-ink);
  padding: 2.75rem 9vw 3.25rem;
  box-shadow: 0 16px 34px rgba(29, 43, 58, 0.35);
  overflow: hidden;
}

.masthead-content {
  position: relative;
  z-index: 2;
  transform: rotate(3deg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: 58%;
}

.masthead-logo-wrap {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.masthead-logo {
  width: min(42vw, 180px);
  height: auto;
}

.masthead-tagline {
  margin: 0;
  color: var(--color-page);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
  opacity: 0.92;
}

.compass-dial {
  position: absolute;
  top: -50px;
  right: -55px;
  width: 230px;
  height: 230px;
  opacity: 0.16;
  z-index: 1;
}

.compass-needle {
  transform-origin: 110px 110px;
  animation: compass-spin 12s linear infinite;
}

@keyframes compass-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .compass-needle { animation: none; }
}

/* ---------- Section header ---------- */

.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 1.25rem 1rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  margin: 0;
}

.header-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  opacity: 0.4;
}

.section-fin .compass-icon, .section-fin h2 { color: var(--color-fin); }
.section-fin .header-line { background: var(--color-fin); }
.section-eco .compass-icon, .section-eco h2 { color: var(--color-eco); }
.section-eco .header-line { background: var(--color-eco); }
.section-tec .compass-icon, .section-tec h2 { color: var(--color-tec); }
.section-tec .header-line { background: var(--color-tec); }

.compass-icon { width: 22px; height: 22px; flex-shrink: 0; }

.section-band {
  border-radius: 28px;
  margin: 0 1rem 2.75rem;
  padding: 1.5rem 1rem 0.5rem;
}

.section-fin .section-band { background: var(--color-fin-tint); }
.section-eco .section-band { background: var(--color-eco-tint); }
.section-tec .section-band { background: var(--color-tec-tint); }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.preview {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0.5rem 0 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
}

.chip-fin { background: var(--color-fin); color: #fff; }
.chip-eco { background: var(--color-eco); color: #fff; }
.chip-tec { background: var(--color-tec); color: #fff; }

.ver-mas {
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0;
}
.ver-mas-fin { color: var(--color-fin); }
.ver-mas-eco { color: var(--color-eco); }
.ver-mas-tec {
  background: var(--color-tec);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

/* ---------- FINANZAS: card stack ---------- */

.stack {
  position: relative;
  margin: 0 0.4rem 2.6rem;
}

.stack-peek {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--color-fin-tint);
}
.stack-peek-1 { transform: translate(6px, 6px) scale(0.98); z-index: 1; }
.stack-peek-2 {
  transform: translate(13px, 13px) scale(0.95);
  z-index: 0;
  background: var(--color-fin-tint-deep);
  opacity: 0.85;
}

.fin-card {
  position: relative;
  z-index: 2;
  background: var(--color-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(11, 122, 98, 0.16);
}

.card-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-fin-tint);
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: fade-in 0.5s ease;
}

.card-body { padding: 1.1rem 1.1rem 1.35rem; }
.card-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0.55rem 0 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- ECONOMÍA: feature + duo ---------- */

.eco-feature {
  background: var(--color-card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(214, 51, 108, 0.16);
  margin: 0 0.4rem 1.5rem;
}

.eco-feature-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-eco-tint);
}
.eco-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: fade-in 0.5s ease;
}
.eco-feature-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(214, 51, 108, 0.88) 0%, rgba(214, 51, 108, 0.25) 45%, transparent 75%);
}
.eco-feature-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1.1rem 1.4rem;
}
.eco-feature-text .chip-eco { background: #fff; color: var(--color-eco); margin-bottom: 0.55rem; }
.eco-feature-text h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  line-height: 1.25;
  color: #fff;
  margin: 0;
}
.eco-feature-body { padding: 1rem 1.1rem 1.3rem; }

.eco-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 0 0.4rem;
}

.eco-grid-card {
  background: var(--color-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(214, 51, 108, 0.14);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.eco-grid-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-eco-tint);
}
.eco-grid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: fade-in 0.5s ease;
}
.eco-grid-body {
  padding: 0.8rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.eco-grid-body h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.eco-grid-body .preview {
  font-size: 0.82rem;
  flex: 1;
}
.eco-grid-body .ver-mas { align-self: flex-start; }

/* ---------- TECNOLOGÍA: browser windows ---------- */

.tec-window {
  background: var(--color-card);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0.4rem 1.6rem;
  box-shadow: 0 10px 22px rgba(0, 148, 184, 0.14);
}

.tec-topbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: #F4F6F7;
  border-bottom: 1px solid #E7EBED;
}
.tec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #D7DCDF;
}
.tec-address {
  margin-left: 0.5rem;
  font-size: 0.68rem;
  color: var(--color-muted);
  background: #fff;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  border: 1px solid #E7EBED;
}

.tec-image { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--color-tec-tint); }
.tec-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: fade-in 0.5s ease;
}

.tec-body { padding: 1rem 1.1rem 1.2rem; }
.tec-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0;
}

.tec-glow {
  height: 4px;
  margin: 0 1.1rem 1rem;
  border-radius: 4px;
  background: var(--color-tec);
  box-shadow: 0 0 12px 1px rgba(0, 148, 184, 0.65);
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
}
.footer-tagline {
  font-style: italic;
  color: var(--color-muted);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto 0.6rem;
  line-height: 1.5;
}
.footer-email a {
  color: var(--color-ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--color-fin);
}

/* ---------- Overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--color-page);
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.overlay.open { transform: translateY(0); }

.overlay-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay-close {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  right: 1rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(29, 43, 58, 0.78);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-ink);
}
.overlay-hero img { width: 100%; height: 100%; object-fit: cover; }

.overlay-content { padding: 1.5rem 1.25rem 3rem; }
.overlay-content h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 7vw, 2rem);
  line-height: 1.25;
  margin: 0.75rem 0 0.4rem;
}
.reading-time {
  color: var(--color-muted);
  font-size: 0.82rem;
  margin: 0 0 1.25rem;
}
.overlay-body p {
  line-height: 1.7;
  font-size: 1rem;
  margin: 0 0 1.1rem;
}

@media (min-width: 640px) {
  .eco-grid { grid-template-columns: 1fr 1fr; }
}
