:root {
  color-scheme: light;
  --page-bg: #fff9fc;
  --page-bg-soft: #eefbff;
  --page-bg-warm: #fffbe8;
  --text: #2b2433;
  --muted: #6f6278;
  --accent: #7a2bbf;
  --accent-strong: #e0448f;
  --focus: #1585ff;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(145deg, var(--page-bg) 0%, var(--page-bg-soft) 48%, var(--page-bg-warm) 100%);
  color: var(--text);
  font-family:
    "Fredoka", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1rem;
  font-weight: 350;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

.page-shell {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  gap: clamp(1rem, 4vh, 2.5rem);
}

.main-content {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(100%, 44rem);
  margin: 0 auto;
  padding-block: clamp(1rem, 7vh, 4rem);
  gap: clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

.logo {
  width: clamp(13rem, 45vmin, 22rem);
  filter: drop-shadow(0 1rem 2rem rgb(85 45 117 / 18%));
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: min(100%, 34rem);
  gap: clamp(0.75rem, 2vw, 1rem);
}

.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(10.5rem, 38vw, 13rem);
  aspect-ratio: 250 / 81;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  font: inherit;
  outline: 0;
  text-decoration: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.store-button:not(.store-button--disabled):hover {
  transform: translateY(-0.125rem);
}

.store-button:focus-visible {
  box-shadow:
    0 0 0 0.2rem #fff,
    0 0 0 0.4rem var(--focus);
}

.store-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.store-button--disabled,
.store-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.75);
  opacity: 0.42;
}

.site-footer {
  color: var(--muted);
  font-size: clamp(0.98rem, 2.6vw, 1.08rem);
  line-height: 1.7;
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.35rem;
  font-weight: 350;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.9rem;
}

.footer-links a {
  color: var(--accent);
  font-weight: 450;
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.footer-links a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.footer-links a:focus-visible {
  border-radius: 0.25rem;
  outline: 0.18rem solid var(--focus);
  outline-offset: 0.18rem;
}

@media (max-width: 30rem) {
  .store-buttons {
    flex-direction: column;
    align-items: center;
  }

  .store-button {
    width: min(100%, 13rem);
  }
}

@media (max-height: 38rem) and (min-width: 40rem) {
  .page-shell {
    padding-block: 1rem;
  }

  .main-content {
    padding-block: 0.5rem;
    gap: 0.9rem;
  }

  .logo {
    width: clamp(10rem, 36vmin, 16rem);
  }

  .store-button {
    width: 11rem;
  }

  .site-footer {
    font-size: 0.95rem;
  }
}

/* ── Text content pages (Privacy Policy, Terms of Service) ── */

.page-content {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding-block: clamp(1rem, 5vh, 3rem);
  line-height: 1.75;
}

.page-content h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--accent);
}

.page-content .last-updated {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-content h2 {
  margin: 2rem 0 0.5rem;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 600;
  color: var(--accent);
}

.page-content h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.page-content p {
  margin: 0 0 0.75rem;
}

.page-content ul {
  margin: 0 0 0.75rem;
  padding-left: 1.4rem;
}

.page-content li {
  margin-bottom: 0.25rem;
}

/* ── Contact form ── */

.contact-intro {
  margin: 0 0 2rem;
  color: var(--muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-weight: 500;
  font-size: 0.95rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #d8cfe0;
  border-radius: 0.6rem;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(122 43 191 / 15%);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #bfb4cc;
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.char-count {
  align-self: flex-end;
  font-size: 0.8rem;
  color: var(--muted);
}

.char-count--near {
  color: var(--accent-strong);
  font-weight: 500;
}

.cf-turnstile {
  align-self: flex-start;
}

.form-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  padding: 0;
}

.form-status:not(:empty) {
  padding: 0.65rem 0.9rem;
}

.form-status--success {
  background: #edf7ed;
  color: #1a6e1a;
}

.form-status--error {
  background: #fdedf0;
  color: #b91c3c;
}

.btn-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.75rem 2rem;
  border: 0;
  border-radius: 2rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.btn-submit:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-submit:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.btn-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgb(255 255 255 / 40%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-spin 0.7s linear infinite;
}

.btn-submit--loading .btn-spinner {
  display: block;
}

@keyframes contact-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
