@import url('fonts.css');

:root {
  --page: #FFF7CF;
  --card: #FFFFFF;
  --ink: #0E3B43;
  --muted: #5B7A80;
  --sun: #FFC93C;

  --finanza: #1B9AAA;
  --economia: #E4572E;
  --tecnologia: #7F8F2A;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;

  --font-head: 'Young Serif', Georgia, serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  overflow-x: hidden;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}

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

a {
  color: inherit;
}

/* ---------- progress line ---------- */

.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--sun);
  z-index: 500;
  transition: width 0.1s linear;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 58svh;
  min-height: 420px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--finanza) 0%, #4FB8B0 38%, var(--page) 100%);
}

.hero__sun {
  position: absolute;
  top: 50%;
  right: -22vw;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  max-width: 560px;
  max-height: 560px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE08A 0%, var(--sun) 55%, #FFB01F 100%);
  box-shadow: 0 0 80px rgba(255, 201, 60, 0.55);
}

.hero__waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  display: block;
}

.hero__waves path {
  opacity: 0.55;
}

.hero__waves .wave-1 {
  animation: drift 18s linear infinite;
}

.hero__waves .wave-2 {
  animation: drift 26s linear infinite reverse;
  opacity: 0.4;
}

.hero__waves .wave-3 {
  animation: drift 34s linear infinite;
  opacity: 0.3;
}

@media (prefers-reduced-motion: reduce) {
  .hero__waves path {
    animation: none !important;
  }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-25%); }
}

.hero__content {
  position: absolute;
  top: 50%;
  left: 6%;
  transform: translateY(-50%);
  width: 58%;
  max-width: 360px;
  z-index: 2;
}

.hero__logo-plate {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 18px 40px rgba(14, 59, 67, 0.25);
  display: inline-block;
}

.hero__logo-plate img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 8px);
}

.hero__tagline {
  margin: 16px 0 0;
  color: #FFFFFF;
  font-weight: 700;
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  text-shadow: 0 2px 10px rgba(14, 59, 67, 0.35);
  max-width: 280px;
}

.hero__scroll-cue {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__scroll-cue svg {
  animation: bob 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue svg {
    animation: none;
  }
}

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

/* ---------- section header ---------- */

.section {
  padding: 56px 16px 32px;
  max-width: 720px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.section-header__badge {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 201, 60, 0.45);
}

.section-header__text {
  display: flex;
  flex-direction: column;
}

.section-header__name {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1;
  margin: 0;
}

.section-header__wave {
  margin-top: 6px;
  width: 140px;
  height: 10px;
}

.section--finanza .section-header__name,
.section--finanza .section-header__badge svg { color: var(--finanza); }
.section--economia .section-header__name { color: var(--economia); }
.section--tecnologia .section-header__name { color: var(--tecnologia); }

/* ---------- fade-in on scroll ---------- */

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

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

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

/* ---------- FINANZA: snap panels ---------- */

.finanza-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.panel {
  position: relative;
  height: 78svh;
  min-height: 520px;
  margin: 12px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 20px 40px rgba(14, 59, 67, 0.18);
  cursor: pointer;
  border: none;
  padding: 0;
  display: block;
  width: 100%;
  background: none;
  font: inherit;
  text-align: left;
}

.panel__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.panel__image.loaded {
  opacity: 1;
}

.panel__card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: var(--radius-md);
  padding: 18px 20px 20px;
  box-shadow: 0 10px 30px rgba(14, 59, 67, 0.2);
}

.panel__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--finanza);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.panel__headline {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}

.panel__preview {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--finanza);
}

.read-more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.panel:hover .read-more svg,
.chapter:hover .read-more svg,
.seal-card:hover .read-more svg {
  transform: translateX(4px);
}

/* ---------- ECONOMIA: chapter cards ---------- */

.economia-stack {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.chapter {
  display: flex;
  align-items: center;
  gap: 20px;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.chapter--right {
  flex-direction: row-reverse;
}

.chapter__media {
  position: relative;
  flex: 0 0 50%;
  max-width: 50%;
}

.chapter__image {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center 40%;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity 0.5s ease;
  box-shadow: 0 14px 30px rgba(14, 59, 67, 0.2);
}

.chapter__image.loaded {
  opacity: 1;
}

.chapter__sticker {
  position: absolute;
  top: -14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--economia);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(228, 87, 46, 0.4);
}

.chapter--left .chapter__sticker {
  right: -14px;
}

.chapter--right .chapter__sticker {
  left: -14px;
}

.chapter__sticker svg {
  width: 22px;
  height: 22px;
  animation: spin-slow 7s linear infinite;
}

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

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.chapter__body {
  flex: 1;
  min-width: 0;
}

.chapter__num {
  font-family: var(--font-head);
  color: var(--economia);
  font-size: 1rem;
  margin: 0 0 6px;
  font-weight: 400;
}

.chapter__headline {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 4.6vw, 1.4rem);
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}

.chapter__preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--economia);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
}

.pill svg { width: 14px; height: 14px; }

/* ---------- TECNOLOGIA: seal badges ---------- */

.tecnologia-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.seal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}

.seal-card--left { align-items: flex-start; }
.seal-card--right { align-items: flex-end; }
.seal-card--left .seal-card__inner,
.seal-card--right .seal-card__inner { text-align: left; }

.seal {
  position: relative;
  width: 68%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
}

.seal__ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--tecnologia);
  opacity: 0.4;
}

.seal__scallop {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--page) 0deg 4deg, var(--tecnologia) 4deg 8deg);
  opacity: 0.5;
}

.seal__image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.5s ease;
  box-shadow: 0 16px 34px rgba(14, 59, 67, 0.25);
}

.seal__image.loaded {
  opacity: 1;
}

.seal-card__inner {
  margin-top: 18px;
  max-width: 320px;
}

.tag {
  display: inline-block;
  background: var(--tecnologia);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.seal-card__headline {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 4.6vw, 1.35rem);
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}

.seal-card__preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.btn-tec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--tecnologia);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
}

.btn-tec svg { width: 14px; height: 14px; }

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

.site-footer {
  text-align: center;
  padding: 48px 20px 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer__tagline {
  font-family: var(--font-head);
  color: var(--ink);
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.site-footer__email {
  color: var(--finanza);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--page);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

@media (prefers-reduced-motion: reduce) {
  .overlay { transition: none; }
}

.overlay__hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.overlay__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(14, 59, 67, 0.3);
  cursor: pointer;
}

.overlay__close svg {
  width: 20px;
  height: 20px;
  color: var(--ink);
}

.overlay__body {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.overlay__pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.overlay__headline {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 10px;
}

.overlay__meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 24px;
}

.overlay__text p {
  color: var(--ink);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0 0 18px;
}

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .chapter__media { max-width: 44%; flex-basis: 44%; }
}
