/* Lunitora — site stylesheet. Mobile-first, system fonts only, no external assets.
   All colour pairs used for text meet WCAG AA contrast on their backgrounds. */

:root {
  color-scheme: dark;
  --bg: #0d1a36;
  --bg-raised: #14264b;
  --bg-sunken: #0a152c;
  --text: #fff8ec;
  --text-muted: #c9d3e6;
  --gold: #f3b33d;
  --gold-strong: #ffcf66;
  --ink-on-gold: #0d1a36;
  --line: rgba(255, 248, 236, 0.14);
  --pending-bg: #3a2a07;
  --pending-text: #ffe2a3;
  --radius: 14px;
  --radius-small: 10px;
  --gap: clamp(1rem, 3vw, 1.5rem);
  --content: 68rem;
  --reading: 42rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--text);
}

:focus-visible {
  outline: 3px solid var(--gold-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
  margin-top: 1.8em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.4em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

/* Layout */

.container {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.reading {
  max-width: var(--reading);
}

main {
  flex: 1 0 auto;
  padding-block: clamp(1.5rem, 5vw, 3.5rem);
}

/* Skip link */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 700;
  border-radius: var(--radius-small);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header and navigation: wraps under the wordmark on narrow screens */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.06em;
}

.wordmark:hover {
  color: var(--gold-strong);
}

/* Official logo on a cream plate: the navy cat and its cut-out features need a
   light ground to stay visible on the dark site. The artwork is not altered. */
.logo-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: var(--text);
}

.logo-badge img {
  width: 100%;
  height: auto;
}

.logo-badge--small {
  width: 2rem;
  height: 2rem;
  padding: 0.18rem;
  border-radius: 0.55rem;
}

@media (min-width: 64rem) {
  .wordmark .logo-badge {
    width: 3rem;
    height: 3rem;
  }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.site-nav {
  width: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  background: var(--bg-raised);
}

.site-nav a[aria-current="page"] {
  background: var(--bg-raised);
  color: var(--gold-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (min-width: 40rem) {
  .site-nav {
    width: auto;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
  align-self: center;
}

/* Hero and intro */

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lede {
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  color: var(--text-muted);
  max-width: var(--reading);
}

.hero {
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

/* Game page intro: app icon above the title on phones, beside it from 44 rem */
.hero--game {
  display: grid;
  gap: var(--gap);
  align-items: center;
}

.hero--game > div > :last-child {
  margin-bottom: 0;
}

@media (min-width: 44rem) {
  .hero--game {
    grid-template-columns: auto 1fr;
  }
}

/* Official Totolina Merge app icon: the complete square artwork at its own
   aspect ratio; the corner radius matches the placeholder it replaced. */
.app-icon {
  width: 100%;
  max-width: 14rem;
  border-radius: var(--radius);
}

.app-icon--hero {
  width: 8rem;
}

@media (min-width: 44rem) {
  .app-icon--hero {
    width: 10rem;
  }
}

@media (min-width: 64rem) {
  .app-icon--hero {
    width: 12rem;
  }
}

/* Cards */

.card {
  display: grid;
  gap: var(--gap);
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

@media (min-width: 44rem) {
  .card--feature {
    grid-template-columns: minmax(9rem, 14rem) 1fr;
    align-items: center;
  }
}

.card h2,
.card h3 {
  margin-top: 0;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--gold-strong);
  color: var(--ink-on-gold);
}

/* Artwork placeholders: same box sizes as the final images, so swapping in
   approved artwork does not move the layout. */

.art-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.75rem;
}

.art-placeholder--screenshot {
  aspect-ratio: 9 / 16;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li + li {
  margin-top: 0;
}

@media (min-width: 48rem) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Feature grid */

.feature-grid {
  display: grid;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-grid li + li {
  margin-top: 0;
}

@media (min-width: 44rem) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .feature-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.store-status {
  display: grid;
  gap: 0.75rem;
}

/* Pending (unapproved) content: clearly visible in drafts */

.pending {
  background: var(--pending-bg);
  color: var(--pending-text);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-weight: 600;
}

.notice {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-small);
  border: 1px solid var(--gold);
  background: var(--pending-bg);
  color: var(--pending-text);
  margin-bottom: 2rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

/* Legal text */

.toc {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--bg-raised);
  margin-bottom: 2rem;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.toc ol {
  margin-bottom: 0;
}

.toc a {
  display: inline-block;
  padding-block: 0.3rem;
}

.meta {
  color: var(--text-muted);
}

/* FAQ (native disclosure, no script) */

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--bg-raised);
  margin-bottom: 0.75rem;
}

.faq summary {
  cursor: pointer;
  min-height: 48px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  list-style-position: inside;
}

.faq details > div {
  padding: 0 1rem 1rem;
}

.faq details > div p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
