/* 369Games website - one stylesheet for every page.
   No web fonts, no scripts, no cookies: nothing here talks to anyone but the host. */

:root {
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --ink: #1b1a17;
  --muted: #5d5a52;
  --line: #e2dccd;
  --accent: #a2461f;
  --accent-ink: #fffdf8;
  --mark: #ffe58a;
  --radius: 14px;
  --wrap: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Impact, Haettenschweiler, "Arial Narrow Bold", "sans-serif-condensed", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1c19;
    --ink: #f1ece2;
    --muted: #a9a397;
    --line: #2e2c27;
    --accent: #f08a5d;
    --accent-ink: #141311;
    --mark: #6b5a12;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  overflow-x: hidden;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

mark { background: var(--mark); color: inherit; padding: 0 .2em; border-radius: 3px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 750; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* ---------- header and footer ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 14px; padding-bottom: 14px;
}

.brand { display: inline-flex; align-items: baseline; gap: 1px; color: var(--ink); text-decoration: none; }
.brand b { font-size: 1.6rem; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.brand span { font-size: 1.15rem; font-weight: 500; color: var(--muted); }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--muted); }

/* ---------- buttons, pills ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }
.muted { color: var(--muted); }
.nav .btn { padding: 6px 16px; color: var(--accent-ink); }
.nav .btn:hover { color: var(--accent-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600;
}

/* ---------- layout pieces ---------- */

.hero { padding: 72px 0 56px; }
.hero .lead { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--muted); max-width: 40em; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }

section { padding: 40px 0; }
.section-head { max-width: 44em; margin-bottom: 24px; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.card p:last-child { margin-bottom: 0; }
.card .num { font-weight: 900; font-size: 1.6rem; color: var(--accent); line-height: 1; margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.motto {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem); font-weight: 900; line-height: 1.15; letter-spacing: -.02em;
  margin: 0 0 16px;
}
.motto em { font-style: normal; color: var(--accent); }

/* the game card on the studio home page */
.game-card {
  display: grid; grid-template-columns: 1fr; overflow: hidden; padding: 0;
  text-decoration: none; color: var(--ink);
}
@media (min-width: 760px) { .game-card { grid-template-columns: 1.1fr 1fr; } }
.game-card .art { min-height: 220px; }
.game-card .body { padding: 26px; }
.game-card:hover h3 { color: var(--accent); }

/* ---------- long text pages (news, legal) ---------- */

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.8em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote {
  margin: 0 0 1em; padding: 14px 18px; border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.updated { color: var(--muted); font-size: .92rem; }

.draft-note {
  border: 2px dashed var(--accent); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 28px;
  background: var(--surface); font-size: .95rem;
}

.post { padding: 32px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post time { color: var(--muted); font-size: .92rem; font-weight: 600; }
.post h2 { margin-top: .2em; }

.toc { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .95rem; }

/* ---------- the DeadRooms page: always dark, fluorescent yellow ---------- */

.dr {
  --dr-bg: #0d0c07;
  --dr-wall: #c9b85a;
  --dr-wall-dark: #8e7f34;
  --dr-glow: #fff7c2;
  --dr-text: #efe8c8;
  --dr-muted: #b3ab86;
  --dr-line: #2b2814;
  --dr-card: #16140b;
  --accent: #e6d36a;
  --accent-ink: #0d0c07;
  --mark: #6b5a12;
  background: var(--dr-bg); color: var(--dr-text); color-scheme: dark;
}
.dr .site-header { background: var(--dr-bg); border-color: var(--dr-line); }
.dr .brand, .dr .nav a { color: var(--dr-text); }
.dr .brand span { color: var(--dr-muted); }
.dr .nav a:hover, .dr .nav a[aria-current="page"] { color: var(--accent); }
.dr .nav .btn { color: var(--accent-ink); }
.dr .site-footer { border-color: var(--dr-line); color: var(--dr-muted); }
.dr .site-footer a { color: var(--dr-muted); }
.dr .card { background: var(--dr-card); border-color: var(--dr-line); }
.dr .section-head p, .dr .muted { color: var(--dr-muted); }
.dr .pill { background: transparent; border-color: var(--dr-wall-dark); color: var(--dr-wall); }

/* a room drawn in CSS: striped wallpaper, a ceiling light, a doorway into the dark */
.backrooms {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(ellipse 60% 38% at 50% 0%, rgba(255, 247, 194, .55), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #d9c870 0%, #c4b257 55%, #8f7f36 100%);
}
.backrooms::before { /* the doorway */
  content: ""; position: absolute; z-index: -1; left: 62%; bottom: 0; width: 13%; min-width: 46px; height: 58%;
  background: linear-gradient(180deg, #0d0c07, #1b1809 80%, #2a2410);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .9);
}
.backrooms::after { /* VHS lines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.backrooms .light {
  position: absolute; z-index: -1; top: 0; left: 50%; width: 30%; max-width: 260px; height: 10px; transform: translateX(-50%);
  background: var(--dr-glow); box-shadow: 0 0 40px 16px rgba(255, 247, 194, .7);
  animation: flicker 7s infinite steps(1);
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: .35; } 42% { opacity: 1; } 43.5% { opacity: .5; } 44% { opacity: 1; }
  78% { opacity: .7; } 78.6% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .backrooms .light { animation: none; } }

.dr-hero { padding: 0; }
.dr-hero .backrooms { min-height: min(78vh, 640px); display: flex; align-items: flex-end; }
.dr-hero .wrap { position: relative; padding-top: 120px; padding-bottom: 40px; }
.dr-hero .shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 30%, rgba(13, 12, 7, .82) 78%, var(--dr-bg) 100%);
}

.dr-title {
  font-family: var(--font-display); font-weight: 400; font-stretch: condensed; text-transform: uppercase;
  font-size: clamp(3.4rem, 13vw, 8rem); line-height: .9; letter-spacing: .01em; margin: 0 0 12px;
  color: var(--dr-text); text-shadow: 0 2px 0 #000, 0 0 24px rgba(0, 0, 0, .6);
}
.dr-hero .lead { color: var(--dr-text); max-width: 34em; font-size: clamp(1.1rem, 2.4vw, 1.3rem); text-shadow: 0 1px 2px #000; }
.dr-hero .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dr-hero .pill { background: rgba(13, 12, 7, .7); }

.dr h2 { font-family: var(--font-display); font-weight: 400; font-stretch: condensed; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(1.9rem, 5vw, 2.8rem); }

.feature h3 { color: var(--accent); }

.platforms { width: 100%; border-collapse: collapse; }
.platforms th, .platforms td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--dr-line); vertical-align: top; }
.platforms th { color: var(--dr-muted); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }

.promise-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.promise-list li { padding-left: 34px; position: relative; }
.promise-list li::before {
  content: "\2713"; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .85rem; font-weight: 900;
  background: var(--accent); color: var(--accent-ink);
}

/* the small game art used on the home page card */
.game-card .art.backrooms { min-height: 240px; }
.game-card .art .mini-title {
  position: absolute; left: 20px; bottom: 16px; font-family: var(--font-display); font-stretch: condensed;
  text-transform: uppercase; font-size: 2.6rem; line-height: 1; color: #f6f0d2; text-shadow: 0 2px 0 #000, 0 0 18px rgba(0,0,0,.7);
}
