/* Funpocalypse home page — "the end of boredom" */

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lilita-one-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --sun: #FFD23F;
  --ink: #1E1B4B;
  --pink: #FF3E7F;
  --teal: #0E9F9A;
  --red: #E3262E;
  --white: #FFFFFF;
  --sky: #EAF7F6;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

a { color: inherit; }

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Hero: the burst ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    repeating-conic-gradient(from 0deg at 50% 46%, #FFC81A 0deg 9deg, var(--sun) 9deg 18deg);
  padding: 72px 16px 88px;
  text-align: center;
  border-bottom: 6px solid var(--ink);
}

.burst {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: min(640px, 100%);
  aspect-ratio: 1.6 / 1;
  margin: 0 auto;
}

/* The jagged comic explosion behind the logo */
.burst::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pink);
  clip-path: polygon(50% 0%, 57% 17%, 72% 4%, 71% 22%, 92% 14%, 82% 32%, 100% 38%, 84% 50%, 99% 64%, 79% 66%, 87% 86%, 68% 77%, 62% 98%, 51% 81%, 39% 100%, 35% 79%, 15% 90%, 20% 69%, 0% 63%, 16% 50%, 2% 34%, 21% 31%, 12% 11%, 32% 21%, 34% 2%, 45% 17%);
  filter: drop-shadow(8px 8px 0 var(--ink));
}

.logo {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.25rem);
  line-height: 1;
  color: var(--white);
  letter-spacing: 0.01em;
  transform: rotate(-6deg);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
}

.tagline {
  position: relative;
  margin: 28px auto 0;
  max-width: 34ch;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.25;
  color: var(--ink);
}

.intro {
  position: relative;
  margin: 12px auto 0;
  max-width: 46ch;
  font-size: 1.1rem;
}

/* ---------- Products ---------- */

.products {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0;
}

.product + .product {
  border-top: 3px dashed #C9C6E3;
}

/* Alternate the object side on wide screens */
.product:nth-child(even) .product-art { order: 2; }

.product-art {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.product h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 2.75rem);
  line-height: 1.05;
}

.product p {
  margin: 0 0 16px;
  max-width: 44ch;
}

.facts {
  margin: 0 0 24px;
  font-size: 1rem;
  color: #4B4880;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-block;
  padding: 12px 22px;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button.primary {
  background: var(--pink);
  color: var(--white);
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.soon {
  display: inline-block;
  padding: 8px 18px;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  transform: rotate(-3deg);
}

/* --- Then What Happened?: a fanned hand of real cards --- */

.hand {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1.2 / 1;
}

.hand img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 50%;
  max-width: 230px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(30, 27, 75, 0.25);
  transform-origin: 50% 110%;
  translate: -50% 0;
}

.hand img:nth-child(1) { rotate: -16deg; }
.hand img:nth-child(2) { rotate: 0deg; z-index: 2; translate: -50% -14px; }
.hand img:nth-child(3) { rotate: 16deg; }

/* --- RetroFit Cards: a retro-striped card --- */

.retro-card {
  position: relative;
  width: 230px;
  aspect-ratio: 5 / 7;
  background: #FFF4D6;
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 10px 10px 0 var(--teal);
  rotate: 5deg;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.retro-card::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: 34%;
  height: 34%;
  background: linear-gradient(to bottom,
    var(--red) 0 25%, #FF8A1F 25% 50%, var(--sun) 50% 75%, var(--teal) 75% 100%);
  rotate: -12deg;
}

.retro-card span {
  position: relative;
  padding: 6px 14px;
  font-family: var(--display);
  font-size: 2.1rem;
  color: var(--ink);
  background: #FFF4D6;
  border: 3px solid var(--ink);
  border-radius: 10px;
  rotate: -12deg;
}

/* --- Comics collection: a stack of halftone covers --- */

.comics {
  position: relative;
  width: 250px;
  height: 330px;
}

.cover {
  position: absolute;
  inset: 0;
  border: 4px solid var(--ink);
  border-radius: 4px;
}

.cover:nth-child(1) { background: var(--teal); rotate: -9deg; translate: -22px 10px; }
.cover:nth-child(2) { background: var(--sun); rotate: 5deg; translate: 18px 4px; }
.cover:nth-child(3) {
  background:
    radial-gradient(circle, rgba(255,255,255,0.55) 2.2px, transparent 2.6px) 0 0 / 12px 12px,
    var(--red);
  rotate: -2deg;
  box-shadow: 8px 8px 0 var(--ink);
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.cover .issue {
  justify-self: start;
  padding: 2px 10px;
  font-family: var(--display);
  font-size: 1.1rem;
  background: var(--white);
  border: 3px solid var(--ink);
}

.cover .bubble {
  position: relative;
  justify-self: end;
  max-width: 80%;
  padding: 10px 14px;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.15;
  text-align: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

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

.site-footer {
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: 32px 16px;
  font-size: 0.95rem;
}

.site-footer p { margin: 0; }

/* ---------- One entrance moment ---------- */

@media (prefers-reduced-motion: no-preference) {
  .burst::before { animation: pop 0.55s cubic-bezier(.2, 1.6, .4, 1) both; }
  .logo { animation: slam 0.5s 0.25s cubic-bezier(.2, 1.4, .4, 1) both; }
  .hand img:nth-child(1) { animation: fan-left 0.7s 0.5s ease-out both; }
  .hand img:nth-child(3) { animation: fan-right 0.7s 0.5s ease-out both; }

  @keyframes pop {
    from { transform: scale(0.2) rotate(-25deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
  }
  @keyframes slam {
    from { transform: rotate(-6deg) scale(1.8); opacity: 0; }
    to   { transform: rotate(-6deg) scale(1); opacity: 1; }
  }
  @keyframes fan-left  { from { rotate: 0deg; } to { rotate: -16deg; } }
  @keyframes fan-right { from { rotate: 0deg; } to { rotate: 16deg; } }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .hero { padding: 48px 16px 64px; }
  .product {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px 0;
  }
  .product:nth-child(even) .product-art { order: 0; }
  .product-art { min-height: 0; }
  .retro-card { width: 190px; }
  .comics { width: 210px; height: 280px; }
}
