/* ---------- Tokens ----------
   No system/CDN internet access for this build, so the headline and body
   stacks fall back to platform-native sans/serif fonts instead of the
   self-hosted Plus Jakarta Sans / Newsreader files named in the spec. */
:root {
  --color-surface: #FFFFFF;
  --color-ink: #111827;
  --color-muted: #6B7280;
  --color-hairline: #E5E7EB;

  --fin-color: #0F6E7A;
  --fin-tint: #E4F2F4;
  --eco-color: #F59E0B;
  --eco-tint: #FEF3DC;
  --tec-color: #4F46E5;
  --tec-tint: #ECEBFD;

  --font-head: -apple-system, "Segoe UI", Roboto, ui-sans-serif, system-ui, sans-serif;
  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;

  --gutter: 20px;
  --accent: var(--fin-color);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

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

.hairline {
  height: 1px;
  width: 100%;
  background: var(--color-hairline);
}

/* ---------- Progress line ---------- */
#progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: background-color 0.4s ease;
}

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  min-height: 52svh;
  background: var(--color-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) 28px;
}

.masthead-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.18;
}

.blob-teal {
  width: 60vw;
  height: 60vw;
  background: var(--fin-color);
  top: -18vw;
  left: -20vw;
}
.blob-amber {
  width: 55vw;
  height: 55vw;
  background: var(--eco-color);
  top: -8vw;
  left: 22vw;
}
.blob-indigo {
  width: 58vw;
  height: 58vw;
  background: var(--tec-color);
  top: 2vw;
  left: 52vw;
}

.masthead-logo-wrap {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  width: 56%;
}

.masthead-hairline {
  height: 1px;
  width: 100%;
  background: var(--color-hairline);
  margin-bottom: 14px;
}

.masthead-logo {
  width: 100%;
  height: auto;
  display: block;
}

.desliza-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  z-index: 1;
}

.desliza-arrow {
  animation: bounce 1.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

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

/* ---------- Section header ---------- */
.section {
  padding: 56px var(--gutter) 24px;
}

.section-header {
  margin-bottom: 36px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

#section-financial .section-label { color: var(--fin-color); }
#section-economic .section-label { color: var(--eco-color); }
#section-technology .section-label { color: var(--tec-color); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: 0 0 22px;
}

/* ---------- Story card base ---------- */
.story-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.story-card img {
  transition: transform 0.25s ease;
}

.story-card.pressed img {
  transform: scale(1.03);
}

.fade-rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-rise.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-rise { opacity: 1; transform: none; transition: none; }
}

.story-preview {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-ink);
  margin: 10px 0 14px;
}

.story-headline {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 21px;
  line-height: 1.25;
  color: var(--color-ink);
  margin: 10px 0 0;
}

.leer-mas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
}

.leer-mas svg { width: 14px; height: 10px; }

/* ---------- FINANZAS: centered squircles ---------- */
.stories-financial .story-card {
  padding: 28px 0;
  text-align: center;
}

.stories-financial .story-card:not(:first-child) {
  border-top: 1px solid var(--color-hairline);
}

.squircle-wrap {
  width: 74%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 40px;
  overflow: hidden;
  background: var(--fin-tint);
}

.squircle-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.story-number {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  color: var(--fin-color);
  margin-top: 20px;
  letter-spacing: 0.04em;
}

.stories-financial .leer-mas { color: var(--fin-color); justify-content: center; }

/* ---------- ECONOMÍA: capsules ---------- */
.stories-economic .story-card {
  padding: 22px 0;
}

.capsule-wrap {
  width: 92%;
  aspect-ratio: 2 / 1;
  border-radius: 999px;
  overflow: hidden;
  background: var(--eco-tint);
  margin-bottom: 16px;
}

.stories-economic .story-card:nth-child(odd) .capsule-wrap { margin-left: 0; }
.stories-economic .story-card:nth-child(even) .capsule-wrap { margin-left: 8%; }

.capsule-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.eco-chip {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--eco-color);
  background: var(--eco-tint);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.stories-economic .story-headline { text-align: left; }
.stories-economic .story-preview { text-align: left; }

.stories-economic .leer-mas {
  color: var(--eco-color);
  text-decoration: underline;
  text-decoration-color: var(--eco-color);
  text-underline-offset: 3px;
}

/* ---------- TECNOLOGÍA: wave cards ---------- */
.stories-technology .story-card {
  margin-bottom: 36px;
}

.wave-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.wave-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.wave-card-media svg {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  display: block;
}

.wave-panel {
  background: var(--tec-tint);
  margin-top: -2px;
  padding: 22px var(--gutter) 26px;
  border-radius: 0 0 18px 18px;
}

.stories-technology .story-headline { margin-top: 0; }

.tec-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  background: var(--tec-color);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
}

.tec-pill-btn svg { width: 12px; height: 9px; }
.tec-pill-btn svg path { stroke: #fff; }

/* ---------- Soft shadows ---------- */
.squircle-wrap,
.capsule-wrap,
.wave-card-media {
  box-shadow: 0 18px 40px -16px rgba(17, 24, 39, 0.14);
}

/* ---------- Footer ---------- */
.footer {
  padding: 48px var(--gutter) 64px;
  text-align: center;
  border-top: 1px solid var(--color-hairline);
  margin-top: 24px;
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 10px;
}

.footer-email {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-ink);
  margin: 0;
}

/* ---------- Overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  visibility: hidden;
}

.overlay.open {
  transform: translateY(0);
  visibility: visible;
}

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

.overlay-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
  z-index: 2001;
  box-shadow: 0 8px 20px -8px rgba(17, 24, 39, 0.2);
}

.overlay-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0 0 24px 24px;
}

.overlay-body {
  padding: 24px var(--gutter) 72px;
}

.overlay-pill {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.overlay-headline {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--color-ink);
}

.overlay-reading-time {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-muted);
  margin: 0 0 24px;
}

.overlay-article {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-ink);
}

.overlay-article p {
  margin: 0 0 20px;
}
