/* Rigged Games - index, projects, contact.
   The older privacy policy pages still load styles.css - leave that file alone.

   Palette: one violet hue (~277) held across every surface, stepping up in
   lightness as things sit closer to the reader. Links are an analogous
   lavender so the page stays purple-led; amber is the only other hue, used
   for actions - it sits near the split-complement of violet, so it stands
   out without fighting.

   Type: Archivo, self-hosted. One variable file carries both a weight axis
   (100-900) and a width axis (62-125%), so headings run condensed and heavy
   off the same download the body text uses. Sizes follow a 1.25 ratio. */

/* Archivo - SIL Open Font License 1.1, see fonts/OFL.txt */
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --page:        #1e1226;   /* hsl(277 37% 11%) - furthest back  */
    --panel:       #271733;   /* hsl(277 38% 14%) - raised off the page */
    --card:        #342141;   /* hsl(277 33% 19%) - raised again */
    --card-lit:    #3f2a4e;   /* card, focused */
    --edge:        #4a3159;   /* hsl(280 29% 27%) - borders */

    --text:        #f2ecf7;   /* violet-tinted white, not blue-white */
    --text-soft:   #b9a8c9;   /* 6.6:1 on --card */

    --link:        #c9a6f0;   /* 8.5:1 on --page, 6.8:1 on --card */
    --link-lit:    #ffffff;

    --action:      #f5b942;   /* amber - buttons only */
    --action-lit:  #ffcd6b;
    --on-action:   #241428;

    /* body face at normal width, display face at condensed width */
    --face: 'Archivo', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    --face-display: 'Archivo', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;

    /* 1.25 ratio from a 17px base */
    --f--1:  0.85rem;
    --f-0:   1.0625rem;
    --f-1:   1.33rem;
    --f-2:   1.66rem;
    --f-3:   2.08rem;
    --f-4:   2.59rem;
    --f-5:   3.24rem;
    --f-6:   4.05rem;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background-color: var(--page);
    color: var(--text);
    font-family: var(--face);
    font-size: var(--f-0);
    font-stretch: 100%;
    line-height: 1.6;
    text-align: center;
    -webkit-font-smoothing: antialiased;
}

/* condensed and heavy - the width axis is what separates these from the body */
h1, h2, h3 {
    font-family: var(--face-display);
    font-stretch: 75%;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
}

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

a {
    color: var(--link);
    transition-duration: 0.3s;
}

a:hover, a:focus-visible { color: var(--link-lit); }

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

/* ---------- navbar ---------- */

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    list-style-type: none;
    margin: 0;
    padding: 1rem;
}

nav li { margin: 0; }

nav a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: var(--f-0);
    font-weight: 500;
    text-decoration: none;
}

nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* ---------- hero ---------- */

.fixed-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 300px;
    padding: 3rem 1.25rem;
    background-image: url(Images/PatotiaSea.jpg);
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0px 0px 24px 2px black;
}

/* the wordmark - set wider and lighter than the section headings, because a
   studio mark and a heading are doing different jobs. the rules and the open
   tracking are what make it read as a name rather than a title. the trailing
   letter-space is cancelled by an equal text-indent so it stays optically centred. */
.fixed-bg h1 {
    font-size: var(--f-2);
    font-stretch: 88%;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;
    text-indent: 0.12em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    border-top: 3px solid var(--text);
    border-bottom: 3px solid var(--text);
    text-shadow: 4px 4px 24px #000000;
}

.fixed-bg p {
    margin: 0;
    font-size: var(--f-1);
    font-weight: 500;
    text-shadow: 4px 4px 24px #000000;
}

/* height matters as much as width here: a 500px hero on a rotated phone
   (844x390) would fill 128% of the screen, so cap it against the viewport
   too and let whichever is smaller win. */
@media (min-width: 700px) {
    .fixed-bg { min-height: min(500px, 78vh); }
    .fixed-bg h1 {
        font-size: var(--f-4);
        letter-spacing: 0.16em;
        text-indent: 0.16em;
        padding: 0.6rem 0;
    }
    .fixed-bg p { font-size: var(--f-2); font-stretch: 90%; }
}

/* short and wide - rotated phones, half-height desktop windows */
@media (max-height: 520px) {
    .fixed-bg {
        min-height: 0;
        padding: 1.75rem 1.25rem;
        background-attachment: scroll;
    }
    .fixed-bg h1 { font-size: var(--f-2); padding: 0.4rem 0; }
    .fixed-bg p { font-size: var(--f-1); }
    .description, .games, .container { margin: 1.5rem auto; }
}

/* the original used background-attachment: fixed, which mobile browsers
   either ignore or render badly, so it's desktop-only now */
@media (min-width: 700px) and (hover: hover) {
    .fixed-bg { background-attachment: fixed; }
}

/* ---------- panels ---------- */

/* width: min(...) rather than max-width, so panels keep a gutter instead of
   running into the screen edge on a narrow phone */
.description, .games, .container {
    width: min(46rem, 100% - 2rem);
    margin: 2.5rem auto;
    padding: 1.5rem;
    border-radius: 5px;
    background-color: var(--panel);
}

/* paragraphs read left-aligned - centring is for a line or two, not prose:
   it leaves no fixed edge for the eye to return to on each new line */
.description p {
    max-width: 66ch;
    margin: 0 0 1rem;
    text-align: left;
}

.description p:last-child { margin-bottom: 0; }

h2 { font-size: var(--f-2); margin: 0 0 1rem; }

/* ---------- two-up on wide screens ---------- */

/* a lone 46rem panel adrift in a 1920px window is the landscape problem;
   pairing the prose with the follow links fills the width honestly, without
   stretching either one past its comfortable measure */
/* stretch, not start: a matched pair of panels reads as deliberate, whereas
   two different heights sitting side by side just looks misaligned */
.split {
    width: min(46rem, 100% - 2rem);
    margin: 2.5rem auto;
    display: grid;
    gap: 1rem;
    align-items: stretch;
}

.split > * { width: 100%; margin: 0; }

@media (min-width: 1000px) {
    .split { width: min(74rem, 100% - 3rem); grid-template-columns: 1.7fr 1fr; }
    .split .description, .split .container { text-align: left; }
    .split .follow { flex-direction: column; align-items: stretch; }
    .split .follow a { text-align: left; }
}

/* ---------- games ---------- */

/* cards are matched height: every card reserves an image slot and three lines
   of text, and the links are pinned to the bottom, so a row lines up */
.games { display: grid; gap: 1rem; align-items: stretch; }

@media (min-width: 780px) {
    .games { max-width: 60rem; grid-template-columns: 1fr 1fr; }
}

/* wide monitors: three across rather than a narrow ribbon down the middle.
   the reading column stays put - only the grid earns the extra width. */
@media (min-width: 1200px) {
    .games { max-width: 74rem; grid-template-columns: repeat(3, 1fr); }
    .fixed-bg { min-height: min(620px, 74vh); }
    .fixed-bg h1 { font-size: var(--f-5); }
}

.game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    background-color: var(--card);
    transition-duration: 0.3s;
}

.game:hover { border-color: var(--link); background-color: var(--card-lit); }

.game h2 { margin: 0; font-size: var(--f-1); font-stretch: 80%; }

.game p {
    margin: 0;
    max-width: 46ch;
    font-size: var(--f-0);
    color: var(--text-soft);
}

/* reserve three lines whether or not the text fills them, so short blurbs
   don't pull their card out of line with the rest of the row */
.game .blurb { min-height: calc(3 * 1.6 * var(--f-0)); }

/* only clamp when the toggle can actually be added - without scripting the
   full text stays visible rather than being silently cut off */
.js .game .blurb {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.js .game .blurb.open {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.game .more {
    padding: 0;
    font-family: var(--face);
    font-size: var(--f--1);
    font-weight: 600;
    color: var(--link);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    transition-duration: 0.3s;
}

.game .more:hover, .game .more:focus-visible { color: var(--link-lit); }

.game img, .game .shot-placeholder {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}

.game img { object-fit: cover; }

/* keeps an unreleased game the same shape as the rest of the row */
.game .shot-placeholder {
    display: grid;
    place-items: center;
    border: 1px dashed var(--edge);
    font-size: var(--f--1);
    color: var(--text-soft);
}

.game .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-top: auto;
    padding-top: 0.25rem;
    font-size: var(--f--1);
}

/* ---------- follow ---------- */

.follow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.follow a {
    display: block;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    background-color: var(--card);
    font-weight: 600;
    text-decoration: none;
    transition-duration: 0.3s;
}

.follow a:hover, .follow a:focus-visible {
    border-color: var(--link);
    background-color: var(--card-lit);
}

/* ---------- contact form ---------- */

.container { max-width: 34rem; }

.container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.container label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: var(--f--1);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-soft);
}

input[type=email], textarea {
    width: 100%;
    padding: 0.75rem;
    font-family: var(--face);
    font-size: var(--f-0);
    color: var(--text);
    background-color: var(--card);
    border: 1px solid var(--edge);
    border-radius: 4px;
    transition-duration: 0.3s;
}

textarea { min-height: 9rem; resize: vertical; }

input[type=email]:focus, textarea:focus {
    background-color: var(--card-lit);
    border-color: var(--link);
    outline: none;
}

button[type=submit] {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    font-family: var(--face);
    font-size: var(--f-0);
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--on-action);
    background-color: var(--action);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition-duration: 0.3s;
}

button[type=submit]:hover, button[type=submit]:focus-visible { background-color: var(--action-lit); }

/* ---------- footer ---------- */

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 1.5rem 1.25rem 2.5rem;
    font-size: var(--f--1);
    color: var(--text-soft);
}

footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0s !important; }
}
