/* =========================================================
   Pirate Bees — estilos
   Mobile first: las reglas base son para móvil; los
   @media (min-width …) amplían para tablet y escritorio.
   ========================================================= */

:root {
  --dark: #0f1a15;          /* verde-negro de fondo */
  --dark-2: #15241d;        /* superficie sobre el fondo oscuro */
  --cream: #f5f0e6;         /* fondo claro */
  --ink: #1c1a15;           /* texto sobre claro */
  --ink-soft: #5c5a52;      /* texto secundario sobre claro */
  --light: #f3efe6;         /* texto sobre oscuro */
  --light-soft: #aab5ad;    /* texto secundario sobre oscuro */
  --honey: #e8a826;         /* acento miel */
  --honey-deep: #c98a12;
  --line: rgba(243, 239, 230, 0.16);

  --font-display: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;

  --gutter: 20px;
  --container: 1240px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--dark);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--honey);
  margin-bottom: 1rem;
}

/* ---------- animación de aparición al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in-view { opacity: 1; transform: none; }

/* =========================================================
   Cabecera
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--light);
  isolation: isolate;
  --hdr: 0;   /* 0 = transparente (arriba del todo) … 1 = banda oscura; lo va subiendo el JS con el scroll */
}
.site-header::before {
  /* degradado suave para que logo y menú se lean sobre la foto */
  content: "";
  position: absolute;
  inset: 0;
  height: 140%;
  background: linear-gradient(to bottom, rgba(10, 16, 13, 0.65), rgba(10, 16, 13, 0));
  pointer-events: none;
  z-index: -1;
  opacity: calc(1 - var(--hdr));
}
.site-header::after {
  /* banda oscura que aparece gradualmente al hacer scroll, con el borde inferior difuminado */
  content: "";
  position: absolute;
  inset: 0 0 -32px 0;
  background: linear-gradient(to bottom, rgba(15, 26, 21, 0.95) 0, rgba(15, 26, 21, 0.95) calc(100% - 32px), rgba(15, 26, 21, 0) 100%);
  pointer-events: none;
  z-index: -1;
  opacity: var(--hdr);
}

.header-inner {
  position: relative;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* logo: arriba a la izquierda */
.brand { position: relative; z-index: 60; display: flex; align-items: center; }
.brand img {
  width: 54px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s var(--ease);
}
.brand:hover img { transform: scale(1.04); }

/* botón hamburguesa (solo móvil) */
.menu-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 60;
}
.menu-toggle span {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--light);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s ease, top 0.35s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* menú móvil: panel a pantalla completa */
.site-nav {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  background: rgba(15, 26, 21, 0.97);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.4s ease, transform 0.45s var(--ease), visibility 0s linear 0.45s;
}
.site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.site-nav ul { display: flex; flex-direction: column; gap: 0.35rem; }
.site-nav li a {
  display: block;
  padding: 0.55rem 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 7vw, 2.4rem);
  color: var(--light);
  border-bottom: 1px solid var(--line);
  transition: color 0.3s ease, padding-left 0.3s var(--ease);
}
.site-nav li a:hover { color: var(--honey); padding-left: 0.4rem; }

/* selector de idioma */
.lang-switch { display: flex; gap: 0.25rem; align-items: center; }
.lang-switch a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: var(--light-soft);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.lang-switch a:hover { color: var(--light); }
.lang-switch a[aria-current="true"] { color: var(--dark); background: var(--honey); }
.lang-switch--mobile { margin-top: 2rem; }
.lang-switch--desktop { display: none; }

/* =========================================================
   Portada (hero)
   La foto se funde en blanco por abajo (acuarela), así que el
   título va debajo de la foto, en tinta oscura sobre blanco.
   ========================================================= */
.hero {
  position: relative;
  background: #fff;
  color: var(--ink);
  isolation: isolate;
}
.hero-media {
  display: block;
  position: relative;
  overflow: hidden;
  /* Pantallas apaisadas: la foto se ve entera (4:3) y escala con el ancho de la ventana.
     Nunca se recorta ni por arriba ni por abajo, así el borde de acuarela siempre queda a la vista. */
  width: 100%;
  aspect-ratio: 4 / 3;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 0%;     /* arriba fijo; 55% = centro de la fila de colmenas */
  transform: scale(1.06);
  transform-origin: 55% 0%;
  animation: hero-zoom 8s var(--ease) forwards;
}
/* Pantallas verticales (móvil, tablet en vertical): la foto llena buena parte de la pantalla
   y se recortan los lados, con la colmena centrada y el borde superior fijo. */
@media (max-aspect-ratio: 1/1) {
  .hero-media { aspect-ratio: auto; height: 68svh; min-height: 420px; }
}
@keyframes hero-zoom { to { transform: scale(1); } }

.hero-content {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3.5rem;   /* el título queda por debajo de la acuarela, sin pisarla */
}
.rule {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--honey);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 0.2s forwards;
}
.hero h1 {
  font-size: clamp(3.1rem, 13vw, 7.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
  color: var(--ink);
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 0.35s forwards;
}
.hero-sub {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.15rem, 4.5vw, 1.7rem);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 0.55s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.2rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  animation: fade-up 1s var(--ease) 1s forwards;
}
.scroll-cue-line {
  width: 48px;
  height: 1px;
  background: var(--ink-soft);
  position: relative;
  overflow: hidden;
}
.scroll-cue-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--honey);
  transform: translateX(-100%);
  animation: cue-slide 2.2s ease-in-out infinite;
}
@keyframes cue-slide {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* =========================================================
   Sección "La apicultura" (texto + foto)
   ========================================================= */
.intro {
  background: var(--cream);
  color: var(--ink);
  padding: 4.5rem 0;
}
.intro-grid { display: grid; gap: 2.5rem; }
.intro h2 {
  font-size: clamp(2.3rem, 8vw, 3.6rem);
  margin-bottom: 1.5rem;
}
.intro-text p { color: var(--ink-soft); }
.intro-text p:last-child { margin-bottom: 0; }
.intro-figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(28, 26, 21, 0.45);
}
.intro-figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
/* en móvil, la foto va primero */
.intro-figure { order: -1; }

/* =========================================================
   Sección de apartados (tarjetas)
   ========================================================= */
.explore {
  background: var(--dark);
  color: var(--light);
  padding: 4.5rem 0 5rem;
}
.explore h2 { font-size: clamp(2.1rem, 7vw, 3.2rem); margin-bottom: 2.25rem; }

.cards { display: grid; gap: 0.9rem; }
.card a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 190px;
  padding: 1.4rem 1.4rem 1.3rem;
  background: var(--dark-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.4s ease, background-color 0.4s ease;
}
.card a::after {
  /* resplandor miel al pasar el ratón */
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 168, 38, 0.35), rgba(232, 168, 38, 0) 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.card a:hover { transform: translateY(-4px); border-color: rgba(232, 168, 38, 0.6); background: #192b22; }
.card a:hover::after { opacity: 1; }
.card-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--honey);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.1;
  margin-top: 0.2rem;
}
.card-teaser { color: var(--light-soft); font-size: 0.98rem; }
.card-cta {
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--honey);
}
.card-cta span { display: inline-block; transition: transform 0.35s var(--ease); }
.card a:hover .card-cta span { transform: translateX(5px); }

/* =========================================================
   Pie
   ========================================================= */
.site-footer {
  background: #0b1310;
  color: var(--light-soft);
  border-top: 1px solid var(--line);
  padding: 3rem 0 1.5rem;
  font-size: 0.95rem;
}
.footer-grid { display: grid; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 1rem; color: var(--light); }
.footer-brand img { width: 64px; }
.footer-brand span { font-family: var(--font-display); letter-spacing: 0.04em; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-nav a { transition: color 0.3s ease; }
.footer-nav a:hover { color: var(--honey); }
.footer-langs { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.footer-langs-label { margin-right: 0.4rem; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-langs a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.footer-langs a:hover { color: var(--light); border-color: var(--light-soft); }
.footer-langs a[aria-current="true"] { color: var(--dark); background: var(--honey); border-color: var(--honey); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* =========================================================
   Tablet
   ========================================================= */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: center; }
  .footer-langs { grid-column: 1 / -1; }
}

/* =========================================================
   Escritorio
   ========================================================= */
@media (min-width: 900px) {
  :root { --gutter: 48px; --header-h: 96px; }
  body { font-size: 1.1rem; }

  .menu-toggle { display: none; }
  .brand img { width: 76px; }

  /* logo a la izquierda, menú a continuación, idiomas a la derecha */
  .site-nav {
    position: static;
    inset: auto;
    display: block;
    padding: 0;
    background: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .site-nav { margin-left: clamp(1.5rem, 3vw, 3rem); }
  .site-nav ul { flex-direction: row; gap: clamp(1.2rem, 2.6vw, 2.6rem); }
  .site-nav li a {
    padding: 0.3rem 0;
    font-size: 1.05rem;
    border: 0;
    position: relative;
  }
  .site-nav li a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--honey);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
  }
  .site-nav li a:hover { padding-left: 0; color: var(--light); }
  .site-nav li a:hover::after { transform: scaleX(1); }
  .lang-switch--mobile { display: none; }
  .lang-switch--desktop { display: flex; margin-left: auto; }

  .hero-content { padding-top: 2.5rem; padding-bottom: 5rem; }
  .hero h1 { max-width: 12ch; }

  .intro { padding: 7rem 0; }
  .intro-grid { grid-template-columns: 1.15fr 1fr; gap: 4.5rem; align-items: center; }
  .intro-figure { order: 0; }   /* foto a la derecha */

  .explore { padding: 7rem 0; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
  .card a { min-height: 230px; padding: 1.7rem; }
  .card-title { font-size: 1.7rem; }

  .site-footer { padding-top: 4rem; }
  .footer-grid { grid-template-columns: auto 1fr auto; gap: 3rem; }
  .footer-nav { justify-self: center; }
  .footer-langs { grid-column: auto; }
}

@media (min-width: 1300px) {
  .intro-grid { gap: 6rem; }
}

/* =========================================================
   Accesibilidad: sin animaciones si el usuario lo pide
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-media img, .rule, .hero h1, .hero-sub, .scroll-cue { animation: none; opacity: 1; transform: none; }
  .scroll-cue-line::after { animation: none; }
}
