/* The House That Sings: the game's look on the web. Cream on a dark night, like the title card;
   Alegreya Sans, the game's one font, with italic headings over a hairline rule, like the room
   names. Fonts are served from this site (no Google Fonts: no visitor data leaves it). */

@font-face {
    font-family: "Alegreya Sans";
    src: url("fonts/AlegreyaSans-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Alegreya Sans";
    src: url("fonts/AlegreyaSans-Italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --night: #0c0a08;
    --cream: #ede5d3;
    --muted: #a69d8c;
    --lamp: #e3b673;
    --rule: rgba(237, 229, 211, 0.22);
    --frame: rgba(237, 229, 211, 0.1);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--night);
}

body {
    margin: 0;
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, rgba(227, 182, 115, 0.07), transparent 70%),
        var(--night);
    color: var(--cream);
    font: 400 1.2rem/1.6 "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--cream);
    text-decoration-color: var(--rule);
    text-underline-offset: 0.2em;
    transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover,
a:focus-visible {
    color: var(--lamp);
    text-decoration-color: var(--lamp);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The title logo, a line under it, the hairline rule. */
.brand {
    text-align: center;
    padding: 4.5rem 1rem 2.5rem;
}

.brand h1 {
    margin: 0;
}

.brand-logo {
    display: block;
    width: min(34rem, 88vw);
    height: auto;
    margin: 0 auto;
}

.brand-sub {
    margin: 1.4rem 0 0;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--muted);
}

.rule {
    width: 9rem;
    height: 1px;
    margin: 1.6rem auto 0;
    border: 0;
    background: linear-gradient(to right, transparent, var(--rule), transparent);
}

/* Pictures of the game, edge to edge on small screens. */
.hero,
.wide {
    margin: 0 auto;
    max-width: 72rem;
    padding: 0 1rem;
}

.hero img,
.shots img,
.compare {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.7), 0 0 0 1px var(--frame);
}

.page {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1rem;
}

h2 {
    margin: 4rem 0 1.4rem;
    font-weight: 400;
    font-style: italic;
    font-size: 1.9rem;
    line-height: 1.2;
    text-align: center;
}

h2::after {
    content: "";
    display: block;
    width: 6rem;
    height: 1px;
    margin: 0.8rem auto 0;
    background: linear-gradient(to right, transparent, var(--rule), transparent);
}

p {
    margin: 0 0 1.1rem;
}

.lead {
    margin-top: 3.5rem;
    font-size: 1.5rem;
    line-height: 1.45;
    text-align: center;
}

.lead em {
    white-space: nowrap;
}

.features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.features li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--frame);
}

.features li:last-child {
    border-bottom: 0;
}

.features strong {
    display: block;
    font-weight: 400;
    font-style: italic;
    font-size: 1.35rem;
    color: var(--lamp);
}

/* Abandoned and alive: drag across a room to bring it back. */
.compares {
    display: grid;
    gap: 2.5rem;
}

.compare-wrap {
    margin: 0;
}

.compare {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: ew-resize;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    --pos: 50%;
}

.compare img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.compare .before {
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    margin-left: -1px;
    background: rgba(237, 229, 211, 0.85);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.compare-line::after {
    content: "\2039\00a0\203a";
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    transform: translate(-50%, -50%);
    border: 2px solid var(--cream);
    border-radius: 50%;
    background: rgba(12, 10, 8, 0.55);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
    font-size: 1.5rem;
    line-height: 1;
    padding-bottom: 0.15rem;
}

.compare-tag {
    position: absolute;
    bottom: 0.8rem;
    padding: 0.15rem 0.6rem;
    border-radius: 2px;
    background: rgba(12, 10, 8, 0.6);
    font-style: italic;
    font-size: 1rem;
    pointer-events: none;
}

.compare-tag.left {
    left: 0.8rem;
}

.compare-tag.right {
    right: 0.8rem;
}

.compare input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.compare:has(input:focus-visible) {
    outline: 2px solid var(--lamp);
    outline-offset: 4px;
}

.compare-wrap figcaption,
.shots figcaption {
    margin-top: 0.7rem;
    text-align: center;
    font-style: italic;
    color: var(--muted);
}

.hint {
    text-align: center;
    font-style: italic;
    color: var(--muted);
}

/* More of the house. */
.shots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shots li:first-child {
    grid-column: 1 / -1;
}

.shots figure {
    margin: 0;
}

.shots a {
    display: block;
}

.shots a img {
    transition: box-shadow 0.3s;
}

.shots a:hover img,
.shots a:focus-visible img {
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.7), 0 0 0 1px var(--lamp);
}

@media (max-width: 40rem) {
    .shots {
        grid-template-columns: 1fr;
    }
}

.contact {
    text-align: center;
    font-size: 1.35rem;
}

.back {
    text-align: center;
    margin-top: 3rem;
    font-style: italic;
}

footer {
    margin-top: 5rem;
    padding: 2rem 1rem 3rem;
    border-top: 1px solid var(--frame);
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
}

footer p {
    margin: 0.2rem 0;
}
