@import url(reset.css);
@import url(typography.css);
@import url(variables.css);

/* BASELINE */
html {
    scroll-behavior: smooth;
}
body {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background-color: var(--clr-background);
    color: var(--clr-foreground);
    font-family: 'Avenir Next';
    font-weight: 400;
}
#root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 1rem;
}

/* HEADER */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    padding: 1rem;
    background-color: var(--clr-background);
    z-index: 99;
}
.site-title {
    font-family: 'Neptune';
    color: var(--clr-foreground);
    text-align: center;
    font-weight: 400;
}
.site-title span {
    display: block;
}
.site-title span:first-child {
    font-size: 4rem;
    margin-bottom: -.15em;
}
.site-title span:last-child {
    font-size: 1.4rem;
}
.site-title.index-view > span {
    background: linear-gradient(to right, var(--clr-utopian), var(--clr-hybrid), var(--clr-dystopian));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background-position .7s ease;
}
/* Fallback for Firefox on iOS */
.firefox-ios .site-title.index-view span {
    background: none;
    color: var(--clr-hybrid); /* fallback */
    -webkit-text-fill-color: initial;
}

/* ORACLES VIEWPORT */
.oracles-viewport {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    overflow: scroll;
    width: min(100%, 600px);
    margin: 0 auto;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
.oracles-viewport::-webkit-scrollbar {
    display: none;
}
.site-logo {
    display: flex;
    flex-direction: column;
}
.site-logo > p {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: .7rem;
    font-weight: 400;
    font-style: italic;
    color: var(--clr-foreground);
    margin-bottom: -4rem;
    width: max-content;
}
.site-logo > p > span {
    display: block;
}

/* CAROUSEL */
.oracles-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 100%;
}

.site-logo,
.oracles-symbols > img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(75%, 230px);
    height: auto;
}
.site-logo > img {
    margin-top: -20%;
}

.oracle-symbol[data-state="hidden"] {
    display: none;
} 
.oracle-symbol[data-state="visible"] {
    display: block;
} 

/* ORACLES CONTAINER */
.oracles-container {
    position: relative;
    display: none;
}
.oracles-container.current-lang {
    display: block;
}
/* .oracles-container[data-lang='es'] {
    display: block;
} */
.oracle {
    display: none;
}
.oracle.selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 150px;
    scroll-margin-top: 100px;
}
.oracle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Neptune';
    margin-bottom: -1em;
}
.heading-symbol {
   height: 70px;
}
.heading-number {
    font-size: 5.7rem;
    text-align: center;
    margin-inline: 1rem;
    margin-bottom: -.15em;
}
.heading-descriptor {
    font-size: 1.5rem;
}
.oracle-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 98px;
    overflow: hidden;
}
.oracle-title h2 {
    font-family: 'Neptune';
    font-size: 2rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    text-align: center;
    padding-block: .5em .2em;
}
.oracle-title::before,
.oracle-title::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
}
.oracle--utopian .oracle-title::before,
.oracle--utopian .oracle-title::after {
    background-color: var(--clr-utopian);
}
.oracle--hybrid .oracle-title::before,
.oracle--hybrid .oracle-title::after {
    background-color: var(--clr-hybrid);
}
.oracle--dystopian .oracle-title::before,
.oracle--dystopian .oracle-title::after {
    background-color: var(--clr-dystopian);
}
.oracle-title::before {
    top: 0;
}
.oracle-title::after {
    bottom: 0;
}
.oracle-subtitle {
    width: 100%;
    position: relative;
    padding-block: .5em;
    margin-bottom: 1em;
    font-size: 1.5em;
    font-weight: 500;
    text-align: center;
}
.oracle-subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
}
.oracle--utopian .oracle-subtitle::after {
    background-color: var(--clr-utopian);
}
.oracle--hybrid .oracle-subtitle::after {
    background-color: var(--clr-hybrid);
}
.oracle--dystopian .oracle-subtitle::after {
    background-color: var(--clr-dystopian);
}
.oracle-content {
    font-size: 1.2rem;
    text-align: justify;
    padding-block: 2em 3em;
}
.oracle-question {
    font-size: 1.5rem;
    font-style: italic;
    text-align: center;
    padding-block: 2em 0;
}

/* INDEX VIEW */
.oracles-selector.index-view .oracles-symbols {
    width: min(100%, 600px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    align-items: center;
    justify-items: center;
}
.oracles-selector.index-view .site-logo {
    display: none;
}
.oracles-selector.index-view img {
    position: relative;
    top: 0;
    left: 0;
    transform: translate(0, 0);
    width: min(60%, 75px);
}
.oracles-selector.index-view .oracle-symbol[data-state="hidden"] {
    display: block;
}
.index-view .oracle-symbol[data-color='utopian'] {
    justify-self: flex-start;
    margin-left: 1em;
}
.index-view .oracle-symbol[data-color='dystopian'] {
    justify-self: flex-end;
    margin-right: 1em;
}

/* FOOTER */
footer {
    background-color: var(--clr-background);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: end;
    justify-content: space-between;
    width: min(100%, 600px);
    font-size: 1.2em;
    padding: .5rem 1rem;
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom));
    z-index: 99;
}
footer > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}
footer img {
    height: 40px;
}
footer button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
    border: none;
    color: var(--clr-foreground);
}
#toggle-sound.sound-off {
    filter: grayscale(1);
}

#toggle-lang-selector {
    position: relative;
}
#toggle-lang-selector > img {
    pointer-events: none;
}
.col--lang {
    position: relative;
}
#lang-selector {
    position: absolute;
    bottom: 100%;
    opacity: 0;
    transform-origin: bottom;
    transform: 
        /* translateY(-100%)     */
        scaleY(0);
    transition: all .5s ease;
}
#lang-selector.open {
    opacity: 1;
    transform: 
        /* translateY(-100%)     */
        scaleY(1);
    transition: all .2s ease;
}
#lang-selector li {
    background-color: var(--clr-background);
    display: flex;
    justify-content: center;
    text-transform: uppercase;
    padding: .5em 1.5em;
    cursor: pointer;
}
#lang-selector li:last-child {
    margin-bottom: 1em;
}

/* ALL */
*[data-color="utopian"] {
    color: var(--clr-utopian);
}
*[data-color="dystopian"] {
    color: var(--clr-dystopian);
}
*[data-color="hybrid"] {
    color: var(--clr-hybrid);
}

/* MEDIA QUERIES */
/* EXTRA SMALL DEVICES */
@media screen and (max-width: 376px) {
    .site-logo, 
    .oracles-symbols > img {
        width: min(75%, 190px);
    }
    .oracles-selector.index-view img {
        width: min(60%, 50px);
    }
}


/* TABLET PORTRAIT UP */
@media screen and (min-width: 600px) {
    .site-title div:first-child {
        font-size: 6.5rem;
    }
    .site-title div:last-child {
        font-size: 2.4rem;
    }
    .oracle.selected {
        /* margin-bottom: 100px; */
        scroll-margin-top: 150px;
    }
    .site-logo, 
    .oracles-symbols > img {
        width: min(75%, 350px);
    }
    footer button,
    #lang-selector {
        font-size: 1.5rem;
    }
    footer img {
        height: 60px;
    }
}

/* TABLET LANDSCAPE UP */
@media screen and (min-width: 900px) {
    #root {
        padding: 0;
    }
    header {
        background-color: transparent;
        padding: 1rem 2rem;
        transition: width .5s linear;
    }
    header.shrink {
        width: 50vw;
    }
    .site-title div:first-child {
        font-size: 4rem;
    }
    .site-title div:last-child {
        font-size: 2rem;
    }
    .oracles-viewport {
        flex-direction: row;
        width: 100vw;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    .oracles-selector {
        width: 100vw;
        height: 100%;
        padding-block: 120px 100px;
        transition: width .5s linear;
    }
    .site-logo, 
    .oracles-symbols > img {
        width: min(75%, 200px);
    }
    .oracles-selector.shrink {
        width: 50vw;
    }
    .oracles-selector.index-view img {
        width: min(60%, 75px);
    }
    .oracles-container {
        opacity: 0;
        width: 50vw;
        overflow-y: scroll;
        padding: 2rem 2rem 100px;
        transition: all 1s ease;
    }
    .oracles-container.active {
        opacity: 1;
    }
    .oracle.selected {
        padding-bottom: 0;
    }

    /* INDEX VIEW */
    .oracles-selector.index-view .oracles-symbols {
        width: 500px;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, min-content);
        grid-auto-flow: column;
    }
    .index-view .oracle-symbol[data-color='utopian'] {
        justify-self: center;
        margin-left: 0;
    }
    .index-view .oracle-symbol[data-color='dystopian'] {
        justify-self: center;
        margin-right: 0;
    }

    /* FOOTER */
    footer {
        background-color: transparent;
        left: 0;
        transform: translateX(0);
        justify-content: center;
        width: 100vw;
        font-size: 1.3rem;
        transition: width .5s linear;
    }
    footer.shrink {
        width: 50vw;
    }
    footer button {
        margin-inline: 1.5rem;
    }
    footer img {
        height: 40px;
    }
}

/* DESKTOP UP */
@media screen and (min-width: 1400px) {
    .site-title div:first-child {
        font-size: 6.5rem;
    }
    .site-title div:last-child {
        font-size: 2.5rem;
    }
    .site-logo > p {
        font-size: 1rem;
    }
    .site-logo, 
    .oracles-symbols > img {
        width: min(75%, 300px);
    }
    .oracles-selector.index-view .oracles-symbols {
        width: 800px;
        gap: 2em;
    }
    .oracles-selector.index-view img {
        width: min(75%, 100px);
    }
    .heading-number {
        font-size: 7rem;
    }   
    .heading-descriptor {
        font-size: 2.5rem;
    }
    .heading-number {
        margin-inline: 2.5rem;
    }
    .oracle-title {
        height: 130px;
    }
    .oracle-title h2 {
        font-size: 2.5rem;
    }
    footer img {
        height: 60px;
    }
}