/* mia.max Games: asphalt, road markings and a departures board */

:root {
    --asphalt: #24272c;
    --asphalt-2: #2d3137;
    --tile: #17191c;
    --chalk: #eeece6;
    --steel: #9aa1aa;
    --marking: #f5c542;
    --go: #6fd36a;
    --line: rgba(238, 236, 230, 0.12);

    --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    --body: "Barlow", "Segoe UI", system-ui, sans-serif;

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background-color: var(--asphalt);
    /* faint asphalt grain */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    color: var(--chalk);
    font: 400 1.0625rem/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--marking);
    outline-offset: 3px;
    border-radius: 2px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: 16px;
    top: -60px;
    padding: 10px 14px;
    background: var(--marking);
    color: var(--tile);
    font-weight: 600;
    z-index: 20;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(36, 39, 44, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.topbar__logo img { width: clamp(140px, 30vw, 200px); }

.topbar__nav {
    display: flex;
    gap: clamp(14px, 3vw, 32px);
}

.topbar__nav a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--steel);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

.topbar__nav a:hover,
.topbar__nav a[aria-current="page"] {
    color: var(--chalk);
    border-color: var(--marking);
}

@media (max-width: 480px) {
    .topbar__extra { display: none; }
}

/* ---------- Hero ---------- */

.hero {
    padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
    /* the lane marking that leads down into the games */
    background:
        repeating-linear-gradient(90deg, var(--marking) 0 56px, transparent 56px 96px)
        bottom / 100% 6px no-repeat;
}

.hero__title {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(3.25rem, 11vw, 9.5rem);
    line-height: 0.9;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.hero__intro {
    max-width: 38em;
    margin: 28px 0 clamp(40px, 6vw, 64px);
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: var(--steel);
}

/* ---------- Departures board ---------- */

.board {
    --cell: clamp(16px, calc((100vw - 2 * var(--gutter) - 440px) / 22), 30px);
    background: #151719;
    border: 1px solid #383c43;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.04), 0 30px 60px -30px rgba(0,0,0,.6);
}

.board__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px 14px;
    border-bottom: 1px solid #2f3339;
}

.board__title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1;
    text-transform: uppercase;
    color: var(--marking);
}

.board__clock {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board__city {
    color: var(--steel);
    font-weight: 500;
    font-size: 0.95rem;
}

.flaps.flaps--clock {
    --cell: clamp(16px, 4.5vw, 22px);
    flex-wrap: nowrap;
}

.flap--sep {
    background: none;
    box-shadow: none;
    width: calc(var(--cell) * .45);
    color: var(--steel);
}
.flap--sep::after { display: none; }

.board__head,
.board__row {
    display: grid;
    grid-template-columns: calc(22 * (var(--cell) + 2px)) minmax(0, 1fr) 10.5rem;
    gap: 24px;
    align-items: center;
    padding: 12px 14px;
}

.board__head {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--marking);
    padding-top: 6px;
    padding-bottom: 8px;
}

.board__row {
    text-decoration: none;
    border-top: 1px solid #2f3339;
    border-radius: 6px;
    transition: background-color .15s;
}

.board__row:hover { background: #1f2226; }
.board__row:hover .flap { color: var(--marking); }

.board__genre { color: var(--steel); }

/* the name cells: one tile per character */
.flaps {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 2px;
    font-family: var(--display);
    font-weight: 600;
    font-size: calc(var(--cell) * 0.86);
    line-height: 1;
}

.flap-word {
    display: flex;
    gap: 2px;
}

.flap {
    flex: none;
    position: relative;
    display: grid;
    place-items: center;
    width: var(--cell);
    height: calc(var(--cell) * 1.4);
    background: linear-gradient(#363a41 0 50%, #2d3137 50% 100%);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
    color: #f6f4ee;
    overflow: hidden;
    transition: color .15s;
}

/* hinge line across the middle of each tile */
.flap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, .7);
}

.flap--blank { color: transparent; background: linear-gradient(#24272c 0 50%, #202327 50% 100%); }

.flap.is-flipping { animation: flip 70ms linear; }

@keyframes flip {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(.55); filter: brightness(.7); }
    100% { transform: scaleY(1); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* status lamps */
.lamp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.lamp::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.lamp--live { color: var(--go); }
.lamp--soon { color: var(--marking); }
.lamp--old { color: var(--steel); }
.lamp--old::before { box-shadow: none; opacity: .6; }

@media (max-width: 1000px) {
    .board {
        --cell: clamp(12px, calc((100vw - 2 * var(--gutter) - 66px) / 16), 26px);
        padding: 6px;
    }

    .board__head { display: none; }

    .board__row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 16px;
        padding: 12px 8px;
    }

    .board__row .flaps { grid-column: 1 / -1; }
    .board__row:first-of-type { border-top: 0; }
}

/* ---------- How the games work ---------- */

.deal {
    padding: clamp(56px, 8vw, 96px) 0;
}

.deal__title {
    margin: 0 0 32px;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    text-transform: uppercase;
    line-height: 1;
}

.deal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(24px, 4vw, 56px);
}

.deal__list li {
    border-top: 3px solid var(--marking);
    padding-top: 18px;
}

.deal__list h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 600;
}

.deal__list p {
    margin: 0;
    color: var(--steel);
}

@media (max-width: 760px) {
    .deal__list { grid-template-columns: 1fr; }
}

/* ---------- Games ---------- */

.game {
    padding: clamp(48px, 7vw, 88px) 0;
    border-top: 1px solid var(--line);
}

.game__pic {
    width: 100%;
    border-radius: 10px;
    background: var(--asphalt-2);
}

.game__body {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(24px, 5vw, 72px);
    margin-top: clamp(28px, 4vw, 48px);
}

.game__name {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.5rem, 5.5vw, 4.25rem);
    line-height: 0.92;
    text-transform: uppercase;
}

.game__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 14px 0 28px;
    color: var(--steel);
}

.facts {
    margin: 0;
    display: grid;
    gap: 14px;
}

.facts div {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.facts dt {
    color: var(--accent, var(--marking));
    font-weight: 600;
}

.facts dd { margin: 0; }

.game__text { max-width: 40em; }

.game__text p { margin: 0 0 1em; color: #d4d2cc; }

.game__text .game__lead {
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    line-height: 1.4;
    font-weight: 500;
    color: var(--chalk);
}

.game__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    margin-top: 28px;
}

.btn {
    display: inline-block;
    padding: 14px 24px;
    background: var(--accent, var(--marking));
    color: var(--tile);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: filter .15s, transform .15s;
}

.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

button.btn { border: 0; font: inherit; font-weight: 600; cursor: pointer; }

.btn--gold { background: #e3b860; }

.btn--ghost {
    background: transparent;
    color: var(--chalk);
    box-shadow: inset 0 0 0 2px rgba(238, 236, 230, .45);
}

.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--chalk); filter: none; }
.btn:active { transform: translateY(0); }

.btn--off,
.btn--off:hover {
    background: transparent;
    filter: none;
    color: var(--accent, var(--marking));
    border: 2px dashed var(--accent, var(--marking));
    padding: 12px 22px;
    transform: none;
}

.link {
    color: var(--chalk);
    text-decoration: underline;
    text-decoration-color: var(--marking);
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.link:hover { color: var(--marking); }

@media (max-width: 860px) {
    .game__body { grid-template-columns: 1fr; }
}

/* ---------- Media + trailer ---------- */

.media {
    position: relative;
    margin: 0;
}

.media img { border-bottom: 4px solid var(--accent, var(--marking)); }

.trailer {
    position: absolute;
    left: clamp(12px, 2.5vw, 28px);
    bottom: clamp(16px, 2.5vw, 32px);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(23, 25, 28, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--chalk);
    font: 600 1rem/1 var(--body);
    cursor: pointer;
    transition: background-color .15s;
}

.trailer:hover { background: rgba(23, 25, 28, .95); }

.trailer--inline {
    position: static;
    background: rgba(23, 25, 28, .55);
}

/* ---------- Godwake band on the home page ---------- */

.feature-gw {
    --accent: #e3b860;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(72px, 12vw, 160px) 0 clamp(56px, 8vw, 96px);
    background: #1d1f30;
}

.feature-gw__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.feature-gw::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to right, rgba(29, 31, 48, .94) 0%, rgba(29, 31, 48, .78) 45%, rgba(29, 31, 48, .2) 100%),
        linear-gradient(to top, rgba(29, 31, 48, .8), transparent 50%);
}

.feature-gw__title { margin: 0; }

.feature-gw__title img {
    width: min(520px, 80vw);
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .5));
}

.feature-gw__tagline {
    margin: 16px 0 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    color: #efe6d2;
}

.feature-gw__text {
    max-width: 34em;
    margin: 14px 0 0;
    color: #d8d2e2;
}

@media (max-width: 760px) {
    .feature-gw::after {
        background: linear-gradient(to top, rgba(29, 31, 48, .96) 30%, rgba(29, 31, 48, .55));
    }
}

.trailer__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent, var(--marking));
    transition: transform .15s;
}

.trailer__icon::before {
    content: "";
    margin-left: 3px;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent var(--tile);
}

.trailer:hover .trailer__icon { transform: scale(1.08); }

.trailer__len {
    color: var(--steel);
    font-weight: 500;
}

@media (max-width: 520px) {
    .trailer { font-size: .9rem; padding-right: 14px; gap: 10px; }
    .trailer__icon { width: 32px; height: 32px; }
    .trailer__len { display: none; }
}

.player {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: none;
    max-height: none;
    overflow: visible;
}

.player::backdrop {
    background: rgba(12, 13, 15, .88);
    backdrop-filter: blur(4px);
}

.player__frame {
    width: min(92vw, calc(84vh * 16 / 9), 1120px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}

.player.is-portrait .player__frame {
    width: min(92vw, calc(84vh * 9 / 16), 460px);
    aspect-ratio: 9 / 16;
}

.player__frame iframe,
.player__frame video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.player.is-image .player__frame {
    width: min(94vw, calc(86vh * 16 / 9), 1600px);
}

.player__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player__close {
    position: absolute;
    top: -52px;
    right: 0;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--chalk);
    color: var(--tile);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
    .player[open] { animation: player-in .2s ease-out; }
}

@keyframes player-in {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: none; }
}

/* ---------- Studio ---------- */

.studio {
    padding: clamp(56px, 8vw, 104px) 0;
    background: var(--asphalt-2);
    border-top: 1px solid var(--line);
}

.studio__inner {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
}

.studio__title {
    margin: 0 0 20px;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.studio__text { max-width: 40em; }
.studio__text p { color: #d4d2cc; }

.studio { --accent: #5b9bd5; }

.studio__media {
    transform: rotate(1.5deg);
}

.studio__pic {
    border-radius: 10px;
    box-shadow: 0 24px 48px -24px rgba(0,0,0,.7);
}

@media (max-width: 860px) {
    .studio__inner { grid-template-columns: 1fr; }
    .studio__media { transform: none; }
}

/* ---------- Document pages (privacy policies, account deletion) ---------- */

.doc-head {
    padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px);
    background:
        repeating-linear-gradient(90deg, var(--marking) 0 56px, transparent 56px 96px)
        bottom / 100% 6px no-repeat;
}

.doc-head h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.75rem, 8vw, 6rem);
    line-height: 0.92;
    text-transform: uppercase;
}

.doc-head p {
    max-width: 38em;
    margin: 20px 0 0;
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--steel);
}

.doc-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: clamp(32px, 6vw, 88px);
    padding-top: clamp(40px, 6vw, 72px);
    padding-bottom: clamp(56px, 8vw, 104px);
}

.doc-index {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.doc-index h2 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--steel);
}

.doc-index ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
}

.doc-index a {
    display: block;
    margin-left: -2px;
    padding: 7px 0 7px 16px;
    border-left: 2px solid transparent;
    color: var(--steel);
    text-decoration: none;
    line-height: 1.3;
    transition: color .15s, border-color .15s;
}

.doc-index a:hover { color: var(--chalk); }

.doc-index a.is-current {
    color: var(--chalk);
    border-left-color: var(--marking);
    font-weight: 500;
}

.doc {
    max-width: 44em;
    padding-bottom: clamp(40px, 6vw, 64px);
    margin-bottom: clamp(40px, 6vw, 64px);
    border-bottom: 1px solid var(--line);
}

.doc:last-child { border-bottom: 0; margin-bottom: 0; }

.doc__name {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.25rem, 4.5vw, 3.25rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.doc__meta {
    margin: 10px 0 28px;
    color: var(--steel);
}

.doc h3 {
    margin: 2em 0 0.4em;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--chalk);
}

.doc p,
.doc li { color: #d4d2cc; }

.doc p { margin: 0 0 1em; }

.doc ul {
    margin: 0 0 1em;
    padding-left: 1.2em;
}

.doc li::marker { color: var(--marking); }

.doc li p { margin: 0 0 0.4em; }

.doc a {
    color: var(--chalk);
    text-decoration: underline;
    text-decoration-color: var(--marking);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.doc a:hover { color: var(--marking); }

@media (max-width: 900px) {
    .doc-layout { grid-template-columns: 1fr; }

    .doc-index {
        position: static;
        max-height: none;
    }

    .doc-index ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border: 0;
    }

    .doc-index a {
        margin: 0;
        padding: 7px 12px;
        border: 1px solid var(--line);
        border-radius: 6px;
    }

    .doc-index a.is-current { border-color: var(--marking); }
}

.doc-layout--single { grid-template-columns: minmax(0, 1fr); }

/* ---------- Footer ---------- */

.footer {
    padding: 40px 0 48px;
    border-top: 6px solid var(--marking);
    background: var(--tile);
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
}

.footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.footer__nav a {
    color: var(--steel);
    text-decoration: none;
}

.footer__nav a:hover { color: var(--chalk); text-decoration: underline; }

.footer__copy {
    width: 100%;
    margin: 0;
    color: #6f757d;
    font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
