@font-face {
    font-family: 'Chelsea Market';
    src: url('../fonts/ChelseaMarket-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: monospace;
}

h1, h2, h3, h4, .tab-selector {
    font-family: 'Chelsea Market', monospace;
}

/* UTILITY */
.flex-center{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}


.top-5neg{ top:  -5%; } .top-0   { top:   0%; } .top-5   { top:   5%; } .top-10  { top:  10%; }
.top-15  { top:  15%; } .top-20  { top:  20%; } .top-25  { top:  25%; } .top-30  { top:  30%; }
.top-35  { top:  35%; } .top-40  { top:  40%; } .top-45  { top:  45%; } .top-50  { top:  50%; }
.top-55  { top:  55%; } .top-60  { top:  60%; } .top-65  { top:  65%; } .top-70  { top:  70%; }
.top-75  { top:  75%; } .top-80  { top:  80%; } .top-85  { top:  85%; } .top-90  { top:  90%; }
.top-95  { top:  95%; } .top-100 { top: 100%; } .top-105 { top: 105%; } .top-110 { top: 110%; }
.top-115 { top: 115%; } .top-120 { top: 120%; } 
.top-of-tops{
    z-index: 2000;
}

.tab-coral     { background: #E07A5F; }
.tab-sage      { background: #81B29A; }
.tab-amber     { background: #E9C46A; }
.tab-slate     { background: #7B9BB8; }
.tab-lavanda   { background: #B8A9C9; }
.tab-terracota { background: #C8704E; }

/* Rotations */
.rot-2neg{rotate: -2deg;}
.rot-1neg{ rotate: -1deg;}
.rot-2{ rotate: 2deg;}
.rot-1{ rotate: 1deg;}

/* HTML ELEMENTS*/

/* BACKGROUND */
html {
    /* overflow-x: hidden; */
}

main{
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a {
    color: darkgreen;
}

body {
    min-height: 1920px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: baseline;
    overflow-x: hidden;
    width: 1080px;
    background-color: #81B29A;
}


body::before {
    content: '';
    position: fixed;
    inset: -20px;
    background-image: url('../images/bg-v2.png');
    background-color: rgb(8, 50, 0);
    background-blend-mode: luminosity;
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position-y: center;
    animation: scroll-bg 200s linear infinite;
    z-index: -1;
    filter: blur(2px);
}

@keyframes scroll-bg {
    from { background-position-x: 0px; }
    to   { background-position-x: calc(-1 * var(--bg-scaled-w, 1000px)); }
}



h2{
    margin: 2rem;
    font-size: 5rem;
    font-weight: 800;
    color: lightyellow;
    /* color: rgb(23, 39, 39); */
    background-color: #E9C46A;
    padding: 1rem 3rem;
    border-radius: 2rem 2rem 0 0 ;
    box-shadow: 1rem -1rem 1rem rgba(0, 0, 0, 0.5);

    text-shadow:
        -4px -4px 16px rgba(0, 0, 0, 0.2),
         4px -4px 16px rgba(0, 0, 0, 0.2),
        -4px  4px 16px rgba(0, 0, 0, 0.2),
         4px  4px 16px rgba(0, 0, 0, 0.2);
}

h3{
    font-size: 4rem;
}

header {
    position: sticky;
    top: 0;
    width: 100%;
    align-self: stretch;
    z-index: 1000;
    background-color: rgb(8, 50, 0);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 72px;
}

.header-logo {
    font-size: 2.5rem;
    font-weight: 800;
    color: #E9C46A;
    text-decoration: none;
    font-family: monospace;
    letter-spacing: -0.02em;
}

.header-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 32px 16px 16px;
}

.hamburger-bar {
    display: block;
    width: 38px;
    height: 4px;
    background-color: #E9C46A;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.header-menu-btn.open .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.header-menu-btn.open .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.header-menu-btn.open .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.header-nav {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
    border-top: 1px solid rgba(233, 196, 106, 0.15);
}

.header-nav.open {
    max-height: 600px;
}

.header-nav a {
    color: ivory;
    text-decoration: none;
    font-size: 2rem;
    font-family: monospace;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(233, 196, 106, 0.1);
}

.header-nav a:hover {
    background-color: rgba(233, 196, 106, 0.1);
    color: #E9C46A;
}

footer{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background-color: rgb(8, 50, 0);
    color: whitesmoke;
    border-radius: 16px;
    font-size: 3rem;
    padding: 2rem;
    width: 90% !important;

}

footer>a{
    color: whitesmoke;
}

footer>div>a>img{
    width: 216px !important;
    height: auto;
}

/* CUSTOM SELECTORS */

.hero-animal-name{
    background-color: #E9C46A;
    color: #5a4c29;
    padding: 1rem;
}

.hero-animal-cientific-name{
    font-size: 3rem;
    font-weight: 300;
    font-style: italic;
}

.other-names{
    font-size: 2.5rem;
}

.hero-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
    align-items: baseline;
}

.hero-stats-label {
    font-size: 1.2rem;
    font-style: italic;
    opacity: 0.6;
    width: 100%;
}

.hero-stat {
    font-size: 1.6rem;
    background-color: #E9C46A;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

#hero-habitat .hero-stat {
    background-color: transparent;
}

#hero-habitat .hero-stat::after {
    content: ' ·';
    margin-left: 0.5rem;
}

#hero-habitat .hero-stat:last-child::after {
    content: '';
}

.tabs-content-container{
    position: relative;
    width: 100%;
    height: 960px;
    min-height: 40px !important;
    min-width: 410px !important;
    max-width: 960px;
    background-color: #F3E5AB;
    border-radius: 1rem;

}

.tab-content{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: baseline;
    pointer-events: none;
    margin: 1rem 0 2rem 2rem;
}

.tab-content .polaroid{
    pointer-events: auto;
}

.polaroid{
    position: relative;
    background: ivory;
    padding: 12px 12px 60px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: inline-block;
    height: 960px;
    width: 90%;
}

.tab-selector{
    position: absolute;
    right: 10px;
    transform: translateX(100%);
    writing-mode: vertical-lr;
    padding: 1.5rem 1rem 1.5rem 32px;
    background: ivory;
    border: none;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 0.01rem;
    font-family: monospace;
    color: white;
    text-shadow:
        -4px -4px 16px rgba(0, 0, 0, 0.2),
         4px -4px 16px rgba(0, 0, 0, 0.2),
        -4px  4px 16px rgba(0, 0, 0, 0.2),
         4px  4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 0 32px 32px 0;
}

.tab-pos-0   { top: -16px }
.tab-pos-1   { top: 116px }
.tab-pos-2   { top: 280px }
.tab-pos-3   { top: 470px }
.tab-pos-4   { top: 636px }

.hero-img{
    display: block;
    max-width: 100%;
    max-height: 768px;
    width: auto;
    height: auto;
}

.img-habitat{
    display: block;
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
}

.border-dotted{
    border: #a77777 2px dashed;
}

.habitat-map-colors{
    width: 50%;
}

.map-color-container{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    min-width: 672px;
    padding: 0 0.5rem 0.5rem 0.5rem;
}
.map-color{
    height: 2rem;
    aspect-ratio: 1;
    border: 1px black solid;
    /* margin-right: -0.2rem; */
}

.map-color-label{
    font-size: 1.8rem;

}

.map-color-extant {
    background-color: #ff0000;
}

.map-color-non-extant {
    background-color: #ffaaaa;
}

.tab-coral     { background: #E07A5F; }
.tab-sage      { background: #81B29A; }
.tab-amber     { background: #E9C46A; }
.tab-slate     { background: #7B9BB8; }
.tab-lavanda   { background: #B8A9C9; }
.tab-terracota { background: #C8704E; }

.hero-trivia-list {
    list-style: decimal;
    padding: 5rem 5rem 5rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-trivia-item {
    font-size: 2rem;
    line-height: 1.3;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.hero-trivia-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hero-encyclopedia-link {
    position: absolute;
    bottom: 14px;
    right: 14px;
    font-size: 2rem;
    text-decoration: none;
}

.hero-trivia-more {
    display: block;
    font-size: 2rem;
    margin: 1rem 3rem;
}

.textos-lista{
    margin: 2rem;
    font-size: 18px;
}

.footer-full-width{
    width: 1080px;
}

.video-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    overflow-y: auto;
    width: 100%;
    max-height: calc(960px - 72px);
}

.video-embed {
    width: 350px;
    height: 350px;
    border: none;
    display: block;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 80%;
    padding: 3rem 2rem;
    background: ivory;
    border-radius: 1.5rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    margin-bottom: 3rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 4px solid #E9C46A;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

.game-card-emoji {
    font-size: 8rem;
    line-height: 1;
}

.game-card-title {
    font-family: 'Chelsea Market', monospace;
    font-size: 4rem;
    color: #5a4c29;
}

.game-card-desc {
    font-size: 2.5rem;
    color: #5a4c29;
    font-family: monospace;
    opacity: 0.65;
}

/* ── Scale container ─────────────────────────────────────── */
html, body {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Scroll override (home page) */
html.page-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
}

html.page-scroll body {
    overflow: visible;
    height: auto;
    min-height: 0;
}

html.page-scroll .scale-container {
    position: absolute;
}

html.page-scroll header {
    position: absolute;
    width: 100%;
}

html.page-scroll main {
    padding-top: 72px;
}

.scale-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 1080px;
    height: 1920px;
    transform-origin: top left;
    display: flex;
    flex-direction: column;
    align-items: center;
}
