/* =========================================================================
   Portfolio Patricia Bóveda — sistema visual centralizado
   Editorial · blanco/coral · Source Serif Pro + Inter
   Todo cambio visual global se hace AQUÍ (variables o reglas), nunca inline.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Marca */
  --accent:        #EF6351;
  --accent-hover:  #D94A38;
  --accent-deep:   #B83828;
  --accent-bg:     #FDEDEB;
  --accent-border: #F9C4BE;

  /* Texto / neutros */
  --text:        #1A1A1A;
  --text-soft:   #555555;
  --muted:       #B5B5B5;
  --line:        #E5E5E5;
  --line-soft:   #EFEFEF;
  --bg:          #FFFFFF;

  /* Matriz para visuales internos de case studies: coral / crema / gris.
     (Se sustituyó el antiguo verde/azul/mostaza para alinear con la marca.) */
  --cream-bg:    #F5F0E5;  --cream-border: #E6DCC2;  --cream-text: #8A6D3B;
  --gray-bg:     #F5F5F5;  --gray-border:  #E2E2E2;  --gray-text:  #6F6F6F;
  --neutral-bg:  #F5F0E5;  --neutral-border: #E6DCC2;

  /* Tipografía */
  --serif: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1040px;
  --pad: 32px;
  --radius: 3px;
}

/* ---------- Reset ligero ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }

/* Accesibilidad: foco visible coral */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: #fff; padding: 10px 16px;
  font-family: var(--sans); font-size: 14px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
}
.brand img {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; background: var(--neutral-bg);
  border: 1px solid var(--line);
}
.brand span { font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-family: var(--sans); font-size: 15px; font-weight: 500; text-decoration: none;
  color: var(--text); padding-bottom: 2px;
}
.nav a:hover { color: var(--accent); }
.nav a.active {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.lang-toggle {
  display: flex; align-items: center; gap: 8px;
  padding-left: 22px; margin-left: -4px;
  border-left: 1px solid var(--line);
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.02em;
}
.lang-toggle a { text-decoration: none; color: var(--muted); }
.lang-toggle a:hover { color: var(--text); }
.lang-toggle a.active { color: var(--text); font-weight: 600; }
.lang-toggle .sep { color: var(--line); }

/* Botón hamburguesa (oculto en escritorio, visible en móvil) */
.nav-toggle { display: none; }

/* ---------- Main spacing ---------- */
main { display: block; }
.section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; }

/* ---------- Hero (home) ---------- */
.hero { padding-top: 88px; padding-bottom: 56px; }
.hero h1 {
  font-size: clamp(48px, 7vw, 80px);
  font-weight: 600; letter-spacing: -0.01em; margin-bottom: 28px;
}
.hero .lead { max-width: none; }
.hero .lead p { color: var(--text-soft); font-size: 24px; line-height: 1.5; margin-bottom: 20px; }
.hero .lead p:last-child { margin-bottom: 0; }
.hero .lead strong { color: var(--text); font-weight: 600; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-soft); margin-bottom: 14px;
}

/* ---------- Company tag ---------- */
.company-tag {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}

/* ---------- Botones outline ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 14px;
  font-weight: 500; letter-spacing: 0.01em; text-decoration: none;
  color: var(--text); padding: 11px 22px;
  border: 1px solid var(--text); border-radius: var(--radius);
  background: transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--text); color: #fff; }
.btn-accent { border-color: var(--accent); color: var(--accent-deep); }
.btn-accent:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Project rows (home) ---------- */
.projects { display: grid; gap: 0; }
.project-row {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 60px;
  align-items: center; padding: 56px 0; border-top: 1px solid var(--line);
}
.project-row .info { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.project-row .info h2 {
  font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.01em;
}
.project-row .info p { font-family: var(--sans); color: var(--text-soft); font-size: 15.5px; line-height: 1.55; }
.project-row .cover {
  aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: var(--neutral-bg); border: 1px solid var(--line);
}
.project-row .cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- About CTA ---------- */
.about-cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 26px;
}
.about-cta p {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 400; line-height: 1.3; max-width: 760px;
}
.about-cta p em { color: var(--accent); font-style: normal; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 64px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 18px;
}
.footer-contact {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 34px);
  color: var(--text); text-decoration: none;
}
.footer-contact:hover { color: var(--accent); }
.footer-meta { font-family: var(--sans); font-size: 13px; color: var(--muted); }

/* ---------- Contacto (sección en About) ---------- */
.section-title { font-size: clamp(28px, 3vw, 36px); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.section-title em { color: var(--accent); font-style: normal; }
.section-lead { font-family: var(--sans); font-size: 17px; color: var(--text-soft); max-width: 520px; margin-bottom: 28px; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.contact-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 26px 24px;
  text-decoration: none; color: var(--text); background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.contact-card:hover { background: var(--accent-bg); border-color: var(--accent-border); border-top-color: var(--accent); }
.cc-icon {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent-bg);
  display: grid; place-items: center; margin-bottom: 8px;
}
.contact-card:hover .cc-icon { background: #fff; }
.cc-icon svg { width: 20px; height: 20px; display: block; }
.cc-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep);
}
.cc-value { font-family: var(--serif); font-size: 18px; line-height: 1.3; word-break: break-word; overflow-wrap: anywhere; }

.contact-cv { font-family: var(--sans); font-size: 14px; color: var(--text-soft); }
.contact-cv a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.contact-cv a:hover { color: var(--accent); }

@media (max-width: 880px) {
  .contact-wrap { padding: 52px 0; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- About layout ---------- */
.about-layout {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: start;
}
.about-text h1 {
  font-size: clamp(36px, 4.5vw, 54px); font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 28px;
}
.about-text p { font-family: var(--sans); font-size: 16.5px; line-height: 1.65; color: var(--text-soft); margin-bottom: 18px; }
.about-text p strong { color: var(--text); font-weight: 600; }
.skills-list { list-style: none; margin: 8px 0 28px; }
.skills-list li {
  position: relative; padding-left: 22px; margin-bottom: 10px;
  font-family: var(--sans); color: var(--text-soft); font-size: 16px;
}
.skills-list li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent);
}
.about-photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  background: var(--neutral-bg); border: 1px solid var(--line);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }

/* ---------- Recomendaciones (testimoniales) ---------- */
.testimonials-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 8px;
}
.testimonial {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; background: #fff;
}
.testimonial blockquote {
  margin: 0 0 16px; font-family: var(--serif); font-size: 18px;
  line-height: 1.55; color: var(--text);
}
.testimonial .sign { font-family: var(--sans); font-size: 13px; color: var(--text-soft); }
.testimonial .sign strong { color: var(--text); font-weight: 600; }

/* ---------- About projects (cards) ---------- */
.about-projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.project-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.project-card .cover {
  aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: var(--neutral-bg); border: 1px solid var(--line); order: -1;
}
.project-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.project-card h3 { font-size: 22px; font-weight: 600; }
.project-card .btn { align-self: flex-start; }

/* =========================================================================
   CASE STUDY
   El cuerpo de texto de los case studies va en Inter (los títulos, en serif).
   Se activa con <body class="case-study">.
   ========================================================================= */
.case-study .case-hero .lead,
.case-study .case-section > p,
.case-study .callout p,
.case-study .decision-card .body,
.case-study .ba-card .body,
.case-study .phase-card p,
.case-study .result-card p,
.case-study .next-project + *,
.case-study .skills-list li {
  font-family: var(--sans);
  letter-spacing: -0.005em;
}
.case-study .case-hero .lead { font-size: 18px; line-height: 1.6; }
.case-study .case-section > p { font-size: 16px; line-height: 1.65; }
.case-study .callout p { font-size: 15.5px; }
/* headings y company-tag se mantienen como están (serif / Inter respectivamente) */

.back-link {
  font-family: var(--sans); font-size: 14px; text-decoration: none;
  color: var(--text-soft); display: inline-block; padding: 24px 0;
}
.back-link:hover { color: var(--accent); }

.case-hero { padding: 8px 0 56px; }
.case-hero h1 {
  font-size: clamp(36px, 4.2vw, 52px); font-weight: 600;
  letter-spacing: -0.01em; margin: 16px 0 22px; max-width: 18ch;
}
.case-hero .lead { font-size: 20px; color: var(--text-soft); max-width: 640px; }
.case-meta {
  margin-top: 28px; font-family: var(--sans); font-size: 13px;
  color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 10px;
}
.case-meta span { display: inline-flex; align-items: center; gap: 10px; }
.case-meta span::after { content: "/"; color: var(--line); }
.case-meta span:last-child::after { content: ""; }

.case-cover {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--neutral-bg); border: 1px solid var(--line); margin-top: 40px;
}
.case-cover img { width: 100%; height: 100%; object-fit: cover; }

.case-section { padding: 56px 0; border-top: 1px solid var(--line); }
.case-section h2 {
  font-size: clamp(28px, 3vw, 36px); font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 20px;
}
.case-section > p { color: var(--text-soft); max-width: 680px; margin-bottom: 18px; }
.case-section > p:last-child { margin-bottom: 0; }
.case-section p strong { color: var(--text); font-weight: 600; }

/* Role badges */
.role-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.role-pill {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 6px 13px; border: 1px solid var(--line);
  border-radius: 100px; color: var(--text);
}
.role-pill.accent {
  background: var(--accent-bg); color: var(--accent-deep);
  border-color: var(--accent-border);
}
.role-arrow { color: var(--muted); font-family: var(--sans); }

/* Callout */
.callout {
  border-left: 3px solid var(--accent); background: var(--gray-bg);
  padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0; max-width: 720px;
}
.callout p { color: var(--text); font-size: 17px; margin: 0; }

/* Decision grid (elegido / descartado / por qué) */
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.decision-card {
  border-radius: var(--radius); padding: 22px;
  border: 1px solid var(--line); background: #fff;
}
.decision-card .label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
.decision-card .body { font-size: 16px; line-height: 1.5; }
.decision-card.good   { background: var(--accent-bg); border-color: var(--accent-border); }
.decision-card.good .label  { color: var(--accent-deep); }
.decision-card.discard { background: var(--gray-bg); border-color: var(--gray-border); }
.decision-card.discard .label { color: var(--gray-text); }
.decision-card.discard .body { text-decoration: line-through; color: var(--muted); text-decoration-color: var(--gray-text); }
.decision-card.why    { background: var(--cream-bg);  border-color: var(--cream-border); }
.decision-card.why .label   { color: var(--cream-text); }

/* Phases (Ahora / Próximo / Futuro) */
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.phase-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; background: #fff;
}
.phase-card .pill {
  display: inline-block; font-family: var(--sans); font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 100px; margin-bottom: 14px;
}
.phase-card.now .pill    { background: var(--accent-bg); color: var(--accent-deep); border: 1px solid var(--accent-border); }
.phase-card.next .pill   { background: var(--cream-bg);  color: var(--cream-text);  border: 1px solid var(--cream-border); }
.phase-card.future .pill { background: var(--gray-bg);   color: var(--gray-text);   border: 1px solid var(--gray-border); }
.phase-card h3 { font-size: 18px; margin-bottom: 8px; }
.phase-card p { font-size: 15px; color: var(--text-soft); line-height: 1.5; }
.phase-list { list-style: none; margin: 10px 0 16px; padding: 0; }
.phase-list li {
  position: relative; padding-left: 14px; margin-bottom: 6px;
  font-family: var(--sans); font-size: 13.5px; color: var(--text-soft); line-height: 1.4;
}
.phase-list li::before { content: "·"; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }
.phase-status {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft);
}

/* Before / after / insight */
.ba-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.ba-card { border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.ba-card .label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
.ba-card .body { font-size: 16px; line-height: 1.5; color: var(--text-soft); }
.ba-card.before  { background: var(--gray-bg); border-color: var(--gray-border); }
.ba-card.before .label  { color: var(--gray-text); }
.ba-card.after   { background: var(--accent-bg); border-color: var(--accent-border); }
.ba-card.after .label   { color: var(--accent-deep); }
.ba-card.insight { background: var(--cream-bg); border-color: var(--cream-border); }
.ba-card.insight .label { color: var(--cream-text); }

/* CS flow (fases con micro-tarjetas apiladas) */
.cs-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.cs-phase { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cs-phase .head {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 16px; color: #fff;
}
.cs-phase.p1 .head { background: var(--accent); }
.cs-phase.p2 .head { background: #8A8A8A; }
.cs-phase.p3 .head { background: #2A2A2A; }
.cs-phase .stack { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cs-card {
  border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px;
  font-family: var(--sans); font-size: 14px; background: #fff; color: var(--text-soft);
}
.cs-card .tag {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent-deep); background: var(--accent-bg);
  padding: 2px 8px; border-radius: 100px; margin-bottom: 6px;
}

/* =========================================================================
   MINI-MOCKUPS — pantallitas en CSS puro (representan pantallas reales)
   ========================================================================= */
.mockups { display: grid; gap: 18px; margin-top: 28px; }
.mockups.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mockups.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mockups.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mockup { display: flex; flex-direction: column; gap: 9px; }
.mk-frame { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.mk-chrome { display: flex; gap: 5px; padding: 8px 10px; background: var(--neutral-bg); border-bottom: 1px solid var(--line); }
.mk-chrome i { width: 7px; height: 7px; border-radius: 50%; background: #D9D2C2; }
.mk-body { padding: 12px; display: flex; flex-direction: column; gap: 7px; min-height: 132px; }
.mk-cap { font-family: var(--sans); font-size: 12px; color: var(--text-soft); text-align: center; }

/* App con barra lateral (editor, dashboard, listados con menú) */
.mk-app { display: flex; min-height: 132px; }
.mk-rail { width: 32%; background: var(--neutral-bg); border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.mk-main { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 7px; }

/* Bloques de construcción */
.mk-line { height: 7px; border-radius: 3px; background: var(--line); width: 100%; }
.mk-line.w30 { width: 30%; } .mk-line.w40 { width: 40%; } .mk-line.w50 { width: 50%; }
.mk-line.w60 { width: 60%; } .mk-line.w70 { width: 70%; } .mk-line.w80 { width: 80%; }
.mk-line.accent { background: var(--accent-border); }
.mk-line.tall { height: 11px; }
.mk-row { display: flex; gap: 7px; align-items: center; }
.mk-row.between { justify-content: space-between; }
.mk-chip { height: 16px; border-radius: 3px; background: var(--neutral-bg); border: 1px solid var(--line); flex: 1; }
.mk-pill { height: 16px; width: 46px; border-radius: 3px; background: var(--accent); }
.mk-pill.ghost { background: transparent; border: 1px solid var(--text); }
.mk-card { border: 1px solid var(--line); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Calendario (contrato) */
.mk-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mk-cal i { aspect-ratio: 1; background: var(--neutral-bg); border-radius: 2px; }
.mk-cal i.on { background: var(--accent-border); }
.mk-cal i.hi { background: var(--accent); }

/* Tabla de tarifas / rejilla */
.mk-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 5px; }
.mk-grid i { height: 9px; border-radius: 2px; background: var(--neutral-bg); }
.mk-grid i.head { background: var(--line); }

/* Vista móvil (player del alumno) */
.mk-phone { max-width: 168px; margin: 0 auto; border: 2px solid var(--text); border-radius: 16px; padding: 10px 9px; background: #fff; }
.mk-phone .mk-notch { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.mk-phone .mk-body { padding: 4px 2px; min-height: 150px; }

figure.mockup { margin: 0; }

/* Card contenedora: el mockup vive dentro de su contexto (título + pantalla) */
.mockup-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 14px;
}
.mockup-card h3 { font-size: 17px; font-weight: 600; }
.mockup-card p { font-family: var(--sans); font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.mockup-card .mockup { margin-top: auto; }
.mockup-card .mk-cap { text-align: left; }
.mockup-card figure.mockup img { width: 100%; display: block; border: 1px solid var(--line); border-radius: var(--radius); }

/* Mockups embebidos dentro de las fases del flujo: más compactos */
.cs-phase .mockup { gap: 6px; }
.cs-phase .mk-body, .cs-phase .mk-app { min-height: 78px; }
.cs-phase .mk-cap { font-size: 11px; }

/* =========================================================================
   FLOW DIAGRAM — panel único con partes y pantallas conectadas por flechas
   ========================================================================= */
.flowdiagram {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; margin-top: 28px; overflow: hidden;
}
.fd-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.fd-title { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--text); }
.fd-badge {
  font-family: var(--sans); font-size: 11px; color: var(--accent-deep);
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  padding: 3px 11px; border-radius: 100px;
}
.fd-body { padding: 26px 24px 28px; }
.fd-part-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
}
.fd-part.p1 .fd-part-label { color: var(--accent-deep); }
.fd-part.p2 .fd-part-label { color: #5A5A5A; }
.fd-part.p3 .fd-part-label { color: var(--cream-text); }
.fd-screens { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.fd-screen { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 116px; }
.fd-arrow { align-self: flex-start; margin-top: 26px; color: var(--muted); font-size: 14px; }
.fd-down { color: #CFCFCF; font-size: 16px; margin: 12px 0 12px 4px; }

.fd-screen .mk-frame { width: 100%; }
.fd-screen .mk-chrome { padding: 5px 7px; gap: 4px; }
.fd-screen .mk-chrome i { width: 5px; height: 5px; }
.fd-screen .mk-body { min-height: 52px; padding: 8px; gap: 5px; }
.fd-screen .mk-line { height: 5px; }
.fd-screen .mk-line.tall { height: 8px; }
.fd-screen .mk-cal { gap: 2px; }
.fd-screen .mk-grid { gap: 3px; }
.fd-screen .mk-grid i { height: 6px; }
.fd-cap { font-family: var(--sans); font-size: 11px; color: var(--text-soft); text-align: center; line-height: 1.3; }
.fd-cap small { display: block; color: var(--muted); font-size: 10px; }
.fd-cap.done { color: var(--accent-deep); font-weight: 600; }

/* tinte de marca por parte en las líneas de acento de las pantallas */
.fd-part.p1 .mk-line.accent { background: var(--accent); }
.fd-part.p2 .mk-line.accent { background: #B4B4B4; }
.fd-part.p3 .mk-line.accent { background: #D7B86A; }

@media (max-width: 520px) {
  .fd-screen { width: 88px; }
  .fd-arrow { margin-top: 20px; }
}

@media (max-width: 880px) {
  .mockups.cols-3, .mockups.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .mockups.cols-2, .mockups.cols-3, .mockups.cols-4 { grid-template-columns: 1fr; }
}

/* Price cascade (reglas de negocio) */
.cascade { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; max-width: 640px; }
.cascade-step {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  font-family: var(--sans); font-size: 15px;
}
.cascade-step .num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--neutral-bg); color: var(--text-soft);
}
.cascade-step.hot { border-color: var(--accent-border); background: var(--accent-bg); }
.cascade-step.hot .num { background: var(--accent); color: #fff; }
.cascade-step.hot { color: var(--accent-deep); font-weight: 500; }

/* Tabla genérica de case study */
.case-table { width: 100%; border-collapse: collapse; margin-top: 28px; font-family: var(--sans); font-size: 14px; }
.case-table th, .case-table td {
  text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.case-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-soft);
}
.case-table td { color: var(--text-soft); }
.case-table td strong { color: var(--text); font-weight: 600; }

/* Query builder mockup */
.qb { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 28px; background: #fff; max-width: 680px; }
.qb-group { border-left: 2px solid var(--accent-border); padding-left: 16px; }
.qb-label { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent-deep); margin-bottom: 12px; }
.qb-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
  font-family: var(--sans); font-size: 13px;
}
.qb-row span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--neutral-bg); color: var(--text-soft); }
.qb-sub { margin: 12px 0 0 16px; border-left: 2px solid var(--cream-border); padding-left: 16px; }
.qb-sub .qb-label { color: var(--cream-text); }

/* Results grid 2×2 */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.result-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: #fff;
}
.result-card .label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-deep); margin-bottom: 10px;
}
.result-card h3 { font-size: 19px; margin-bottom: 8px; }
.result-card p { font-size: 15px; color: var(--text-soft); line-height: 1.5; }

/* Figura con captura real (borde fino, sin marco de navegador) */
.case-figure { margin: 28px 0 0; }
.case-figure img { width: 100%; display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--neutral-bg); }
.case-figure figcaption { font-family: var(--sans); font-size: 13px; color: var(--text-soft); margin-top: 10px; }

/* Closing note (NDA) */
.closing-note {
  margin-top: 40px; border: 1px dashed var(--line-soft); border-radius: var(--radius);
  padding: 20px 24px; font-family: var(--sans); font-size: 13px; color: var(--muted);
  background: #fff;
}

/* Next project link */
.next-project { padding: 56px 0; border-top: 1px solid var(--line); }
.next-project a { text-decoration: none; color: var(--text); }
.next-project .eyebrow { margin-bottom: 8px; }
.next-project h2 { font-size: clamp(26px, 3vw, 36px); }
.next-project a:hover h2 { color: var(--accent); }

/* ---------- 404 ---------- */
.error-wrap { text-align: center; padding-top: 120px; padding-bottom: 120px; }
.error-wrap .code { font-family: var(--sans); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.error-wrap h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 20px; }
.error-wrap p { color: var(--text-soft); margin-bottom: 32px; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 880px) {
  body { font-size: 17px; }
  .hero .lead p { font-size: 22px; line-height: 1.5; }
  .about-layout { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { max-width: 420px; }
  .project-row { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .project-row .cover { order: -1; }
  .about-projects { grid-template-columns: 1fr; gap: 36px; }
  .decision-grid, .phases, .ba-grid, .cs-flow { grid-template-columns: 1fr; }
  .results-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- Móvil: menú hamburguesa ---------- */
@media (max-width: 600px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; margin-right: -8px; padding: 8px;
    background: none; border: none; cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 22px; height: 2px; border-radius: 2px;
    background: var(--text); transition: transform .2s ease, opacity .2s ease;
  }
  .header-inner.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header-inner.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .header-inner.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 4px var(--pad) 16px; display: none;
  }
  .header-inner.nav-open .nav { display: flex; }
  .nav a { width: 100%; padding: 12px 0; font-size: 16px; }
  .nav a.active { border-bottom: none; color: var(--accent); }
  .lang-toggle {
    width: 100%; margin: 4px 0 0; padding: 10px 0 0;
    border-left: none; border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  :root { --pad: 24px; }
  .header-inner { height: 64px; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .case-meta { flex-direction: column; gap: 4px; }
  .case-meta span::after { content: ""; }
}
