/* ==========================================================================
   KORDAN — Grupo Empresarial S.L.
   Hoja de estilos principal · Diseño 2026 · Responsive · Accesible
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. Variables / Design tokens
   ------------------------------------------------------------------------- */
:root {
  /* Marca */
  --red: #cb1f2b;
  --red-dark: #a01820;
  --ink: #16181d;
  --ink-soft: #2b2f38;
  --graphite: #4a4f59;
  --grey: #8a8f99;
  --grey-light: #c9ccd2;
  --line: #e6e8ec;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-dark: #14161b;
  --white: #ffffff;

  /* Tipografía */
  --font-head: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  /* Escala */
  --container: 1200px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(20, 22, 27, .06);
  --shadow: 0 12px 34px rgba(20, 22, 27, .10);
  --shadow-lg: 0 28px 60px rgba(20, 22, 27, .16);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 128px;
}

/* -------------------------------------------------------------------------
   2. Reset / base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.85rem); }
h2 { font-size: clamp(1.7rem, 1.2rem + 2.1vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 1rem + .8vw, 1.45rem); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--red); color: #fff; }

/* -------------------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------------------- */
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 2rem + 6vw, 7rem) 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--bg-dark); color: #d7dae0; }
.section--dark h2, .section--dark h3 { color: #fff; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-head); font-weight: 600; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--red);
  margin-bottom: 1.5rem;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--red); display: inline-block; box-shadow: 10px 0 0 var(--red), 4px 7px 0 rgba(203,31,43,.45), 14px -5px 0 rgba(203,31,43,.45); margin-right: 12px; }

.section-head { max-width: 720px; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }
.section-head p { color: var(--graphite); margin-top: 1rem; font-size: 1.075rem; }
.section--dark .section-head p { color: #aeb3bd; }

/* cabecera de sección a dos columnas: pretítulo+título a la izquierda, descripción a la derecha */
.section-head--row {
  max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: end;
}
.section-head--row .head-left { max-width: 560px; }
.section-head--row p { margin-top: 0; padding-bottom: .35rem; }
@media (max-width: 980px) { .section-head--row { grid-template-columns: 1fr; gap: 1rem; } .section-head--row p { padding-bottom: 0; } }

.lead { font-size: clamp(1.1rem, 1rem + .6vw, 1.3rem); color: var(--graphite); }

/* -------------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .92rem 1.7rem; border-radius: 999px; font-family: var(--font-head);
  font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  white-space: nowrap; cursor: pointer; border: 1.5px solid transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 10px 24px rgba(203, 31, 43, .30); }
.btn--primary:hover { background: linear-gradient(135deg, var(--red-dark), var(--red-dark)); transform: translateY(-2px); box-shadow: 0 16px 32px rgba(203, 31, 43, .38); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--outline-light { border-color: rgba(255,255,255,.9); color: #fff; background: rgba(255,255,255,.14); backdrop-filter: blur(2px); }
.btn--outline-light:hover { background: #fff; color: var(--ink); border-color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }

/* -------------------------------------------------------------------------
   5. Header / Navigation
   ------------------------------------------------------------------------- */
/* Cabecera NO fija: se desplaza con el contenido al hacer scroll */
.site-header {
  position: relative; z-index: 100;
  background: #ffffff;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.brand img { height: 86px; width: auto; }
.brand .brand-sub { display: none; }

.nav-links { display: flex; align-items: center; gap: .5rem; }
.nav-links a {
  position: relative; padding: .6rem 1.05rem; border-radius: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; color: var(--ink);
  letter-spacing: .005em; transition: color .2s, background .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .35rem; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--red); }
.nav-cta { display: flex; align-items: center; gap: .75rem; }

.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 10px; align-items: center; justify-content: center; }
.nav-toggle span { position: relative; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), top .3s; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* -------------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: 12%; right: 3%; width: 300px; height: 260px; z-index: -1; pointer-events: none; opacity: .92;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='300'%20height='260'%3E%3Cg%20fill='%23cb1f2b'%3E%3Crect%20x='170'%20y='16'%20width='34'%20height='34'/%3E%3Crect%20x='228'%20y='48'%20width='20'%20height='20'/%3E%3Crect%20x='168'%20y='86'%20width='44'%20height='44'/%3E%3Crect%20x='236'%20y='108'%20width='18'%20height='18'/%3E%3Crect%20x='128'%20y='146'%20width='26'%20height='26'/%3E%3Crect%20x='182'%20y='160'%20width='36'%20height='36'/%3E%3Crect%20x='240'%20y='182'%20width='16'%20height='16'/%3E%3C/g%3E%3C/svg%3E") no-repeat right top;
}
@media (max-width: 760px) { .hero::before { display: none; } }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(20,22,27,.92) 0%, rgba(20,22,27,.78) 38%, rgba(20,22,27,.35) 70%, rgba(20,22,27,.15) 100%);
}
.hero-inner { padding: clamp(4rem, 3rem + 8vw, 9rem) 0 clamp(4rem, 3rem + 6vw, 8rem); max-width: 760px; }
.hero h1 { color: #fff; }
.hero h1 .accent { color: var(--red); }
.hero p { color: #d4d7de; font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); margin-top: 1.4rem; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .6rem; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; font-family: var(--font-head);
  letter-spacing: .03em; backdrop-filter: blur(4px); margin-bottom: 1.6rem;
}
.hero-tag b { color: var(--red); }

/* página interior: cabecera con foto real de la web + degradado a negro */
.page-hero { position: relative; background: #0c0d10; overflow: hidden; isolation: isolate; }
.page-hero .hero-media img { filter: brightness(.8) contrast(1.06) saturate(1.04); transform: scale(1.04); }
.page-hero .hero-media::after {
  background:
    linear-gradient(90deg, rgba(8,9,11,.85) 0%, rgba(8,9,11,.55) 40%, rgba(8,9,11,.22) 100%),
    linear-gradient(180deg, rgba(8,9,11,0) 38%, rgba(0,0,0,.7) 100%);
}
.page-hero::after {
  content: ""; position: absolute; top: 0; right: 0; width: 300px; height: 100%; pointer-events: none; opacity: .4;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='260'%20height='220'%3E%3Cg%20fill='%23cb1f2b'%3E%3Crect%20x='150'%20y='14'%20width='28'%20height='28'/%3E%3Crect%20x='200'%20y='40'%20width='18'%20height='18'/%3E%3Crect%20x='150'%20y='74'%20width='36'%20height='36'/%3E%3Crect%20x='206'%20y='92'%20width='16'%20height='16'/%3E%3Crect%20x='120'%20y='122'%20width='22'%20height='22'/%3E%3Crect%20x='166'%20y='132'%20width='30'%20height='30'/%3E%3Crect%20x='212'%20y='152'%20width='14'%20height='14'/%3E%3C/g%3E%3C/svg%3E") no-repeat right 24px center;
}
.page-hero-inner { padding: clamp(3.5rem, 3rem + 5.5vw, 7rem) 0 clamp(3rem, 2.4rem + 4vw, 5.5rem); position: relative; z-index: 1; }
.page-hero h1 { color: #fff; max-width: 760px; }
.page-hero p { color: #c2c6cf; max-width: 620px; margin-top: 1.1rem; font-size: 1.12rem; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; color: #9aa0ab; font-size: .9rem; margin-bottom: 1.3rem; font-family: var(--font-head); font-weight: 500; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { color: var(--red); }

/* -------------------------------------------------------------------------
   7. Stats band
   ------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat { text-align: center; padding: 1.4rem .5rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3rem); color: var(--ink); line-height: 1; }
.stat .num span { color: var(--red); }
.stat .label { color: var(--graphite); font-size: .95rem; margin-top: .5rem; }
.section--dark .stat { border-color: rgba(255,255,255,.12); }
.section--dark .stat .num { color: #fff; }
.section--dark .stat .label { color: #aeb3bd; }

/* -------------------------------------------------------------------------
   8. Cards / Values / Services
   ------------------------------------------------------------------------- */
.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.4rem 2rem 2.2rem; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(203,31,43,.22); }
.card .ic {
  width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 1.4rem; border-radius: 16px;
  background: linear-gradient(140deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 10px 22px rgba(203,31,43,.28);
}
.card .ic svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .55rem; }
.card p { color: var(--graphite); }

/* =========================================================================
   VALORES — banda editorial conectada (icono que se rellena al pasar)
   ========================================================================= */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.7rem; }
.value {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2.7rem 2rem 2.3rem; overflow: hidden; box-shadow: var(--shadow-sm); isolation: isolate;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s;
}
/* lavado de color superior */
.value::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 140px; z-index: -1;
  background: linear-gradient(180deg, rgba(203,31,43,.08), rgba(203,31,43,0)); pointer-events: none; }
/* número fantasma grande */
.value-num {
  position: absolute; top: .9rem; right: 1.5rem; font-family: var(--font-head); font-weight: 800; font-size: 4.4rem;
  line-height: 1; color: rgba(203,31,43,.10); z-index: -1; pointer-events: none;
  transition: color .45s var(--ease), transform .45s var(--ease);
}
/* placa del icono con degradado y anillo discontinuo */
.value-ic {
  position: relative; width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 1.7rem;
  background: linear-gradient(140deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 14px 30px rgba(203,31,43,.30);
  transition: transform .5s var(--ease);
}
.value-ic::after { content: ""; position: absolute; inset: -8px; border-radius: 28px; border: 1.6px dashed rgba(203,31,43,.35); transition: transform .7s var(--ease); }
.value-ic svg { width: 32px; height: 32px; }
.value h3 { font-size: 1.3rem; margin-bottom: .55rem; }
.value p { color: var(--graphite); }
.value:hover { transform: translateY(-9px); box-shadow: var(--shadow-lg); border-color: rgba(203,31,43,.22); }
.value:hover .value-num { color: rgba(203,31,43,.2); transform: translateY(-4px); }
.value:hover .value-ic { transform: translateY(-4px) rotate(-6deg); }
.value:hover .value-ic::after { transform: rotate(45deg) scale(.96); }

/* =========================================================================
   SERVICIO DETALLE — módulo rico e interactivo (reformas / obra civil)
   ========================================================================= */
.service-feature { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2.5rem, 1.5rem + 4.5vw, 5rem); align-items: center; }
.service-feature.reverse { direction: rtl; }
.service-feature.reverse > * { direction: ltr; }
.service-feature-media { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.service-feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.service-feature-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16,18,22,.55), transparent 55%); opacity: .8; transition: opacity .4s; }
.service-feature-media:hover img { transform: scale(1.07); }
.service-feature-media:hover::after { opacity: 1; }
.service-badge {
  position: absolute; left: 1.3rem; bottom: 1.3rem; z-index: 2; width: 66px; height: 66px; border-radius: 20px;
  display: grid; place-items: center; background: linear-gradient(140deg, var(--red), var(--red-dark)); color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; box-shadow: 0 14px 30px rgba(203,31,43,.42);
  transition: transform .4s var(--ease);
}
.service-feature-media:hover .service-badge { transform: translateY(-4px) rotate(-6deg); }
.service-feature-body > p { color: var(--graphite); margin-top: 1.1rem; }
.service-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin: 1.8rem 0; }
.service-point {
  display: flex; gap: .75rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.service-point:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(203,31,43,.28); }
.service-point .spi { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(203,31,43,.1); color: var(--red); transition: background .3s, color .3s, transform .4s var(--ease); }
.service-point:hover .spi { background: linear-gradient(140deg, var(--red), var(--red-dark)); color: #fff; transform: rotate(-6deg); }
.service-point .spi svg { width: 18px; height: 18px; }
.service-point span { font-size: .9rem; color: var(--ink-soft); line-height: 1.35; }
@media (max-width: 900px) {
  .service-feature { grid-template-columns: 1fr; }
  .service-feature.reverse { direction: ltr; }
  .service-feature-media { order: -1; }
}
@media (max-width: 560px) { .service-points { grid-template-columns: 1fr; } }

/* =========================================================================
   SERVICIOS — paneles grandes, audaces (uno oscuro, uno rojo)
   ========================================================================= */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
.service-panel {
  display: block; position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); border-radius: var(--radius-lg); color: #fff;
  background: var(--bg-dark); transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.service-panel:nth-child(2) { background: linear-gradient(145deg, var(--red), var(--red-dark)); }
.service-panel::after { /* gran filigrana de marca (píxeles) */
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 220px; height: 200px; z-index: -1; opacity: .14;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='220'%20height='200'%3E%3Cg%20fill='%23ffffff'%3E%3Crect%20x='150'%20y='14'%20width='30'%20height='30'/%3E%3Crect%20x='198'%20y='44'%20width='20'%20height='20'/%3E%3Crect%20x='150'%20y='78'%20width='40'%20height='40'/%3E%3Crect%20x='120'%20y='128'%20width='24'%20height='24'/%3E%3Crect%20x='168'%20y='136'%20width='34'%20height='34'/%3E%3C/g%3E%3C/svg%3E") no-repeat right bottom;
}
.service-panel:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); }
.service-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; margin-bottom: 1.5rem; backdrop-filter: blur(2px); }
.service-ic svg { width: 30px; height: 30px; }
.service-panel h3 { color: #fff; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
.service-panel p { color: rgba(255,255,255,.82); margin-top: .7rem; max-width: 42ch; }
.service-arrow { display: inline-flex; align-items: center; gap: .55rem; margin-top: 1.7rem; font-family: var(--font-head); font-weight: 600; color: #fff; }
.service-arrow svg { width: 20px; height: 20px; transition: transform .35s var(--ease); }
.service-panel:hover .service-arrow svg { transform: translateX(6px); }

@media (max-width: 980px) {
  .values { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
}

/* Servicio destacado (split) */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2.5rem, 1.5rem + 4.5vw, 5.5rem); align-items: center; }
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }
.split-media { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.split-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.split-media:hover img { transform: scale(1.05); }
/* acento de marca: esquina roja en triángulo */
.split-media::after { content: ""; position: absolute; left: 0; top: 0; width: 72px; height: 72px; background: linear-gradient(135deg, var(--red), var(--red-dark)); clip-path: polygon(0 0, 100% 0, 0 100%); pointer-events: none; }
/* marco decorativo desplazado detrás de la imagen */
.split-media-wrap { position: relative; }
.split-media-wrap::before { content: ""; position: absolute; right: -16px; bottom: -16px; width: 62%; height: 70%; border: 2px solid rgba(203,31,43,.35); border-radius: var(--radius-lg); z-index: 0; pointer-events: none; }
.split-media-wrap .split-media { position: relative; z-index: 1; }

/* -------------------------------------------------------------------------
   8b. Decoraciones de sección (formas)
   ------------------------------------------------------------------------- */
.section--soft { position: relative; overflow: hidden; }
.section--soft::before { content: ""; position: absolute; top: -130px; right: -130px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(203,31,43,.06), transparent 70%); pointer-events: none; z-index: 0; }
.section--soft::after { content: ""; position: absolute; bottom: -90px; left: -90px; width: 220px; height: 220px; border-radius: 50%; border: 1.5px solid rgba(203,31,43,.10); pointer-events: none; z-index: 0; }
.section--soft > .container { position: relative; z-index: 1; }
.section--dark { position: relative; overflow: hidden; }
.section--dark::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(203,31,43,.16), transparent 70%); pointer-events: none; }
.section--dark > .container { position: relative; z-index: 1; }
.feature-list { display: grid; gap: .9rem; margin-top: 1.6rem; }
.feature-list li { display: flex; gap: .8rem; align-items: flex-start; color: var(--ink-soft); }
.feature-list .chk { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--red); display: grid; place-items: center; margin-top: 2px; }
.feature-list .chk svg { width: 13px; height: 13px; color: #fff; }

/* Tarjetas de característica (presentación alternativa en cuadrícula 2×2) */
.feature-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.feature-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.4rem; box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(203,31,43,.22); }
.feature-card .fic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(203,31,43,.1); color: var(--red); margin-bottom: 1rem; transition: background .35s, color .35s, transform .4s var(--ease); }
.feature-card:hover .fic { background: linear-gradient(140deg, var(--red), var(--red-dark)); color: #fff; transform: rotate(-6deg); }
.feature-card .fic svg { width: 22px; height: 22px; }
.feature-card h4 { font-family: var(--font-head); font-size: 1.04rem; font-weight: 600; margin-bottom: .35rem; }
.feature-card p { font-size: .92rem; color: var(--graphite); }
@media (max-width: 560px) { .feature-cards { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------------
   9. Process steps
   ------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: step; }
.step { position: relative; padding-top: 1rem; }
.step .n { font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; color: var(--grey-light); line-height: 1; }
.step h3 { font-size: 1.15rem; margin: .8rem 0 .5rem; }
.step p { color: var(--graphite); font-size: .96rem; }
.section--dark .step .n { color: #3a3f49; }
.section--dark .step p { color: #aeb3bd; }

/* -------------------------------------------------------------------------
   10. Projects / Portfolio
   ------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.4rem; }
.filter-btn {
  padding: .55rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--line);
  font-family: var(--font-head); font-weight: 500; font-size: .92rem; color: var(--graphite);
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.portfolio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.project {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1;
  box-shadow: var(--shadow-sm); cursor: default;
}
.project img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.project:hover img { transform: scale(1.08); }
.project-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem; color: #fff;
  background: linear-gradient(to top, rgba(20,22,27,.9) 0%, rgba(20,22,27,.45) 45%, rgba(20,22,27,0) 75%);
  opacity: 1; transition: background .3s;
}
.project:hover .project-overlay { background: linear-gradient(to top, rgba(203,31,43,.92) 0%, rgba(20,22,27,.55) 55%, rgba(20,22,27,0) 90%); }
.project .tag { font-family: var(--font-head); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.project h3 { color: #fff; font-size: 1.25rem; margin-top: .25rem; }
.project.hide { display: none; }

/* -------------------------------------------------------------------------
   11. Clients carousel (logos)
   ------------------------------------------------------------------------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: scroll 32s linear infinite; align-items: center; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img { height: 188px; width: auto; transition: transform .3s var(--ease); }
.marquee-track img:hover { transform: scale(1.06); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* -------------------------------------------------------------------------
   12. CTA band
   ------------------------------------------------------------------------- */
.cta-band { position: relative; overflow: hidden; background: var(--red); color: #fff; border-radius: var(--radius-lg); padding: clamp(2.6rem, 2rem + 4vw, 4.5rem); text-align: center; }
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.cta-band::before { width: 300px; height: 300px; top: -120px; right: -80px; }
.cta-band::after { width: 220px; height: 220px; bottom: -110px; left: -60px; }
.cta-band h2 { color: #fff; position: relative; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 560px; margin: 1rem auto 2rem; position: relative; }
.cta-band .hero-actions { justify-content: center; position: relative; }

/* -------------------------------------------------------------------------
   13. Contact
   ------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: start; }
.info-list { display: grid; gap: 1.3rem; margin-top: 2rem; }
.info-item { display: flex; gap: 1.1rem; align-items: flex-start; }
.info-item .ic { flex-shrink: 0; width: 50px; height: 50px; border-radius: 13px; background: rgba(203,31,43,.09); color: var(--red); display: grid; place-items: center; }
.info-item .ic svg { width: 22px; height: 22px; }
.info-item h4 { font-family: var(--font-head); font-size: 1.02rem; margin-bottom: .15rem; }
.info-item a, .info-item p { color: var(--graphite); }
.info-item a:hover { color: var(--red); }

.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem, 1rem + 2vw, 2.4rem); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-family: var(--font-head); font-weight: 500; font-size: .92rem; margin-bottom: .45rem; }
.field label .req { color: var(--red); }
.field input, .field textarea {
  width: 100%; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(203,31,43,.1); }
.field textarea { resize: vertical; min-height: 130px; }
.form-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--graphite); margin-bottom: 1.4rem; }
.form-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); flex-shrink: 0; }
.form-check a { color: var(--red); text-decoration: underline; }
.form-note { font-size: .82rem; color: var(--grey); margin-top: 1rem; }
/* Honeypot anti-spam: oculto para personas, visible para bots */
.hp-field { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* Cláusula informativa de protección de datos (RGPD) */
.form-legal { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.form-legal-title { font-family: var(--font-head); font-weight: 600; font-size: .9rem; margin-bottom: .55rem; color: var(--ink); }
.form-legal ul { display: grid; gap: .4rem; }
.form-legal li { font-size: .82rem; color: var(--graphite); line-height: 1.5; }
.form-legal a { color: var(--red); text-decoration: underline; }
.form-status { display: none; padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; font-size: .94rem; }
.form-status.ok { display: block; background: #e8f7ee; color: #176b3a; border: 1px solid #b7e4c7; }
.form-status.err { display: block; background: #fdecec; color: #a01a1f; border: 1px solid #f5c2c4; }

.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-top: 3rem; box-shadow: var(--shadow-sm); }
.kordan-map { width: 100%; height: 460px; z-index: 0; background: var(--bg-soft); }
/* mismo mapa detallado de OSM pero con color más claro/suave */
.kordan-map .leaflet-tile { filter: brightness(1.06) contrast(.9) saturate(.82); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content { font-size: .92rem; line-height: 1.5; }
.leaflet-bar a { color: var(--ink); }
/* Marcador personalizado con el favicon de Kordan */
.kordan-marker { background: none; border: 0; }
.kordan-marker .pin { position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #fff; border: 2.5px solid var(--red); box-shadow: 0 8px 20px rgba(0,0,0,.32); }
.kordan-marker .pin::after { content: ""; position: absolute; left: 50%; top: 43px; transform: translateX(-50%); width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 13px solid var(--red); }
.kordan-marker .pin img { width: 34px; height: 34px; display: block; }

/* -------------------------------------------------------------------------
   14. Legal pages (prose)
   ------------------------------------------------------------------------- */
.prose { max-width: 820px; }
.prose h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin: 2.6rem 0 1rem; }
.prose h3 { margin: 1.8rem 0 .7rem; }
.prose p, .prose li { color: var(--ink-soft); margin-bottom: 1rem; }
.prose ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1.2rem; }
.prose ul li { margin-bottom: .5rem; }
.prose a { color: var(--red); text-decoration: underline; }
.prose strong { color: var(--ink); }
.prose .toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; margin-bottom: 2.5rem; }
.prose .toc h2 { margin: 0 0 .8rem; font-size: 1.1rem; }
.prose .toc ol { list-style: decimal; padding-left: 1.3rem; columns: 2; column-gap: 2rem; }
.prose .toc li { margin-bottom: .4rem; }
.prose .toc a { color: var(--ink-soft); text-decoration: none; }
.prose .toc a:hover { color: var(--red); }
.updated { display: inline-block; font-size: .85rem; color: var(--grey); background: var(--bg-soft); border: 1px solid var(--line); padding: .35rem .9rem; border-radius: 999px; margin-bottom: 2rem; }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); }
table.cookies-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
table.cookies-table th, table.cookies-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.cookies-table th { background: var(--bg-soft); font-family: var(--font-head); font-weight: 600; color: var(--ink); }
table.cookies-table tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------------------------------
   15. Footer
   ------------------------------------------------------------------------- */
.site-footer { background: var(--bg-dark); color: #aeb3bd; padding-top: clamp(3rem, 2rem + 4vw, 5rem); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-brand img { height: 64px; background: #fff; padding: 10px 14px; border-radius: 10px; }
.footer-brand p { margin-top: 1.2rem; max-width: 320px; font-size: .95rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1.1rem; font-family: var(--font-head); }
.footer-col ul { display: grid; gap: .65rem; }
.footer-col a { font-size: .95rem; transition: color .2s, padding-left .2s; }
.footer-col a:hover { color: #fff; padding-left: 4px; }
.footer-contact li { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; margin-bottom: .8rem; }
.footer-contact svg { width: 18px; height: 18px; color: var(--red); flex-shrink: 0; margin-top: 3px; }
.footer-contact a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; align-items: center; padding: 1.6rem 0; font-size: .88rem; text-align: center; }

/* Botón flotante: volver arriba (abajo a la derecha) */
.back-to-top {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 950;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(203,31,43,.36);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s, background .2s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--red-dark); transform: translateY(-3px); }
.back-to-top svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   16. Cookie banner + modal
   ------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 140%);
  width: min(100% - 2rem, 980px); z-index: 1000;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.6rem 1.8rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1.4rem 2rem; align-items: center;
  transition: transform .5s var(--ease); opacity: 1;
}
.cookie-banner.show { transform: translate(-50%, 0); }
.cookie-banner h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.cookie-banner p { font-size: .92rem; color: var(--graphite); margin: 0; }
.cookie-banner p a { color: var(--red); text-decoration: underline; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; }
.cookie-actions .btn { padding: .7rem 1.3rem; font-size: .9rem; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; transform: translateY(-2px); }

.cookie-overlay {
  position: fixed; inset: 0; z-index: 1001; background: rgba(20,22,27,.55);
  backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 1.2rem;
}
.cookie-overlay.show { display: flex; }
.cookie-modal {
  background: #fff; border-radius: var(--radius-lg); width: min(100%, 640px); max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .4s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.cookie-modal-head { padding: 1.7rem 1.8rem 1.2rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; position: sticky; top: 0; background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.cookie-modal-head h3 { font-size: 1.3rem; }
.cookie-modal-head p { font-size: .9rem; color: var(--graphite); margin-top: .3rem; }
.cookie-close { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--graphite); flex-shrink: 0; transition: background .2s; }
.cookie-close:hover { background: var(--bg-soft); color: var(--ink); }
.cookie-modal-body { padding: 1rem 1.8rem 1.8rem; }
.cookie-cat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.cookie-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-cat-head h4 { font-family: var(--font-head); font-size: 1.05rem; }
.cookie-cat p { font-size: .88rem; color: var(--graphite); margin-top: .5rem; }
.cookie-cat .fixed-tag { font-size: .8rem; color: var(--red); font-family: var(--font-head); font-weight: 600; }

/* Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--grey-light); border-radius: 999px; transition: background .25s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 21px; width: 21px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--red); }
.switch input:checked + .slider::before { transform: translateX(21px); }
.switch input:disabled + .slider { background: var(--red); opacity: .55; cursor: not-allowed; }
.cookie-modal-foot { padding: 1.2rem 1.8rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.cookie-modal-foot .btn { padding: .7rem 1.3rem; font-size: .9rem; }

/* Floating reopen button */
.cookie-fab { position: fixed; left: 1rem; bottom: 1rem; z-index: 900; width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: none; place-items: center; color: var(--ink); transition: transform .2s; }
.cookie-fab:hover { transform: scale(1.08); color: var(--red); }
.cookie-fab.show { display: grid; }
.cookie-fab svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   17. Reveal-on-scroll
   ------------------------------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------
   18. Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .grid-3, .steps, .stats { grid-template-columns: repeat(2, 1fr); }
  .portfolio { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .split.reverse { direction: ltr; }
  .split-media { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
}

/* El menú grande no cabe en horizontal por debajo de ~1100px: ocultar el CTA de cabecera ahí */
@media (max-width: 1100px) { .nav-cta .btn { display: none; } }

/* Menú hamburguesa en tablet y móvil */
@media (max-width: 920px) {
  :root { --header-h: 92px; }
  .brand img { height: 60px; }
  .marquee-track img { height: 138px; }
  .back-to-top { right: .9rem; bottom: .9rem; width: 46px; height: 46px; }
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; padding: 1rem 1.25rem 1.6rem; gap: .2rem; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .4s var(--ease); z-index: 99;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .9rem .5rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta .btn { display: none; }
  .cookie-banner { grid-template-columns: 1fr; gap: 1.1rem; padding: 1.3rem 1.3rem 1.5rem; bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100%; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1; min-width: 130px; }
}

@media (max-width: 560px) {
  .grid-3, .grid-2, .steps, .stats, .portfolio { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .prose .toc ol { columns: 1; }
  .hero-actions .btn, .cta-band .btn { width: 100%; }
  .kordan-map { height: 360px; }
  .page-hero::after { display: none; }
  .service-badge { width: 54px; height: 54px; font-size: 1.4rem; left: 1rem; bottom: 1rem; }
}
