@font-face {
    font-family: Directory Display;
    src: url("/directory-display.woff2?v=1") format("woff2");
    font-weight: 500 800;
    font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }

body {
    --ink: #27221e;
    --muted: #554b41;
    --paper: #fdf6e3;
    --surface: #fffcf4;
    --line: #322c25;
    --subtle-line: #d8cbb3;
    --accent: #ffcc33;
    --accent-ink: #27221e;
    --accent-hover: #ffdc6d;
    --hero: #ffefb4;
    --hero-highlight: #ffc83e;
    --highlight-ink: #27221e;
    --action: #315d50;
    --card-shadow: 3px 4px 0 #312920;
    --hero-shadow: 5px 6px 0 #312920;
    --radius: 5px;
    --header: #191715;
    --header-ink: #f9f5e5;
    --header-line: #ffcc33;
    --header-current: #ffdb73;
    --display: "Directory Display", "Trebuchet MS", system-ui, sans-serif;
    --label-font: system-ui, sans-serif;
    --title-weight: 800;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(#976a3626 0.65px, transparent 0.65px) 0 0 / 11px 11px, var(--paper);
    color: var(--ink);
    font: 1rem/1.55 system-ui, sans-serif;
}

.theme-kids-es {
    --paper: #fff3dc;
    --hero: #ffedb1;
    --highlight-ink: #541b35;
    --hero-highlight: #ffbb9e;
    --action: #8b3158;
}

.theme-space {
    --ink: #f1f5ff;
    --muted: #b8c3d5;
    --paper: #0b0e16;
    --surface: #121824;
    --line: #364357;
    --subtle-line: #283345;
    --accent: #9be7f8;
    --accent-ink: #101c2e;
    --accent-hover: #c6f5ff;
    --hero: #0e1523;
    --highlight-ink: #9be7f8;
    --action: #a9eafa;
    --card-shadow: none;
    --hero-shadow: none;
    --radius: 2px;
    --header: #090b11;
    --header-ink: #ecf1ff;
    --header-line: #303b4d;
    --header-current: #9be7f8;
    --label-font: ui-monospace, "SFMono-Regular", Consolas, monospace;
    --title-weight: 700;
    background: radial-gradient(ellipse at 70% 2%, #182333 0%, transparent 55rem), var(--paper);
    color-scheme: dark;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--title-weight); line-height: 1.08; }
h1, h2, h3, p { overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
.shell { width: min(100% - 3.5rem, 72rem); margin-inline: auto; }

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    padding: 0.6rem 1rem;
    background: var(--surface);
    transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.site-header { background: var(--header); color: var(--header-ink); border-bottom: 3px solid var(--header-line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 2rem; min-height: 4.65rem; }
.brand { display: block; flex: 0 1 15rem; }
.brand img { width: 100%; height: auto; mix-blend-mode: screen; }
.theme-space .brand { flex-basis: 13.75rem; }
.navigation { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0.125rem 1.5rem; }
.navigation a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-block: 0.45rem 0.35rem;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}
.navigation a:hover, .navigation a[aria-current] { color: var(--header-current); border-bottom-color: currentColor; }
.site-header a:focus-visible { outline-color: var(--header-current); }

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    align-items: center;
    min-height: 22rem;
    overflow: hidden;
    margin-top: 2.15rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--hero-shadow);
    background: var(--hero);
}
.hero-copy { padding: clamp(1.5rem, 3vw, 2.4rem) 0 clamp(1.5rem, 3vw, 2.4rem) clamp(1.5rem, 4vw, 3.25rem); }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--action);
    font: 750 0.74rem/1.35 var(--label-font);
    letter-spacing: 0.105em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; display: inline-block; flex: 0 0 0.95rem; height: 3px; background: currentColor; }
.hero h1 {
    position: relative;
    z-index: 1;
    margin-block: 0.75rem 1.1rem;
    font-size: clamp(2.7rem, 5.15vw, 4.55rem);
    letter-spacing: -0.055em;
    line-height: 1;
}
.hero h1 em {
    color: var(--highlight-ink);
    font-style: normal;
    background: linear-gradient(transparent 67%, var(--hero-highlight) 67% 93%, transparent 93%);
}
.theme-kids-es .hero h1 { font-size: clamp(2.5rem, 4.45vw, 4.15rem); }
.hero-intro { max-width: 44ch; color: var(--muted); font-size: clamp(0.98rem, 1.45vw, 1.15rem); }
.hero-art { width: 100%; align-self: stretch; height: 100%; object-fit: contain; object-position: center; }
.theme-space .hero {
    grid-template-columns: 1fr 1.13fr;
    min-height: 23rem;
    border-width: 1px;
    background:
        linear-gradient(90deg, #34466122 1px, transparent 1px),
        linear-gradient(0deg, #34466122 1px, transparent 1px),
        linear-gradient(110deg, #101827, #0b101b);
    background-size: 37px 37px, 37px 37px, auto;
}
.theme-space .hero h1 em { background: none; }
.theme-space .hero-art { object-fit: cover; }
.theme-space .hero::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 4.25rem;
    height: 2px;
    background: var(--accent);
    content: "";
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 2.8rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.button span { font-size: 1.15em; line-height: 1; }
.button:hover { background: var(--accent-hover); }
body:not(.theme-space) .hero .button { box-shadow: 2px 3px 0 var(--line); }
.hero .button, .detail-copy .button, .notice .button { margin-top: 1.35rem; }

.catalog-section { margin-top: 2.8rem; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--subtle-line);
}
.section-heading h2, .detail-panel h2 { font-size: clamp(1.65rem, 3vw, 2.45rem); letter-spacing: -0.035em; }
.section-heading .eyebrow { margin-bottom: 0.35rem; }
.game-count {
    flex-shrink: 0;
    padding: 0.23rem 0.55rem;
    border: 1px solid var(--subtle-line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font: 700 0.82rem/1.45 var(--label-font);
}
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.game-card { min-width: 0; }
.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--card-shadow);
    text-decoration: none;
}
.card-link:hover { border-color: var(--action); }
.card-link:hover .card-action { text-decoration: underline; text-underline-offset: 0.2em; }
.card-art { position: relative; flex-shrink: 0; aspect-ratio: 584 / 284; background: var(--subtle-line); border-bottom: 1px solid var(--line); }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.promo-art { aspect-ratio: 5 / 1; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.05rem; }
.card-body h3 { font-size: clamp(1.23rem, 2vw, 1.58rem); letter-spacing: -0.025em; }
.card-body p { margin-top: 0.45rem; color: var(--muted); font-size: 0.92rem; }
.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.9rem;
    color: var(--action);
    font-size: 0.88rem;
    font-weight: 750;
}
.card-action span { font-size: 1.15rem; line-height: 1; }
body:not(.theme-space) .game-card:nth-child(3n+1) .card-body { border-top: 3px solid #ffc948; }
body:not(.theme-space) .game-card:nth-child(3n+2) .card-body { border-top: 3px solid #73b49d; }
body:not(.theme-space) .game-card:nth-child(3n+3) .card-body { border-top: 3px solid #e6a1b4; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin-block: 1rem 0.55rem;
    color: var(--action);
    font-weight: 700;
    text-underline-offset: 0.19em;
}
.detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    padding: clamp(1rem, 4vw, 2.5rem);
    background: var(--hero);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--hero-shadow);
}
.detail-art { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--subtle-line); }
.detail-art img { width: 100%; height: auto; }
.detail-copy h1, .player-header h1, .notice h1 {
    font-size: clamp(2.1rem, 5vw, 4rem);
    letter-spacing: -0.05em;
}
.detail-copy h1 { margin-block: 0.35rem 0.65rem; }
.language { color: var(--muted); }
.detail-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.35rem; align-items: start; margin-top: 1.6rem; }
.detail-panel { padding: clamp(1.15rem, 3vw, 1.75rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.detail-panel h2 { margin-bottom: 0.8rem; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.detail-panel img + h2 { margin-top: 1.45rem; }
.game-description { white-space: pre-line; }
.screenshot { width: 100%; height: auto; }
.video, .player { display: block; width: 100%; border: 0; background: #10141b; }
.video { aspect-ratio: 16 / 9; }
.player { border: 1px solid var(--line); }
.player-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-block: 0.4rem 1.35rem; }
.notice { margin-top: 2rem; padding: clamp(1.25rem, 5vw, 3rem); border: 1px solid var(--line); background: var(--hero); }
.notice h1 { margin-block: 0.45rem 0.75rem; }

.site-footer { margin-top: 3.5rem; padding-block: 1.65rem; border-top: 1px solid var(--subtle-line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; }
.footer-name { font: var(--title-weight) 1.2rem/1.2 var(--display); text-decoration: none; }
.footer-name:hover { text-decoration: underline; }
.footer-inner p { margin-top: 0.2rem; color: var(--muted); font-size: 0.87rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; font-size: 0.88rem; }
.footer-inner nav a, .footer-inner button {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    border: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.cookie-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    width: min(23rem, 100% - 2rem);
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 4px 24px #0003;
}
.cookie-notice h2 { font-size: 1.04rem; }
.cookie-notice p { margin-block: 0.35rem 0.65rem; color: var(--muted); font-size: 0.82rem; }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 0.5rem; }
.cookie-actions .button { min-height: 2.5rem; font-size: 0.86rem; }
.button-secondary { background: var(--surface); color: var(--ink); }
.button-secondary:hover { background: var(--hero); }

@media (max-width: 57rem) {
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero, .theme-space .hero { min-height: 19rem; }
}

@media (max-width: 42rem) {
    .shell { width: calc(100% - 2rem); }
    .header-inner { min-height: 3.9rem; }
    .brand { flex-basis: 11rem; }
    .theme-space .brand { flex-basis: 11rem; }
    .navigation { column-gap: 0.85rem; }
    .navigation a { font-size: 0.82rem; }
    .hero, .theme-space .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 1.15rem; }
    .hero-copy { padding: 1.25rem 1.15rem 0; }
    .hero h1 { font-size: clamp(2.35rem, 8vw, 3.65rem); }
    .theme-kids-es .hero h1 { font-size: clamp(2.14rem, 7.5vw, 3.45rem); }
    .hero h1 br { display: none; }
    .hero h1 em::before { content: " "; }
    .hero-art { height: clamp(9.5rem, 44vw, 14rem); }
    .theme-space .hero-art { object-fit: contain; }
    .catalog-section { margin-top: 2rem; }
    .game-grid { gap: 1rem; }
    .card-body { padding: 0.8rem; }
    .detail-header, .detail-content { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 28rem) {
    .header-inner { flex-wrap: wrap; gap: 0; padding-top: 0.45rem; }
    .theme-space .header-inner { flex-wrap: nowrap; gap: 1rem; padding-top: 0; }
    .navigation { width: 100%; }
    .theme-space .navigation { width: auto; flex-shrink: 0; }
    .navigation a { min-height: 2.4rem; }
    .game-grid { grid-template-columns: minmax(0, 1fr); }
    .section-heading { gap: 0.5rem; }
}
