/* ==========================================================================
   Dibujando la Vida — styles.css
   Mobile-first. Section order below mirrors the page order.
   ========================================================================== */

:root {
  /* --- Palette (client-provided, Sept 2026 update) --- */
  --color-sage: #8FA28A;
  --color-moss-light: #C7D3C0;
  --color-cream: #F7F4ED;
  --color-gold: #C8A96B;

  /* --- Added for contrast/depth: a deep sage-ink for text, and a soft
     blush that pairs with gold without competing with it --- */
  --color-ink: #33392F;
  --color-ink-soft: #5b6153;
  --color-mist: #EFEBE1;

  /* --- Semantic tokens --- */
  --bg-page: var(--color-cream);
  --bg-alt: var(--color-mist);
  --text-body: var(--color-ink);
  --text-muted: var(--color-ink-soft);
  --accent: var(--color-gold);
  --accent-secondary: var(--color-sage);

  /* --- Type --- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;

  /* --- Layout --- */
  --content-max: 68ch;
  --side-pad: 1.25rem;
  --navbar-h: 64px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-body);
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

/* Visible keyboard focus, always */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-ink);
  color: var(--color-cream);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: rgba(250, 243, 240, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.navbar.is-scrolled {
  background: rgba(250, 243, 240, 0.96);
  box-shadow: 0 1px 0 rgba(58, 50, 48, 0.08);
}

.navbar__inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text-body);
  white-space: nowrap;
}

/* Hamburger toggle — mobile default */
.navbar__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.navbar__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-ink);
  margin: 0 auto;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.navbar__toggle[aria-expanded="true"] .navbar__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar__toggle[aria-expanded="true"] .navbar__bar:nth-child(2) {
  opacity: 0;
}
.navbar__toggle[aria-expanded="true"] .navbar__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.navbar__menu {
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-cream);
  padding: 0.5rem 0 1.5rem;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  border-bottom: 1px solid rgba(58, 50, 48, 0.08);
}
.navbar__menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.navbar__menu a {
  text-decoration: none;
  color: var(--text-body);
  font-weight: 500;
  padding: 0.85rem var(--side-pad);
  border-radius: 6px;
}
.navbar__menu a:hover,
.navbar__menu a:focus-visible {
  color: var(--accent);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fixed-position layer behind everything, instead of background-attachment:
   fixed (which jitters badly on iOS Safari). This gives the same
   "background stays put while content scrolls over it" effect reliably. */
.hero__bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}

.hero__scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(250, 243, 240, 0) 0%,
    rgba(250, 243, 240, 0.15) 70%,
    rgba(250, 243, 240, 0.55) 100%
  );
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  text-align: center;
  color: var(--color-ink);
  padding: 0 1rem;
  transition: opacity 0.15s linear, transform 0.15s linear;
  will-change: opacity, transform;
}

/* ==========================================================================
   SECTIONS — shared rhythm
   ========================================================================== */
.section {
  position: relative;
  z-index: 1;
  background: var(--bg-page);
  padding: 4.5rem var(--side-pad) 4rem;
}

/* First content section needs to fully cover the fixed hero background */
.section--about {
  border-radius: 28px 28px 0 0;
  margin-top: -1.5rem;
}

.section--gallery { background: var(--bg-alt); }
.section--closing { background: var(--bg-page); }
.section--contact { background: var(--bg-alt); }

.reveal-heading {
  max-width: var(--content-max);
  margin: 0 auto 2rem;
  text-align: center;
}

/* ==========================================================================
   PROSE (Sobre mí / Colaboraciones)
   ========================================================================== */
.prose {
  max-width: var(--content-max);
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-body);
}

.prose-figure {
  max-width: var(--content-max);
  margin: 2.25rem auto 0;
}
.prose-figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.prose-figure:last-of-type { margin-bottom: 0.5rem; }

.section__cta {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ==========================================================================
   SUBPAGE HEADER (retratos / abstracto / cosas / colaboraciones / contacto)
   No hero image on these pages — a simple, calm title block under the navbar.
   ========================================================================== */
.page-header {
  padding: calc(var(--navbar-h) + 3rem) var(--side-pad) 2.5rem;
  text-align: center;
  background: var(--bg-page);
}
.page-header h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   COLLAB STEPS (colaboraciones.html)
   ========================================================================== */
.collab-steps {
  max-width: var(--content-max);
  margin: 2rem auto 0;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.collab-steps li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 1.02rem;
}
.collab-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==========================================================================
   TESTIMONIALS (colaboraciones.html)
   ========================================================================== */
.testimonial-grid {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.testimonial-card {
  background: var(--bg-page);
  border: 2px solid var(--color-moss-light);
  border-radius: 10px;
  padding: 1.5rem;
}
.testimonial-card p {
  font-style: italic;
  color: var(--text-body);
  margin-bottom: 0.75rem;
}
.testimonial-card__author {
  font-style: normal;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (min-width: 700px) {
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   CONTACT INFO BLOCK (contacto.html)
   ========================================================================== */
.contact-info {
  max-width: var(--content-max);
  margin: 2rem auto 2.5rem;
  text-align: center;
}
.contact-info__email {
  display: inline-block;
  font-weight: 700;
  color: var(--text-body);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  margin-bottom: 1.5rem;
  text-decoration: none;
}
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.social-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-moss-light);
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: background-color 0.2s var(--ease);
}
.social-buttons a:hover,
.social-buttons a:focus-visible { background: var(--accent); }

/* ==========================================================================
   COMIC GRID (gallery)
   Mobile: simple single column stack. Desktop: asymmetric 3-col, see below.
   ========================================================================== */
.comic-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.comic-grid__column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-card {
  border: 2px solid var(--color-sage);
  border-radius: 10px;
  background: var(--bg-page);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.gallery-card:nth-of-type(even) { border-color: var(--color-moss-light); }

.gallery-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.gallery-card__intro {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}
.gallery-card__img {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-alt);
}
.gallery-card__desc {
  font-size: 0.95rem;
  margin: 0;
}
.gallery-card__link {
  align-self: flex-start;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-body);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  font-size: 0.92rem;
}
.gallery-card__link:hover,
.gallery-card__link:focus-visible { color: var(--accent); }

/* Breaker box — text-only, fills the comic-strip rhythm */
.gallery-breaker {
  background: var(--color-moss-light);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
}
.gallery-breaker p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-body);
  margin: 0;
}

/* Reveal-on-scroll: gentle, single treatment, applied only in the gallery */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact__lead {
  max-width: var(--content-max);
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--text-muted);
}

.contact-form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.contact-form__field label {
  font-weight: 700;
  font-size: 0.9rem;
}
.contact-form__field input,
.contact-form__field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--color-sage);
  border-radius: 8px;
  background: var(--bg-page);
  color: var(--text-body);
  resize: vertical;
}
.contact-form__field input:focus,
.contact-form__field textarea:focus {
  border-color: var(--accent);
}
.contact-form__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  color: var(--color-ink);
}

.btn--whatsapp {
  display: flex;
  margin: 1.75rem auto 0;
  width: fit-content;
  background: var(--color-moss-light);
  color: var(--color-ink);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--color-ink);
  color: var(--color-cream);
  padding: 2rem var(--side-pad);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
  font-size: 0.9rem;
}
.footer a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.footer a:hover,
.footer a:focus-visible { color: var(--accent); }

.footer__social {
  display: flex;
  gap: 0.6rem;
}
.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(247, 244, 237, 0.12);
  color: var(--color-cream);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: lowercase;
}
.footer__social a:hover,
.footer__social a:focus-visible {
  background: var(--accent);
  color: var(--color-ink);
}

/* ==========================================================================
   DESKTOP (≥ 860px)
   ========================================================================== */
@media (min-width: 860px) {
  :root { --side-pad: 2.5rem; }

  .navbar__toggle { display: none; }

  .navbar__menu {
    position: static;
    flex-direction: row;
    gap: 1.75rem;
    background: transparent;
    padding: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    border: none;
  }
  .navbar__menu a { padding: 0.4rem 0.1rem; }

  .section { padding: 6.5rem var(--side-pad) 5.5rem; }

  .prose-figure { max-width: var(--content-max); }

  /* Comic grid: true columns (flex-row of column containers) so each
     column stacks its own cards tightly — no fixed margin guesswork.
     Natural height differences between cards/breakers create the
     staggered "comic strip" look on their own. */
  .comic-grid {
    flex-direction: row;
    gap: 1.75rem;
    align-items: flex-start;
  }
  .comic-grid__column { flex: 1; }

  .footer {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 2rem 2.5rem;
  }
}

@media (min-width: 1100px) {
  .hero__title { font-size: clamp(3rem, 7vw, 5.5rem); }
}
