/* Crooked Horror Games — shared styles. Plain CSS. The one font is self-hosted (no third-party requests). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  /* Studio: a plum night lit by jack-o'-lantern orange */
  --night: #1d1426;
  --night-deep: #150e1c;
  --night-raised: #271b33;
  --line: #3d2e4a;
  --text: #efeaf4;
  --text-muted: #b9aec6;
  --ember: #ff5a1f;         /* studio accent: Halloween red-orange */
  --ember-hover: #ff9466;

  /* How Many Points: sky, road and paint, sampled from the game art */
  --sky: #2a83d9;
  --sky-deep: #1d6cc0;
  --asphalt: #2a2b32;
  --asphalt-raised: #33343c;
  --asphalt-line: #474955;
  --paint: #f3f5f8;
  --lane-yellow: #ffd23f;
  --game-orange: #ffb53a;

  --todo-bg: #3b3210;
  --todo-text: #ffe28a;

  --max: 1040px;
  --measure: 66ch;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}

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

a { color: var(--ember); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ember-hover); text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--text); color: var(--night);
  padding: 8px 14px; border-radius: 6px; z-index: 10;
}
.skip-link:focus { top: 12px; }

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

p { max-width: var(--measure); }

/* --- Header / nav --------------------------------------------------------- */

.site-header { background: var(--night-deep); }
.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-block;
  font-weight: 800; font-stretch: 80%; font-size: 1.2rem; letter-spacing: 0.005em;
  color: var(--text); text-decoration: none;
  transform: rotate(-2deg);
}
.brand span { color: var(--ember); }
.brand:hover { color: var(--text); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* --- Studio hero: the name, set crooked ----------------------------------- */

.hero { padding: 72px 0 88px; overflow: hidden; }

.wordmark {
  margin: 0; isolation: isolate;
  font-weight: 800; line-height: 0.86; letter-spacing: -0.01em;
  font-size: clamp(3.6rem, 15vw, 8.5rem);
}
.wordmark span { display: block; position: relative; transform-origin: left center; }
.wordmark .w1 { font-stretch: 75%; transform: rotate(-4deg); }
.wordmark .w2 {
  font-stretch: 100%; color: var(--night-deep);
  margin: 0.14em 0 0.1em; transform: translateX(0.32em) rotate(-2deg);
}
/* "Horror" sits on a tilted band of ember that runs off both edges of the page, like caution tape */
.wordmark .w2::before {
  content: ""; position: absolute; z-index: -1;
  top: -0.08em; bottom: -0.1em; left: -100vw; right: -100vw;
  background: var(--ember);
}
.wordmark .w3 { font-stretch: 85%; transform: translateX(0.08em) rotate(-1deg); }

.hero-copy { display: grid; gap: 8px 56px; margin-top: 48px; }
@media (min-width: 860px) { .hero-copy { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; } }
.hero-copy p { margin: 0 0 14px; color: var(--text-muted); }
.hero-copy .tagline {
  font-size: clamp(1.4rem, 3vw, 1.85rem); line-height: 1.2; font-weight: 600; font-stretch: 90%;
  color: var(--text);
}

/* The page's one moment: the band stretches out from behind the word once on load. */
@media (prefers-reduced-motion: no-preference) {
  .wordmark .w2::before { animation: tape 0.7s 0.25s cubic-bezier(.6, 0, .2, 1) both; }
}
@keyframes tape { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --- Shared section headings --------------------------------------------- */

h2 {
  font-weight: 800; font-stretch: 85%; line-height: 1.05; letter-spacing: -0.005em;
  font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 24px;
}
h3 { font-weight: 700; font-size: 1.33rem; line-height: 1.25; margin: 48px 0 14px; }
.lede { font-size: 1.2rem; line-height: 1.5; }

/* --- Featured game: the page steps into the game's world ------------------ */

.game { background: var(--asphalt); }

/* Sky: a sunburst behind the key art, like the art itself */
.game-sky {
  background:
    repeating-conic-gradient(from 0deg at 50% 100%, var(--sky) 0deg 6deg, var(--sky-deep) 6deg 12deg);
  padding: 56px 0 64px;
}
/* The key art as a slightly crooked sticker, outlined in the logo's own ink */
.game-banner {
  margin: 0 auto; width: 100%; max-width: 960px;
  border: 5px solid #13283d; border-radius: 22px;
  box-shadow: 0 10px 0 #13283d;
  transform: rotate(-1.5deg);
}
@media (max-width: 600px) { .game-sky { padding: 36px 0 44px; } .game-banner { border-width: 3px; border-radius: 14px; box-shadow: 0 6px 0 #13283d; } }
.game-sky h2 {
  /* Visually the banner says the name; the h2 stays for structure and screen readers */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Road: the content drives down the asphalt, between a yellow edge and a dashed lane line */
.road {
  border-top: 6px solid var(--lane-yellow);
  padding: 56px 0 72px;
  color: var(--paint);
}
@media (min-width: 860px) {
  .road .wrap {
    padding-left: 72px;
    background:
      repeating-linear-gradient(180deg, var(--paint) 0 40px, transparent 40px 80px)
      32px 0 / 4px 100% no-repeat;
  }
}
.road .lede strong.go { color: #7be08a; }
.road .lede strong.stop { color: #ff8a8a; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px 32px; margin: 36px 0 0; max-width: 820px;
}
.facts div { border-top: 2px solid var(--asphalt-line); padding-top: 10px; }
.facts dt { color: var(--lane-yellow); font-weight: 700; font-size: 0.95rem; }
.facts dd { margin: 2px 0 0; }

.table-scroll { overflow-x: auto; max-width: 820px; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { padding: 12px 14px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--asphalt-line); }
th { color: var(--lane-yellow); font-weight: 700; border-bottom-width: 2px; }
td:first-child { font-weight: 600; width: 38%; }
caption { text-align: left; color: #c7c9d3; padding-bottom: 8px; }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; max-width: 820px; }
@media (max-width: 560px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .shot img { border-radius: 14px; } }
.shot { aspect-ratio: 9 / 16; background: var(--asphalt-raised); border-radius: 22px; }
.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }

.store-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.button {
  display: inline-block; padding: 13px 24px; border-radius: 999px; font-weight: 800; text-decoration: none;
  background: var(--game-orange); color: #1d1405; box-shadow: 0 4px 0 #b86e00;
}
.button:hover { background: #ffc864; color: #1d1405; }
.button.is-placeholder { background: transparent; color: #c7c9d3; border: 2px dashed var(--asphalt-line); box-shadow: none; cursor: default; }

.legal-links { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 0.95rem; }
.road a:not(.button) { color: var(--paint); }
.road a:not(.button):hover { color: var(--lane-yellow); }

/* A zebra crossing hands the reader back to the studio */
.crossing {
  height: 64px;
  background:
    repeating-linear-gradient(90deg, var(--paint) 0 44px, var(--asphalt) 44px 88px);
  background-color: var(--asphalt);
  border-top: 14px solid var(--asphalt);
  border-bottom: 14px solid var(--asphalt);
}

/* --- About / contact (studio sections) ------------------------------------ */

.studio { padding: 88px 0; }
.studio + .studio { padding-top: 0; }

.contact .email {
  display: inline-block; font-weight: 800; font-stretch: 80%;
  font-size: clamp(1.5rem, 5.4vw, 3rem); line-height: 1.1; word-break: break-word;
  margin: 4px 0 24px;
}

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

.site-footer { background: var(--night-deep); padding: 32px 0; color: var(--text-muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* --- Legal pages ---------------------------------------------------------- */

.legal { padding: 56px 0 80px; }
.legal .wrap { max-width: 800px; }
.legal h1 {
  font-weight: 800; font-stretch: 85%; line-height: 1.05;
  font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0 0 12px;
  transform: rotate(-1deg); transform-origin: left center;
}
.legal h2 { font-weight: 700; font-stretch: 100%; font-size: 1.4rem; line-height: 1.25; margin: 48px 0 12px; }
.legal h3 { margin-top: 28px; font-size: 1.15rem; }
.legal li { margin-bottom: 6px; }
.legal .table-scroll { margin: 16px 0; max-width: none; }
.legal th { color: var(--text); }
.legal td:first-child { width: auto; }
.legal th, .legal td { border-bottom-color: var(--line); padding-right: 16px; }
.legal caption { color: var(--text-muted); }
.meta { color: var(--text-muted); margin-top: 0; }
.toc { background: var(--night-raised); border-radius: 12px; padding: 18px 22px; margin: 28px 0; }
.toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2 220px; }
.callout { background: var(--night-raised); border-left: 4px solid var(--ember); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 20px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }
.legal .caps { text-transform: uppercase; font-size: 0.95rem; }

/* Visible placeholders for the owner to fill in before publishing. Remove every .todo before going live. */
.todo {
  background: var(--todo-bg); color: var(--todo-text);
  border: 1px dashed var(--todo-text); border-radius: 4px;
  padding: 0 6px; font-weight: 600;
}
div.todo, p.todo { display: block; padding: 10px 14px; margin: 12px 0; }

@media (prefers-reduced-motion: no-preference) {
  a, .button { transition: color 0.15s, background-color 0.15s; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero { padding: 48px 0 64px; }
  .studio { padding: 64px 0; }
  .road { padding: 44px 0 56px; }
  .crossing { height: 48px; background: repeating-linear-gradient(90deg, var(--paint) 0 30px, var(--asphalt) 30px 60px); }
}
