/* ============================================================
   Chonky Dinosaur Studios
   Palette sampled from the studio logo:
     purple  #C397C5  (stegosaurus body)
     red     #D51919  (mushroom cap)
     grey    #6D6D6D  (plates)
     cream   #F5D6B8  (mushroom face)
     + grass green #6FBF4A from the game world
   ============================================================ */

:root {
  --purple:        #c397c5;
  --purple-deep:   #7a4e8a;
  --purple-ink:    #4a2f57;
  --red:           #d51919;
  --red-deep:      #a81313;
  --grey:          #6d6d6d;
  --cream:         #f5d6b8;
  --green:         #6fbf4a;
  --green-deep:    #4e9a34;

  --bg:            #f6eefb;
  --bg-soft:       #fbf7fe;
  --surface:       #ffffff;
  --ink:           #36283f;
  --ink-soft:      #6a5c73;
  --line:          rgba(122, 78, 138, .14);

  --shadow-sm: 0 2px 8px rgba(74, 47, 87, .10);
  --shadow-md: 0 14px 34px rgba(74, 47, 87, .16);
  --shadow-lg: 0 26px 60px rgba(74, 47, 87, .22);

  --radius:    18px;
  --radius-lg: 26px;
  --maxw:      1120px;

  --font-head: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--purple-deep); text-decoration: none; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; }

/* crisp pixel-art rendering for sprites */
.brand__mark,
.hero__badge img,
.float { image-rendering: pixelated; }

/* ----------------------------- Header -------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(251, 247, 254, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--purple-ink);
}
.brand__mark { width: 44px; height: 44px; }
.brand__name { display: flex; flex-direction: column; font-size: 1.05rem; line-height: 1.05; }
.brand__sub { font-size: .72rem; color: var(--purple-deep); letter-spacing: .06em; }

.nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-weight: 700;
}
.nav a {
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color .18s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 3px;
  border-radius: 3px;
  background: var(--red);
  transition: width .22s ease;
}
.nav a:hover { color: var(--purple-ink); }
.nav a:hover::after { width: 100%; }

.header-socials { display: flex; gap: 6px; }
.iconbtn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  color: var(--purple-deep);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.iconbtn svg { width: 20px; height: 20px; fill: currentColor; }
.iconbtn:hover { background: var(--purple); color: #fff; transform: translateY(-2px); }

/* ----------------------------- Hero ---------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  /* bottom padding min must exceed the 90px curved edge (::after) so CTAs clear it on mobile */
  padding: clamp(60px, 11vw, 120px) 20px clamp(116px, 14vw, 140px);
  background:
    radial-gradient(120% 90% at 50% -10%, #b88dc6 0%, var(--purple-deep) 55%, #5e3a73 100%);
  color: #fff;
}
/* soft hills at the bottom, echoing the games' grassy worlds */
.hero::after {
  content: "";
  position: absolute;
  left: -5%; right: -5%; bottom: -2px;
  height: 90px;
  background: var(--bg);
  border-radius: 100% 100% 0 0 / 100% 100% 0 0;
}

.hero__inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }

.hero__badge {
  display: inline-grid;
  place-items: center;
  width: 168px; height: 168px;
  margin: 0 auto 26px;
  background: var(--bg-soft);
  border-radius: 50%;
  box-shadow: var(--shadow-lg), inset 0 0 0 6px rgba(255,255,255,.6);
  animation: bob 4.5s ease-in-out infinite;
}
.hero__badge img { width: 120px; height: 120px; }

.hero__title {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -.01em;
  text-shadow: 0 3px 0 rgba(94,58,115,.45), 0 6px 18px rgba(0,0,0,.18);
}
.hero__title span { color: var(--cream); }

.hero__tagline {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: clamp(1.02rem, 2.4vw, 1.22rem);
  color: rgba(255,255,255,.92);
  font-weight: 600;
}

.hero__cta {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* floating decorative sprites */
.hero__decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float { position: absolute; opacity: .16; width: 90px; }
.float--1 { top: 14%;  left: 8%;  width: 70px;  animation: bob 6s ease-in-out infinite; }
.float--2 { top: 22%;  right: 9%; width: 110px; animation: bob 7s ease-in-out infinite .6s; }
.float--3 { bottom: 24%; left: 16%; width: 84px; animation: bob 5.5s ease-in-out infinite .3s; }

/* ----------------------------- Buttons ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn__icon { width: 20px; height: 20px; fill: currentColor; }
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 0 var(--red-deep), var(--shadow-md);
}
.btn--primary:hover { background: #e62525; box-shadow: 0 4px 0 var(--red-deep), var(--shadow-md); }

.btn--ghost {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7);
}
.btn--ghost:hover { background: rgba(255,255,255,.24); }

.btn--steam { background: #1b2838; color: #fff; box-shadow: 0 5px 0 #0b1320, var(--shadow-sm); }
.btn--steam:hover { background: #2a3f5a; }

.btn--itch { background: #fa5c5c; color: #fff; box-shadow: 0 5px 0 #c43d3d, var(--shadow-sm); }
.btn--itch:hover { background: #ff6e6e; }

/* ----------------------------- Sections ------------------------ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(54px, 9vw, 96px) clamp(18px, 5vw, 40px);
}
/* first section sits right under the hero's curved edge — trim its top padding */
#games { padding-top: 0; margin-top: -5px }

.section__head { text-align: center; margin-bottom: clamp(34px, 5vw, 56px); }
.section__title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  color: var(--purple-ink);
  font-weight: 700;
}
.section__title::after {
  content: "";
  display: block;
  width: 64px; height: 5px;
  margin: 14px auto 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--red), var(--purple));
}
.section__sub {
  margin: 14px auto 0;
  max-width: 520px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ----------------------------- Game cards ---------------------- */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(22px, 3vw, 34px);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.card__media {
  aspect-ratio: 16 / 9;
  background: #2a1633;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--apart { background: #dfbcf5; }
.card__media--apart img { object-fit: cover; }

.card__body { padding: clamp(20px, 3vw, 30px); display: flex; flex-direction: column; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .02em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(122,78,138,.10);
  color: var(--purple-deep);
}
.tag--steam { background: #1b2838; color: #fff; }
.tag--itch  { background: #fa5c5c; color: #fff; }
.tag--jam   { background: var(--green); color: #16330a; }

.card__title { font-size: 1.55rem; color: var(--purple-ink); margin-bottom: 10px; }
.card__desc { color: var(--ink-soft); font-weight: 600; margin: 0 0 16px; }
.card__note {
  font-size: .92rem;
  color: var(--ink-soft);
  margin: 0 0 18px;
  padding: 10px 14px;
  background: rgba(111,191,74,.12);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}
.card__note a { font-weight: 800; color: var(--green-deep); }
.card__note a:hover { text-decoration: underline; }

.card__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; }

/* ----------------------------- Connect ------------------------- */
.connect { padding-top: 0; }

.social-grid {
  display: grid;
  /* fluid, but capped at 3 columns: floor each column at 1/3 of the row
     (minus gaps) so auto-fit never creates a 4th, collapsing to 2 then 1
     on narrower screens once the 190px minimum kicks in */
  grid-template-columns: repeat(auto-fit, minmax(max(190px, (100% - 2 * 24px) / 3), 1fr));
  gap: 24px;
}
.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 26px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.social-card svg { width: 34px; height: 34px; fill: var(--purple-deep); transition: fill .18s ease, transform .18s ease; }
.social-card__label { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: var(--purple-ink); }
.social-card__handle { font-size: .82rem; color: var(--ink-soft); font-weight: 600; word-break: break-word; }
.social-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.social-card:hover svg { transform: scale(1.12); }

.social-card--yt:hover svg { fill: #ff0033; }
.social-card--dc:hover svg { fill: #5865f2; }
.social-card--x:hover  svg { fill: #000; }
.social-card--bs:hover svg { fill: #1185fe; }
.social-card--tt:hover svg { fill: #000; }
.social-card--mail:hover svg { fill: var(--red); }

/* ----------------------------- Footer -------------------------- */
.site-footer {
  text-align: center;
  padding: 48px 20px 56px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.footer__logo { margin: 0 auto 14px; image-rendering: pixelated; opacity: .92; }
.footer__contact { margin: 0 0 8px; font-weight: 700; font-size: .95rem; }
.footer__contact a { color: var(--purple-deep); }
.footer__contact a:hover { color: var(--red); text-decoration: underline; }
.footer__copy { color: var(--ink-soft); font-weight: 600; font-size: .9rem; margin: 0; }

/* ----------------------------- Animations ---------------------- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ----------------------------- Responsive ---------------------- */
@media (max-width: 720px) {
  .nav { display: none; }
  .header-socials { margin-left: auto; }
}
@media (max-width: 460px) {
  .header-socials .iconbtn:nth-child(n+4) { display: none; }
  .brand__name { font-size: .95rem; }
}
