/* Topsy Tune: paper, ink and one red, like the game's own menus. Every colour comes from these tokens. */
@font-face { font-family: "Abril Fatface"; src: url("fonts/AbrilFatface-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("fonts/LibreBaskerville.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("fonts/SpecialElite-Regular.ttf") format("truetype"); font-display: swap; }
:root {
  --paper: #EFE2C4; --paper-2: #E2CFA6; --ink: #1E1611; --ink-soft: #4a3b30; --red: #C23B2A; --red-dark: #9e2e20; --gold: #E0B23A;
  --display: "Abril Fatface", Georgia, serif; --body: "Libre Baskerville", Georgia, serif; --label: "Special Elite", "Courier New", monospace;
  --shadow: 6px 7px 0 var(--ink); --radius: 4px; --max: 1180px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 72px; --s7: 112px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--body);
  /* a faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .09 0 0 0 0 .07 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); text-align: center; }
.sub { text-align: center; max-width: 60ch; margin: var(--s2) auto var(--s5); color: var(--ink-soft); }
section { padding: var(--s6) var(--s2); }
section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* the logo, drawn as in the game: TOPSY in ink over a rule, TUNE in red upside down, on a framed paper card */
.mini-logo { display: inline-flex; flex-direction: column; align-items: flex-start; font: 22px/0.9 var(--display); letter-spacing: .01em; }
.mini-logo b { font-weight: 400; border-bottom: 2.5px solid var(--ink); padding-bottom: 2px; }
.mini-logo i { font-style: normal; color: var(--red); transform: scaleY(-1); margin-top: 1px; }
.logo-card { display: inline-flex; flex-direction: column; align-items: flex-start; background: var(--paper); border: 4px solid var(--ink); outline: 2px solid var(--ink); outline-offset: -11px;
  padding: .32em .42em .4em; font-size: clamp(3.6rem, 12vw, 7.2rem); line-height: .86; box-shadow: 10px 12px 0 var(--ink); transform: rotate(-2deg); }
.logo-card .rule { display: block; width: 100%; height: .07em; background: var(--ink); margin: .05em 0 .06em; }
.logo-card .t2 { color: var(--red); transform: scaleY(-1); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s2); background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 2px solid var(--ink); backdrop-filter: blur(4px); }
.brand { text-decoration: none; color: var(--ink); }
.top nav { display: none; gap: var(--s3); margin-left: auto; font-family: var(--label); }
.top nav a { color: var(--ink); text-decoration: none; padding: 8px 2px; }
.top nav a:hover { color: var(--red); }
.top .btn-small { margin-left: auto; }
@media (min-width: 860px) { .top nav { display: flex; } .top .btn-small { margin-left: 0; } }

/* buttons: ink-framed cards with a flat shadow that the press pushes in */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 22px; font: 1.05rem/1.2 var(--label); text-decoration: none; cursor: pointer;
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s ease-out, box-shadow .15s ease-out; touch-action: manipulation; }
.btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 9px 0 var(--ink); }
.btn:active { transform: translate(4px, 5px); box-shadow: 2px 2px 0 var(--ink); }
.btn-red { background: var(--red); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: .95rem; box-shadow: 4px 4px 0 var(--ink); }

/* hero */
.hero { display: grid; gap: var(--s5); align-items: center; padding-top: var(--s5); }
.tagline { font: clamp(1.6rem, 4vw, 2.2rem)/1.2 var(--display); margin: var(--s4) 0 var(--s1); }
.lede { max-width: 46ch; margin: 0 0 var(--s4); }
.ctas { display: flex; flex-wrap: wrap; gap: var(--s2); }
.soon { font: .95rem var(--label); color: var(--ink-soft); margin-top: var(--s3); }
.frame { position: relative; border: 4px solid var(--ink); background: var(--ink); box-shadow: 10px 12px 0 var(--ink); border-radius: var(--radius); margin: 0; }
.trailer video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sound { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; font: .9rem var(--label);
  color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; cursor: pointer; }
.sound svg { width: 20px; height: 20px; fill: var(--ink); stroke: var(--ink); stroke-width: 2; }
.sound[aria-pressed="false"] .w { display: none; }
@media (min-width: 960px) { .hero { grid-template-columns: 5fr 6fr; } }

/* marquee */
.marquee { overflow: hidden; background: var(--ink); color: var(--paper); border-block: 3px solid var(--ink); }
.track { display: flex; width: max-content; animation: slide 30s linear infinite; }
.track span { font: 1.4rem/1 var(--display); padding: 16px 28px; white-space: nowrap; }
.track span::after { content: "♪"; color: var(--gold); margin-left: 56px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* how it plays */
.how h2 { margin-bottom: var(--s5); }
.cards { list-style: none; padding: 0; display: grid; gap: var(--s5); }
.card { background: var(--paper); padding: 0 0 var(--s3); }
.card video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 4px solid var(--ink); }
.card h3 { font-size: 1.7rem; padding: var(--s3) var(--s3) var(--s1); display: flex; align-items: center; gap: 12px; }
.card p { padding: 0 var(--s3); margin: 0; }
.num { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; background: var(--red); color: var(--paper); border: 3px solid var(--ink); border-radius: 50%; font-size: 1.2rem; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }

/* worlds and bosses */
.grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.grid li { border: 3px solid var(--ink); background: var(--paper); box-shadow: 5px 6px 0 var(--ink); border-radius: var(--radius); overflow: hidden; }
.grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--ink); }
.grid p { margin: 0; padding: 8px 12px; font: .95rem/1.3 var(--label); display: flex; justify-content: space-between; gap: 8px; }
.grid p span { color: var(--ink-soft); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1050px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.bosses { background: var(--ink); color: var(--paper); }
.bosses .sub { color: var(--paper-2); }
.boss-grid li { border-color: var(--paper); box-shadow: 5px 6px 0 var(--red); background: var(--ink); }
.boss-grid img { border-color: var(--paper); }
.boss-grid p span { color: var(--gold); }

/* features */
.feat { list-style: none; padding: 0; display: grid; gap: var(--s4) var(--s5); margin-top: var(--s5); }
.feat li { display: grid; grid-template-columns: 56px 1fr; column-gap: var(--s2); align-items: start; }
.feat svg { grid-row: span 2; width: 56px; height: 56px; fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.feat h3 { font-size: 1.5rem; }
.feat p { margin: 4px 0 0; }
@media (min-width: 760px) { .feat { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .feat { grid-template-columns: repeat(3, 1fr); } }

/* short videos in little phones */
.shorts { background: var(--paper-2); border-block: 3px solid var(--ink); }
.phones { list-style: none; padding: 0; display: flex; gap: var(--s4); justify-content: center; flex-wrap: wrap; margin-top: var(--s5); }
.phones li { width: min(260px, 80vw); text-align: center; font: .95rem var(--label); }
.phone { position: relative; display: block; width: 100%; padding: 10px; background: var(--ink); border: 0; border-radius: 28px; box-shadow: 8px 9px 0 var(--red); cursor: pointer; }
.phone img, .phone video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 18px; }
.phone .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.phone .play::after { content: ""; position: absolute; left: 27px; top: 20px; border-left: 24px solid var(--ink); border-block: 15px solid transparent; }
.phone.on .play { display: none; }

/* demo band */
.demo-band { text-align: center; background: var(--red); color: var(--paper); border-bottom: 3px solid var(--ink); }
.demo-band p { max-width: 52ch; margin: var(--s2) auto var(--s4); }

/* press */
.press h2 { margin-bottom: var(--s5); }
.press-cols { display: grid; gap: var(--s5); }
.facts { background: var(--paper); padding: var(--s3); display: grid; gap: 12px; margin: 0; }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; border-bottom: 1px dashed var(--ink-soft); padding-bottom: 8px; }
.facts dt { font-family: var(--label); color: var(--ink-soft); }
.facts dd { margin: 0; }
.press-text p { margin-top: 0; max-width: 60ch; }
@media (min-width: 900px) { .press-cols { grid-template-columns: 2fr 3fr; } }

.foot { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s5) var(--s2); border-top: 3px solid var(--ink); font: .95rem var(--label); text-align: center; }

/* things land as they scroll in */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .45s ease-out, transform .45s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}

/* news from the admin page */
.news-list { list-style: none; padding: 0; display: grid; gap: var(--s2); max-width: 760px; }
.news-list li { background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 5px 6px 0 var(--ink); padding: 18px 20px; }
.news-list time { font: 14px var(--label); color: var(--ink-soft); }
.news-list h3 { font: 400 1.5rem var(--display); margin: 4px 0 0; }
.news-list p { margin: 8px 0 0; }
[hidden] { display: none !important; }
