:root {
    --bg: #fff;
    --fg: #111;
    --xx: (0, 0, 0, 0.1);
    --muted: #666;
    --accent: rgb(0, 187, 146);
    --violet: rgb(175, 71, 175);
}

:root[data-theme="dark"] {
    --bg: #0b0b0f;
    --fg: #e6e6e6;
    --muted: #9a9a9a;
    --accent: rgb(170, 238, 221);
    --violet: #e1b3e6;

}

:root {
    --header-height: 4rem;
}

:root[data-theme="dark"] .invert {
    filter: invert(1) hue-rotate(180deg) saturate(90%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style: none;
}

html {
    /* Esto hace que al pinchar en el menú baje deslizándose suavemente 
       en vez de dar un salto brusco */
    scroll-behavior: smooth;
}

section[id],
.panel {
    /* Aquí está la magia: le decimos al navegador que el "tope" 
       del elemento está más arriba, sumando la altura del header + un poco de aire */
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    margin: 1rem;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--header-height);
}

main {
    flex: 1 0 auto;
}

button {
    border: 1px solid var(--accent);


    border-radius: 6px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    cursor: pointer
}

a {
    color: var(--accent);
    text-decoration: none
}

li,
p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

h2,
h3,
h4 {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    color: var(--violet)
}

h2 {
    font-size: 2rem;
    color: var(--violet);
    transition: transform 0.3s, text-shadow 0.3s;

}

h2:hover {

    text-shadow: 0px 0px 15px rgba(233, 31, 206, 0.3);
}

h1 {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    color: var(--violet);
    transition: transform 0.3s, text-shadow 0.3s;
}

h1:hover {

    text-shadow: 0px 0px 15px rgba(233, 31, 206, 0.3);
}
.horizontal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tema {
    background: none;
    border: none;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.rrss-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

.site-header {
    background-color: var(--bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06)
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--fg)
}

.brand-row {
    display: flex;
    height: 2rem;
    align-items: center;
    gap: 0.6rem;
}

.brand-row .brand {
    font-size: 1.15rem;
    line-height: 1;
}

.tema {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tema .icono {
    width: 2rem;
    height: auto;
    display: block;
}

.nav {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: .95rem;
    transition: text-decoration 0.3s cubic-bezier(0.3, 0, 0.2, 1), color 0.3s cubic-bezier(0.3, 0, 0.2, 1);
}

.nav a:hover {
    color: var(--fg);
    text-decoration: underline;
}

.hero {
    background: linear-gradient(90deg, rgba(11, 119, 102, 0.06), transparent);
    padding: 3rem 0
}

.cta {
    display: inline-block;
    margin-top: 1rem;
    padding: .6rem 1rem;
    background: var(--accent);
    color: #002;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600
}

.panel {
    /* padding: 2rem 0; */
    border-top: 1px solid rgba(0, 0, 0, 0.04)
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem
}

.card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02)
}

.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px
}

.meta {
    color: var(--muted);
    font-size: .85rem
}

.site-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
    font-size: .9rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

}

.icono {
    width: 2rem;
    height: 2rem;
}

.invert {
    transition: filter .18s ease;
}

/* evitar que imágenes ensanchen la página en móviles */
img,
picture,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

.compensacion {
    width: 10rem;
    height: auto;
}

.rrss {
    width: 3rem;
    height: auto;
    margin: 0.5rem;
    transition: transform 0.3s ease;
}

.rrss:hover {
    transform: scale(1.1);
}

.contenedor-fitxas {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.fitxa {
    flex: 1 1 220px;
    border: 1px solid var(--accent);
    padding: 1rem;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.3, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.3, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.3, 0, 0.2, 1);
    cursor: pointer;
}

.fitxa:hover {
    border-color: var(--fg);
    transform: scale(1.01);
    box-shadow: 0px 0px 12px 0 rgb(70, 153, 146), 0px 0px 6px 0 rgb(198, 255, 221), 0px 0px 8px 2px rgb(102, 221, 195);
}

.fitxa:focus {
    outline: 3px solid rgba(var(--accent-rgb), 0.25);
    outline-offset: 3px;
}

.imagenes-proyecto {
    border-radius: 8px;
}

.vertical {
    width: 100%;
    display: flex;
    flex-direction: column;
    max-width: 30rem;
    gap: 1rem;
    margin: 0 auto 1rem;
}

/* Scroll to top button */
#scrollTopBtn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    transition: opacity 0.2s;
    opacity: 0.85;
}

#scrollTopBtn:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* --- ESTILOS DEL DESPLEGABLE (DETAILS/SUMMARY) --- */

details.desplegable-formacion {
    border: 1px solid rgba(243, 184, 243, 0.616);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    background-color: rgba(248, 221, 247, 0.02);
    /* Un fondo muy sutil */
    transition: background-color 0.3s ease;
}

details.desplegable-formacion[open] {
    background-color: transparent;
    /* Al abrirse se limpia */
}

summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--accent);
    /* Usamos tu verde corporativo */
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Truco para poner una flechita personalizada que rote */
summary::after {
    content: "▼";
    font-size: 1rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    /* Empuja la flecha a la derecha del todo */
}

/* Cuando el desplegable está abierto ([open]), rotamos la flecha */
details[open] summary::after {
    transform: rotate(180deg);
}

/* Quitamos el triángulo feo que ponen Safari y Chrome por defecto */
summary::-webkit-details-marker {
    display: none;
}

/* Animación suave de entrada para la lista */
details[open] ul {
    animation: fadeIn 0.4s ease-out;
    margin-top: 1rem;
    padding-left: 1rem;
    /* Indentamos un poco la lista */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    #scrollTopBtn {
        right: 1rem;
        bottom: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    #scrollTopBtn svg {
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0;
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}