/* ══════════════════════════════════════════════════════
   CAROLINA MONTALTO — STYLESHEET
   ══════════════════════════════════════════════════════ */

/* ── RESET ───────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── VARIABLES ───────────────────────────────────────── */
:root {
  --verde-oscuro: #1a2e1f;
  --verde-medio: #2d4a2f;
  --verde-claro: #4a7c4e;
  --amarillo-suave: #c8c44a;
  --amarillo-luz: #e8e070;
  --crema: #f5f0e8;
  --blanco-niebla: rgba(245, 240, 232, 0.92);
  --texto-claro: rgba(245, 240, 232, 0.88);
  --texto-tenue: rgba(245, 240, 232, 0.5);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", sans-serif;
}

/* ── BASE ────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--sans);
  color: var(--texto-claro);
  background: var(--verde-oscuro);
  overflow-x: hidden;
  font-size: clamp(16px, 1vw, 18px);
}

/* ── BACKGROUND ──────────────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url(../images/portada.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(4px) brightness(0.52) saturate(0.85);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    160deg,
    rgba(10, 22, 12, 0.72) 0%,
    rgba(20, 35, 18, 0.55) 50%,
    rgba(8, 18, 8, 0.78) 100%
  );
}

/* ── HEADER ──────────────────────────────────────────── */
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

nav {
  display: flex;
  gap: 2.8rem;
  opacity: 0;
  animation: fadeDown 1s 0.5s forwards;
}

nav a {
  font-family: var(--sans);
  font-size: clamp(0.7rem, 0.8vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--texto-tenue);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--amarillo-luz);
  transition: width 0.4s ease;
}

nav a:hover {
  color: var(--crema);
}

nav a:hover::after {
  width: 100%;
}

/* ── HAMBURGER ───────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  padding: 2rem 2rem;
  z-index: 200;
  position: absolute;
  right: 0;
  align-items: flex-end;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--texto-tenue);
  border-radius: 1px;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease,
    width 0.3s ease;
  transform-origin: center;
}

.hamburger span:nth-child(1) {
  width: 16px;
  margin-left: auto;
}
.hamburger span:nth-child(2) {
  width: 22px;
  margin-left: auto;
}
.hamburger span:nth-child(3) {
  width: 28px;
  margin-left: auto;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  width: 22px !important;
  margin-left: 0 !important;
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  width: 22px !important;
  margin-left: 0 !important;
}

/* ── MOBILE NAV ──────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(8, 18, 10, 0.96);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  color: var(--crema);
  text-decoration: none;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.mobile-nav a:hover {
  color: var(--amarillo-luz);
}

/* ── SECTIONS (BASE) ─────────────────────────────────── */
section {
  position: relative;
  z-index: 10;
  padding-block-end: 120px;
}

/* ── SHARED COMPONENTS ───────────────────────────────── */
.section-label {
  font-family: var(--sans);
  font-size: clamp(0.7rem, 0.8vw, 0.85rem);
  font-weight: 200;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--amarillo-luz);
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--crema);
  margin-bottom: 1.2rem;
}

.section-title em {
  font-style: italic;
}

.newsletter-divider {
  width: 40px;
  height: 1px;
  background: var(--amarillo-luz);
  margin: 0 auto 2rem;
  opacity: 0.6;
}

.btn-primary {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(0.85rem, 0.9vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--crema);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.1rem 2.8rem;
  transition: all 0.4s ease;
  position: relative;
  opacity: 0;
  animation: fadeUp 1.2s 1.5s forwards;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  cursor: pointer;
}

.btn-primary:hover {
  border-color: rgba(232, 224, 112, 0.5);
  color: var(--amarillo-luz);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* Overrides animation for btns outside home */
.btn-static,
.reveal.visible .btn-primary,
.libro-cta .btn-primary,
#libro .btn-primary,
#newsletter .btn-primary,
#sobre .btn-primary {
  opacity: 1 !important;
  animation: none !important;
  pointer-events: auto !important;
}

/* ── HOME ────────────────────────────────────────────── */
#home {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  text-align: center;
  padding: 15vh 2rem 0;
  gap: 0;
  height: 100vh;
}

.home-subtitle {
  position: absolute;
  top: clamp(5rem, 12vh, 9rem);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 90%;
  max-width: 600px;
  text-align: center;
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1vw, 1rem);
  font-weight: 200;
  letter-spacing: 0.18em;
  color: var(--texto-tenue);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 1.2s 1.1s forwards;
  margin-bottom: 3rem;
}

.home-double-line {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 5rem auto 2rem;
}

.home-line {
  width: 2px;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--amarillo-luz),
    transparent
  );
}

.home-title {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 6vw, 7rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--crema);
  margin: 0 0 1.5rem;
  opacity: 0;
  animation: fadeUp 1.2s 0.9s forwards;
}

.home-title em {
  font-style: normal;
  color: var(--amarillo-luz);
}

.home-eyebrow {
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1vw, 1rem);
  font-weight: 200;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--amarillo-luz);
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 1.2s 0.7s forwards;
}

.divider-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--amarillo-luz),
    transparent
  );
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 1.2s 1.3s forwards;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* ── SCROLL INDICATOR ────────────────────────────────── */
.scroll-indicator {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 1.2s 2s forwards;
}

.scroll-indicator span {
  font-family: var(--sans);
  font-size: 0.55rem;
  font-weight: 200;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--texto-tenue);
}

.scroll-line {
  width: 1px;
  height: 130px;
  background: linear-gradient(to bottom, var(--amarillo-luz), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

/* ── LIBRO ───────────────────────────────────────────── */
#libro {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: clamp(4rem, 6vw, 8rem);
  padding-inline: 4rem;
  margin-top: 80px;
}

.libro-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: min(1100px, 70vw);
  width: 100%;
  align-items: center;
  justify-items: center;
}

.libro-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

.libro-flores {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(-1);
  transform-origin: center center;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  overflow: visible;
}

.book-cover {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 2/3;
  background: transparent;
  position: relative;
  border-radius: 0;
  transform: perspective(800px) rotateY(-8deg);
  transition: transform 0.6s ease;
  overflow: visible;
  filter: drop-shadow(-18px 24px 40px rgba(0, 0, 0, 0.7))
    drop-shadow(-6px 8px 16px rgba(0, 0, 0, 0.45));
}

.book-cover:hover {
  transform: perspective(800px) rotateY(-3deg) translateY(-10px);
  filter: drop-shadow(-22px 30px 50px rgba(0, 0, 0, 0.75))
    drop-shadow(-8px 12px 20px rgba(0, 0, 0, 0.5));
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.section-body {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  font-weight: 200;
  line-height: 1.7;
  color: var(--texto-tenue);
  max-width: 480px;
}

.section-body p {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.libro-divider {
  margin: 1rem 0;
}

.libro-texto .section-label {
  margin-bottom: 3rem;
}

.libro-cta {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* ── NEWSLETTER ──────────────────────────────────────── */
#newsletter {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: clamp(4rem, 6vw, 8rem);
  padding-inline: 4rem;
}

.newsletter-inner {
  max-width: min(1100px, 60vw);
  width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-body {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  font-weight: 200;
  line-height: 1.7;
  color: var(--texto-tenue);
  margin-bottom: 2.5rem;
}

.newsletter-meta {
  font-family: var(--sans);
  font-size: clamp(0.7rem, 0.8vw, 0.85rem);
  font-weight: 200;
  letter-spacing: 0.15em;
  color: var(--texto-tenue);
  text-transform: uppercase;
  margin-top: 2rem;
  text-align: center;
}
.newsletter-meta span {
  color: var(--amarillo-luz);
}

/* ── SOBRE MÍ ────────────────────────────────────────── */
#sobre {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(4rem, 6vw, 8rem);
  padding-inline: 4rem;
  overflow: visible;
  position: relative;
}

.sobre-layout {
  position: relative;
  max-width: min(1100px, 60vw);
  width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.sobre-img-col {
  position: absolute;
  left: -150px;
  z-index: 3;
  opacity: 1;
}

.sobre-portrait-img {
  height: 100%;
  width: auto;
  max-width: 450px;
  display: block;
  object-fit: contain;
  object-position: left center;

  filter: sepia(0.1) saturate(1.1) brightness(0.75) contrast(1.4);

  /* Standard browsers */
  mask-image:
    linear-gradient(to left, transparent 0%, black 45%),
    linear-gradient(to bottom, transparent 0%, black 15%),
    linear-gradient(to top, transparent 0%, black 15%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  mask-composite: intersect, intersect;
}

.sobre-text-col {
  padding-left: 0;
}

.sobre-quote-big {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  color: var(--crema);
  margin: 2rem 0 2.5rem;
  position: relative;
}

.sobre-quote-big::before {
  content: '"';
  font-size: 5rem;
  font-family: var(--serif);
  color: var(--amarillo-luz);
  position: absolute;
  top: -1.5rem;
  left: -1rem;
  line-height: 1;
}

.sobre-body-centered {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  font-weight: 200;
  line-height: 1.7;
  color: var(--texto-tenue);
  margin-bottom: 2.5rem;
}

/* Mobile portrait (below text on small screens) */
.sobre-mobile-img {
  display: none;
  position: relative;
  z-index: 3;
}

.sobre-mobile-portrait {
  width: 75%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0;

  filter: sepia(0.1) saturate(1.1) brightness(0.75) contrast(1.4);

  /* Standard browsers */
  mask-image:
    linear-gradient(to left, transparent 0%, black 45%),
    linear-gradient(to bottom, transparent 0%, black 15%),
    linear-gradient(to top, transparent 0%, black 15%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  mask-composite: intersect, intersect;
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(200, 196, 74, 0.08);
}

.footer-copy {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.5);
  margin-top: 0.6rem;
}

/* ── MODAL ───────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 18, 10, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: rgba(15, 28, 17, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(232, 224, 112, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 24px;
  padding: 3rem;
  max-width: 460px;
  width: 100%;
  position: relative;
  animation: modalIn 0.35s ease forwards;
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--texto-tenue);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 200;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(200, 196, 74, 0.35);
  color: var(--crema);
}

.modal-eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 200;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amarillo-luz);
  margin-bottom: 1.2rem;
}

.modal-title {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 300;
  font-style: italic;
  color: var(--crema);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  line-height: 1.2;
}

.modal-links {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  text-decoration: none;
  color: var(--crema);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.modal-link:hover {
  background: rgba(200, 196, 74, 0.1);
  border-color: rgba(200, 196, 74, 0.35);
  color: var(--amarillo-luz);
  transform: translateX(4px);
}

.modal-link-icon {
  font-size: 0.65rem;
  opacity: 0.5;
  letter-spacing: 0.15em;
}

.modal-divider {
  width: 100%;
  height: 1px;
  background: rgba(200, 196, 74, 0.1);
  margin: 1.5rem 0;
}

/* ── SCROLL REVEAL ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

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

.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.25s;
}
.reveal-delay-3 {
  transition-delay: 0.4s;
}

/* ── ANIMATIONS ──────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.9;
    transform: scaleY(1.15);
  }
}

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

/* ── RESPONSIVE: ≤900px ──────────────────────────────── */
@media (max-width: 900px) {
  section {
    padding-block-end: 100px;
  }
  nav {
    display: none;
  }

  .hamburger {
    display: flex;
    margin-block-start: 2rem;
  }
  .libro-inner,
  .newsletter-inner,
  .sobre-layout {
    max-width: 100%;
    padding-inline: 2rem;
  }

  #libro,
  #newsletter,
  #sobre {
    padding-inline: 0;
  }

  .libro-flores {
    top: 25%;
    width: 100%;
    height: 60%;
  }

  .libro-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
    text-align: center;
  }

  .libro-texto .section-body {
    max-width: 100%;
  }
  .libro-texto .newsletter-divider {
    margin: 0 auto 2rem;
  }
  .libro-texto .libro-subtitle-extra {
    text-align: center;
  }
  .libro-cta {
    justify-content: center;
  }
  .libro-divider {
    margin: 0 auto 2rem;
  }
  .libro-mockup {
    order: -1;
  }

  .sobre-img-col {
    display: none;
  }

  .sobre-text-col,
  .sobre-quote-big,
  .sobre-body-centered {
    text-align: center;
  }

  .sobre-text-col .newsletter-divider {
    margin: 0 auto 2rem;
  }

  #sobre {
    flex-direction: column;
    align-items: flex-start;
    min-height: 50vh;
    padding-block-start: 0;
  }

  .sobre-mobile-img {
    display: block;
  }
}

/* ── RESPONSIVE: ≤576px ──────────────────────────────── */
@media (max-width: 576px) {
  .libro-flores {
    top: 15%;
  }

  .book-cover {
    position: relative;
    z-index: 1;
  }
  .modal-box {
    padding: 3rem 1rem 2rem;
}
}

/* ── RESPONSIVE: ≥1900px ─────────────────────────────── */
@media (min-width: 1900px) {
  body {
    font-size: 18px;
  }

  .home-title {
    font-size: clamp(3.5rem, 6vw, 7rem);
  }

  .home-eyebrow {
    font-size: clamp(0.85rem, 1vw, 1rem);
  }

  .section-title {
    font-size: clamp(3rem, 5vw, 5.5rem);
  }

  .section-body,
  .newsletter-body,
  .sobre-body-centered {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
  }

  .sobre-quote-big {
    font-size: clamp(2.5rem, 4vw, 5rem);
  }

  nav a {
    font-size: clamp(0.7rem, 0.8vw, 0.85rem);
  }

  .btn-primary {
    font-size: clamp(0.85rem, 0.9vw, 1rem);
  }
 
  .book-cover {
    width: 560px;
  }

  .sobre-portrait-img {
    max-width: 650px;
  }
  .sobre-img-col {
    left: -50px;
  }

  .sobre-portrait-img {
    transform: scale(0.8);
    transform-origin: left center;
  }

  .libro-flores {
    width: 900px;
  }
}

/* ── CLASES REEMPLAZANDO ESTILOS INLINE ──────────────── */

/* em amarillo en títulos (Menos Verso, profundo) */
em.accent {
  color: var(--amarillo-luz);
}

/* Subtítulo del libro */
.libro-subtitle {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  font-weight: 200;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

/* Título newsletter con más margen inferior */
.section-title--spaced {
  margin-bottom: 2rem;
}

/* Divider en sobre mí */
.sobre-divider {
  margin: 0 auto 1rem !important;
}

/* CTA sobre mí */
.sobre-cta {
  margin-top: 2.5rem;
}
