:root {
  /* Paleta oficial del logo de Imagina. */
  --yellow: #f4c416;
  --yellow-dark: #e0a800;
  --teal: #45bcd3;
  --teal-dark: #2d8fa0;
  --navy: #342f52;
  --coral: #e53b54;
  --lavender: #dee0f2;
  --lavender-dark: #c7cde9;
  --sand: #f2cc8d;
  --orange-muted: #c9793d;
  --green: #4f9d69;
  --pink: #eab4ba;
  --pink-light: #f8cbcf;
  --muted: #5f5570;
  --cream: #ffffff;
  --ink: #2b2b2b;
  --radius: 8px;
  --shadow: 0 4px 16px rgba(22, 30, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Nunito", "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(31, 58, 77, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Atma", sans-serif;
  font-size: 1.3rem;
  color: var(--teal);
}

.nav-brand img {
  height: 42px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 700;
}

.nav-links a {
  color: var(--navy);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--teal-dark);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.55) 100%),
    url("images/cielo-hero-index.jpg") center / cover no-repeat;
  background-attachment: scroll, fixed;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  background: var(--teal);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero h1 span {
  color: var(--teal-dark);
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 24px;
}

.hero-credentials {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-credentials li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: var(--navy);
}

.hero-credentials li::before {
  content: "";
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  margin-top: 8px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 4px;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.25px;
  font-size: 1rem;
  transition: filter 0.15s ease, transform 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--teal-dark);
  border: 2px solid var(--teal-dark);
  box-shadow: none;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.hero-image {
  position: relative;
  text-align: center;
}

.hero-image img {
  margin: 0 auto;
  max-width: 340px;
  filter: drop-shadow(0 20px 30px rgba(31, 58, 77, 0.18));
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Sections */
section {
  padding: 72px 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.section-eyebrow {
  color: var(--teal-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: block;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--muted);
}

/* About */
.about {
  background:
    linear-gradient(180deg, rgba(222, 224, 242, 0.8) 0%, rgba(222, 224, 242, 0.88) 100%),
    url("images/cielo-hero-index.jpg") center / cover no-repeat;
  background-attachment: scroll, fixed;
  text-align: center;
}

.about-text h2 {
  margin-bottom: 24px;
}

.about-text .lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 18px;
  text-align: left;
}

/* Services */
.services {
  background: linear-gradient(180deg, rgba(69, 188, 211, 0.22) 0%, var(--cream) 100%);
}

/* Services map */
.services-map {
  position: relative;
}

.map-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 70px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
}

.map-line svg {
  width: 100%;
  height: 100%;
}

.map-line path {
  fill: none;
  stroke: var(--lavender-dark);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 2 16;
}

.map-balloon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(52, 47, 82, 0.25));
  transition: top 0.05s linear, transform 0.2s ease-out;
}

.map-balloon img {
  display: block;
  width: 100%;
}

.map-stop {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
}

.map-marker {
  grid-column: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lavender-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  transition: background 0.4s ease, transform 0.4s ease;
}

.js-ready .map-stop.revealed .map-marker {
  background: var(--marker-color);
  transform: scale(1.1);
}

.map-stop:nth-child(odd) .service-card {
  grid-column: 1;
}

.map-stop:nth-child(even) .service-card {
  grid-column: 3;
}

.service-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--marker-color, var(--yellow));
  transition: transform 0.2s ease, opacity 0.5s ease, translate 0.5s ease;
}

.js-ready .map-stop .service-card {
  opacity: 0;
  translate: 0 24px;
}

.js-ready .map-stop.revealed .service-card {
  opacity: 1;
  translate: 0 0;
}

.service-card:hover {
  transform: translateY(-6px);
}

.service-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--marker-color, var(--yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0 0 8px;
}

.service-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.96rem;
}

.service-card ul li {
  margin-bottom: 4px;
}

.service-card ul li:last-child {
  margin-bottom: 0;
}

/* Articles preview (home) */
.articles-preview {
  background: white;
}

.articles-preview-cta {
  text-align: center;
  margin-top: 32px;
}

/* Contact */
.contact {
  background: linear-gradient(180deg, var(--cream) 0%, var(--lavender) 100%);
}

.contact-card {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 30px;
  color: white;
  box-shadow: var(--shadow);
}

.contact-card h2 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.contact-card p {
  color: var(--lavender);
  max-width: 42ch;
  margin: 0 0 8px;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px 22px;
  border-radius: 6px;
  font-weight: 700;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.contact-link:hover {
  background: var(--teal);
}

.contact-link .icon {
  display: inline-flex;
  align-items: center;
}

/* Page header (non-hero pages) */
.page-header {
  padding: 64px 0 32px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.96) 100%),
    url("images/education-icons.jpg") center / cover no-repeat;
}

.page-header h1 {
  font-size: 2.2rem;
  margin: 10px 0;
}

.page-header p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 720px;
}

/* Subscribe box */
.subscribe {
  padding: 56px 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.94) 100%),
    url("images/hero-craft-bunting.jpg") center 30% / cover no-repeat;
}

.subscribe-card {
  background: var(--lavender);
  border: 1px solid var(--lavender-dark);
  border-radius: var(--radius);
  padding: 30px 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
}

.subscribe-card h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.subscribe-card p {
  margin: 0;
  color: var(--muted);
}

.subscribe-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
  padding: 12px 16px;
  border-radius: 4px;
  border: 2px solid var(--lavender-dark);
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 320px;
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--teal);
}

.subscribe-form .btn {
  padding: 12px 22px;
}

.subscribe-thanks {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 600;
  color: var(--teal);
}

/* Articles list */
.articles-list {
  padding-top: 20px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.article-card {
  display: block;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--teal);
  transition: transform 0.2s ease;
}

.article-card:hover {
  transform: translateY(-6px);
}

.article-card-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.article-card-body {
  padding: 26px;
}

.article-date {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card h3 {
  font-size: 1.2rem;
  margin: 10px 0 8px;
}

.article-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.article-read-more {
  color: var(--coral);
  font-weight: 800;
  font-size: 0.9rem;
}

.articles-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* Single article page */
.article-page {
  padding: 48px 0 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--teal-dark);
  font-weight: 700;
}

.article-page h1 {
  font-size: 2rem;
  margin: 10px 0 24px;
}

.article-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.article-body {
  font-size: 1.05rem;
  color: var(--muted);
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 32px 0 12px;
  color: var(--teal-dark);
}

.article-body p {
  margin: 0 0 18px;
}

.article-body .article-figure {
  margin: 0 0 24px;
  text-align: center;
}

.article-body .article-figure img {
  max-width: 340px;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-body .article-figure figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.article-body a {
  color: var(--coral);
  font-weight: 700;
  text-decoration: underline;
}

.article-body .article-references {
  font-size: 0.9rem;
  color: var(--muted);
  word-break: break-word;
}

.article-body .article-references a {
  font-weight: 400;
}

/* Footer */
footer {
  text-align: center;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

footer strong {
  color: var(--teal-dark);
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  color: var(--muted);
}

.footer-social a {
  display: inline-flex;
  transition: transform 0.15s ease, color 0.15s ease;
}

.footer-social a:hover {
  color: var(--teal-dark);
  transform: translateY(-2px);
}

/* Scroll balloon */
.scroll-balloon {
  position: fixed;
  right: 22px;
  top: 90px;
  z-index: 5;
  pointer-events: none;
  transform-origin: top center;
  transition: transform 0.15s ease-out, top 0.05s linear;
  filter: drop-shadow(0 4px 10px rgba(52, 47, 82, 0.28));
}

.scroll-balloon img {
  display: block;
  width: 34px;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-balloon {
    transition: top 0.05s linear;
  }

  .map-balloon {
    display: none;
  }

  .js-ready .service-card,
  .js-ready .map-marker {
    transition: none;
  }
}

@media (max-width: 640px) {
  .scroll-balloon {
    right: 10px;
  }

  .scroll-balloon img {
    width: 24px;
  }
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 860px) {
  .hero,
  .about {
    background-attachment: scroll, scroll;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-credentials {
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image img {
    max-width: 260px;
  }

  .contact-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 36px 24px;
  }

  .contact-links {
    align-items: stretch;
  }

  .contact-link {
    white-space: normal;
    word-break: break-word;
    padding: 12px 16px;
  }

  .subscribe-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .subscribe-form {
    justify-content: center;
  }

  .subscribe-form input[type="email"] {
    min-width: 0;
    width: 100%;
  }

  .map-line {
    left: 20px;
    width: 36px;
    transform: none;
  }

  .map-balloon {
    left: 20px;
    transform: none;
  }

  .map-stop {
    grid-template-columns: 40px 1fr;
    column-gap: 16px;
  }

  .map-marker {
    grid-column: 1;
    grid-row: 1;
  }

  .map-stop:nth-child(odd) .service-card,
  .map-stop:nth-child(even) .service-card {
    grid-column: 2;
    grid-row: 1;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    display: none;
    border-bottom: 1px solid rgba(31, 58, 77, 0.08);
  }

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