/* Misc. */

@media (min-aspect-ratio: 1 / 1) {
    section:nth-child(odd) a::after {
        content: " →";
    }

    section:nth-child(even) a::before {
        content: "← ";
    }
}

a {
    text-decoration: none;
}

/* Organization */

html {
    /* Space */
    padding: 0;
    margin:  0;

    /* Size */
    width:  100%;
    height: 100%;

    /* Layout */
    display:         flex;
    align-items:     flex-start;
    justify-content: safe center;
}

body {
    /* Size */
    width:     100%;
    max-width: 42cm;

    /* Space */
    padding: 0;
    margin:  0;
}

header {
    text-align: center;
}

h1 {
    padding: 0;
    margin:  0;
}

video {
    /* Space */
    padding: 0;
    margin:  0;

    /* Size */
    width: 100%;

    /* Layout */
    /* Trick to avoid the video pushing the motto outside. */
    display: block;
}

header p {
    /* Size */
    /* Trick so that the motto does not occupy extra space. */
    height: 0;

    /* Space */
    padding: 0;
    margin:  0;

    /* Position */
    position: relative;
    top:      -2.5em;
}

section {
    /* Space */
    padding: 2rem;
    margin:  0;
    gap:     4rem;

    /* Layout */
    display:           grid;
    grid-auto-flow:    column;
    grid-auto-columns: 1fr;
}

@media (min-aspect-ratio: 1 / 1) {
    section:nth-child(even) > div:first-child {
        order: 2;
    }
}

@media (max-aspect-ratio: 1 / 1) {
    section {
        display:         flex;
        flex-flow:       column nowrap;
        align-items:     stretch;
        justify-content: flex-start;
    }
}

section:nth-child(even) div div:last-child {
    text-align: left;
}

section:nth-child(odd) div div:last-child {
    text-align: right;
}

@media (max-aspect-ratio: 1 / 1) {
    section a {
        width: 100%;
    }
}

main h2 {
    margin-top: 0;
}

main a {
    /* Padding */
    padding: 0.5rem 1rem;
    margin:  0;

    /* Alignment */
    text-align: center;

    /* Border */
    border-radius: 1rem;

    /* Layout */
    display: inline-block;

    /* Misc. */
    box-sizing: border-box;
}

main img {
    width: 100%;
}

.networks {
    text-align: center;
}

.networks img {
    height: 2rem;
}

.hreflangs {
    text-align: center;
}

.hreflangs a {
    /* Space */
    padding: 0.5rem 1rem;
    margin:  0;

    /* Layout */
    display: inline-block;
}

/* Fonts */

html {
    font-family: serif;
    font-size:   14pt;
}

@media (max-aspect-ratio: 1 / 1) {
    html {
        font-size: 10pt;
    }
}

h1 {
    font-family: serif;
    font-size:   5rem;
}

header p {
    font-family: serif;
    font-size:   2rem;
}

@media (max-aspect-ratio: 5 / 4) {
    header p {
        font-size: 1rem;
    }
}

h2 {
    font-family: serif;
    font-size:   3rem;
}

p {
    font-family: sans-serif;
    font-size:   2rem;
}

main a {
    font-family: sans-serif;
    font-size:   2rem;
}

.hreflangs {
    font-family: sans-serif;
}

/* Theme */

html {
    background: #222;
}

body {
    color: #222;
}

header p {
    /* Color */
    color: white;

    /* Shadow */
    text-shadow: 0 0 1rem white;
}

main {
    background: url("/misc/pantalla.png") left top repeat-x;
}

section:nth-child(1) h2 {
    color: #BB2244;
}

section:nth-child(2) h2 {
    color: #222;
}

section:nth-child(3) h2 {
    color: indigo;
}

section:nth-child(4) h2 {
    color: grey;
}

main a {
    color: white;
}

section:nth-child(1) a {
    background: #BB2244;
    box-shadow: 0 0.25rem #990022;
}

section:nth-child(2) a {
    background: #222;
    box-shadow: 0 0.25rem black;
}

section:nth-child(3) a {
    background: indigo;
    box-shadow: 0 0.25rem #290060;
}

section:nth-child(4) a {
    background: grey;
    box-shadow: 0 0.25rem #606060;
}

main a:hover {
    opacity: 0.8;
}

.hreflangs {
    background: #F0F0F0;
}

.hreflangs a {
    color: #A0A0A0;
}

.hreflangs a:hover {
    background: #E0E0E0;
}

.hreflangs a:active {
    color:      #909090;
    background: #D0D0D0;
}

/* Animations */

body {
    animation: leche 2.5s 1s forwards;
}

@keyframes leche {
    from {
        background: black;
    }
    to {
        background: white;
    }
}

main {
    animation: fantasma 4s forwards;
}

@keyframes fantasma {
    from {
        opacity: 0;
    }
    80% {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

header p {
    animation: evanece 0.5s 3.5s forwards;
    transition: font-size 1s;
    opacity: 0;
}

@keyframes evanece {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
    }
}

section:nth-child(1) {
    animation: izquierda 1s 3.75s forwards;
    opacity: 0;
}

section:nth-child(2) {
    animation: derecha 1s 3.75s forwards;
    opacity: 0;
}

section:nth-child(3) {
    animation: izquierda 1s 3.75s forwards;
    opacity: 0;
}

section:nth-child(4) {
    animation: derecha 1s 3.75s forwards;
    opacity: 0;
}

@keyframes izquierda {
    from {
        transform: translateX(-5rem);
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes derecha {
    from {
        transform: translateX(5rem);
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

nav {
    animation: devanece 1s 4s forwards;
    opacity: 0;
}

@keyframes devanece {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
    }
}

main a:active {
    transform: translateY(0.25rem);
    box-shadow: none;
}
