@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap');

:root {
    --color-cian: #31C4CF;
    --color-text: #d2d2d2;
    --color-orange: #CF7132;
    --color-inactive: #555;
    --color-line: #333;
    --color-back: #222;
    --radius: 5px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--color-text);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000;
    font-size: 14px;
}

.tapa {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 2s ease-in-out;
}

.tapa.loaded {
    opacity: 0;
}

.loader {
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

header {
    top: 0;
    right: 0;
    width: 100%;
    padding: 60px 100px 0 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .logo {
    width: 50px;
    height: auto;
    cursor: pointer;
}

.toggle {
  position: relative;
  width: 60px;
  height: 60px;
  background: url(./img/menu.svg);
  background-repeat: no-repeat;
  background-size: 30px;
  background-position: center;
  cursor: pointer;
}

.toggle.active {
    background: url(./img/close.svg);
    background-repeat: no-repeat;
    background-size: 30px;
    background-position: center;
}

.page {
    position: relative;
    right: 0;
    z-index: 2;
    width: 100%;
    transition: 0.5s;
}

.page.active {
    right: 300px;
}

p {
    line-height: 1.6;
}

/* Icono */
.icon {
  width: 16px;
  height: 16px;
}

/* MENU */
.menu {
    position: fixed;
    z-index: 1;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu ul {
    position: relative;
    font-size: 1.2em;
    color: #FFF;
    line-height: 3;
}

.menu ul li {
    list-style: none;
}

.menu ul li a {
    display: inline-block;
    font-weight: 300;
    text-decoration: none;
    transform-origin: left center;
    transition: transform 0.3s ease, color 0.3s ease;
}

.btn-line{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* separación icono-texto */

    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 500;

    border: 1px solid;
    border-color: var(--color-line);
    background-color: transparent;
    color: #666;

    padding: 12px 32px;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    transition: border-color 0.7s ease, color  0.2s ease;
}


/* SECCIONES */
.seccion {
    padding: 60px 100px;
    font-weight: 200;
    min-height: 100vh;
}

header,
.seccion {
    background-color: #222;
}

.seccion .wrapper2 {
    max-width: 860px;
    margin: 0 auto;
}

.seccion h2 {
    padding-bottom: 20px;
    line-height: 1;
    --optical-y: -0.10em;
    transform: translateY(var(--optical-y));
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--color-cian);
    text-transform: uppercase;
}

.seccion h3 {
    padding-bottom: 20px;
    font-weight: 200;
}

.seccion.izquierda .wrapper,
.seccion.izquierda .wrapper2 {
  margin-left: 0;
  margin-right: auto;
}

.container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    transition: grid-template-columns 0.4s ease;
}

.container2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.item {
    transition: all 0.4s ease;
}

.prox {
    font-weight: 300;
    color: var(--color-cian);
}

/* Cuando hay un item activo, las columnas se redefinen */
.container:has(.item.active) {
    grid-template-columns: repeat(6, 1fr); /* se sobreescribe por JS */
}

#resultados img {
    width: 100%;
    height: auto;
    border: 1px solid var(--color-line);
    transition: all 0.4s ease;
    display: block;
}

/* ============================================
    HOVERS solo en DESK
============================================ */

@media (hover: hover) and (pointer: fine) {
    .menu ul li a:hover {
        transform: scale(1.3);
        color: var(--color-cian);
    }
    /* efecto de dock macOS */
    .menu ul li:hover + li > a {
        transform: scale(1.1) translateY(6px);
    }
    .menu ul li:has(+ li:hover) > a {
        transform: scale(1.1) translateY(-6px);
    }
    .btn-line:hover {
        border-color: var(--color-cian);
        color: var(--color-cian);
    }
}

/* ============================================
    RESPONSIVE
============================================ */

@media(min-width: 1280px) {
    .seccion .wrapper {
        width: 100%;
        margin: 0 auto;
    }
    .item {
        cursor: pointer;
    }
    #resultados img:hover {
        border-color: var(--color-cian);
    }
}

@media(max-width: 1280px) {
    .seccion {
        padding: 40px;
    }
    header {
        padding: 40px 40px 0 40px;
    }
    .container {
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 600px) {
    .seccion {
        padding: 40px;
    }
    header {
        padding: 40px 40px 0 40px;
    }
    .container,
    .container2 {
    grid-template-columns: 1fr;
    }
}