@import url("/design-tokens.css");
@import url("/brand.css");

/* Adaptador semántico de los componentes HTML al sistema visual de la home. */
:root {
  color-scheme: light;
  --bg: var(--ivory);
  --surface-2: var(--sand);
  --muted: var(--ink-soft);
  --soft: var(--stone);
  --blue: var(--teal);
  --blue-soft: var(--teal-tint);
  --accent: var(--copper);
  --accent-dark: var(--copper-hover);
  --accent-soft: var(--copper-tint);
  --green: var(--teal);
  --green-soft: var(--teal-tint);
  --danger: var(--alert);
  --danger-soft: var(--alert-tint);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ivory); }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--site-font-sans); font-size: 16px; font-weight: 400; line-height: 1.5; font-synthesis-weight: none; }
[id] { scroll-margin-top: var(--header-offset); }
a { color: inherit; text-underline-offset: 4px; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--navy); color: var(--ivory); }
h1, h2, h3 { margin: 0; font-family: var(--site-font-serif); font-weight: 400; text-wrap: balance; }
h1 { max-width: 22ch; font-size: var(--site-h1); line-height: 1.12; }
h2 { max-width: 30ch; font-size: var(--site-h2); line-height: 1.15; }
h3 { font-size: 24px; line-height: 1.3; }
p { margin: 0; color: var(--ink-soft); line-height: 1.625; text-wrap: pretty; }
p + p { margin-top: 16px; }
strong { font-weight: 600; }
ul, ol { margin: 20px 0 0; padding-left: 24px; }
li { line-height: 1.625; }
li + li { margin-top: 8px; }
li > p { margin-top: 8px; }
code { font-family: var(--site-font-mono); }
.wrap, .profile-content { width: 100%; max-width: var(--site-width); margin-inline: auto; padding-inline: var(--site-gutter); }
:where(.hero-grid, .grid-2, .grid-3, .document-intro-grid, .acceptance-grid, .footer-grid) > * { min-width: 0; }

/* Cabecera: escala, marca y control móvil de la home. Los enlaces se conservan. */
.topbar { position: sticky; top: 0; z-index: 50; background: rgb(247 244 239 / 95%); border-bottom: 1px solid var(--line); backdrop-filter: blur(4px); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 15px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.navlinks { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.navlinks a { text-decoration: none; color: var(--ink-soft); }
.navlinks a:hover { color: var(--copper); }
.navlinks a:last-child { border-radius: var(--site-radius-button); padding: 10px 20px; background: var(--copper); color: white; font-weight: 600; }
.navlinks a:last-child:hover { background: var(--copper-hover); }
.nav > .navlinks { display: none; }
.site-menu > summary { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; list-style: none; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu .menu-close, .site-menu[open] .menu-open { display: none; }
.site-menu[open] .menu-close { display: block; }
.site-menu .navlinks { position: absolute; inset: 100% 0 auto; display: flex; align-items: stretch; flex-direction: column; gap: 0; padding: 12px var(--site-gutter); background: var(--ivory); border-bottom: 1px solid var(--line); }
.site-menu .navlinks a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.site-menu .navlinks a:last-child { margin-block: 16px; padding: 14px 20px; border: 0; text-align: center; font-size: 14px; }

/* Cabeceras y secciones; los artículos compactan el ritmo sin acumular márgenes. */
.hero, .profile-hero { padding-block: 40px 56px; }
.hero { border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.eyebrow { display: block; margin: 0; color: var(--copper); font-family: var(--site-font-sans); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: .16em; text-transform: uppercase; }
.profile-hero > .eyebrow::before, .hero .eyebrow::before { content: ""; display: block; width: 40px; border-top: var(--site-control-rule); margin-bottom: 16px; }
:is(.hero, .profile-hero) h1 { margin-top: 20px; }
.lead { max-width: 62ch; margin-top: 24px; font-size: var(--site-lead); line-height: 1.625; }
.profile-hero > p:not(.lead):not(.eyebrow) { margin-top: 20px; font-size: 14px; color: var(--stone); }
main > section:not(.hero):not(.profile-hero), main > article > section { padding-block: var(--site-section-space); }
.section-alt { background: var(--sand); border-block: 1px solid var(--line); }
.section-head { max-width: 780px; margin-bottom: 28px; }
.section-head h2 { margin-top: 16px; }
.section-head p:not(.eyebrow) { margin-top: 20px; font-size: var(--site-lead); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center h2 { margin-inline: auto; }
.profile-content { padding-bottom: var(--site-section-space); }
.profile-content section { padding-block: 32px; border-top: 1px solid var(--line); }
.profile-content section > :is(p, ul, ol) { max-width: 76ch; }
.profile-content h2 { margin-bottom: 20px; }
.profile-content h3 { margin-block: 24px 12px; }
.profile-content section > :is(ul, ol) + p { margin-top: 20px; }
.profile-content a:not(.btn), .profile-footer a { color: var(--copper); text-decoration: underline; }
.profile-contact { font-size: 14px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.profile-download { font-size: 14px; font-weight: 600; margin-top: 12px; }
.case-summary { display: grid; gap: 20px; margin: 24px 0; padding: 24px; background: var(--sand); border-top: var(--site-control-rule); }
.case-summary dt { font-size: 12px; font-weight: 600; color: var(--teal); margin-bottom: 8px; }
.case-summary dd { margin: 0; font-size: 14px; line-height: 1.65; }
@media (min-width: 768px) { .case-summary { grid-template-columns: repeat(3,minmax(0,1fr)); } }

/* Acciones y superficies: mismos radios, bordes y sombra plana. */
.cta-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: var(--site-radius-button); font-size: 14px; font-weight: 600; line-height: 20px; text-align: center; text-decoration: none; transition: background-color .2s; }
.btn-primary { background: var(--copper); color: white; }
.btn-primary:hover { background: var(--copper-hover); }
.btn-secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.btn-secondary:hover { background: var(--sand); }
:is(.card, .hero-card, .ba-box, .document-index, .acceptance-box, .stop-box, .metric-formula, .table-wrap, .rules-list, .strip-item, .faq details) { border: 1px solid var(--line); border-radius: var(--site-radius-card); background: var(--surface); box-shadow: var(--shadow-flat); }
:is(.card, .ba-box, .document-index, .acceptance-box, .stop-box, .metric-formula) { padding: 24px; }
:is(.card, .ba-box, .acceptance-box) p { margin-top: 16px; }
.card p, .card li { font-size: 14px; }
.tag { display: inline-block; margin-bottom: 16px; color: var(--teal); font-size: 12px; font-weight: 600; line-height: 16px; }
.grid-2, .grid-3, .strip-grid, .before-after { display: grid; grid-template-columns: 1fr; gap: 20px; }
.hero-card { overflow: hidden; }
.hero-card::before { content: "Ejemplo de proceso"; display: table; margin: 20px 24px 0; font-size: 12px; font-weight: 600; color: var(--teal); }
.panel-title { padding: 24px; border-bottom: 1px solid var(--line); }
.panel-title strong { display: block; font-family: var(--site-font-serif); font-size: 24px; font-weight: 400; line-height: 1.3; }
.panel-title span { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.625; }
.metric { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.metric:last-child { border-bottom: 0; }
.dot { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--teal-line); border-radius: 8px; background: var(--teal-tint); color: var(--teal); font-family: var(--site-font-mono); font-size: 13px; font-weight: 600; }
.mini-flow { margin: 0; padding: 0; list-style: none; }
.mini-flow li { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.mini-flow li:last-child { border-bottom: 0; }
.mini-flow li > span { flex: 0 0 32px; color: var(--teal); }
.process-note { margin: 0; padding: 20px 24px; border-top: 1px solid var(--line); font-size: 13px; }
.hero-points { display: grid; gap: 12px; margin-top: 28px; }
.hero-points span { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); font-size: 14px; }
.conversion-strip { padding-block: 0 40px; }
.strip-item { padding: 20px; }
.strip-item strong, .strip-item span { display: block; }
.strip-item span { margin-top: 8px; color: var(--stone); font-size: 14px; }
.offer-card, .ba-box.after { background: var(--teal-tint); }
.ba-box.before { background: var(--alert-tint); }
.price { margin-block: 16px; color: var(--copper); font-family: var(--site-font-mono); font-size: 28px; }

/* Pasos: el texto fluye en un bloque, nunca como celdas de grid anónimas. */
.flow, .process-steps { display: grid; gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.flow > li, .process-steps > li { counter-increment: step; position: relative; display: block; margin: 0; padding: 20px 20px 20px 68px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-flat); }
.flow > li::before, .process-steps > li::before { content: counter(step); position: absolute; top: 22px; left: 20px; color: var(--teal); font-family: var(--site-font-mono); font-size: 13px; font-weight: 600; }
.flow strong, .process-steps strong { display: block; margin-bottom: 8px; }
.process-steps-grid { max-width: none; }

/* Componentes de documentos: tablas, contratos, controles y código. */
.artifact-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; color: var(--stone); font-size: 12px; }
.blueprint-hero .document-card::before { content: "Documento v1.1"; }
.document-control { margin: 0; }
.document-control > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.document-control > div:last-child { border-bottom: 0; }
.document-control dt { color: var(--stone); font-size: 12px; }
.document-control dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.document-intro { border-bottom: 1px solid var(--line); }
.document-intro-grid, .acceptance-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
.document-intro h2 { margin-top: 16px; }
.document-intro p { margin-top: 20px; }
.document-index h2 { font-family: var(--site-font-sans); font-size: 14px; font-weight: 600; line-height: 20px; }
.document-index ol { padding-left: 24px; }
.document-index li { padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.document-index li + li { margin: 0; }
.document-index a { text-decoration: none; }
.table-wrap { overflow-x: auto; }
.blueprint-table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
.blueprint-table caption { padding: 20px; text-align: left; color: var(--stone); font-size: 13px; }
.blueprint-table th, .blueprint-table td { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; line-height: 1.625; }
.blueprint-table thead th { background: var(--sand); }
.blueprint-table tbody th { font-weight: 600; }
.blueprint-table td { color: var(--ink-soft); }
.blueprint-table tbody tr:last-child :is(th, td) { border: 0; }
.rules-list > div { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.rules-list > div:last-child { border: 0; }
.rules-list strong { font-family: var(--site-font-serif); font-size: 20px; font-weight: 400; }
.rules-list span { font-size: 14px; color: var(--ink-soft); }
.cta-band { background: var(--navy); color: var(--ivory); }
.cta-band p, .cta-band li { color: rgb(247 244 239 / 85%); }
.cta-band .eyebrow { color: var(--copper-on-dark); }
.cta-band .btn-primary { background: var(--copper-on-dark); color: var(--navy); }
.cta-band .btn-secondary { border-color: rgb(247 244 239 / 35%); background: transparent; color: var(--ivory); }
.cta-band :where(a, summary):focus-visible { outline-color: var(--copper-on-dark); }
.control-split { display: grid; gap: 24px; }
.control-split > div { padding: 24px; border: 1px solid var(--navy-line); border-radius: 12px; }
.prompt-block { overflow-x: auto; margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-family: var(--site-font-mono); font-size: 13px; line-height: 1.625; white-space: pre-wrap; overflow-wrap: anywhere; }
.metric-formula { display: grid; gap: 16px; }
.metric-formula > span { color: var(--teal); font-size: 12px; font-weight: 600; }
.metric-formula strong { font-family: var(--site-font-serif); font-size: 28px; font-weight: 400; line-height: 1.3; }
.metric-formula small { color: var(--stone); }
.stop-box { margin-top: 24px; }
.stop-box p { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.artifact-note, .document-disclaimer { margin-top: 24px; padding-left: 16px; border-left: 2px solid var(--line-strong); font-size: 14px; }
.faq details { padding: 20px 24px; }
.faq details + details { margin-top: 12px; }
.faq summary { cursor: pointer; font-weight: 600; }

/* Trayectoria y pie comparten la misma escala sin alterar el texto. */
.career-entry { padding-block: 24px; border-bottom: 1px solid var(--line); }
.career-entry:last-child { border: 0; }
.career-entry h3 { margin-top: 0; }
.career-entry p, .career-entry ul { max-width: 76ch; }
.career-period { margin-bottom: 12px; color: var(--stone); font-size: 14px; }
.skills { display: grid; gap: 24px; }
.skills article { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.skills h3 { margin-top: 0; }
.footer, .profile-footer { border-top: 1px solid var(--line); padding-block: 40px; background: var(--sand); color: var(--stone); font-size: 14px; }
.footer-grid { display: grid; gap: 32px; }
.footer-brand p { max-width: 40ch; margin-top: 16px; font-size: 14px; }
.footer-col h4 { margin: 0 0 16px; font-size: 12px; font-weight: 600; }
.footer-col ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-col li { margin: 0; }
.footer-col a { text-decoration: none; }
.footer-legal { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; }
.profile-footer nav { margin-block: 16px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.sticky-cta { position: fixed; z-index: 40; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; width: min(720px, calc(100% - 40px)); padding: 16px; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-raised); }
.sticky-cta span { font-size: 13px; }
body:has(.sticky-cta) .footer { padding-bottom: 150px; }
@media (min-width: 640px) {
  .cta-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .grid-2, .grid-3, .before-after, .skills, .process-steps-grid, .control-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-points, .strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-list > div { grid-template-columns: minmax(180px, .42fr) minmax(0, 1fr); gap: 24px; }
  .sticky-cta { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 1024px) {
  .hero, .profile-hero { padding-block: 72px 80px; }
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
  .grid-3, .process-steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-points { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .document-intro-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
  .acceptance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
/* 1024px, igual que la cabecera React: entre 1024 y 1279px el contenido ya es
   ancho completo y no hay motivo para esconder navegacion y CTA tras el menu. */
@media (min-width: 1024px) { .nav > .navlinks { display: flex; } .site-menu { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }

@media print {
  .topbar, .profile-footer, .profile-page .cta-row { display: none; }
  .profile-page, .profile-content .skills article { background: white; color: #16202b; }
  .profile-page .profile-hero { padding: 0 0 16px; }
  .profile-page .profile-hero h1 { font-size: 30px; max-width: none; }
  .profile-page .lead { font-size: 12px; }
  .profile-content { padding: 0; }
  .profile-content section { padding: 12px 0; break-inside: avoid; }
  .profile-content h2 { font-size: 20px; margin-bottom: 8px; }
  .profile-content h3 { font-size: 14px; }
  .profile-content p, .profile-content li, .profile-footer { font-size: 11px; line-height: 1.5; }
  .profile-content .skills { gap: 12px; }
  .profile-content .skills article { padding: 10px; }
  .profile-content .career-history { break-inside: auto; }
  .career-entry { padding: 10px 0; break-inside: avoid; }
  .career-page-two { break-before: page; }
  .profile-content .career-entry h3 { margin: 0 0 5px; }
  .profile-content .career-entry p { margin: 6px 0; }
  .profile-content li { margin: 4px 0; }
  a { color: inherit; }
}


@media print {
  html { background: white; }
  .profile-content h2 { max-width: none; }
  .profile-content section > :is(p, ul, ol), .career-entry p, .career-entry ul { max-width: none; }
  .profile-hero > p:not(.lead):not(.eyebrow) { font-size: 11px; }
  /* En papel no hay formulario: fuera las llamadas a la acción de la web. */
  .profile-page p:has(> a[href$="/#servicios"]), .profile-opportunities, .profile-download { display: none; }
  .career-page-two { break-before: auto; }
  #aedas.career-entry { break-inside: auto; }
  .case-summary { break-inside: avoid; padding: 10px 12px !important; margin-block: 8px !important; }
  .case-summary dt { font-size: 10px; margin: 0; }
  .case-summary dd { font-size: 11px !important; line-height: 1.45 !important; margin: 0 0 6px !important; }
  .career-entry h3 { break-after: avoid; }
  .profile-content h2 { break-after: avoid; }
}
