@font-face { font-family: "Andika"; src: url("/fonts/andika-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/fonts/andika-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Sydney's Games: the home page. */

:root {
  --sky-top: #aee3ff;
  --sky-bottom: #fde2ff;
  --ink: #2b2250;
  --muted: #5b5480;
  --accent: #e0357f;
  --accent-dark: #a8245e;
  --card: #ffffff;
  font-family: "Andika", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  font-weight: 700;
  color: var(--ink);
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}
body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.45;
}

.hero { text-align: center; padding: 40px 16px 8px; }
.hero h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 88px);
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 4px 0 var(--accent), 0 9px 0 rgba(0, 0, 0, .12);
}
.tagline { margin: 14px 0 0; font-size: clamp(18px, 2.4vw, 24px); }
.hello {
  position: relative;
  display: inline-block;
  max-width: 640px;
  margin: 22px auto 0;
  padding: 14px 22px;
  background: #fff;
  border-radius: 24px;
  font-size: clamp(19px, 2.6vw, 26px);
  box-shadow: 0 4px 0 rgba(43, 34, 80, .08);
}
.hello::before { /* the little tail of a speech bubble */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  margin-left: -12px;
  border: 12px solid transparent;
  border-top: 0;
  border-bottom: 14px solid #fff;
}

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 8px; }

.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }

.card {
  background: var(--card);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 8px 0 rgba(43, 34, 80, .08), 0 18px 40px rgba(43, 34, 80, .08);
  display: flex;
  flex-direction: column;
}
.thumb { display: block; aspect-ratio: 8 / 5; background: #dff3ff; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card h2 { margin: 0; font-size: 28px; line-height: 1.15; }
.kid { margin: 0; font-size: 20px; }

.play {
  align-self: flex-start;
  font-size: 26px;
  padding: 12px 34px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--accent-dark);
}
.play:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-dark); }
.play:focus-visible, summary:focus-visible, .thumb:focus-visible { outline: 4px solid #3b7bff; outline-offset: 3px; }

details { font-size: 16px; color: var(--muted); }
summary {
  cursor: pointer;
  font-size: 17px;
  color: var(--ink);
  padding: 10px 14px;
  margin: 0 -14px;
  border-radius: 12px;
  min-height: 44px;
  list-style-position: inside;
}
summary:hover { background: #f3f0fb; }
details[open] summary { margin-bottom: 4px; }
details p, details ol { margin: 8px 0 0; }
details ol { padding-left: 22px; }
details li { margin: 4px 0; }

.about {
  margin: 32px auto 0;
  max-width: 720px;
  text-align: center;
  background: rgba(255, 255, 255, .65);
  border-radius: 24px;
  padding: 18px 24px;
}
.about h2 { margin: 0 0 6px; font-size: 24px; }
.about p { margin: 0; font-size: 18px; }

.signup {
  margin: 24px auto 0;
  max-width: 720px;
  background: #fff;
  border-radius: 24px;
  padding: 20px 24px 22px;
  box-shadow: 0 4px 0 rgba(43, 34, 80, .08);
}
.signup h2 { margin: 0 0 6px; font-size: 22px; }
.signup > p { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.signup form { display: grid; gap: 12px; }
.signup .field { display: grid; gap: 4px; font-size: 15px; }
.signup input[type="email"] {
  font: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border: 2px solid #d8d2ee;
  border-radius: 14px;
  min-height: 48px;
}
.signup input[type="email"]:focus { outline: none; border-color: #3b7bff; }
.signup .check { display: flex; align-items: center; gap: 10px; font-size: 17px; min-height: 44px; }
.signup .check input { width: 26px; height: 26px; accent-color: var(--accent); }
.signup .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup button {
  justify-self: start;
  font: inherit;
  font-size: 19px;
  padding: 12px 24px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 0 var(--accent-dark);
  cursor: pointer;
  min-height: 48px;
}
.signup button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-dark); }
.signup .signup-msg { margin: 0; min-height: 1.4em; font-size: 16px; }
.signup form.done .field, .signup form.done .check, .signup form.done button { display: none; }
footer a { color: inherit; }

footer { text-align: center; color: var(--muted); font-size: 14px; padding: 28px 16px 36px; }
footer p { margin: 4px 0; }

@media (max-width: 520px) {
  .hero { padding-top: 28px; }
  .card h2 { font-size: 24px; }
  .kid { font-size: 18px; }
  .play { font-size: 22px; }
}

/* Body text in regular weight; headings and buttons stay bold. */
.kid, details, .about p, .signup > p, .signup .field, .signup .check, .signup .signup-msg, footer, .hello { font-weight: 400; }

/* Text wraps without leaving one lonely word on a line. */
h1, h2, .hello { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* A little life when a mouse points at a game. */
.card { transition: transform .2s ease, box-shadow .2s ease; }
.thumb img { transition: transform .35s ease; }
.play { transition: transform .15s ease, box-shadow .15s ease; }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 12px 0 rgba(43, 34, 80, .08), 0 24px 44px rgba(43, 34, 80, .12); }
  .card:hover .thumb img { transform: scale(1.04); }
  .card:hover .play { animation: hop .6s ease-in-out 1; }
  .play:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--accent-dark); }
  .signup button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-dark); }
}
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } 70% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
