/* ==========================================================================
   1. Global Settings & Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,500&display=swap');

:root {
    /* Color Palette */
    --color-header-bg: #262626;
    --color-content-bg: #ffffff; 
    --color-text-header: #E1E1E1;
    --color-text-body: #444444;
    --color-accent-ui: #00BCA9; /* Verde/Turquesa */
    --color-accent-ux: #FB6E22; /* Naranja */

    /* Variable for case background images */
    --case-bg-image: url(''); 
}

/* ==========================================================================
   2. Base Styles & Layout
   ========================================================================== */
html, body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--color-content-bg);
    color: var(--color-text-body);
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* CLASE DE ALINEACIÓN GLOBAL */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    text-align: left;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* ==========================================================================
   3. Header (Página Principal)
   ========================================================================== */
.main-header {
    background-color: var(--color-header-bg);
    padding: 1.5rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-header .nombre {
    font-size: 1.3125rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #999999;
}

.header-content .fingerprint-icon {
    height: 36px;
    width: auto;
    cursor: pointer;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease-in-out;
}

.header-content a:hover .fingerprint-icon {
    filter: brightness(0) invert(1) drop-shadow(0 0 4px var(--color-accent-ui));
}


/* ==========================================================================
   4. Hero Section (Página Principal)
   ========================================================================== */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 56px 0 60px 0;
}

.hero-title-wrapper {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.job-title {
    font-size: 4.025rem;
    font-weight: 700;
    color: var(--color-header-bg);
    display: flex;
    align-items: center;
    gap: 0.2ch;
    margin: 0;
}

.job-description {
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.03em;
    max-width: 70%;
    min-height: 8em;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.job-description.is-fading {
    opacity: 0;
}

.semi-bold {
    font-weight: 600;
}

/* ==========================================================================
   5. Componentes Interactivos (Página Principal)
   ========================================================================== */
.toggle-switch-container {
    position: relative;
    z-index: 2;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 32px;
    border: 3px solid var(--color-accent-ui);
    border-radius: 16px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.4s ease;
}

.toggle-label::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 23px;
    border-radius: 50%;
    background-color: var(--color-accent-ui);
    top: 5px;
    left: 4px;
    transition: transform 0.4s ease, background-color 0.4s ease;
}

.flip-card-container {
    width: calc(0.8em + 4px);
    height: calc(1.1em - 1px);
    perspective: 1000px;
    filter: drop-shadow(5px 5px 3px rgba(0, 0, 0, 0.15));
    position: relative;
    top: 0px;
    left: -7px;
    cursor: pointer;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.flip-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    box-sizing: border-box;
}

.flip-card-front {
    background-color: var(--color-accent-ui);
    color: #ffffff;
}

.flip-card-back {
    background-color: var(--color-accent-ux);
    color: #ffffff;
    transform: rotateY(180deg);
}

/* --- ANIMACIONES DE ÓRBITA Y COLOR --- */

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes color-change {
    0%    { background-color: #bbbbbb; }
    20%   { background-color: var(--color-accent-ux); }
    30%   { background-color: var(--color-accent-ux); }
    50%   { background-color: #bbbbbb; }
    70%   { background-color: var(--color-accent-ui); }
    80%   { background-color: var(--color-accent-ui); }
    100%  { background-color: #bbbbbb; }
}

@keyframes glow-x {
    0%, 15%   { color: #E1E1E1; text-shadow: none; }
    25%       { color: var(--color-accent-ux); text-shadow: 0 0 5px rgba(251, 110, 34, 0.4); }
    35%, 100% { color: #E1E1E1; text-shadow: none; }
}

@keyframes glow-i {
    0%, 65%   { color: #E1E1E1; text-shadow: none; }
    75%       { color: var(--color-accent-ui); text-shadow: 0 0 5px rgba(0, 188, 169, 0.4); }
    85%, 100% { color: #E1E1E1; text-shadow: none; }
}

.orbit-container {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* <<<<<<< CORRECCIÓN DE ALINEACIÓN >>>>>>> */
    /* Empujamos el contenedor a la izquierda para compensar la "X" que sobresale */
    margin-right: 32px; 
}

.orbit-label {
    position: absolute;
    width: 30px;
    text-align: center;
    font-size: 1.9rem; 
    font-weight: 700;
    color: #E1E1E1;
    z-index: 1;
    user-select: none;
    top: 50%;
    transform: translateY(-50%);
}

.label-i {
    left: -32px; 
    animation: glow-i 3s linear infinite;
}

.label-x {
    right: -32px; 
    animation: glow-x 3s linear infinite;
}

.orbit-path {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed transparent;
    border-radius: 50%;
    z-index: 1;
}

.orbit-group {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: orbit 3s linear infinite;
    transform: rotate(0deg); 
}

.orbit-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: -4px;
    left: calc(50% - 4px);
    animation: color-change 3s linear infinite;
}


/* ==========================================================================
   6. Sección de Casos (Página Principal)
   ========================================================================== */
.cases-section {
    padding: 0 0 4rem 0;
}

.cases-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-header-bg);
    margin-bottom: 1.5rem;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.cases-title.is-fading {
    opacity: 0;
}

.cases-list {
    display: flex;
    flex-direction: column;
    gap: 2.4375rem;
}

.case-link {
    text-decoration: none;
    color: inherit;
}

.case-item {
    position: relative;
    width: 100%;
    height: 360px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    cursor: pointer;
}

.case-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--case-bg-image);
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) brightness(50%);
    transition: filter 0.5s ease-in-out;
}

.case-item:hover::before {
    filter: grayscale(0) brightness(100%);
}

.case-text-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 2.5rem 2.5rem 0.4rem 2.5rem;
    box-sizing: border-box;
    background: none;
    color: #ffffff;
}

.case-title, .case-subtitle {
    background-color: rgba(38, 38, 38, 0.9);
    padding: 6px;
    display: table;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.case-title {
    font-size: 1.6875rem;
    font-weight: 700;
    color: var(--color-accent-ui);
    margin: 0;
    margin-bottom: 0.5rem;
    transition: color 0.4s ease-in-out, opacity 0.3s ease-in-out;
}

.case-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-top: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease-in-out;
}

.case-title.is-fading, .case-subtitle.is-fading {
    opacity: 0;
}

/* ==========================================================================
   7. Modificador de Estado Global (Modo UX)
   ========================================================================== */
body.ux-mode .toggle-label {
    border-color: var(--color-accent-ux);
}

body.ux-mode .toggle-label::before {
    transform: translateX(30px);
    background-color: var(--color-accent-ux);
}

body.ux-mode .flip-card {
    transform: rotateY(180deg);
}

body.ux-mode .case-title {
    color: var(--color-accent-ux);
}

/* ==========================================================================
   8. Animación de Partículas
   ========================================================================== */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

.particle--small {
    width: 5px;
    height: 5px;
}

/* ==========================================================================
   9. Diseño Responsivo
   ========================================================================== */
@media (max-width: 768px) {
    .job-title { font-size: 3.22rem; }
    .job-description { font-size: 1.375rem; max-width: 80%; }
    .case-item { height: 280px; }
    .case-title { font-size: 1.425rem; }
    .case-subtitle { font-size: 1rem; }
}

@media (max-width: 480px) {
    .job-title { font-size: 2.53rem; }
    .job-description { font-size: 1.2rem; max-width: 100%; }
    .case-item { height: 220px; }
    .case-title { font-size: 1.2rem; }
    .case-subtitle { font-size: 0.9rem; }
}

/* ==========================================================================
   10. Case Study Page Styles (Header y Hero)
   ========================================================================== */
div.case-top-bar {
    background-color: var(--color-accent-ux);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.case-top-bar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.case-top-bar a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 14px solid currentColor; 
    margin-right: 12px;
    margin-bottom: 2px;
}

div.case-top-bar.about-top-bar {
    background-color: var(--color-header-bg);
}
.about-top-bar a {
    color: #ffffff;
}


.case-hero {
    position: relative;
    width: 100%;
    height: 748px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    color: #ffffff;
}
#case-hero-1 {
    background-image: url('images/case-1-ux.jpg');
}
#case-hero-2 {
    background-image: url('images/case-2-ux.jpg');
}
#case-hero-3 {
    background-image: url('images/case-3-ux.jpg');
}
.case-hero .container {
    padding-top: 0;
    padding-bottom: 2rem;
}

.case-hero-title, .case-hero-subtitle {
    background-color: rgba(38, 38, 38, 0.9);
    padding: 8px;
    display: table;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.case-hero-title {
    color: var(--color-accent-ux); 
    font-size: 2.013rem;
    font-weight: 700;
    margin: 0;
    margin-bottom: 0.5rem;
}
.case-hero-subtitle {
    font-size: 1.51rem;
    font-weight: 400;
    color: #ffffff;
    margin-top: 0;
    opacity: 0.9;
}

/* ==========================================================================
   11. Case Study Content Components
   ========================================================================== */
.section-light, .section-dark {
    padding: 7rem 0;
}
.section-divided {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 8rem;
}
.section-dark {
    background-color: var(--color-header-bg);
    color: var(--color-text-header);
}
.section-dark h2, .section-dark h3, .section-dark h4 {
    color: #ffffff;
}

.with-overlapping-image {
    padding-top: 8rem;
    padding-bottom: 24px;
}
.with-overlapping-image .case-body-text {
    padding-bottom: 8rem;
}


.role-box {
    background-color: var(--color-header-bg);
    color: var(--color-text-header);
    border-radius: 0;
    padding: 80px;
    margin-top: 100px;
}

.case-body-text .section-title {
    font-size: 4.8rem;
    font-weight: 700;
    margin-top: 9rem;
    margin-bottom: 1.5rem;
}

.case-body-text .section-title:first-child {
    margin-top: 0;
}

.case-body-text .section-title + p {
    font-size: 2.16rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 3.5rem;
}

.case-body-text h3 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-top: 10rem;
}

.case-body-text .section-title + h3 {
    margin-top: 2rem;
}

.role-box .section-title {
    color: #ffffff;
    margin-top: 0;
}

.case-body-text ul {
    font-size: 1.6rem;
    line-height: 1.8;
    list-style: none;
    padding-left: 0;
}
.case-body-text ul li {
    position: relative;
    padding-left: 2rem;
}
.case-body-text ul li:not(:last-child) {
    margin-bottom: 1.5rem;
}
.case-body-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    background-color: var(--color-accent-ux);
    width: 12px;
    height: 12px;
    top: 0.8em;
}
.role-box ul {
    font-size: 1.25rem;
}
.role-box ul li::before {
    top: 0.6em;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 4rem;
}
.info-card {
    border-top: 4px solid var(--color-accent-ux);
    padding-top: 1.5rem;
    text-align: left;
}
.info-header {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 1rem;
}
.info-value {
    color: var(--color-accent-ux);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.info-value span {
    display: block;
}
.info-value-large {
    color: var(--color-accent-ux);
    font-size: 3.5rem;
    font-weight: 700;
}
.info-value-long-text {
    color: var(--color-accent-ux);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
}
.info-locations {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.info-locations span {
    color: var(--color-accent-ux);
}

.personas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
}
.personas-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.case-body-text p {
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.03em;
    margin-bottom: 2rem;
}

.highlight-note {
    border-left: 4px solid var(--color-accent-ux);
    padding-left: 1.5rem;
}

.full-width-image {
    width: 100%;
    height: auto;
    margin-top: 3rem;
    display: block;
}

video.full-width-image {
    height: auto;
    max-width: 100%;
}

.ownership-list, .features-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-top: 4rem;
}
.ownership-item, .feature-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.ownership-number, .feature-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-accent-ux);
    line-height: 1;
    min-width: 5rem;
    text-align: center;
}
.ownership-content h3, .feature-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.full-bleed-image {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}
.full-bleed-image img {
    width: 100%;
    height: auto;
    display: block;
}
.section-dark + .full-bleed-image {
    margin-top: -8rem;
}

/* ==========================================================================
   12. Testimonial Section Component
   ========================================================================== */
.testimonial-section {
    background-color: var(--color-accent-ux);
    padding: 5rem 0;
}

.testimonial-content {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
}

.testimonial-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.testimonial-text {
    color: #ffffff;
}

.testimonial-author {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.testimonial-title {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

.testimonial-quote p {
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.8;
    margin: 0;
}

.section-with-video .case-body-text {
    padding-bottom: 4rem;
}

/* ==========================================================================
   13. About Me Page Styles
   ========================================================================== */
.about-page {
    padding-top: 0;
    padding-bottom: 4rem;
}

.about-page .full-bleed-image {
    margin-top: 0;
    margin-bottom: 4rem;
}

/* Estilo para los párrafos de la intro */
.about-page .intro-paragraph {
    font-weight: 300;
    font-style: italic;
    font-size: 1.8rem;
}

.about-page .intro-paragraph:first-child {
    font-size: 4.0rem; 
    font-weight: 500;
}


/* Estilo para el resto de los párrafos en la página */
.about-page p {
    font-size: 1.6rem;
    line-height: 1.8;
}


.highlight-story {
    border-left: 4px solid var(--color-text-header);
    padding-left: 2rem;
    margin: 4rem 0;
}

.about-page .highlight-story h3 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--color-text-body);
}

.about-page .highlight-story h3 + p {
    font-size: 1.9rem;
    font-weight: 500;
    font-style: italic;
    margin-top: 0;
}


@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .case-hero { height: 350px; }
    .case-hero-title { 
        font-size: 1.725rem;
    }
    .case-hero-subtitle { 
        font-size: 1.294rem;
    }
    .section-light, .section-dark, .section-with-video.section-light {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    .case-body-text .section-title {
        font-size: 3.8rem;
    }
    
    .case-body-text .section-title + p {
        font-size: 1.755rem;
    }

    .case-body-text h3 { font-size: 1.5rem; }

    .about-page .highlight-story h3 {
        font-size: 2.5rem;
    }

    .about-page .highlight-story h3 + p {
        font-size: 1.5rem;
    }

    .role-box h3, .content-box-dark h3 {
        font-size: 2.2rem;
    }
    
    .case-body-text p, .case-body-text ul, .about-page p {
        font-size: 1.3rem;
    }

    .about-page .intro-paragraph {
        font-size: 1.5rem;
    }
    
    .about-page .intro-paragraph:first-child {
        font-size: 2.8rem; 
        font-weight: 500;
    }

    .role-box, .content-box-dark {
        padding: 40px;
        margin-top: 60px;
    }
    .personas-grid {
        grid-template-columns: 1fr;
    }
    .ownership-item, .feature-item {
        flex-direction: column;
        gap: 1rem;
    }
    .ownership-number, .feature-number {
        min-width: auto;
        text-align: left;
    }
    .section-dark + .full-bleed-image {
        margin-top: -8rem;
    }
    .with-overlapping-image .case-body-text {
        padding-bottom: 4rem;
    }
    .testimonial-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
    }
}

/* ==========================================================================
   14. UI Sample Page Styles
   ========================================================================== */

/* Estilo para la barra superior de las páginas de UI. */
div.case-top-bar.ui-top-bar {
    background-color: var(--color-accent-ui);
}

/* Imagen de fondo para el primer sample de UI */
#case-hero-ui-1 {
    background-image: url('images/case-1-ui.jpg');
}

/* Imagen de fondo para el segundo sample de UI */
#case-hero-ui-2 {
    background-image: url('images/case-2-ui.jpg');
}

/* Asegura que el título del banner en las páginas de UI use el color correcto. */
.case-hero[id^="case-hero-ui-"] .case-hero-title {
    color: var(--color-accent-ui);
}

/* ==========================================================================
   15. Slideshow Component
   ========================================================================== */
.image-slideshow {
    position: relative;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.image-slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.image-slideshow img.is-visible {
    position: relative;
    opacity: 1;
}