/* games.knitstech.com — the visual language of knitstech.com (tokens copied from its globals.css):
   an off-white page, Tinos italic for display, Inter for text, pill buttons, cards rounded by 32px with a motif,
   a full-bleed yellow band, a dark textured footer. Breakpoints as there: 590px and 877px. */
:root {
  --bg: #F8F8F6; --text: #282828; --text-hover: #1B1B1B; --muted: rgba(40, 40, 40, .62);
  --orange: #D24C23; --orange-hover: #C04019; --yellow: #FDC27C; --green: #319B58; --green-deep: #247D45;
  --inverse: #FFFFFF; --inverse-2: rgba(255, 255, 255, .85); --line: #D9D5CA;
  --wide: 1344px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 22px; color: var(--text); background: var(--bg); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: Tinos, Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -.04em; line-height: 1; margin: 0; }
h3 { font-size: 24px; line-height: 28px; font-weight: 600; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }

/* ----- header ----- */
.bar { max-width: var(--wide); margin: 16px auto 0; padding: 0 16px; min-height: 44px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; text-decoration: none; }
.brand-full { display: none; }
.bar-title { font-family: Tinos, Georgia, serif; font-style: italic; font-size: 22px; letter-spacing: -.03em; padding-left: 12px; border-left: 1px solid var(--line); }
.bar-nav { display: none; gap: 28px; margin: 0 auto; }
.bar-nav a { text-decoration: none; }
.bar-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lang { margin-left: auto; display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lang button { font: inherit; font-size: 14px; line-height: 20px; padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: var(--text); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--inverse); }

/* ----- buttons and links ----- */
.btn { display: inline-block; text-align: center; text-decoration: none; border-radius: 999px; font-size: 16px; font-weight: 500; line-height: 22px; padding: 17px 24px; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-hover); }
.btn-dark { background: var(--text); color: var(--inverse); }
.btn-dark:hover { background: var(--text-hover); }
.textlink { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(40, 40, 40, .3); }
.textlink:hover { text-decoration-color: currentColor; }

/* ----- hero: the words, and the game itself as the one loud thing ----- */
.hero { max-width: var(--wide); margin: 0 auto; padding: 56px 16px 72px; display: grid; gap: 40px; }
.hero h1 { font-size: 40px; text-align: center; text-wrap: balance; }
.lead { margin-top: 20px; font-size: 16px; line-height: 22px; text-align: center; max-width: 34em; margin-left: auto; margin-right: auto; }
.hero-actions { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-actions .btn { width: 100%; }
.shot { display: block; border-radius: 20px; overflow: hidden; box-shadow: 0 12px 32px -12px rgba(40, 40, 40, .35); background: #e9e6df; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 42%; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.015); }

/* ----- the yellow band ----- */
.now { background: var(--yellow); padding: 80px 0; }
.now h2 { font-size: 32px; }
.cards { margin-top: 40px; display: grid; gap: 8px; }
.card { border-radius: 32px; padding: 24px; min-height: 340px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; background-repeat: no-repeat; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card-body { max-width: 30em; }
.card-body ul { margin: 16px 0 0; padding: 0; list-style: none; }
.card-body li { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .28); }
.card-body .textlink { display: inline-block; margin-top: 16px; }
.card-green { background-color: var(--green); background-image: url(/img/patterns-bg.svg); background-position: right -30px top -20px; background-size: 260px; color: var(--inverse); }
.card-green p, .card-green li { color: var(--inverse-2); }
.card-plain { background-color: var(--bg); background-image: url(/img/bg-shape.svg); background-position: right -40px bottom -60px; background-size: 300px; }
.card-plain p { color: var(--muted); }

/* ----- footer ----- */
.foot { background: var(--text) url(/img/footer-texture.webp) repeat; padding: 60px 0; color: var(--inverse-2); }
.foot-in { display: flex; flex-direction: column; align-items: flex-start; gap: 36px; }
.foot-nav { display: flex; flex-direction: column; gap: 14px; }
.foot-nav a { text-decoration: none; }
.foot-nav a:hover { color: var(--inverse); }

/* ----- 404 ----- */
.lost { max-width: var(--wide); margin: 0 auto; padding: 96px 16px 140px; text-align: center; }
.lost h1 { font-size: 40px; }
.lost p { margin: 20px auto 28px; max-width: 30em; }

@media (min-width: 590px) {
  .brand-full { display: block; } .brand-mark { display: none; }
  .hero { padding-top: 88px; gap: 56px; }
  .hero h1 { font-size: 64px; }
  .lead { font-size: 18px; line-height: 24px; }
  .hero-actions { flex-direction: row; justify-content: center; gap: 28px; }
  .hero-actions .btn { width: auto; }
  .shot { border-radius: 32px; }
  .now { padding: 120px 0; }
  .now h2 { font-size: 48px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card { padding: 32px; min-height: 420px; }
  .lost h1 { font-size: 64px; }
}
@media (min-width: 877px) {
  .bar-nav { display: flex; }
  .lang { margin-left: 0; }
  /* words on the left, the game on the right and larger than its column: it runs off toward the page edge */
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 48px; padding-top: 96px; padding-bottom: 104px; }
  .hero h1, .lead { text-align: left; margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
  .cards { grid-template-columns: 7fr 5fr; }
  .foot { padding: 32px 0; }
  .foot-in { flex-direction: row; justify-content: space-between; align-items: center; }
  .foot-nav { flex-direction: row; gap: 28px; }
}

/* one moment of motion on load, as on knitstech.com: words come down, the game comes up */
@media (prefers-reduced-motion: no-preference) {
  .hero-text { animation: down .8s ease-out both; }
  .shot { animation: up .8s ease-out both; }
  @keyframes down { from { opacity: 0; transform: translateY(-40px); } }
  @keyframes up { from { opacity: 0; transform: translateY(40px); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .shot img { transition: none; } }
