/* Better Letters site. The look follows the game: watercolor paper, the
   game's own display font, yellow pill buttons with a dark edge. */

@font-face {
  font-family: "Balsamiq Sans";
  src: url("/fonts/balsamiq-sans-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #fdfaf2;
  --paper-deep: #f4ecd9;
  --sky: #dfeaf2;
  --ink: #3a2c20;
  --ink-soft: #6b5a4a;
  --edge: #4a3524;
  --blue: #3d6c9c;
  --yellow: #f7dc45;
  --yellow-deep: #caa51c;
  --tile: #f3d9b8;
  --display: "Balsamiq Sans", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--blue);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

h3 {
  font-size: 1.25rem;
}

.wrap {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

/* ── header and footer ─────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  font-family: var(--display);
}

.page-index .site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}

.brand img {
  border-radius: 9px;
}

/* The hero already shows the logo. */
.page-index .brand span {
  display: none;
}

.site-header nav {
  display: flex;
  gap: 1.1rem;
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer nav a:hover {
  text-decoration: underline;
}

.site-footer {
  padding: 2rem 1rem 2.5rem;
  background: var(--paper-deep);
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.site-footer nav a {
  color: var(--ink);
  text-decoration: none;
}

/* ── buttons ───────────────────────────────────────────────────────── */

.button,
.store {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.5rem;
  border: 3px solid var(--edge);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.15;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button {
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--yellow-deep), 0 8px 14px rgba(60, 40, 20, 0.18);
}

.store {
  background: #fffdf8;
  box-shadow: 0 4px 0 #d9cdb6, 0 8px 14px rgba(60, 40, 20, 0.14);
  min-width: 10.5rem;
}

.store small {
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

a.button:hover,
a.store:hover {
  transform: translateY(-2px);
}

a.button:active,
a.store:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--yellow-deep);
}

/* A store the game isn't on yet: shown, not a link. */
span.store,
span.button {
  opacity: 0.72;
  border-style: dashed;
  box-shadow: none;
}

.cta,
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ── hero ──────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  background: var(--sky) url("/img/hero.jpg") center 40% / cover no-repeat;
  padding: 4.5rem 1rem 3rem;
}

/* Fades the painting into the page below it. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 5rem;
  background: linear-gradient(rgba(253, 250, 242, 0), var(--paper));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) 1.4fr;
  align-items: center;
  gap: 1rem 2.5rem;
}

.hero-owl {
  justify-self: end;
  width: min(100%, 330px);
  filter: drop-shadow(0 12px 14px rgba(70, 80, 60, 0.3));
}

.hero-text {
  /* A soft patch of paper white so the text holds up over the sky. */
  background: radial-gradient(closest-side, rgba(255, 253, 246, 0.82), rgba(255, 253, 246, 0));
  padding: 1rem 0;
}

.hero h1 {
  margin: 0;
  max-width: 560px;
}

.hero h1 img {
  display: block;
  filter: drop-shadow(0 2px 3px rgba(255, 255, 255, 0.9))
    drop-shadow(0 5px 10px rgba(50, 80, 120, 0.28));
}

.tagline {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.2;
  margin: 0.6rem 0 0.2rem;
}

.sub {
  margin: 0 0 1.2rem;
  font-size: 1.15rem;
  color: var(--ink);
}

.hero .stores {
  margin-top: 0.9rem;
}

@media (max-width: 720px) {
  .hero {
    padding-top: 3.8rem;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-owl {
    justify-self: center;
    width: 42vw;
    max-width: 200px;
    order: 2;
  }
  .hero h1 {
    margin-inline: auto;
  }
  .hero .cta,
  .hero .stores {
    justify-content: center;
  }
}

/* ── sections ──────────────────────────────────────────────────────── */

.band {
  padding: 3.2rem 0;
}

.band-paper {
  background: var(--paper-deep);
}

.band-sky {
  background: var(--sky);
}

.lead {
  max-width: 46rem;
  font-size: 1.15rem;
  margin: 0 0 1.6rem;
}

.spaced {
  margin-top: 2.4rem;
}

.trailer {
  padding: 1rem 0 0;
}

.trailer video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 4px solid var(--edge);
  border-radius: 18px;
  background: #1d1712;
  box-shadow: 0 14px 30px rgba(60, 40, 20, 0.22);
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.features li {
  background: #fffdf8;
  border: 2px solid #e6dcc6;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
}

.features p {
  margin: 0;
  color: var(--ink-soft);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.gallery a,
.downloads a {
  display: block;
  border: 3px solid var(--edge);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.12s ease;
}

.gallery a:hover,
.downloads a:hover {
  transform: translateY(-3px);
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.split {
  display: grid;
  grid-template-columns: 1.5fr minmax(200px, 300px);
  align-items: center;
  gap: 2.5rem;
}

.phone {
  border: 8px solid #2c221a;
  border-radius: 34px;
  box-shadow: 0 16px 34px rgba(60, 40, 20, 0.28);
}

@media (max-width: 720px) {
  .split {
    grid-template-columns: 1fr;
  }
  .phone {
    width: 62%;
    justify-self: center;
  }
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  font-family: var(--display);
  background: var(--tile);
  border: 2px solid #d6b98f;
  border-radius: 10px;
  padding: 0.3rem 0.8rem;
}

.closing {
  text-align: center;
}

.closing .stores,
.closing .cta {
  justify-content: center;
}

.closing .cta {
  margin-top: 1rem;
}

/* ── lightbox ──────────────────────────────────────────────────────── */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(96vw, 1920px);
  max-height: 96vh;
}

.lightbox::backdrop {
  background: rgba(30, 22, 15, 0.85);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
}

.lightbox form {
  text-align: center;
  margin-top: 0.6rem;
}

.lightbox button {
  font: 700 1rem var(--display);
  padding: 0.4rem 1.4rem;
  border: 2px solid var(--edge);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
}

/* ── text pages ────────────────────────────────────────────────────── */

.prose {
  width: min(46rem, 100% - 2rem);
  margin: 1.5rem auto 4rem;
}

.prose.wide {
  width: min(60rem, 100% - 2rem);
}

.prose h1 {
  font-size: clamp(2.1rem, 6vw, 3rem);
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.meta {
  color: var(--ink-soft);
}

.prose details {
  background: #fffdf8;
  border: 2px solid #e6dcc6;
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  margin-bottom: 0.6rem;
}

.prose summary {
  font-family: var(--display);
  font-size: 1.1rem;
  cursor: pointer;
}

.prose details p {
  margin: 0.6rem 0 0.2rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.5rem;
  margin: 0;
}

.facts dt {
  font-family: var(--display);
}

.facts dd {
  margin: 0;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.downloads a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
}

.downloads img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--sky);
}

.downloads span {
  display: block;
  padding: 0.35rem 0.6rem;
  border-top: 2px solid var(--edge);
}

.lost {
  text-align: center;
  padding: 2rem 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button,
  .store,
  .gallery a,
  .downloads a {
    transition: none;
  }
}
