/* ===== La Famosa — Caso de estudio de rebranding =====
   Dirección: editorial / dossier — hairlines, tipografía con contraste,
   índices numerados, mucho blanco. Nada de efectos pesados: es material
   de defensa de tesis, no un sitio de venta. */

:root {
  --rojo: #E4272B;
  --azul: #1E3A5F;
  --dorado: #F2A81D;
  --verde: #1B7A3D;

  --cream: #FBF6EB;
  --paper: #FFFFFF;
  --ink: #211C16;
  --ink-soft: #5B564D;
  --line: rgba(33, 28, 22, 0.12);

  --font-display: "Fraunces", Georgia, serif;
  --font-script: "Caveat", cursive;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius-s: 6px;
  --radius-m: 14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--azul);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus {
  left: 0;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(251, 246, 235, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -20px rgba(33, 28, 22, 0.35);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img {
  height: 38px;
  width: auto;
}

.header-nav ul {
  list-style: none;
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
}

.header-nav a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--rojo);
  border-bottom-color: var(--rojo);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  padding: calc(84px + 4vw) var(--gutter) 64px;
  background: linear-gradient(180deg, #F5B231 0%, var(--dorado) 45%, #EFA415 100%);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azul);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(30, 58, 95, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 28px;
}

.hero-logo {
  width: min(340px, 60%);
  height: auto;
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 1.06;
  color: var(--azul);
  margin: 0 0 22px;
}

.hero-sub {
  font-size: 1.05rem;
  color: #4a3f24;
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--azul);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s ease;
}
.hero-cta:hover,
.hero-cta:focus-visible {
  background: var(--rojo);
  transform: translateY(-2px);
}
.hero-cta svg {
  transform: rotate(-90deg);
}

.hero-media {
  border-radius: var(--radius-m);
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: auto;
}

/* ===== Generic sections ===== */
.section {
  padding: clamp(64px, 9vw, 120px) var(--gutter);
}
.section-tinted {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.section-index {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--rojo);
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--ink);
}

.section-lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0;
}

.section-head {
  margin-bottom: clamp(36px, 5vw, 56px);
}

.body-copy p {
  margin: 0 0 18px;
  color: #3a352c;
  max-width: 56ch;
}
.body-copy p:last-child { margin-bottom: 0; }

/* ===== Two column layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
.two-col.reverse .col-media { order: 2; }
.two-col.reverse .col-text { order: 1; }

.col-media img {
  border-radius: var(--radius-m);
  width: 100%;
}

/* ===== Timeline ===== */
.timeline {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 26px 26px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rojo);
  border: 2px solid var(--cream);
}
.timeline-year {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--azul);
  margin-bottom: 2px;
}
.timeline-label {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ===== Logo grid (Sistema de marca) ===== */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.logo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--cream);
}
.logo-card img {
  width: 100%;
  height: auto;
  display: block;
}
.logo-card figcaption {
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ===== Palette ===== */
.palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.swatch {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.swatch-chip {
  display: block;
  height: 78px;
  border-radius: var(--radius-s);
  background: var(--sw);
  border: 1px solid rgba(0,0,0,0.06);
}
.swatch-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.swatch-hex {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ===== Sheet (variations) ===== */
.sheet {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--paper);
}
.sheet img { width: 100%; }
.sheet figcaption {
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ===== Productos ===== */
.product-feature {
  margin: 0 0 clamp(36px, 5vw, 56px);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.product-card-media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #eee;
}
.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.crop-catchup img { object-position: 19% 46%; }
.crop-aceite img { object-position: 33% 46%; }

.product-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 18px 18px 8px;
}
.product-card p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 18px 18px;
}

/* ===== Aplicaciones ===== */
.app-feature {
  margin: 0 0 24px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
}
.app-feature:last-child { margin-bottom: 0; }
.app-feature img { width: 100%; }
.app-feature figcaption {
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper);
}

/* ===== Campaña ===== */
.campaign-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  color: var(--rojo);
  margin: 0 0 22px;
  padding-left: 22px;
  border-left: 3px solid var(--dorado);
}
.campaign-quote:last-child { margin-bottom: 0; }

/* ===== Cierre ===== */
.closing {
  background: var(--azul);
  color: #fff;
  padding: clamp(72px, 10vw, 120px) var(--gutter);
  text-align: center;
}
.closing-inner {
  max-width: 560px;
  margin: 0 auto;
}
.closing-logo {
  width: 160px;
  margin: 0 auto 18px;
  filter: brightness(0) invert(1);
}
.closing-tagline {
  font-family: var(--font-script);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--dorado);
}
.closing-note {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* ===== Footer ===== */
.site-footer {
  background: #16273f;
  color: rgba(255,255,255,0.55);
  padding: 20px var(--gutter);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-media { max-width: 360px; margin: 0 auto; }

  .two-col {
    grid-template-columns: 1fr;
  }
  .two-col.reverse .col-media,
  .two-col.reverse .col-text { order: initial; }

  .logo-grid { grid-template-columns: 1fr 1fr; }
  .palette { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header-nav ul {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .header-nav ul.is-open { display: flex; }
  .header-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .header-nav a:hover { border-bottom-color: var(--line); }
  .nav-toggle { display: flex; }

  .logo-grid { grid-template-columns: 1fr; }
  .palette { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr; }

  .hero { padding-top: 100px; }
}
