/* Butterstick Games — single stylesheet, no build step. */

:root {
  /* Palette derived from the studio logo. */
  --cream: #f8ecd2;
  --cream-soft: #fdf6e6;
  --ink: #1e3a5f;
  --ink-soft: #55708c;
  --butter: #f0b93f;
  --brown: #5b2f22;
  --line: rgba(30, 58, 95, 0.14);
  --shadow: 0 1px 2px rgba(91, 47, 34, 0.06), 0 8px 24px rgba(91, 47, 34, 0.07);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --measure: 62rem;
}

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

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

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration-color: var(--ink);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}

h2 {
  font-size: 1.375rem;
}

p {
  margin: 0 0 1.1em;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

.site-header {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.site-header__logo {
  display: inline-block;
  line-height: 0;
}

.site-header__logo img {
  width: 220px;
}

.tagline {
  max-width: 34rem;
  margin: 1.5rem auto 0;
  color: var(--ink);
  font-size: 1.125rem;
}

main {
  padding: 1rem 0 4rem;
}

.section-title {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown);
}

/* ---------- Game list (index) ---------- */

.games {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.games > li {
  border-bottom: 1px solid var(--line);
}

.game-link {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem 0.75rem;
  margin: 0 -0.75rem;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.game-link:hover {
  background: var(--cream-soft);
}

/* Optional cover thumbnail — drop an <img class="game-cover"> in to use it. */
.game-cover {
  flex: none;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--cream-soft);
  box-shadow: var(--shadow);
}

.game-body {
  min-width: 0;
}

.game-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.game-link:hover .game-title {
  text-decoration: underline;
  text-decoration-color: var(--butter);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--brown);
}

.game-desc {
  margin: 0.4rem 0 0;
  color: var(--ink);
}

.badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--butter);
  color: var(--brown);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--released {
  background: rgba(30, 58, 95, 0.1);
  color: var(--ink);
}

.empty-note {
  padding: 2rem 0;
  color: var(--brown);
}

/* ---------- Game page ---------- */

.back-link {
  display: inline-block;
  margin: 2rem 0 0;
  font-size: 0.9375rem;
  color: var(--brown);
}

.game-header {
  padding: 1.5rem 0 2.5rem;
}

.game-header h1 {
  margin-bottom: 0.5rem;
}

.game-intro {
  max-width: 42rem;
  font-size: 1.125rem;
}

.block {
  margin: 0 0 3.5rem;
}

/* Trailer — click-to-load YouTube facade (no third-party request until clicked) */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--cream-soft) center / cover no-repeat;
  box-shadow: var(--shadow);
  color: var(--brown);
  font: inherit;
}

.video[data-youtube-id] {
  cursor: pointer;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.video__play {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--butter);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.video__play::after {
  content: "";
  margin-left: 5px;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent var(--brown);
}

.video:hover .video__play {
  transform: scale(1.08);
}

.video__note {
  font-size: 0.875rem;
  font-weight: 400;
}

/* Screenshots — landscape by default, add .shots--portrait for mobile games */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: var(--cream-soft);
  box-shadow: var(--shadow);
}

.shots--portrait {
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  justify-content: start;
  gap: 1.25rem;
}

.shots--portrait img {
  aspect-ratio: 9 / 16;
  border-radius: 14px;
}

/* Store links */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.store-link:hover {
  background: #172e4b;
  transform: translateY(-1px);
}

.store-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

.stores-soon {
  margin: 0;
  color: var(--brown);
  font-weight: 600;
}

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

.prose {
  max-width: 42rem;
}

.prose h2 {
  margin-top: 2.25rem;
}

.prose address {
  font-style: normal;
}

.todo {
  background: var(--butter);
  color: var(--brown);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-weight: 700;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  font-size: 0.9375rem;
  color: var(--brown);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* ---------- 404 ---------- */

.center-note {
  text-align: center;
  padding: 4rem 0 6rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
