/* =====================================================================
   Dirección A — Consultor SaaS (claro primero) + detalles terminal (B)
   Carga al final: sobreescribe zoho-accent.css y las hojas por sección.
   El modo oscuro conserva el diseño anterior; el claro es el nuevo look.
   ===================================================================== */

:root {
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --saas-accent: #226DB4;
    --saas-accent-soft: #E6F1FB;
    --saas-red: #E42527;
}

/* ---------- Estructural (ambos temas) ---------- */

/* Hero: foto como complemento en tarjeta con marco, texto protagonista */
.title__media {
    justify-self: end;
    width: min(100%, 300px);
    padding: 0.8rem;
    border: 1px solid var(--senior-line);
    border-radius: 16px;
    background: var(--senior-surface);
    box-shadow: none;
    overflow: visible;
}

.title__media::after {
    display: none;
}

.title__profile {
    width: 100%;
    max-width: none;
    border-radius: 10px;
    opacity: 1;
    filter: none;
}

.title__media-caption {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0.7rem 0.15rem 0;
}

.title__media-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--senior-text);
}

.title__media-role {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--senior-text-soft);
}

/* Ritmo vertical y anchos consistentes entre secciones */
.about,
.services,
.skills,
.academic,
.experience-summary,
.cases,
.experience {
    padding: 4.75rem 2rem;
}

.contact-section {
    padding: 4.75rem 0;
}

.titular {
    padding: 4.2rem 2rem 3.6rem;
}

.title__div {
    width: min(1020px, 100%);
}

.about__title,
.services__title,
.skills__title,
.academic__title,
.experience-summary__title,
.cases__title,
.experience__section__title {
    font-size: clamp(1.7rem, 2.4vw, 2.05rem);
    margin: 0 0 0.85rem;
}

.skills__title,
.academic__title {
    margin-bottom: 2.2rem;
}

.services__subtitle,
.experience-summary__intro,
.cases__intro,
.experience__section__intro {
    max-width: 720px;
    margin: 0 auto 2.6rem;
}

.skills__group {
    width: min(1020px, 100%);
}

.skills__group .skills__container {
    width: 100%;
}

.cases__grid {
    width: min(1020px, 100%);
}

@media only screen and (max-width: 767px) {
    .about,
    .services,
    .skills,
    .academic,
    .experience-summary,
    .cases,
    .experience {
        padding: 3.4rem 1rem;
    }

    .contact-section {
        padding: 3.4rem 0;
    }
}

/* Contacto rediseñado: split intro + formulario (ambos temas) */
.contact__grid {
    width: min(1020px, 100%);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3rem;
    align-items: start;
}

.contact__intro {
    text-align: left;
}

.contact__eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--senior-text-soft);
    margin: 0 0 0.9rem;
}

.contact__main-title {
    text-align: left;
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin: 0 0 1rem;
    color: var(--senior-text);
}

.contact__pitch {
    color: var(--senior-text-soft);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.6rem;
}

.contact__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    font-size: 0.85rem;
    line-height: 1.35;
    margin: 0 0 1.9rem;
}

.contact__badge-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: status-soft-pulse 2.8s ease-in-out infinite;
}

.contact__channels {
    margin: 0 0 1.7rem;
    padding: 0;
}

.contact__channel {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0.2rem;
    border-bottom: 1px solid var(--senior-line);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.contact__channels > li:first-child .contact__channel {
    border-top: 1px solid var(--senior-line);
}

.contact__channel:hover {
    border-color: var(--senior-line-strong);
}

.contact__channel-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--senior-surface-2);
    color: var(--senior-text);
}

.contact__channel-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.contact__channel-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--senior-text-soft);
}

.contact__channel-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--senior-text);
    overflow-wrap: anywhere;
}

.contact__channel-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.5;
    color: var(--senior-text-soft);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact__channel:hover .contact__channel-arrow {
    transform: translate(2px, -2px);
    opacity: 1;
}

.contact__meta-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--senior-text-soft);
    margin: 0;
}

@media only screen and (max-width: 900px) {
    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2.4rem;
        padding: 0 1rem;
    }
}

/* La banda de chips de About no debe desbordar en anchos intermedios */
.about__meta {
    flex-wrap: wrap;
    max-width: 100%;
}

/* Detalle terminal: métricas y labels de casos en mono */
.hero__metrics-value {
    font-family: var(--font-mono);
}

.cases__eyebrow,
.cases__tags > li,
.cases__block > dt {
    font-family: var(--font-mono);
}

/* Tarjetas de caso como ventana de terminal sutil */
.cases__card {
    position: relative;
    padding-top: 2.7rem;
}

.cases__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    border-bottom: 1px solid rgba(160, 224, 255, 0.22);
    border-radius: 14px 14px 0 0;
    pointer-events: none;
}

.cases__card::after {
    content: "";
    position: absolute;
    top: 13px;
    left: 18px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #E24B4A;
    box-shadow: 13px 0 0 #F0B429, 26px 0 0 #1D9E75;
}

.cases__block > dt::before {
    content: "$ ";
    opacity: 0.75;
}

/* Formación rediseñada: tarjetas sin logos, periodo en mono */
.academic__grid {
    width: min(1020px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
    margin-top: 0.4rem;
}

.academic__entry {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    border: 1px solid var(--senior-line);
    border-radius: 12px;
    padding: 1.35rem 1.25rem;
    background: var(--senior-surface);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.academic__entry:hover {
    border-color: var(--senior-line-strong);
    transform: translateY(-2px);
}

.academic__entry-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--senior-surface-2);
    color: var(--senior-text);
    margin-bottom: 0.95rem;
}

.academic__entry-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--senior-text);
    margin: 0 0 0.35rem;
}

.academic__entry-inst {
    font-size: 0.88rem;
    color: var(--senior-text-soft);
    margin: 0 0 0.85rem;
}

.academic__entry-period {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    color: var(--senior-text-soft);
    margin: auto 0 0;
}

.academic__extras {
    width: min(1020px, 100%);
}

/* Proyectos de desarrollo web: grilla estática estilo pinned repos */
.repo-grid {
    width: min(1020px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.repo-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--senior-line);
    border-radius: 12px;
    padding: 1.15rem 1.2rem;
    background: var(--senior-surface);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.repo-card:hover {
    border-color: var(--senior-line-strong);
    transform: translateY(-2px);
}

.repo-card__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.repo-card__glyph {
    color: var(--senior-text-soft);
    font-size: 0.95rem;
}

.repo-card__name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--senior-text);
    margin: 0;
}

.repo-card__desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--senior-text-soft);
    margin: 0 0 1rem;
}

.repo-card__foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.repo-card__lang {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--senior-text-soft);
}

.repo-card__lang-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.repo-card__links {
    display: inline-flex;
    gap: 0.35rem;
}

.repo-card__link {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--senior-text-soft);
    border: 1px solid var(--senior-line);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.repo-card__link:hover {
    color: var(--senior-text);
    border-color: var(--senior-line-strong);
}

.repo-grid .github-loading,
.repo-grid .github-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem 0;
    color: var(--senior-text-soft);
}

@media only screen and (max-width: 1100px) {
    .repo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 700px) {
    .repo-grid {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 900px) {
    .academic__grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   TEMA CLARO — Dirección A
   ===================================================================== */

html:not([data-theme="dark"]) {
    --degradado-fondo: #FAFBFC;
    --color-primario: rgba(255, 255, 255, 0.92);
    --color-terciario: #334155;
    --color-de-link: #0F172A;
    --color-de-fondo: #F1F5F9;
    --color-fondo2: rgba(15, 23, 42, 0.04);
    --color-cuaternario: #226DB4;
    --accent-color: #226DB4;
    --senior-text: #0F172A;
    --senior-text-soft: #475569;
    --senior-line: rgba(15, 23, 42, 0.1);
    --senior-line-strong: rgba(15, 23, 42, 0.22);
    --senior-surface: #FFFFFF;
    --senior-surface-2: #F1F5F9;
}

html:not([data-theme="dark"]) body {
    background: #FAFBFC;
    color: #334155;
}

html:not([data-theme="dark"]) :where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline-color: #226DB4;
}

/* --- Header --- */
html:not([data-theme="dark"]) header > section {
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

html:not([data-theme="dark"]) .menu__header > a > img {
    filter: invert(0.82) sepia(0.12) saturate(2) hue-rotate(180deg);
}

html:not([data-theme="dark"]) header > section > nav > ul > li > a:hover {
    color: #0F172A;
}

html:not([data-theme="dark"]) .menu-toggle:hover {
    color: #0F172A;
}

html:not([data-theme="dark"]) .theme-toggle,
html:not([data-theme="dark"]) .language-toggle {
    background: #F1F5F9;
    border-color: rgba(15, 23, 42, 0.14);
}

html:not([data-theme="dark"]) .boton-cv-mobile {
    background-color: #226DB4;
}

/* --- Hero --- */
html:not([data-theme="dark"]) .title__media {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .title__bio {
    color: #0F172A;
}

html:not([data-theme="dark"]) .title__subsection {
    color: #475569;
    font-weight: 400;
}

html:not([data-theme="dark"]) .hero__btn--primary {
    background: #226DB4;
    border-color: #226DB4;
    color: #FFFFFF;
}

html:not([data-theme="dark"]) .hero__btn--primary::after {
    display: none;
}

html:not([data-theme="dark"]) .hero__btn--primary:hover {
    background: #1B5A96;
    border-color: #1B5A96;
}

html:not([data-theme="dark"]) .hero__btn--secondary,
html:not([data-theme="dark"]) .hero__btn--tertiary {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.18);
    color: #0F172A;
}

html:not([data-theme="dark"]) .hero__btn--secondary:hover,
html:not([data-theme="dark"]) .hero__btn--tertiary:hover {
    background: #F1F5F9;
    border-color: rgba(15, 23, 42, 0.3);
}

html:not([data-theme="dark"]) .hero__metrics-item {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .hero__metrics-value {
    color: #226DB4;
}

html:not([data-theme="dark"]) .hero__metrics-label {
    color: #64748B;
}

html:not([data-theme="dark"]) .title__network__item > a {
    color: #334155;
}

html:not([data-theme="dark"]) .title__network__item > a::after {
    background-color: #226DB4;
}

html:not([data-theme="dark"]) .boton-curriculum {
    background: #226DB4;
    color: #FFFFFF;
}

/* --- Títulos de sección --- */
html:not([data-theme="dark"]) .title__bio,
html:not([data-theme="dark"]) .about__title,
html:not([data-theme="dark"]) .services__title,
html:not([data-theme="dark"]) .skills__title,
html:not([data-theme="dark"]) .academic__title,
html:not([data-theme="dark"]) .experience-summary__title,
html:not([data-theme="dark"]) .experience__section__title,
html:not([data-theme="dark"]) .cases__title,
html:not([data-theme="dark"]) .contact__main-title {
    color: #0F172A;
}

/* --- Sobre mí --- */
html:not([data-theme="dark"]) .about__divider {
    background: #226DB4;
    height: 3px;
}

html:not([data-theme="dark"]) .about__paragraph {
    color: #475569;
}

html:not([data-theme="dark"]) .about__meta-item {
    color: #475569;
}

html:not([data-theme="dark"]) .about__meta-item i {
    color: #226DB4;
}

/* --- Servicios --- */
html:not([data-theme="dark"]) .services__icon {
    color: #226DB4;
}

html:not([data-theme="dark"]) .services__card:hover {
    background: rgba(34, 109, 180, 0.04);
}

/* --- Skills --- */
html:not([data-theme="dark"]) .skills__subtitle {
    color: #64748B;
}

html:not([data-theme="dark"]) .skills__group--dev .skills__subtitle {
    color: #94A3B8;
}

html:not([data-theme="dark"]) .skills__container > .skills__box > ul > .skill__icon {
    color: #226DB4;
}

html:not([data-theme="dark"]) .skills__group--dev .skills__container > .skills__box > ul > li {
    color: #64748B;
}

html:not([data-theme="dark"]) .skills__group--dev .skills__container > .skills__box > ul > .skill__icon {
    color: #94A3B8;
}

/* --- Formación --- */
html:not([data-theme="dark"]) .academic__entry {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .academic__entry:hover {
    border-color: rgba(15, 23, 42, 0.22);
}

html:not([data-theme="dark"]) .academic__entry-icon {
    background: #E6F1FB;
    color: #226DB4;
}

html:not([data-theme="dark"]) .academic__entry-inst,
html:not([data-theme="dark"]) .academic__entry-period {
    color: #64748B;
}

html:not([data-theme="dark"]) .academic__extras__title {
    color: #0F172A;
}

html:not([data-theme="dark"]) .academic__extras__title::before {
    background: #226DB4;
    box-shadow: none;
}

html:not([data-theme="dark"]) .academic__extras__title:hover {
    color: #0F172A;
}

html:not([data-theme="dark"]) .academic__cert-card {
    --cert-accent: #226DB4;
    background: #FFFFFF;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
    min-height: 0;
    align-items: center;
}

html:not([data-theme="dark"]) .academic__cert-card:hover {
    background: #F8FAFC;
    box-shadow: none;
    filter: none;
}

html:not([data-theme="dark"]) .academic__cert-card .academic__cert-icon {
    background: #E6F1FB;
    border-color: transparent;
    color: #226DB4;
}

html:not([data-theme="dark"]) .academic__cert-text {
    color: #475569;
}

html:not([data-theme="dark"]) .academic__language {
    background: #FFFFFF;
    color: #334155;
}

/* --- Experiencia --- */
html:not([data-theme="dark"]) .experience-summary__intro,
html:not([data-theme="dark"]) .cases__intro,
html:not([data-theme="dark"]) .experience__section__intro,
html:not([data-theme="dark"]) .services__subtitle {
    color: #475569;
}

html:not([data-theme="dark"]) .experience-summary__card::before {
    background: #226DB4;
}

html:not([data-theme="dark"]) .experience-summary__impact {
    color: #226DB4;
}

/* --- Casos de estudio (terminal claro) --- */
html:not([data-theme="dark"]) .cases__card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .cases__card:hover {
    border-color: rgba(15, 23, 42, 0.22);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}

html:not([data-theme="dark"]) .cases__card::before {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    background: #F8FAFC;
    border-radius: 13px 13px 0 0;
}

html:not([data-theme="dark"]) .cases__eyebrow {
    color: #64748B;
}

html:not([data-theme="dark"]) .cases__card-title {
    color: #0F172A;
}

html:not([data-theme="dark"]) .cases__tags > li {
    background: #F8FAFC;
    border-color: rgba(15, 23, 42, 0.12);
    color: #334155;
}

html:not([data-theme="dark"]) .cases__block > dt {
    color: #226DB4;
}

html:not([data-theme="dark"]) .cases__block > dd {
    color: #475569;
}

html:not([data-theme="dark"]) .cases__block--result > dd {
    color: #0F172A;
}

/* --- Proyectos (grilla GitHub) --- */
html:not([data-theme="dark"]) .repo-card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .repo-card:hover {
    border-color: rgba(15, 23, 42, 0.22);
}

html:not([data-theme="dark"]) .repo-card__name {
    color: #0F172A;
}

html:not([data-theme="dark"]) .repo-card__desc {
    color: #475569;
}

html:not([data-theme="dark"]) .repo-card__lang,
html:not([data-theme="dark"]) .repo-card__glyph {
    color: #64748B;
}

html:not([data-theme="dark"]) .repo-card__link {
    color: #64748B;
    border-color: rgba(15, 23, 42, 0.14);
}

html:not([data-theme="dark"]) .repo-card__link:hover {
    color: #226DB4;
    border-color: rgba(34, 109, 180, 0.5);
    background: #F8FAFC;
}

/* --- Resumen ejecutivo (modal) --- */
html:not([data-theme="dark"]) .summary-modal__backdrop {
    background: rgba(15, 23, 42, 0.42);
}

html:not([data-theme="dark"]) .summary-modal__dialog {
    background: #FFFFFF;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .summary-modal__eyebrow {
    color: #64748B;
}

html:not([data-theme="dark"]) .summary-modal__title {
    color: #0F172A;
}

html:not([data-theme="dark"]) .summary-modal__subtitle {
    color: #475569;
}

html:not([data-theme="dark"]) .summary-modal__metric {
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

html:not([data-theme="dark"]) .summary-modal__metric-value {
    color: #226DB4;
    font-family: var(--font-mono);
}

html:not([data-theme="dark"]) .summary-modal__metric-label {
    color: #475569;
}

html:not([data-theme="dark"]) .summary-modal__close {
    background: #F1F5F9;
    color: #334155;
}

/* --- Contacto --- */
html:not([data-theme="dark"]) .contact__form-section {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .contact__badge {
    background: #F0FDF4;
    border-color: rgba(22, 163, 74, 0.35);
    color: #166534;
}

html:not([data-theme="dark"]) .contact__channel-icon {
    background: #E6F1FB;
    color: #226DB4;
}

html:not([data-theme="dark"]) .contact__channel:hover {
    background: #F8FAFC;
}

html:not([data-theme="dark"]) .form__input,
html:not([data-theme="dark"]) .form__textarea {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.16);
    color: #0F172A;
}

html:not([data-theme="dark"]) .form__input::placeholder,
html:not([data-theme="dark"]) .form__textarea::placeholder {
    color: #94A3B8;
}

html:not([data-theme="dark"]) .form__input:focus,
html:not([data-theme="dark"]) .form__textarea:focus {
    background: #FFFFFF;
    border-color: #226DB4;
    box-shadow: 0 0 0 3px rgba(34, 109, 180, 0.14);
}

html:not([data-theme="dark"]) .form__submit {
    background: #226DB4;
    color: #FFFFFF;
}

[data-theme="dark"] .form__submit {
    background: #1F65B2;
    color: #FFFFFF;
}

/* --- Footer --- */
html:not([data-theme="dark"]) .footer {
    background-color: #FFFFFF;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    color: #64748B;
}

/* --- Loader --- */
html:not([data-theme="dark"]) .loader {
    background: #FAFBFC;
}

html:not([data-theme="dark"]) .loader-content {
    color: #334155;
}
