/* =========================================================
   The Roll & Spool / Busy Human Games
   All colors, fonts and sizes live in this first block.
   Change a value here and it changes everywhere.
   ========================================================= */
:root {
  /* Fabric colors (soft pastels) */
  --cream: #fdf7ee;      /* page background */
  --paper: #fffdf8;      /* cards */
  --rose: #f6d3cf;
  --sage: #d6e8d2;
  --sky: #d5e5f3;
  --butter: #f8e2a0;
  --lavender: #e2d9f0;

  /* Thread and text */
  --thread: #c98088;     /* stitched dividers */
  --ink: #3d2f2a;        /* main text */
  --ink-soft: #66544c;   /* quieter text */
  --link: #9c3f49;       /* links */
  --placeholder: #e4ded5;

  /* Type */
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --wrap: 960px;
}

@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-variable-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream);
  /* A very light woven-fabric texture, made with CSS only */
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 90, 70, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(120, 90, 70, 0.035) 0 1px, transparent 1px 5px);
}

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

h1, h2, h3 { line-height: 1.2; font-weight: 800; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

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

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.small { font-size: 0.92rem; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---------- Stitched thread ---------- */
.stitch { border: 0; border-top: 3px dashed var(--thread); margin: 2.5rem 0; }

/* A fabric "patch": a soft card with stitching just inside its edge */
.patch {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px 22px;
  outline: 2px dashed var(--thread);
  outline-offset: -9px;
  box-shadow: 0 2px 0 rgba(61, 47, 42, 0.08);
}
.patch--rose { background: var(--rose); }
.patch--sage { background: var(--sage); }
.patch--sky { background: var(--sky); }
.patch--butter { background: var(--butter); }
.patch--lavender { background: var(--lavender); }

/* ---------- Header and navigation ---------- */
.site-header { padding: 14px 0; border-bottom: 3px dashed var(--thread); background: rgba(253, 247, 238, 0.92); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.brand { font-weight: 900; font-size: 1.3rem; color: var(--ink); text-decoration: none; padding: 6px 0; }
.brand:hover { color: var(--link); }
.nav { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nav a { display: block; padding: 6px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 700; }
.nav a:hover { background: var(--rose); }
.nav a[aria-current="page"] { background: var(--butter); }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--butter);
  outline: 2px dashed var(--thread);
  outline-offset: -6px;
  box-shadow: 0 3px 0 rgba(61, 47, 42, 0.18);
}
.button:hover { background: #f5d77f; }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.button--quiet { background: var(--sky); }
.button--quiet:hover { background: #c3d9ee; }
/* Unavailable (for example "Discord coming soon"): flat, gray, not clickable */
.button--disabled,
.button--disabled:hover {
  font-family: inherit;
  border: 0;
  background: #ebe6df;
  color: #6f625b;
  outline-color: #b8ada5;
  box-shadow: none;
  cursor: not-allowed;
}
.buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 1.5rem 0 0; }

/* ---------- Sections ---------- */
main { padding: 32px 0 16px; }
.section { margin: 0 0 3rem; }
.page-title { text-align: center; margin-bottom: 2rem; }

/* Hero */
.hero { text-align: center; }
/* The logo badge is purple, so it reads well on cream. Never put the cream wordmark files on a light background. */
.hero-logo { margin: 0 auto 1.25rem; max-width: 640px; }
.hero-logo img { width: 100%; height: auto; }
.tagline { font-size: clamp(1.25rem, 4vw, 1.6rem); font-weight: 800; margin: 0 0 0.4rem; }
.tagline--hero { font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.25; margin: 0 auto 1.75rem; max-width: 30rem; }
.lead { font-size: 1.15rem; font-weight: 700; }

/* Clip */
.clip { margin: 0 auto; max-width: 820px; }
/* Click-to-play video box (16:9). The still and, after a click, the YouTube player fill it. */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--placeholder);
  border-radius: var(--radius);
  border: 3px dashed var(--thread);
}
.video-still,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-still { object-fit: cover; }
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: rgba(61, 47, 42, 0.78);
  color: #fffdf8;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.video-play svg { width: 44px; height: 44px; fill: currentColor; margin-left: 6px; }
.video-play:hover { background: rgba(156, 63, 73, 0.9); }
.video-play:focus-visible { outline: 4px solid var(--butter); outline-offset: 4px; }
.video-play[hidden], .video-fallback[hidden] { display: none; }
.video-fallback { margin: 4px 0 0; }
@media (max-width: 480px) {
  .video-play { width: 72px; height: 72px; }
  .video-play svg { width: 36px; height: 36px; }
}
.clip figcaption { margin-top: 6px; }

/* Text blocks */
.prose { max-width: 40rem; margin: 0 auto; }
/* The game box matches the video block's width (820px) on desktop; slightly looser lines keep the longer lines easy to read. */
.prose--wide { max-width: 820px; }
@media (min-width: 860px) { .prose--wide p { line-height: 1.75; } }

/* Screenshots: 2 columns on phones, 3 on wider screens */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 700px) { .shots { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.shot-link { display: block; border-radius: 14px; }
.shots img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; border: 3px dashed var(--thread); background: var(--placeholder); transition: transform 0.15s; }
@media (prefers-reduced-motion: no-preference) { .shot-link:hover img { transform: translateY(-3px); } }

/* Lightbox (opened by site/js/site.js) */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(40, 30, 26, 0.88); }
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1600px, 100%); }
/* The picture sits on a cream mat. The dashed stitching is drawn inside the mat, 5px in from its outer edge. */
.lightbox-frame { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; padding: 14px; background: var(--paper); border-radius: 18px; }
.lightbox-frame::before { content: ""; position: absolute; inset: 5px; border: 3px dashed var(--thread); border-radius: 14px; pointer-events: none; }
.lightbox-img { position: relative; display: block; max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 8px; background: var(--paper); }
.lightbox-caption { margin: 12px auto 0; max-width: 60rem; text-align: center; color: #fffdf8; }
.lightbox-caption-text { margin: 0; font-size: 1.05rem; font-weight: 700; }
.lightbox-count { margin: 4px 0 0; font-size: 0.85rem; color: #e9dfd2; }
.lightbox-btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; font: inherit; font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--ink); background: var(--butter); border: 0; border-radius: 50%; cursor: pointer; z-index: 2; }
/* Stitching drawn 5px in from the button's outer edge, same dash size and color as before */
.lightbox-btn::before { content: ""; position: absolute; inset: 5px; border: 2px dashed var(--thread); border-radius: 50%; pointer-events: none; }
.lightbox-btn:hover { background: #f5d77f; }
.lightbox-btn:focus-visible { outline: 3px solid #fffdf8; outline-offset: 3px; }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox-prev, .lightbox-next { top: auto; bottom: 14px; transform: none; } }

/* Email sign-up */
.signup-form { max-width: 34rem; margin: 1.25rem auto 1rem; text-align: left; }
.signup-label { display: block; font-weight: 800; margin: 0 0 6px 6px; }
.signup-row { display: flex; flex-direction: column; gap: 12px; }
.signup-form input[type="email"] {
  width: 100%;
  min-height: 54px;
  padding: 12px 20px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
}
.signup-form input[type="email"]::placeholder { color: #7d6d65; opacity: 1; }
.signup-form input[type="email"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.signup-form .button { min-height: 54px; border: 0; font-family: inherit; cursor: pointer; }
@media (min-width: 560px) {
  .signup-row { flex-direction: row; }
  .signup-form input[type="email"] { flex: 1; }
  .signup-form .button { flex: none; }
}
.consent { max-width: 30rem; margin: 0 auto 0.5rem; text-align: center; }

/* Social links */
.social { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.social a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--paper); border: 2px dashed var(--thread); color: var(--ink); text-decoration: none; font-weight: 700; }
.social a:hover { background: var(--rose); }

/* Devlog */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.post-card h2 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.post-card h2 a { color: var(--ink); }
.post-meta { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0.5rem; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--butter); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em; }

/* Notices (draft, sample, placeholder) */
.notice { border: 3px dashed var(--link); background: var(--paper); border-radius: 14px; padding: 14px 18px; margin: 0 0 2rem; font-weight: 700; }

/* Press kit */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.downloads { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 8px; }
.swatches { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; font-size: 0.95rem; }
.swatches li { display: flex; align-items: center; gap: 10px; }
.swatches code { font-weight: 700; }
.swatch { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid rgba(61, 47, 42, 0.35); }
/* Brand colors from brand-assets/README.txt */
.sw-32377a { background: #32377a; }
.sw-8f5a2e { background: #8f5a2e; }
.sw-f1dba6 { background: #f1dba6; }
.sw-f3e6bf { background: #f3e6bf; }
.sw-fbf1dd { background: #fbf1dd; }
.sw-2a2d63 { background: #2a2d63; }
.sw-d9824a { background: #d9824a; }
.sw-e8723b { background: #e8723b; }
.sw-b9481f { background: #b9481f; }
.sw-d9b377 { background: #d9b377; }

/* Footer */
.site-footer { padding: 8px 0 40px; text-align: center; }
.site-footer .stitch { margin-top: 0; }
.footer-note { max-width: 30rem; margin-left: auto; margin-right: auto; text-wrap: balance; }
.footer-links { list-style: none; padding: 0; margin: 0 0 0.75rem; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; }

@media (min-width: 700px) {
  .patch { padding: 40px 44px; }
  main { padding-top: 48px; }
}
