/* Dee1Games public site.

   The games are glossy, rounded, saturated pieces sitting on a grid. So is the site:
   one deep grape board, ruled into cells, with white tiles seated on it. Tiles carry a
   solid bottom edge instead of a blurred shadow — a piece has thickness, not a shadow.
   Colour is spent on two accents only: berry for anything you can press, candy for the
   brand mark. Everything else is board, tile, or ink. */

:root {
    --grape: #2b1259;
    --grape-deep: #180838;
    --milk: #fff6fa;
    --berry: #ff3d77;
    --berry-deep: #c9134c;
    --candy: #ffc53d;

    --tile: #ffffff;
    --tile-edge: #d6c4ea;
    --ink: #2b1259;
    --ink-soft: #6c5a88;
    --on-board: #ffffff;
    --on-board-soft: rgba(255, 255, 255, .72);

    --display: "Fredoka", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --body: "Rubik", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

    --shell: 71rem;
    --cell: 72px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    /* Short pages — the 404 — still park the footer at the bottom of the window
       instead of leaving bare board underneath it. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--grape);
    /* The board itself: one ruled cell, tiled. Sections with their own background
       paint over it, so the grid runs unbroken behind the masthead, hero and games. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Crect x='6' y='6' width='60' height='60' rx='18' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2'/%3E%3C/svg%3E");
    background-position: center -6px;
    color: var(--on-board);
    font: 400 17px/1.65 var(--body);
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 500;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

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

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10;
    padding: .75rem 1.25rem;
    background: var(--candy);
    color: var(--ink);
    font-family: var(--display);
    text-decoration: none;
}

.skip:focus {
    left: 1rem;
    top: 1rem;
}

/* Masthead ------------------------------------------------------------------- */

.masthead {
    padding: 1.35rem 0;
}

.masthead_i {
    display: flex;
    align-items: center;
    gap: 1rem 1.75rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-right: auto;
    text-decoration: none;
}

.brand_mark {
    flex: none;
}

.brand_name {
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.nav {
    display: flex;
    gap: 1.5rem;
    font-size: .95rem;
}

.nav a {
    color: var(--on-board-soft);
    text-decoration: none;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: var(--on-board);
    border-bottom-color: var(--berry);
}

.langs {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
}

.langs_i {
    padding: .3rem .85rem;
    border-radius: 999px;
    color: var(--on-board-soft);
    font-family: var(--display);
    font-size: .85rem;
    line-height: 1.4;
    text-decoration: none;
}

.langs_i:hover {
    color: var(--on-board);
}

.langs_i.is-current {
    background: var(--candy);
    color: var(--ink);
}

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

.hero {
    padding: clamp(3rem, 8vw, 5.25rem) 0 clamp(2.5rem, 6vw, 3.75rem);
}

.hero_title {
    max-width: 14ch;
    font-size: clamp(3rem, 9.5vw, 5.5rem);
    font-weight: 600;
    line-height: .95;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.hero_lede {
    max-width: 50ch;
    margin-top: 1.5rem;
    color: var(--on-board-soft);
    font-size: 1.2rem;
    line-height: 1.7;
}

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

.games {
    padding-bottom: clamp(3.5rem, 9vw, 6rem);
}

.section_h {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    letter-spacing: -.015em;
}

.games .section_h {
    margin-bottom: 1.75rem;
}

.board {
    display: grid;
    gap: 1.25rem;
}

.tile {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
        "icon text"
        "actions actions";
    gap: 1.25rem 1.35rem;
    padding: 1.5rem;
    border-radius: 22px;
    background: var(--tile);
    box-shadow: 0 7px 0 var(--tile-edge);
    color: var(--ink);
}

.tile_icon {
    grid-area: icon;
    width: 96px;
    height: 96px;
    border-radius: 24px;
}

.tile_text {
    grid-area: text;
    align-self: center;
}

.tile_name {
    display: inline;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

/* The genre rides along with the name rather than sitting under it: it is part of
   what the game is called, not a second line of its own. */
.tile_genre {
    display: inline;
    margin-left: .6rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    background: rgba(43, 18, 89, .07);
    color: var(--ink-soft);
    font-size: .8rem;
    white-space: nowrap;
}

.tile_tagline {
    margin-top: .7rem;
    color: var(--ink-soft);
    font-size: .975rem;
    line-height: 1.6;
}

.tile_actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.tile_privacy {
    color: var(--ink-soft);
    font-size: .9rem;
    text-decoration-color: rgba(108, 90, 136, .4);
    text-underline-offset: 3px;
}

.tile_privacy:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    background: var(--berry);
    box-shadow: 0 4px 0 var(--berry-deep);
    color: #fff;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
}

.button:hover {
    background: #ff5488;
}

.button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--berry-deep);
}

.button_glyph {
    width: .85em;
    height: .85em;
    fill: currentColor;
}

/* Studio and contact --------------------------------------------------------- */

.ground {
    padding: clamp(3.5rem, 9vw, 6rem) 0;
    background: var(--milk);
    color: var(--ink);
}

.ground_i {
    display: grid;
    gap: 2.5rem;
}

.studio p {
    max-width: 52ch;
    margin-top: 1.25rem;
    color: var(--ink-soft);
}

.studio .section_h {
    color: var(--ink);
}

.contact {
    align-self: start;
    padding: 1.75rem;
    border-radius: 22px;
    background: var(--grape);
    box-shadow: 0 7px 0 var(--grape-deep);
    color: var(--on-board);
}

.contact_h {
    font-size: 1.35rem;
    font-weight: 600;
}

.contact_body {
    margin-top: .75rem;
    color: var(--on-board-soft);
    font-size: .95rem;
}

.contact_mail {
    display: inline-block;
    margin-top: 1.25rem;
    color: var(--candy);
    font-family: var(--display);
    font-size: 1.05rem;
    text-underline-offset: 4px;
    word-break: break-all;
}

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

.footer {
    margin-top: auto;
    padding: 3rem 0;
    background: var(--grape-deep);
    font-size: .9rem;
}

.footer_i {
    display: grid;
    gap: 2rem;
}

.footer_rights {
    font-family: var(--display);
    font-size: 1rem;
}

.footer_policy {
    margin-top: .6rem;
}

.footer_policy a {
    color: var(--on-board-soft);
    text-underline-offset: 3px;
}

.footer_policy a:hover {
    color: var(--candy);
}

.footer_h {
    margin-bottom: .6rem;
    color: rgba(255, 255, 255, .5);
    font-family: var(--body);
    font-size: .8rem;
    font-weight: 400;
}

.footer_policies a {
    color: var(--on-board-soft);
    text-decoration: none;
}

.footer_policies a:hover {
    color: var(--candy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer_policies li + li {
    margin-top: .3rem;
}

/* 404 ------------------------------------------------------------------------ */

.gap {
    padding: clamp(4rem, 12vw, 8rem) 0 clamp(5rem, 14vw, 9rem);
}

.gap_title {
    font-size: clamp(2.25rem, 6vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -.02em;
}

.gap_body {
    max-width: 40ch;
    margin-top: 1rem;
    color: var(--on-board-soft);
}

.gap_path {
    display: inline-block;
    margin-top: 1rem;
    padding: .2rem .6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    font-size: .9rem;
    word-break: break-all;
}

.gap .button {
    margin-top: 2rem;
}

/* Layout at wider sizes ------------------------------------------------------- */

@media (min-width: 46rem) {
    .board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .tile {
        padding: 1.75rem;
    }

    .ground_i {
        grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 1fr);
        gap: 4rem;
    }

    .footer_i {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 3rem;
    }
}

@media (max-width: 30rem) {
    .tile {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .tile_icon {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }

    .nav {
        gap: 1.1rem;
        font-size: .9rem;
    }
}

/* One orchestrated moment: the tiles drop into their cells on arrival. Nothing else
   on the page moves unless a person asks it to. */

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

    .tile {
        animation: settle .5s cubic-bezier(.2, .8, .3, 1) backwards;
        animation-delay: calc(var(--settle-order, 0) * 70ms + 120ms);
    }

    @keyframes settle {
        from {
            opacity: 0;
            transform: translateY(-14px) scale(.97);
        }
    }

    .button,
    .nav a,
    .langs_i,
    .footer_policies a,
    .footer_policy a,
    .tile_privacy {
        transition: background-color .15s ease, color .15s ease, box-shadow .1s ease, transform .1s ease;
    }
}
