/* Critters Studio — one-page marketing site
   Tokens mirror design/design.json. */

:root {
  --bg: #0b1f33;
  --bg-footer: #091a2b;
  --card-top: #12293f;
  --card-bottom: #0e2235;

  --text-primary: #ffffff;
  --text-body: #eaf1f8;
  --text-muted: #93aac1;
  --text-nav: #b9cbdd;
  --text-faint: #5e7891;
  --text-pill: #c6d7e7;

  --accent: #f5a623;
  --accent-hover: #ffc15e;
  --accent-text: #ffd08a;
  --blue: #7fa6ce;

  --purple-glow: rgba(97, 88, 140, 0.5);
  --blue-glow: rgba(127, 166, 206, 0.32);

  --border: rgba(127, 166, 206, 0.16);
  --border-pill: rgba(127, 166, 206, 0.2);
  --pill-bg: rgba(127, 166, 206, 0.1);
  --pill-hover-bg: rgba(245, 166, 35, 0.14);
  --pill-hover-border: rgba(245, 166, 35, 0.5);

  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: Outfit, system-ui, sans-serif;

  --radius-card: 24px;
  --radius-pill: 12px;

  --page-x: 48px;
  --grid-gap: 28px;
  --max-w: 1400px;

  --shadow-card-hover: 0 26px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header. */
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  /* clip (et non hidden) : garde le header sticky fonctionnel tout en
     empechant le scroll horizontal cause par les blobs du hero. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

img,
video { display: block; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #10202f;
  font-weight: 600;
  border-radius: 0 0 var(--radius-pill) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Brand lockup ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  height: 34px;
  /* width/height attributes are presentational hints — reset width so the
     mark keeps its 942x1244 ratio when only the height is scaled. */
  width: auto;
}
.brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand em {
  color: var(--blue);
  font-style: normal;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px var(--page-x);
  background: rgba(11, 31, 51, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  color: var(--text-nav);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 34px var(--page-x) 30px;
}
.hero__inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.hero__mark {
  height: 88px;
  width: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.45));
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.hero h1 em {
  color: var(--blue);
  font-style: normal;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.blob--a {
  top: -220px;
  left: 6%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--purple-glow), rgba(97, 88, 140, 0) 72%);
  animation: driftA 18s ease-in-out infinite;
}
.blob--b {
  top: -120px;
  right: 8%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, var(--blue-glow), rgba(127, 166, 206, 0) 74%);
  animation: driftB 22s ease-in-out infinite;
}

@keyframes driftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}
@keyframes driftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 25px) scale(1.05); }
}

/* ---------- Games grid ---------- */

.games {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-x) 110px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--grid-gap);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%);
  border: 1px solid var(--border);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-8px);
  border-color: var(--pill-hover-border);
  box-shadow: var(--shadow-card-hover);
}

.card__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg);
}
.card__thumb img,
.card__thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__thumb video {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover .card__thumb video,
.card:focus-within .card__thumb video,
.card.is-playing .card__thumb video { opacity: 1; }

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 11px;
  padding: 20px 22px;
}
.card__body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.card__body p {
  margin: 0;
  flex: 1;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lien plein-carte : couvre la tuile, les badges restent au-dessus. */
.card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-card);
}

/* ---------- Store badges ---------- */

/* Official App Store / Poki lockups: never recoloured, restyled or stretched.
   They only get a focus ring and a subtle lift on hover. */
.stores {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.badge {
  display: inline-flex;
  border-radius: 8px;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.badge img {
  display: block;
  height: 40px;
  width: auto;
}
.badge:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Content pages (privacy, support) ---------- */

.page {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 54px var(--page-x) 110px;
}

.page__head {
  padding-bottom: 26px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
}
.page__head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.page__meta {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-faint);
}

.prose {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-body);
  text-wrap: pretty;
}
.prose > * + * { margin-top: 18px; }
.prose h2 {
  margin: 48px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.prose h3 {
  margin: 28px 0 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--blue);
}
.prose h2 + p,
.prose h2 + ul,
.prose h3 + p,
.prose h3 + ul { margin-top: 10px; }
.prose ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text-muted);
}
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--blue); }
.prose strong {
  font-weight: 600;
  color: var(--text-primary);
}
.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(245, 166, 35, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  overflow-wrap: anywhere;
}
.prose a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* Boxed contact block, reuses the card gradient. */
.prose .callout {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%);
  border: 1px solid var(--border);
}
.prose .callout > * + * { margin-top: 8px; }
.prose .callout p { margin: 0; }

.mail-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  border: 1px solid var(--border-pill);
  color: var(--text-pill);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.mail-pill:hover {
  background: var(--pill-hover-bg);
  border-color: var(--pill-hover-border);
  color: var(--accent-text);
  text-decoration: none;
}
.mail-pill svg { flex: none; }

/* ---------- Contact form ---------- */

.form {
  margin-top: 28px;
  padding: 28px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%);
  border: 1px solid var(--border);
}

.field + .field { margin-top: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-nav);
}
.field label .req { color: var(--accent); }

.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-pill);
  background: rgba(11, 31, 51, 0.55);
  border: 1px solid var(--border-pill);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field textarea {
  min-height: 150px;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:hover,
.field textarea:hover { border-color: rgba(127, 166, 206, 0.34); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--pill-hover-border);
  background: rgba(11, 31, 51, 0.75);
}
/* Only flag invalid fields once the user has tried to submit. */
.form.is-validated input:invalid,
.form.is-validated textarea:invalid { border-color: #e2724f; }

.form__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #10202f;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn:active { transform: none; }

.form__note {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-faint);
}

.form__status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  border: 1px solid var(--border-pill);
  font-size: 14px;
  color: var(--text-pill);
}
.form__status[hidden] { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 52px var(--page-x);
  background: var(--bg-footer);
}
.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.site-footer .brand img { height: 30px; }
.site-footer .brand span { font-size: 17px; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}
.site-footer nav a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  transition: color 0.2s ease;
}
.site-footer nav a:hover { color: var(--accent); }
.site-footer__copy {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --page-x: 28px; }

  .hero { padding: 26px var(--page-x) 24px; }
  .hero__mark { height: 68px; }
  .hero__inner { gap: 20px; }
  .games { padding-bottom: 80px; }
  .page { padding-bottom: 80px; }
  .site-footer { padding: 40px var(--page-x); }
  .site-footer__inner { gap: 24px; }
}

@media (max-width: 620px) {
  :root { --page-x: 18px; --grid-gap: 20px; }

  .site-header { padding: 10px var(--page-x); gap: 12px; }
  .brand img { height: 28px; }
  .brand span { font-size: 16px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 14px; }

  .hero { padding: 30px var(--page-x) 26px; }
  .hero__inner { gap: 16px; }
  .hero__mark { height: 56px; }

  .games { grid-template-columns: 1fr; }
  .page { padding-top: 38px; }
  .prose { font-size: 15px; }
  .prose h2 { margin-top: 38px; font-size: 21px; }
  .prose .callout { padding: 18px 18px; }
  .form { padding: 20px 18px; }
  .form__actions { gap: 12px; }
  .btn { width: 100%; justify-content: center; }
  .card__body { padding: 18px 18px; }
  .card__body h3 { font-size: 23px; }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .site-footer nav { gap: 22px; }
}

/* Touch devices: no hover, so the lift is skipped and video plays in view (see app.js). */
@media (hover: none) {
  .card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob { animation: none; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
