/* Sunny Plot Games / Harvest Hours - the game's palette: cream paper, dark-brown ink, grass green, tomato red. */

@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-12.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #fbf3e2;
  --card: #f7e7c6;
  --card-edge: #e3c99a;
  --ink: #4a2e22;
  --ink-soft: #6a4434;
  --grass: #3d8848;
  --grass-dark: #2b6534;
  --grass-deep: #1f4a27;
  --tomato: #d65a35;
  --tomato-dark: #a8401f;
  --leaf: #5c9a3e;
  --gold: #e8b44a;
  --pixel: "Fusion Pixel", ui-monospace, monospace;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; }

a { color: var(--tomato-dark); }
a:hover { color: var(--tomato); }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* The pixel font is drawn on a 12 px grid: keep it at whole multiples so every glyph stays crisp. */
h1, h2, h3, .pixel-text, .btn, .site-nav a, .brand {
  font-family: var(--pixel);
  font-weight: normal;
  letter-spacing: 0;
}
h1 { font-size: 48px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 36px; line-height: 1.3; margin: 0 0 16px; }
h3 { font-size: 24px; line-height: 1.35; margin: 0 0 8px; }
@media (max-width: 640px) {
  h1 { font-size: 36px; }
  h2 { font-size: 24px; }
}

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 3px solid var(--ink);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 24px; }
.brand img { width: 32px; height: 32px; }
.site-nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 24px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--tomato); }
@media (max-width: 640px) {
  .brand span { display: none; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 24px; }
  .site-nav .wide-only { display: none; }
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 12px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.btn:hover { color: #fff; background: #e1673f; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.secondary { background: var(--card); color: var(--ink); }
.btn.secondary:hover { background: #fff3da; color: var(--ink); }
.btn.green { background: var(--leaf); }
.btn.green:hover { background: #69a948; }
.btn .soon {
  font-size: 12px;
  padding: 3px 6px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
}

/* ------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 72px 16px 88px;
  background: var(--grass) url("../img/hero.webp") center / cover no-repeat;
  image-rendering: pixelated;
  border-bottom: 3px solid var(--ink);
}
@media (max-width: 900px) {
  .hero { background-image: url("../img/hero-tall.webp"); background-position: center 40%; }
}
.hero-card {
  position: relative;
  width: min(820px, 100%);
  padding: 40px 40px 32px;
  text-align: center;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 8px 0 rgba(31, 74, 39, 0.55);
  image-rendering: auto;
}
.hero-card .logo { width: min(492px, 100%); height: auto; margin: 0 auto 8px; image-rendering: pixelated; }
.hero-card .subtitle { font-family: var(--pixel); font-size: 24px; color: var(--ink-soft); margin: 0 0 16px; }
.hero-card .tagline { font-size: 21px; margin: 0 auto 24px; max-width: 46ch; }
.hero-card .sticker {
  position: absolute;
  top: -44px;
  left: -36px;
  width: 104px;
  height: 104px;
  image-rendering: pixelated;
  transform: rotate(-8deg);
}
.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.release-line { margin: 20px 0 0; font-family: var(--pixel); font-size: 24px; color: var(--grass-dark); }
@media (max-width: 640px) {
  .hero { padding: 56px 12px 64px; }
  .hero-card { padding: 32px 16px 24px; }
  .btn { padding: 10px 14px 12px; }
  .hero-card .sticker { width: 72px; height: 72px; top: -30px; left: -14px; }
  .hero-card .tagline { font-size: 18px; }
}

/* ------------------------------------------------------------ sections */

section { padding: 88px 0; }
section.green {
  background: var(--grass-dark);
  color: #fdf6e6;
  border-block: 3px solid var(--ink);
}
section.green h2, section.green h3 { color: #fff3da; }
section.green a { color: #ffd99a; }
.lead { font-size: 21px; max-width: 62ch; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
@media (max-width: 900px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(74, 46, 34, 0.25);
}
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--ink); }
.card .body { padding: 18px 20px 22px; }
.card .num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: 8px;
  font-family: var(--pixel);
  font-size: 24px;
  color: #fff;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 50%;
  vertical-align: middle;
}
.card p { margin: 8px 0 0; }

/* Alternating picture / words rows */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  margin-top: 72px;
}
.feature:first-of-type { margin-top: 40px; }
.feature.flip .shot { order: 2; }
@media (max-width: 900px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 48px; }
  .feature.flip .shot { order: 0; }
}
.shot {
  border: 3px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(74, 46, 34, 0.25);
  background: var(--grass);
}
.shot img { width: 100%; }
.ticks { list-style: none; padding: 0; margin: 16px 0 0; }
.ticks li { position: relative; padding-left: 32px; margin: 10px 0; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 16px;
  height: 16px;
  background: var(--leaf);
  border: 3px solid var(--ink);
  border-radius: 3px;
}
section.green .ticks li::before { background: var(--gold); }

/* ------------------------------------------------------------ gallery */

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .gallery { gap: 10px; } }
.gallery a {
  display: block;
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.12s;
}
.gallery a:hover { transform: translateY(-3px); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

dialog.viewer {
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  max-width: min(1600px, 94vw);
}
dialog.viewer::backdrop { background: rgba(20, 30, 20, 0.82); }
dialog.viewer img { width: 100%; height: auto; max-height: 86vh; object-fit: contain; }
dialog.viewer button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  font: 24px/1 var(--pixel);
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}

/* ------------------------------------------------------------ closing call + footer */

.closing { text-align: center; }
.closing .tomato { width: 96px; margin: 0 auto 16px; image-rendering: pixelated; }

.site-footer {
  background: var(--grass-deep);
  color: #e9dcc0;
  padding: 40px 0 48px;
  font-size: 16px;
  border-top: 3px solid var(--ink);
}
.site-footer a { color: #ffd99a; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer .credits { opacity: 0.8; max-width: 60ch; }


/* ------------------------------------------------------------ seasons on the hero */

/* Two picture layers under the card: the season the date calls for (or the one picked) fades in over the other.
   Without JavaScript the plain hero stays, as the section's own background. */
.hero-bg {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.hero-bg.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-bg { transition: none; } }
.hero-card { z-index: 2; }

/* Blossom, autumn leaves or snow drifting down the whole page, in the game's blocky pixels: a fixed layer over
   everything that never takes a click, sparse and soft enough to read through. Summer has none. */
.site-weather { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 50; }
.site-weather span {
  position: absolute;
  top: -16px;
  width: 6px;
  height: 6px;
  opacity: 0;
  will-change: transform, opacity;
  animation: drift linear infinite;
}
body[data-season="winter"] .site-weather span { background: #fff; box-shadow: 0 0 0 1px rgba(110, 166, 216, 0.3); }
body[data-season="autumn"] .site-weather span { background: #d8782e; width: 8px; height: 6px; box-shadow: 1px 1px 0 rgba(74, 40, 20, 0.3); }
body[data-season="autumn"] .site-weather span:nth-child(3n) { background: #c9a227; }
body[data-season="autumn"] .site-weather span:nth-child(3n+1) { background: #9a4a1f; }
/* Spring's cherry blossom: the game's blossom pinks (Tools/Art/game_palette.py). */
body[data-season="spring"] .site-weather span { background: #ffd2e0; width: 6px; height: 5px; box-shadow: 1px 1px 0 rgba(180, 90, 134, 0.35); }
body[data-season="spring"] .site-weather span:nth-child(3n) { background: #f5a8c4; }
body[data-season="spring"] .site-weather span:nth-child(3n+1) { background: #fff0f4; }
body:not([data-season="winter"]):not([data-season="autumn"]):not([data-season="spring"]) .site-weather { display: none; }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  6% { opacity: var(--alpha, 0.8); }
  94% { opacity: var(--alpha, 0.8); }
  100% { transform: translate(var(--sway, 40px), calc(100vh + 32px)) rotate(var(--spin, 360deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .site-weather { display: none; } }

/* The season picker on the card: four little chips, the picked one pressed in. */
.season-pick { margin: 22px 0 0; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.season-pick .label { font-family: var(--pixel); font-size: 24px; color: var(--ink-soft); margin-right: 4px; }
.season-pick button {
  font: 24px/1 var(--pixel);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 6px;
  padding: 7px 12px 9px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
}
.season-pick button:hover { background: #fff3da; }
.season-pick button[aria-pressed="true"] {
  background: var(--leaf);
  color: #fff;
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}
.season-pick button[data-season="spring"][aria-pressed="true"] { background: #dc7ea6; }
.season-pick button[data-season="autumn"][aria-pressed="true"] { background: #d8782e; }
.season-pick button[data-season="winter"][aria-pressed="true"] { background: #6ea6d8; }
@media (max-width: 640px) { .season-pick .label { width: 100%; margin: 0 0 2px; } }

/* The four seasons side by side under "Four seasons", two by two on a tablet, and the desktop mode's two little shots. */
.season-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
@media (max-width: 900px) { .season-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .season-strip { grid-template-columns: minmax(0, 1fr); } }
.season-strip figure { margin: 0; }
.season-strip a { display: block; border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; transition: transform 0.12s; }
.season-strip a:hover { transform: translateY(-3px); }
.season-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.season-strip figcaption { font-family: var(--pixel); font-size: 24px; margin-top: 8px; text-align: center; color: #fff3da; }
.shot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.shot-pair a { display: block; border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; transition: transform 0.12s; }
.shot-pair a:hover { transform: translateY(-3px); }
.shot-pair img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ------------------------------------------------------------ shorter page: header wishlist, facts, tiles */

/* A small wishlist button that rides along in the sticky header, so it's always one click away. */
.btn.small { font-size: 12px; padding: 7px 12px 8px; border-width: 2px; box-shadow: 0 3px 0 var(--ink); }
.site-header .btn.small { margin-left: 4px; }
@media (min-width: 641px) { .btn.small { font-size: 24px; padding: 6px 14px 8px; } }
@media (max-width: 640px) { .site-nav a[href="#screenshots"] { display: none; } }

/* The game at a glance, in one line under the hero. */
.facts {
  list-style: none;
  margin: 0;
  padding: 18px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 40px;
  background: var(--card);
  border-bottom: 3px solid var(--ink);
  font-family: var(--pixel);
  font-size: 24px;
  color: var(--ink-soft);
}
.facts b { font-weight: normal; color: var(--tomato-dark); }
@media (max-width: 640px) { .facts { gap: 4px 20px; font-size: 12px; } .facts b { font-size: 24px; } }

/* Six things to do on a break, as cards: three across, two on a tablet, one on a phone. */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* On a phone the six cards swipe sideways instead of stacking six screens deep; the next one peeks in. */
@media (max-width: 560px) {
  .tiles {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -16px;
    padding: 4px 16px 14px;
    scroll-padding-inline: 16px;
  }
  .tiles .card { flex: 0 0 84%; scroll-snap-align: start; }
}
.tiles .card p { font-size: 16px; }
.center-block { margin-inline: auto; text-align: center; }

.feature h2 { margin-bottom: 12px; }
.feature .season-strip { margin-top: 20px; gap: 10px; }
.feature .season-strip figcaption { font-size: 12px; margin-top: 4px; }
#desktop .feature, #seasons .feature, #tools .feature { margin-top: 0; }
@media (max-width: 480px) { .feature .season-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gallery.more { margin-top: 16px; }
/* Two across leaves the ninth on its own; festival night is in the cards above anyway. */
@media (max-width: 900px) { .gallery:not(.more) a:nth-child(9) { display: none; } }
.gallery[hidden] { display: none; }
.more-row { margin: 32px 0 0; }

/* ------------------------------------------------------------ press kit */

.press-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; padding: 56px 0 88px; }
@media (max-width: 900px) { .press-layout { grid-template-columns: minmax(0, 1fr); } }
.factsheet {
  position: sticky;
  top: 80px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 20px 22px;
  font-size: 16px;
}
@media (max-width: 900px) { .factsheet { position: static; } }
.factsheet h2 { font-size: 24px; margin-bottom: 8px; }
.factsheet dl { margin: 0; }
.factsheet dt { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--ink-soft); margin-top: 14px; }
.factsheet dd { margin: 2px 0 0; }
.press-main section { padding: 0; margin-bottom: 56px; }
.press-main h2 { border-bottom: 3px solid var(--card-edge); padding-bottom: 6px; }
.downloads { display: flex; flex-wrap: wrap; gap: 16px; margin: 20px 0 8px; }
.note { font-size: 16px; color: var(--ink-soft); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .gallery a, .season-strip a, .shot-pair a, .season-pick button { transition: none; }
}
