/* ============================================
   Kipa — Landing
   Fondo crema, acentos marrón claro,
   tipografía elegante y legible.
   ============================================ */

:root {
  --cream: #f6f1e8;
  --cream-deep: #ebe4d8;
  --cream-soft: #faf7f2;
  --brown: #a67c52;
  --brown-dark: #7a5a3a;
  --brown-light: #c4a484;
  --brown-muted: #b8956e;
  --ink: #2c241c;
  --ink-soft: #4a3f34;
  --ink-faint: #6b5d4f;
  --line: rgba(166, 124, 82, 0.28);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brown-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.25s var(--ease);
}

a:hover {
  color: var(--brown);
}

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

ul,
ol {
  list-style: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover {
  color: var(--brown-dark);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--brown-dark);
}

.main-nav .nav-cta {
  color: var(--cream);
  background: var(--brown);
  padding: 0.55rem 1.1rem;
}

.main-nav .nav-cta:hover {
  background: var(--brown-dark);
  color: var(--cream);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.55rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn-primary {
  background: var(--brown);
  color: var(--cream);
  border-color: var(--brown);
}

.btn-primary:hover {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  color: var(--brown-dark);
  border-color: var(--brown-light);
}

.btn-ghost:hover {
  background: var(--cream-deep);
  color: var(--brown-dark);
  border-color: var(--brown);
}

.btn-small {
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 72% 18%, rgba(196, 164, 132, 0.4), transparent 55%),
    radial-gradient(ellipse 55% 45% at 12% 85%, rgba(166, 124, 82, 0.2), transparent 50%),
    linear-gradient(165deg, var(--cream-soft) 0%, var(--cream) 45%, var(--cream-deep) 100%);
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 48px,
      rgba(166, 124, 82, 0.035) 48px,
      rgba(166, 124, 82, 0.035) 49px
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  width: 100%;
}

.hero-brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(5.5rem, 18vw, 11rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1.5rem;
  animation: fade-up 0.95s var(--ease) both;
}

.hero-eyebrow {
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--brown-dark);
  margin-bottom: 1rem;
  max-width: 34rem;
  animation: fade-up 0.9s var(--ease) 0.08s both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  line-height: 1.25;
  color: var(--ink-soft);
  max-width: 22ch;
  margin-bottom: 1.1rem;
  animation: fade-up 0.9s var(--ease) 0.16s both;
}

.hero-subtitle {
  font-weight: 400;
  font-size: 1.08rem;
  color: var(--ink-faint);
  max-width: 34rem;
  margin-bottom: 0;
  animation: fade-up 0.9s var(--ease) 0.24s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  animation: fade-up 0.9s var(--ease) 0.32s both;
}

.hero-support {
  font-weight: 400;
  font-size: 0.98rem;
  color: var(--ink-faint);
  max-width: 34rem;
  border-left: 2px solid var(--brown-light);
  padding-left: 1.1rem;
  animation: fade-up 0.9s var(--ease) 0.4s both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Secciones ---------- */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--cream-deep);
}

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-head {
  margin-bottom: 2.5rem;
  max-width: 36rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 3.4vw, 2.55rem);
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: 0.85rem;
}

.section-lead {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.section-closing {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--ink);
  max-width: 28rem;
  margin-top: 2.5rem;
}

.section-closing.compact {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.section-cta {
  margin-top: 2rem;
}

/* ---------- Problemas (grid compacto) ---------- */

.problems-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

@media (min-width: 700px) {
  .problems-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .problems-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.problem-card {
  background: var(--cream);
  padding: 1.5rem 1.35rem;
  transition: background 0.3s var(--ease);
}

.problem-card:hover {
  background: var(--cream-soft);
}

.problem-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.problem-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.section-alt .problem-card {
  background: var(--cream-deep);
}

.section-alt .problem-card:hover {
  background: var(--cream);
}

/* ---------- Soluciones + iconos animados ---------- */

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .service-card-wide {
    grid-column: span 2;
  }
}

.service-card {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 1.6rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s var(--ease), transform 0.35s var(--ease);
}

.service-card:hover {
  border-color: var(--brown-light);
  transform: translateY(-3px);
}

.service-card-wide {
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
}

.service-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.25;
}

.service-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.service-icon {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.icon-svg circle,
.icon-svg rect,
.icon-svg path {
  fill: none;
  stroke: var(--brown);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-node,
.icon-core {
  fill: var(--brown-light);
  stroke: var(--brown-dark);
}

.icon-ring {
  stroke: var(--brown);
}

.icon-path,
.icon-bridge,
.icon-wave,
.icon-scan {
  stroke: var(--brown-dark);
}

.icon-box,
.icon-layer,
.icon-sheet {
  fill: rgba(196, 164, 132, 0.18);
  stroke: var(--brown);
}

/* Animaciones de iconos */

.icon-flow .icon-node {
  animation: node-pulse 2.8s var(--ease) infinite;
}

.icon-flow .n2 { animation-delay: 0.35s; }
.icon-flow .n3 { animation-delay: 0.7s; }
.icon-flow .n4 { animation-delay: 1.05s; }

.icon-flow .icon-path {
  stroke-dasharray: 40;
  animation: dash-flow 2.4s linear infinite;
}

.icon-agent .icon-ring {
  transform-origin: 32px 28px;
  animation: ring-breathe 3s var(--ease) infinite;
}

.icon-agent .icon-core {
  animation: core-glow 2.2s var(--ease) infinite;
}

.icon-agent .w1 {
  animation: wave-fade 2.4s var(--ease) infinite;
}

.icon-agent .w2 {
  animation: wave-fade 2.4s var(--ease) 0.4s infinite;
}

.icon-link .b1 {
  animation: box-nudge 3s var(--ease) infinite;
}

.icon-link .b2 {
  animation: box-nudge 3s var(--ease) 0.5s infinite reverse;
}

.icon-link .icon-bridge {
  stroke-dasharray: 14;
  animation: dash-flow 1.8s linear infinite;
}

.icon-build .l1 { animation: layer-rise 2.6s var(--ease) infinite; }
.icon-build .l2 { animation: layer-rise 2.6s var(--ease) 0.2s infinite; }
.icon-build .l3 { animation: layer-rise 2.6s var(--ease) 0.4s infinite; }

.icon-docs .s1 {
  animation: sheet-shift 3.2s var(--ease) infinite;
}

.icon-docs .s2 {
  animation: sheet-shift 3.2s var(--ease) 0.35s infinite reverse;
}

.icon-docs .icon-scan {
  stroke-dasharray: 20;
  animation: dash-flow 2s linear infinite;
}

@keyframes node-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes dash-flow {
  to { stroke-dashoffset: -40; }
}

@keyframes ring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes core-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes wave-fade {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

@keyframes box-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.5px); }
}

@keyframes layer-rise {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1.5px); }
}

@keyframes sheet-shift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(1px, -1px); }
}

@media (prefers-reduced-motion: reduce) {
  .icon-svg * {
    animation: none !important;
  }

  .hero-brand,
  .hero-eyebrow,
  .hero-title,
  .hero-subtitle,
  .hero-actions,
  .hero-support {
    animation: none !important;
  }
}

/* ---------- Ejemplos ---------- */

.examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .examples-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.examples-grid li {
  position: relative;
  padding: 1rem 1rem 1rem 1.85rem;
  background: var(--cream-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.examples-grid li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.3rem;
  width: 6px;
  height: 6px;
  background: var(--brown);
  border-radius: 50%;
}

/* ---------- Productos ---------- */

.products-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.product-card {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
}

.product-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  color: var(--ink);
}

.product-tagline {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--brown-dark);
  line-height: 1.35;
}

.product-card > p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.product-card .btn {
  margin-top: 0.5rem;
}

/* ---------- Pasos ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

@media (min-width: 700px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-card {
  background: var(--cream);
  padding: 1.5rem 1.25rem;
}

.step-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--brown);
  margin-bottom: 0.65rem;
  letter-spacing: 0.04em;
}

.step-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.step-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Inversión (banda compacta) ---------- */

.section-band {
  padding: 3.5rem 0;
  background: var(--cream-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.band-inner .section-title {
  max-width: 18ch;
  margin-bottom: 0.65rem;
}

.band-inner .section-lead {
  max-width: 32rem;
  margin: 0;
}

/* ---------- Contacto ---------- */

.contact-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3.5rem;
    align-items: start;
  }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream-soft);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.25s var(--ease);
}

.form-field textarea::placeholder {
  color: var(--ink-faint);
  opacity: 0.85;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--brown);
}

.form-actions {
  display: flex;
  margin-top: 0.15rem;
}

.form-status {
  min-height: 1.35em;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.form-status.is-error {
  color: #8b3a2a;
}

.form-status.is-success {
  color: #3d6b4f;
}

.form-after {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
  background: var(--cream);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.footer-copy {
  color: var(--ink-faint);
  font-size: 0.98rem;
  margin-bottom: 0.65rem;
  max-width: 28rem;
}

/* ---------- Página evaluación ---------- */

.page-eval {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-eval main {
  flex: 1;
}

.eval-intro {
  padding: 3.5rem 0 1.5rem;
}

.eval-intro .section-title {
  max-width: 28ch;
}

.eval-calendar-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.eval-calendar {
  width: 100%;
  min-height: 700px;
  height: 80vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--cream-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .main-nav {
    gap: 1rem;
  }

  .main-nav a:not(.nav-cta) {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .main-nav .nav-cta {
    margin: 0.75rem 1.5rem 1rem;
    text-align: center;
    border-bottom: none;
  }

  .hero-content {
    padding: 3rem 1.5rem 4rem;
  }

  .hero-title {
    max-width: none;
  }

  .section {
    padding: 3.75rem 0;
  }

  .service-card-wide {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .band-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .eval-calendar {
    min-height: 640px;
    height: 75vh;
  }
}
