:root {
    --ink: #162825;
    --muted: #52635f;
    --paper: #fbf7f7;
    --surface: #fffdf8;
    --forest: #173f3a;
    --forest-dark: #0d2b27;
    --sage: #8fb9ad;
    --rose: #9e4d5b;
    --blue: #315d75;
    --gold: #f4a261;
    --line: rgba(22, 40, 37, .18);
    --shadow: 0 20px 60px rgba(13, 43, 39, .14);
    --radius: 1.25rem;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--ink);
    background: var(--paper);
}

a {
    color: #1f655b;
    text-decoration-thickness: .09em;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--forest-dark);
}

img,
iframe {
    max-width: 100%;
}

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 10000;
    padding: .75rem 1rem;
    color: #fff;
    background: var(--forest-dark);
    transform: translateY(-160%);
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 1000;
}

.site-header .navbar {
    min-height: 6rem;
    padding: 1rem clamp(1rem, 4vw, 4rem);
    background: transparent;
}

.site-header__inner {
    max-width: 90rem;
    padding: 0;
}

.site-header .navbar-brand {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: .55rem .8rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .22em;
    border: 2px solid currentColor;
}

.site-header .navbar-brand:hover {
    color: var(--forest);
    background: rgba(255, 255, 255, .45);
}

.site-header .navbar-toggler {
    border: 2px solid var(--ink);
    border-radius: 0;
}

.site-header .navbar-nav {
    gap: .5rem;
    padding: 0;
}

.site-header .nav-link {
    height: auto;
    padding: .65rem 1rem;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus,
.site-header .nav-link[aria-current="page"] {
    color: #fff;
    background: var(--forest);
}

#site_wrapper,
main {
    background: transparent;
}

main {
    padding-top: 0;
}

.td_bg,
.td_bg2,
.td_bg_article {
    position: absolute;
    inset: 0 0 auto;
    width: 100%;
    height: min(52rem, 86vh);
    background: url("../images/biroix_bg2.jpg") no-repeat center / cover;
}

.td_bg::after,
.td_bg2::after,
.td_bg_article::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(247, 242, 232, .1), rgba(247, 242, 232, .78));
}

.td_bg2 {
    background-image: url("../images/biroix_bg2.jpg");
}

.td_bg_article {
    z-index: 0;
    height: 36rem;
}

#biroix,
#twodots {
    position: relative;
    text-align: center;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(15rem, 32rem) minmax(16rem, 30rem);
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 6vw, 7rem);
    min-height: min(48rem, 80vh);
    width: min(90rem, 100% - 2rem);
    margin: 0 auto;
    padding: 8rem 2rem 5rem;
}

.page-hero img {
    width: 100%;
    height: auto;
    margin: 0;
    filter: drop-shadow(0 1.25rem 2rem rgba(13, 43, 39, .18));
}

.page-hero h2 {
    width: auto;
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.25rem, 5vw, 5rem);
    font-weight: 300;
    line-height: .98;
    letter-spacing: -.045em;
    text-align: left;
}

#snow {
    display: none;
}

#download {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .55rem;
    padding: 1.25rem clamp(1rem, 4vw, 4rem);
    color: #fff;
    background: var(--forest);
}

#download .download-text {
    padding: .6rem 1.25rem;
    font-weight: 700;
}

#download .download-button,
#linkout a,
.cta-button,
.cta-button-outline {
    display: inline-block;
    margin: 0;
    padding: .8rem 1.1rem;
    color: var(--forest-dark);
    background: #fff;
    border: 2px solid #fff;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease;
}

#download .download-button {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    font-size: 1.35rem;
}

#download .download-button:hover,
#linkout a:hover,
.cta-button:hover {
    color: #fff;
    background: transparent;
    transform: translateY(-2px);
}

.cta-button-outline {
    color: #fff;
    background: transparent;
}

.cta-button-outline:hover {
    color: var(--forest-dark);
    background: #fff;
}

#variants .cta-button:hover,
#variants .cta-button:focus-visible {
    color: #fff;
    background: var(--forest-dark);
    border-color: var(--forest-dark);
}

#video {
    position: relative;
    padding: clamp(3rem, 7vw, 7rem) 1rem;
    background: var(--paper);
}

#video .container {
    width: min(64rem, 100%);
}

#video .ratio,
.video-frame {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.press-video .source {
    margin-top: 1rem;
    text-align: left;
}

.press-video .text {
    color: var(--ink);
    font-weight: 700;
}

.ratio > .yt-facade,
.yt-facade {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-facade img {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border: 0;
    margin: 0;
    padding: 0;
    transition: transform .25s ease;
}

.yt-facade:hover img {
    transform: scale(1.02);
}

.yt-facade-play {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    transition: transform .2s ease;
}

.yt-facade-play-bg {
    transition: fill .2s ease, fill-opacity .2s ease;
}

.yt-facade:hover .yt-facade-play-bg,
.yt-facade-play:focus .yt-facade-play-bg {
    fill: #f00;
    fill-opacity: 1;
}

.yt-facade:hover .yt-facade-play,
.yt-facade-play:focus {
    transform: scale(1.1);
}

.yt-facade-play:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 12px;
}

#description,
#benefits,
#variants,
#game-modes,
#audience,
#families,
#editor,
#faq,
#features,
#factsheet,
#linkout {
    position: relative;
    width: 100%;
    padding: clamp(3.5rem, 8vw, 7.5rem) clamp(1.25rem, 5vw, 5rem);
}

#description {
    color: #fff;
    background: var(--rose);
}

#description .container {
    max-width: 58rem;
}

#description p {
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    line-height: 1.55;
}

#description h3,
#benefits h3,
#variants h3,
#game-modes h3,
#audience h3,
#families h3,
#editor h3,
#faq h3,
#features h3,
#factsheet h3,
#screenshot h3 {
    max-width: 62rem;
    margin: 0 auto clamp(2rem, 5vw, 4rem);
    color: inherit;
    font-size: clamp(2rem, 4.5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.03;
    letter-spacing: -.035em;
    text-align: center;
}

#benefits,
#game-modes {
    color: #fff;
    background: var(--forest);
}

#variants,
#families {
    color: var(--ink);
    background: var(--surface);
}

#audience,
#faq {
    color: var(--ink);
    background: #dce7e3;
}

#editor {
    color: #fff;
    background: var(--blue);
}

#benefits .row,
#game-modes .row,
#audience .row {
    gap: 1rem 0;
}

.benefit-card,
.mode-card,
.audience-card {
    padding: 1.75rem !important;
    text-align: left;
    border-top: 1px solid currentColor;
}

.benefit-card h4,
.mode-card h4,
.audience-card h4 {
    color: inherit;
    font-size: 1.25rem;
}

#benefits p,
#variants p,
#game-modes p,
#audience p,
#families p,
#editor p,
#features p {
    font-size: 1.05rem;
    line-height: 1.65;
}

#variants ul,
#families ul,
#features ul,
#factsheet ul {
    list-style: square;
    text-align: left;
}

#variants li,
#families li,
#features li,
#factsheet li {
    margin-bottom: .55rem;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(.75rem, 2vw, 1.5rem);
    padding: clamp(3.5rem, 8vw, 7rem) max(1.25rem, calc((100% - 76rem) / 2));
    color: var(--ink);
    background: #b9ced4;
}

.screenshot-grid h3 {
    grid-column: 1 / -1;
}

.screenshot-grid br {
    display: none;
}

.screenshot-grid a {
    display: block;
    overflow: hidden;
    background: var(--surface);
    border-radius: .75rem;
    box-shadow: 0 .5rem 1.5rem rgba(13, 43, 39, .12);
}

.screenshot-grid img {
    display: block;
    width: 100%;
    max-width: none !important;
    height: auto;
    padding: 0 !important;
    transition: transform .35s ease;
}

.screenshot-grid a:hover img,
.screenshot-grid a:focus-visible img {
    transform: scale(1.035);
}

.press-assets .press-logo {
    grid-column: 1 / -1;
    width: min(20rem, 100%);
    margin: 0 auto;
}

#factsheet {
    color: var(--ink);
    background: var(--surface);
}

#factsheet .container {
    max-width: 78rem;
    text-align: left;
}

#factsheet .row > div {
    padding: 1.5rem;
    border-top: 1px solid var(--line);
}

#factsheet h4 {
    margin-top: 1.75rem;
    color: var(--rose);
}

#linkout {
    color: #fff;
    background: var(--forest-dark);
}

#linkout p {
    margin: 0;
    font-size: 1rem;
}

#faq .accordion {
    max-width: 62rem;
    margin: 0 auto;
    border-top: 1px solid var(--line);
}

#faq .accordion-item {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
}

#faq .accordion-button {
    padding: 1.25rem .25rem;
    color: var(--ink);
    background: transparent;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: none;
}

#faq .accordion-button:not(.collapsed) {
    color: var(--forest);
}

#faq .accordion-body {
    padding: .25rem .25rem 1.5rem;
    color: var(--ink);
    font-size: 1rem;
    text-align: left;
}

#article {
    position: relative;
    margin-top: 0;
    padding: 5rem 1.25rem;
    color: var(--ink);
    background: var(--surface);
    text-align: left;
}

article > h1 {
    position: relative;
    z-index: 1;
    min-height: 30rem;
    max-width: 62rem;
    margin: 0 auto;
    padding: 10rem 1rem 4rem;
    color: var(--ink);
    font-size: clamp(2.75rem, 7vw, 6rem);
    line-height: 1;
}

#article .container {
    max-width: 52rem;
}

#article p {
    font-size: 1.1rem;
    line-height: 1.75;
}

.site-footer {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, .78);
    background: var(--forest-dark);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.site-footer p {
    margin: 0;
    font-size: .85rem;
}

.site-footer__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a {
    color: #fff;
}

/* Level editor */
.levels-page #site_canvas {
    background: var(--blue);
}

.levels-page #header_title {
    width: 100%;
    margin: 0;
    color: var(--ink);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 300;
    text-align: center;
}

.levels-page .page-hero,
.levels-page .header_content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28rem;
    padding: 8rem 1rem 3rem;
}

#level_editor {
    position: relative;
    width: min(72rem, calc(100% - 2rem));
    margin: 0 auto 5rem;
    padding: clamp(1.25rem, 4vw, 3.5rem);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: left;
}

#level_editor h3 {
    margin: 1rem 0;
    color: var(--ink);
    font-size: clamp(1.75rem, 4vw, 3rem);
    text-align: center;
}

#level_editor #loading_banner {
    padding: 3rem;
    color: var(--forest);
    font-size: 2rem;
    text-align: center;
}

#level_editor .button-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .65rem;
    margin: 1.5rem 0;
    text-align: right;
}

#level_editor .level_show .button-bar,
#level_editor .level_edit .button-bar {
    justify-content: center;
}

.editor-icon-button {
    padding: .5rem;
    color: var(--forest);
    background: transparent;
    border: 0;
}

.editor-field {
    width: min(34rem, 100%);
    margin-right: auto;
    margin-left: auto;
}

.editor-board,
#board3 {
    width: min(100%, 32rem) !important;
    margin: 0 auto;
}

.mini-board-wrap {
    padding: 0 1rem 4rem;
}

#level_editor .level_link_row a {
    overflow-wrap: anywhere;
}

#level_editor .card {
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: .75rem;
}

#level_editor .card-content p {
    font-size: 1rem;
}

.rotating {
    animation: spin 4s linear infinite;
}

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

@media (max-width: 991px) {
    .site-header .navbar-collapse {
        margin-top: .75rem;
        padding: .75rem;
        background: var(--surface);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .page-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: 44rem;
        padding-top: 8rem;
    }

    .page-hero img {
        width: min(25rem, 90%);
        margin: 0 auto;
    }

    .page-hero h2 {
        max-width: 38rem;
        margin: 0 auto;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .container {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .screenshot-grid {
        grid-template-columns: 1fr 1fr;
    }

    .screenshot-grid h3,
    .press-assets .press-logo {
        grid-column: 1 / -1;
    }

    #level_editor .button-bar .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 520px) {
    .site-header .navbar {
        min-height: 5rem;
    }

    .page-hero {
        min-height: 38rem;
        padding-right: .75rem;
        padding-left: .75rem;
    }

    #download {
        align-items: stretch;
    }

    #download .download-text {
        flex: 1 1 9rem;
    }

    .screenshot-grid {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .levels-page .header_content {
        min-height: 23rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
