/* ==========================================================================
   IDEA — Innovación, Desarrollo y Escalado de Alimentos
   Design tokens + component classes for the site.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Figtree:wght@400;500;600;700&family=Fraunces:ital,wght@1,400;1,500&display=swap');

:root {
  /* ground */
  --color-bg: #fffdf9;
  --color-surface: #faf4ea;
  --color-text: #1b1a19;
  --color-divider: color-mix(in srgb, #1b1a19 16%, transparent);

  /* neutral ramp (warm cream → ink) */
  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  /* accent — naranja (acción) */
  --color-accent: #e84a27;
  --color-accent-100: #fef6ee;
  --color-accent-200: #fde5d6;
  --color-accent-300: #f9c6a8;
  --color-accent-400: #f0763f;
  --color-accent-500: #e84a27;
  --color-accent-600: #cc3c1c;
  --color-accent-700: #b23417;
  --color-accent-800: #8b2711;
  --color-accent-900: #5e1a0b;

  /* accent-2 — carmín (énfasis, bloques densos) */
  --color-accent-2: #d02543;
  --color-accent-2-100: #fef2f4;
  --color-accent-2-200: #fbdde2;
  --color-accent-2-300: #f3b3bf;
  --color-accent-2-400: #e56076;
  --color-accent-2-500: #d02543;
  --color-accent-2-600: #b71f3a;
  --color-accent-2-700: #9a1a30;
  --color-accent-2-800: #741325;
  --color-accent-2-900: #4c0c18;

  /* support palette (logo + accents in illustrations) */
  --color-logo-gold: #c9992a;
  --color-support-yellow: #f7c351;
  --color-support-yellow-tint: #fdf0d3;
  --color-support-sand: #e28c56;
  --color-support-red: #d63d36;

  /* type */
  --font-heading: "Sora", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-accent: "Fraunces", Georgia, serif;

  /* dark hero panel */
  --color-ink: #241d17;
  --color-ink-soft: #3a2f26;
  --color-cream: #fbf3e7;

  /* spacing / radius / elevation */
  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  letter-spacing: -0.03em;
  margin: 0;
}

p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-800); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 40px; }

.washed { filter: saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94); }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 15px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 13px 26px; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary { background: var(--color-accent-500); color: #fff; }
.btn-primary:hover { background: var(--color-accent-600); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary:active { background: var(--color-accent-700); transform: translateY(0); box-shadow: none; }
.btn-secondary { border-color: var(--color-divider); color: var(--color-text); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em; padding: 6px 14px; border-radius: 999px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-outline { border: 1px solid var(--color-accent-300); color: var(--color-accent-700); }

/* — form fields — */
.field { width: 100%; }
.input {
  width: 100%; min-height: 48px; padding: 10px 18px; font: inherit;
  font-size: 15px; color: var(--color-text); caret-color: var(--color-accent);
  background: #fff; border: 1px solid var(--color-divider); border-radius: 999px;
}
.input::placeholder { color: var(--color-neutral-600); }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { border-radius: var(--radius-md); resize: vertical; min-height: 110px; line-height: 1.5; padding-top: 12px; }

/* ==========================================================================
   Layout
   ========================================================================== */

.brand {
  display: inline-flex; align-items: center; color: var(--color-text);
}
.logo-img { height: 28px; width: auto; display: block; }
.logo-img-sm { height: 22px; }

header.site {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--color-bg) 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
  transition: background-color 0.3s ease;
}
header.site .wrap {
  padding-block: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
header.site nav { display: flex; align-items: center; gap: 30px; }
header.site nav a.link { font-size: 15px; font-weight: 500; color: var(--color-neutral-800); }
header.site nav a.link:hover { color: var(--color-text); }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--color-divider);
  background: none; cursor: pointer; color: var(--color-text);
}

/* — hero: split dark/light panels — */
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes spinCW { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spinCCW { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
header.site { animation: fadeIn 0.6s ease both; }

.hero-split {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 82vh;
}
.hero-panel { display: flex; align-items: center; position: relative; overflow: hidden; }
.hero-panel-copy {
  background: var(--color-surface); color: var(--color-text);
  border-right: 1px solid var(--color-divider);
  padding: 64px clamp(32px, 5vw, 72px);
}
.hero-copy-content {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 64px; max-width: 560px; min-height: 60vh;
}
.hero-top-group { display: flex; flex-direction: column; gap: 22px; }
.hero-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--color-accent-700);
  animation: riseIn 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}
.hero-heading { display: flex; flex-direction: column; }
.hero-heading-line {
  font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(42px, 5.4vw, 72px); line-height: 1.02; color: var(--color-text);
  animation: riseIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}
.hero-heading-accent {
  font-family: var(--font-accent); font-style: italic; font-weight: 400;
  color: var(--color-accent-700);
  animation: riseIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s both;
}
@keyframes wordCycle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-heading-accent #heroWord.word-cycle { display: inline-block; animation: wordCycle 0.45s ease both; }
.hero-bottom {
  display: flex; flex-direction: column; gap: 26px; align-items: flex-start;
  animation: riseIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.65s both;
}
.hero-desc { font-size: 17px; line-height: 1.6; color: var(--color-neutral-800); max-width: 340px; }

.hero-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--color-accent-500); color: #fff;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 16px 28px; border-radius: 999px; text-decoration: none;
}
.hero-cta::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--color-accent-600);
  transform: translateX(-101%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.hero-cta:hover::after { transform: translateX(0); }
.hero-cta:hover { color: #fff; }
.hero-cta-arrow { display: inline-block; transition: transform 0.3s ease; }
.hero-cta:hover .hero-cta-arrow { transform: translateX(6px); }

/* — hero: light panel visual — */
.hero-panel-light { background: var(--color-bg); justify-content: center; }
.hero-rings { position: relative; width: 420px; height: 420px; display: flex; align-items: center; justify-content: center; }
.ring {
  position: absolute; border-radius: 50%; border: 1px solid var(--color-divider);
}
.ring-1 { width: 220px; height: 220px; animation: spinCW 30s linear infinite; }
.ring-2 { width: 310px; height: 310px; border-style: dashed; animation: spinCCW 45s linear infinite; }
.ring-3 {
  width: 420px; height: 420px;
  animation: spinCW 60s linear infinite;
}
.hero-core {
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--color-accent-400), var(--color-accent-600) 78%);
  box-shadow: var(--shadow-lg);
  animation: floatY 4.5s ease-in-out infinite;
}
.hero-float {
  position: absolute; background: var(--color-ink); color: var(--color-cream);
  font-family: var(--font-heading); font-weight: 600; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; opacity: 0;
  animation: riseIn 0.6s ease both;
}
.ft-1 { top: 20%; left: 4%; transform: rotate(-3deg); animation-delay: 1.1s; }
.ft-2 { top: 32%; right: 2%; transform: rotate(2deg); animation-delay: 1.4s; }
.ft-3 { bottom: 26%; left: 2%; transform: rotate(-1deg); animation-delay: 1.7s; }
.ft-4 { bottom: 18%; right: 6%; transform: rotate(3deg); animation-delay: 2s; }

[data-reveal] { opacity: 0; }
[data-reveal].is-visible { animation: riseIn 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* — marquee strip — */
.marquee-strip {
  background: var(--color-ink); overflow: hidden; padding: 20px 0;
}
.marquee-track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee-track span.item {
  display: inline-flex; align-items: center; gap: 22px; padding-right: 22px;
  font-size: 13px; letter-spacing: 1.8px; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-cream) 72%, transparent); white-space: nowrap;
}
.marquee-track span.item .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--color-logo-gold); flex: none;
}
.marquee-strip:hover .marquee-track { animation-play-state: paused; }

/* — eyebrow: shared small uppercase label above every section heading — */
.eyebrow {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--color-accent-700); font-weight: 600;
}

/* — nosotros — */
#nosotros {
  max-width: 1240px; margin: 0 auto;
  padding: 96px 40px 48px;
  display: flex;
}
#nosotros > div { max-width: 720px; }
#nosotros h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; }
#nosotros p.copy { font-size: 18px; line-height: 1.6; color: var(--color-neutral-800); }
#nosotros .stats { display: flex; gap: 44px; flex-wrap: wrap; margin-top: 10px; }
#nosotros .stats .k {
  font-family: var(--font-heading); font-weight: 600; font-size: 44px;
  line-height: 1; color: var(--color-accent-700); letter-spacing: -0.04em;
}
#nosotros .stats .v { font-size: 14px; color: var(--color-neutral-700); margin-top: 8px; }

/* — divisor entre secciones — */
.section-divider {
  position: relative; max-width: 1240px; margin: 0 auto; padding: 24px 40px;
  display: flex; align-items: center; justify-content: center;
}
.section-divider-line { width: 100%; height: 1px; background: var(--color-divider); }
.section-divider-dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 999px; background: var(--color-logo-gold);
}

/* — servicios — */
#servicios {
  max-width: 1240px; margin: 0 auto;
  padding: 48px 40px 96px; display: flex; flex-direction: column; gap: 48px;
}
#servicios .head { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
#servicios h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; }
#servicios .lede { font-size: 18px; line-height: 1.6; color: var(--color-neutral-800); }
.service-list { display: flex; flex-direction: column; }
.service-row {
  border-top: 1px solid var(--color-divider); padding: 26px 24px; margin-inline: -24px;
  border-radius: var(--radius-lg);
  display: grid; grid-template-columns: 64px 1fr; gap: 22px; align-items: start;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.service-row:last-child { border-bottom: 1px solid var(--color-divider); }
.service-row:hover {
  background: color-mix(in srgb, var(--color-accent-100) 70%, transparent);
  box-shadow: var(--shadow-sm);
}
.service-mark {
  width: 56px; height: 56px; border-radius: 999px; background: var(--color-support-yellow-tint);
  color: #8c4a12; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 22px;
  transition: filter 0.3s ease, box-shadow 0.3s ease;
}
/* multi-character marks (e.g. "+IP") need a smaller size to keep breathing room */
.service-mark.is-wide { font-size: 16px; letter-spacing: -0.02em; }
.service-row:hover .service-mark { filter: brightness(1.08); box-shadow: var(--shadow-sm); }
.service-content { display: flex; flex-direction: column; gap: 8px; }
.service-row h3 { font-size: 22px; line-height: 1.15; }
.service-body { display: flex; flex-direction: column; gap: 10px; }
.service-body p { font-size: 15px; line-height: 1.55; color: var(--color-neutral-800); max-width: 640px; }
.service-body ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }

/* — services unfold in, one after another, on first scroll — */
@keyframes serviceUnfold {
  from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-16px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes markPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
.service-row[data-reveal] { opacity: 0; }
.service-row[data-reveal].is-visible { animation: serviceUnfold 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.service-row .service-mark { opacity: 0; }
.service-row.is-visible .service-mark {
  animation: markPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@media (prefers-reduced-motion: reduce) {
  .service-row[data-reveal].is-visible, .service-row.is-visible .service-mark { animation: none; opacity: 1; }
}

/* — portfolio — */
#portfolio {
  background: var(--color-surface);
  padding: 96px 0;
}
#portfolio .head { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
#portfolio h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; }

.portfolio-products { margin-top: 48px; display: flex; flex-direction: column; gap: 28px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.product-card { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.product-photo {
  width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--color-bg);
  transition: box-shadow 0.25s ease;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-card:hover .product-photo { box-shadow: var(--shadow-md); }
.product-card h3 { font-size: 19px; line-height: 1.2; }
.product-card p { font-size: 14px; line-height: 1.55; color: var(--color-neutral-700); }

/* — contacto — */
#contacto { padding: 0 40px 96px; }
.contact-panel {
  background: var(--color-accent-2-700); color: #fff; border-radius: var(--radius-lg);
  padding: 72px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
.contact-panel h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.06; color: #fff; }
.contact-panel .lede { font-size: 18px; line-height: 1.6; color: var(--color-accent-2-200); }
.contact-panel form { display: flex; flex-direction: column; gap: 14px; }
.contact-panel .input { background: rgba(255,255,255,0.94); border-color: transparent; }

.whatsapp-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 24px;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  color: #fff; padding: 12px 22px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, #fff 35%, transparent);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.whatsapp-link:hover { background: color-mix(in srgb, #fff 12%, transparent); color: #fff; border-color: #fff; }
.whatsapp-icon { display: inline-flex; color: #3fd672; }

.form-note {
  font-size: 14px; margin: 4px 0 0; min-height: 20px;
  color: var(--color-accent-2-200);
}
.form-note.is-success { color: #bdf2c8; font-weight: 600; }
.form-note.is-error { color: #ffd0d0; font-weight: 600; }
.contact-panel form.is-sent .field,
.contact-panel form.is-sent button[type="submit"] { display: none; }

footer.site { border-top: 1px solid var(--color-divider); }
footer.site .wrap {
  padding: 44px 40px; display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center; justify-content: space-between;
}
footer.site .foot-brand { display: flex; align-items: center; gap: 16px; }
footer.site .tagline { font-size: 13px; color: var(--color-neutral-700); }
footer.site .foot-links { display: flex; gap: 24px; font-size: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .wrap, .section-divider { padding-inline: 24px; }
  header.site nav.links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--color-bg); border-bottom: 1px solid var(--color-divider);
    padding: 8px 24px 20px;
  }
  header.site nav.links.is-open { display: flex; }
  header.site nav.links a.link { padding: 10px 0; width: 100%; }
  header.site nav.links a.btn { margin-top: 8px; }
  header.site { position: relative; }
  .nav-toggle { display: inline-flex; }

  .hero-split { grid-template-columns: 1fr; min-height: 0; }
  .hero-panel-copy { padding: 56px 24px 64px; border-right: none; }
  .hero-copy-content { max-width: none; min-height: 0; gap: 48px; }
  .hero-panel-light { display: none; }

  #nosotros { padding: 64px 24px 32px; }
  .section-divider { padding-block: 16px; }

  #portfolio { padding-block: 64px; }
  #servicios { padding: 32px 24px 64px; }
  #contacto { padding: 0 24px 64px; }

  .service-row { grid-template-columns: 1fr; gap: 16px; }
  .contact-panel { grid-template-columns: 1fr; padding: 40px 28px; gap: 32px; }
}

@media (max-width: 560px) {
  .hero-heading-line { font-size: 36px; }
  .logo-img { height: 24px; }
}
