/* ==========================================================================

   Crab Interactive — site styles

   1. Tokens   2. Base   3. Layout   4. Header/nav   5. Hero   6. Sections

   7. Cards    8. Community   9. Footer   10. Motion   11. Responsive

   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  --ink: #050b07;

  --bg: #0b0c13;

  --surface: #1c1212;

  --panel: #271918;

  --nav: #1f1313;

  --text: #f8f1ee;

  --muted: #b8a8a6;

  --border: #432b2a;

  --red: #ff0004; /* MrCrab logo red */

  --red-deep: #4e0001; /* deep end of the logo gradient */

  --coral: #ff6b6e; /* lighter red for text/accents on dark */

  --red-dark-text: #c00003; /* red text on white cards */

  --red-soft: #ffe9e9;

  --radius-sm: 12px;

  --radius: 20px;

  --radius-lg: 30px;

  --shadow: 0 5px 0 var(--ink);

  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;

  --font-body: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 32px;

  --content: 1200px;
}

/* 2. Base ------------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  min-height: 100vh;

  display: flex;

  flex-direction: column;

  background: var(--bg);

  color: var(--text);

  font: 500 16px/1.5 var(--font-body);

  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;

  overflow-x: clip;
}

img {
  max-width: 100%;

  display: block;

  background: var(--surface);
}

.img-failed {
  font-size: 0;
}

a {
  color: inherit;

  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;

  padding: 0;

  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--red);

  outline-offset: 3px;

  border-radius: 6px;
}

.skip-link {
  position: absolute;

  left: 16px;

  top: -60px;

  z-index: 100;

  padding: 10px 16px;

  background: var(--red);

  color: var(--ink);

  font-weight: 700;

  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 16px;
}

/* 3. Layout ---------------------------------------------------------------- */

.container {
  width: min(100% - var(--gutter) * 2, var(--content));

  margin-inline: auto;
}

.section {
  padding-block: 100px;
}

.section--tight-top {
  padding-top: 40px;
}

.eyebrow {
  margin-bottom: 14px;

  font-size: 13px;

  font-weight: 700;

  letter-spacing: 2px;

  color: var(--coral);
}

.section-title,
.hero h1 {
  font: 700 clamp(42px, 5.2vw, 72px) / 0.98 var(--font-display);

  letter-spacing: -1.5px;
}

.section-title {
  font-size: clamp(38px, 4.5vw, 52px);

  letter-spacing: -1px;

  margin-bottom: 10px;
}

.section-lead {
  margin-bottom: 33px;

  color: var(--muted);

  font-weight: 600;

  max-width: 56ch;
}

/* 4. Header / nav ---------------------------------------------------------- */

.site-header {
  position: relative;

  z-index: 20;

  background: var(--nav);
}

.site-header .container {
  min-height: 90px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 28px;
}

.logo {
  display: flex;

  align-items: center;

  gap: 10px;

  font: 700 24px var(--font-display);
}

.logo img {
  width: 45px;

  height: 45px;

  border: 3px solid var(--border);

  border-radius: 13px;

  background: var(--panel);
}

.logo span {
  color: var(--coral);
}

.nav {
  position: relative;

  isolation: isolate;

  display: flex;

  align-items: center;

  gap: 6px;

  padding: 5px;

  background-color: var(--nav-red, #b30003);

  /* Header.svg (1166x183): the sizing crops to its inner red area so the pill's own border is the outline */

  background-image: url("../images/Header.svg");

  background-repeat: no-repeat;

  background-size: 101.04% 155.08%;

  background-position: 50% 50.78%;

  border: 3px solid var(--ink);

  border-radius: 40px;

  box-shadow: 0 4px 0 var(--ink);
}

.nav a {
  position: relative;

  z-index: 1;

  padding: 10px 17px;

  font-size: 14px;

  font-weight: 700;

  color: #fff;

  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);

  border-radius: 28px;

  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.nav a:hover {
  transform: translateY(-1px);
}

.nav a[aria-current="page"] {
  color: #fff;
}

/* Fallback highlight (no JS); the sliding pill takes over once JS positions it */

.nav:not(.has-indicator) a[aria-current="page"] {
  background: var(--ink);
}

.nav-indicator {
  position: absolute;

  z-index: 0;

  top: 50%;

  left: 0;

  height: 36px;

  width: 0;

  border-radius: 999px;

  background: var(--ink);

  transform: translateY(-50%);

  opacity: 0;

  pointer-events: none;
}

.nav.is-ready .nav-indicator {
  transition:
    left 0.46s cubic-bezier(0.22, 1.35, 0.36, 1),
    width 0.46s cubic-bezier(0.22, 1.35, 0.36, 1),
    opacity 0.16s ease;
}

.menu-toggle {
  display: none;

  flex-direction: column;

  gap: 4px;

  padding: 8px;

  background: none;

  border: 0;

  cursor: pointer;
}

.menu-toggle span {
  display: block;

  width: 24px;

  height: 2px;

  background: var(--text);

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 5. Hero ------------------------------------------------------------------ */

.hero {
  position: relative;

  padding-block: 58px 100px;

  background: linear-gradient(135deg, #1a0e0e 0%, #2e1514 100%);
}

.hero::after {
  content: "";

  position: absolute;

  left: -2%;

  bottom: -1px;

  width: 104%;

  height: 33px;

  background: var(--bg);

  clip-path: polygon(
    0 40%,

    14% 8%,

    27% 42%,

    40% 0,

    56% 38%,

    73% 12%,

    86% 40%,

    100% 10%,

    100% 100%,

    0 100%
  );
}

.hero .container {
  display: grid;

  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);

  align-items: center;

  gap: 64px;

  min-height: 520px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero h1 em {
  color: var(--coral);

  font-style: normal;

  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.35);
}

.hero-text {
  max-width: 500px;

  margin-bottom: 27px;

  font-size: 17px;

  font-weight: 600;

  line-height: 1.5;

  color: #ecdcd9;
}

.featured-strip {
  display: flex;

  align-items: center;

  gap: 14px;

  max-width: 460px;

  height: 73px;

  padding: 8px 12px;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: 17px;

  box-shadow: var(--shadow);

  transition: transform 0.15s ease;
}

.featured-strip:hover {
  transform: translateY(-2px);
}

.featured-strip img {
  width: 48px;

  height: 48px;

  border-radius: 10px;

  object-fit: cover;
}

.featured-strip span {
  display: flex;

  flex-direction: column;

  flex: 1;
}

.featured-strip small {
  font-size: 11px;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--coral);
}

.featured-strip strong {
  font: 600 16px var(--font-display);
}

.featured-strip b,
.tag {
  padding: 4px 10px;

  font-size: 11px;

  background: var(--red);

  color: var(--ink);

  border: 2px solid var(--ink);

  border-radius: 16px;
}

.hero-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 14px;

  margin: 28px 0;
}

.pill-button {
  display: inline-flex;

  align-items: center;

  gap: 10px;

  padding: 14px 24px;

  background: var(--red);

  color: var(--ink);

  font-weight: 700;

  border: 3px solid var(--ink);

  border-radius: 30px;

  box-shadow: 0 4px 0 var(--ink);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.pill-button:hover {
  transform: translateY(-2px);

  box-shadow: 0 6px 0 var(--ink);
}

.pill-button:active {
  transform: translateY(2px);

  box-shadow: 0 2px 0 var(--ink);
}

.pill-button--light {
  background: #fff;
}

.hero-stats {
  display: flex;

  flex-wrap: wrap;

  gap: 8px 25px;

  font-size: 13px;

  font-weight: 700;
}

.data-status::before {
  content: "";

  display: inline-block;

  width: 8px;

  height: 8px;

  margin-right: 8px;

  border-radius: 50%;

  background: var(--muted);
}

.data-status[data-live="true"]::before {
  background: #72d68a;
}

.hero-card {
  position: relative;

  padding: 13px;

  background: #fff;

  color: var(--ink);

  border: 4px solid var(--ink);

  border-radius: var(--radius-lg);

  box-shadow: 0 7px 0 var(--ink);

  transform: rotate(2deg);
}

.hero-card-image {
  position: relative;
}

.hero-card-image img {
  width: 100%;

  aspect-ratio: 1;

  object-fit: cover;

  border: 3px solid var(--ink);

  border-radius: 21px;
}

.hero-card-image .tag {
  position: absolute;

  top: 15px;

  left: 18px;

  z-index: 1;
}

.hero-card-bottom {
  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 13px 5px 4px;
}

.hero-card-bottom div {
  display: flex;

  flex-direction: column;
}

.hero-card-bottom small {
  font-size: 11px;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--red-dark-text);
}

.hero-card-bottom strong {
  font: 600 19px var(--font-display);
}

.hero-card-bottom a {
  display: grid;

  place-items: center;

  width: 48px;

  height: 48px;

  font-size: 25px;

  background: var(--red);

  border: 3px solid var(--ink);

  border-radius: var(--radius-sm);
}

.playing-badge {
  position: absolute;

  top: -16px;

  right: -16px;

  padding: 11px 17px;

  font-weight: 700;

  color: var(--ink);

  background: var(--coral);

  border: 3px solid var(--ink);

  border-radius: 23px;
}

/* 6. Sections -------------------------------------------------------------- */

.stats-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 18px;
}

.stat-card {
  padding: 25px;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: 18px;

  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;

  font: 700 42px var(--font-display);
}

.stat-card span {
  font-size: 12px;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--muted);
}

.updates-grid {
  margin-top: 50px;

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 22px;
}

.update-card {
  padding: 28px;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.update-card small {
  font-weight: 700;

  letter-spacing: 1px;

  color: var(--coral);
}

.update-card h3 {
  margin: 12px 0;

  font: 700 28px var(--font-display);
}

.update-card p {
  font-weight: 600;

  color: var(--muted);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.social-card {
  display: block;
  padding: 28px;
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--ink);
  transition:
    transform 0.35s var(--spring),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.social-card img {
  width: clamp(48px, 8vw, 64px);
  height: clamp(48px, 8vw, 64px);
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: 100%;
  background: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.38))
    drop-shadow(0 8px 5px rgba(0, 0, 0, 0.24));
  transition:
    filter 0.25s ease,
    transform 0.25s ease;
}

/* Brand-tinted depth that follows each logo's transparent silhouette */
.social-card-discord img {
  filter: drop-shadow(0 4px 0 #3039a6)
    drop-shadow(0 8px 5px rgba(20, 24, 90, 0.35));
}

.social-card-roblox img {
  filter: drop-shadow(0 4px 0 #000) drop-shadow(0 8px 5px rgba(0, 0, 0, 0.4));
}

.social-card-youtube img {
  filter: drop-shadow(0 4px 0 #850019)
    drop-shadow(0 8px 5px rgba(80, 0, 15, 0.35));
}

.social-card-instagram img {
  filter: drop-shadow(0 4px 0 #9b245f)
    drop-shadow(0 8px 5px rgba(83, 20, 67, 0.35));
}

.social-card-tiktok img {
  filter: drop-shadow(3px 4px 0 rgba(37, 244, 238, 0.55))
    drop-shadow(-3px 6px 0 rgba(254, 44, 85, 0.5))
    drop-shadow(0 9px 5px rgba(0, 0, 0, 0.35));
}

.social-card-x img {
  filter: drop-shadow(0 4px 0 #000) drop-shadow(0 8px 5px rgba(0, 0, 0, 0.45));
}

.social-card:hover img {
  transform: translateY(-3px) scale(1.04);
}

/* Brand gradients */
.social-card-discord {
  background: linear-gradient(135deg, #5865f2 0%, #404eed 55%, #252d83 100%);
}

.social-card-roblox {
  background: linear-gradient(135deg, #343434 0%, #171717 55%, #050505 100%);
}

.social-card-youtube {
  background: linear-gradient(135deg, #ff0033 0%, #d90027 55%, #8f001a 100%);
}

.social-card-instagram {
  background: linear-gradient(
    135deg,
    #833ab4 0%,
    #c13584 32%,
    #e1306c 58%,
    #f77737 82%,
    #fcaf45 100%
  );
}

.social-card-tiktok {
  background:
    linear-gradient(
      115deg,
      rgba(37, 244, 238, 0.2),
      transparent 42%,
      rgba(254, 44, 85, 0.22)
    ),
    linear-gradient(135deg, #181818 0%, #050505 60%, #202020 100%);
}

.social-card-x {
  background: linear-gradient(135deg, #000 0%, #111 55%, #303030 100%);
}

.social-card small {
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.78);
}

.social-card h3 {
  margin: 22px 0 2px;
  font: 700 31px var(--font-display);
}

.social-card p {
  margin-bottom: 25px;
  color: rgba(255, 255, 255, 0.82);
}

.social-card b {
  font-size: 14px;
}

/* 7. Cards ----------------------------------------------------------------- */

.game-card {
  display: grid;

  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);

  max-width: 760px;

  overflow: hidden;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.game-card img {
  width: 100%;

  height: 100%;

  aspect-ratio: 1;

  object-fit: cover;
}

.game-card-copy {
  display: flex;

  flex-direction: column;

  justify-content: center;

  padding: 26px;
}

.game-card small {
  font-weight: 600;

  color: var(--muted);
}

.game-card h3 {
  margin: 8px 0 14px;

  font: 600 28px/1.1 var(--font-display);
}

.game-meta {
  display: flex;

  justify-content: space-between;

  gap: 12px;

  font-size: 13px;

  font-weight: 700;

  color: var(--muted);
}

.game-meta strong {
  font-size: 17px;

  color: var(--text);
}

.play-link {
  display: flex;

  justify-content: space-between;

  margin-top: 18px;

  padding: 11px 14px;

  font-weight: 700;

  color: var(--ink);

  background: var(--red);

  border: 2px solid var(--ink);

  border-radius: 11px;

  transition: transform 0.15s ease;
}

.play-link:hover {
  transform: translateY(-2px);
}

/* Creations page (reuses .section, .eyebrow, .play-link) ------------------- */

.creations-jump {
  display: flex;

  flex-wrap: wrap;

  gap: 12px;
}

.creations-jump a {
  padding: 11px 20px;

  font-weight: 700;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: 999px;

  box-shadow: 0 3px 0 var(--ink);

  transition:
    transform 0.25s var(--spring),
    border-color 0.25s ease;
}

.creations-jump a:hover {
  transform: translateY(-3px);

  border-color: var(--red);
}

.creations-section {
  scroll-margin-top: 20px;
}

.creations-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 24px;
}

.creation-card {
  display: flex;

  flex-direction: column;

  overflow: hidden;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  transition:
    transform 0.35s var(--spring),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.creation-card:hover {
  transform: translateY(-7px);

  border-color: var(--red);

  box-shadow:
    0 12px 0 var(--ink),
    0 22px 44px rgba(255, 0, 4, 0.22);
}

.creation-media {
  overflow: hidden;

  aspect-ratio: 16 / 10;

  background: var(--surface);

  border-bottom: 3px solid var(--border);
}

.creation-media img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: transform 0.7s var(--ease-out);
}

.creation-card:hover .creation-media img {
  transform: scale(1.07);
}

.creation-copy {
  display: flex;

  flex: 1;

  flex-direction: column;

  padding: 24px;
}

.creation-copy small {
  font-weight: 700;

  letter-spacing: 1px;

  color: var(--coral);
}

.creation-copy h3 {
  margin: 8px 0 10px;

  font: 600 26px/1.1 var(--font-display);
}

.creation-copy p {
  margin-bottom: 22px;

  font-weight: 600;

  color: var(--muted);
}

.creation-copy .play-link {
  margin-top: auto;
}

.creations-empty {
  padding: 34px;

  font-weight: 700;

  color: var(--muted);

  text-align: center;

  border: 3px dashed var(--border);

  border-radius: var(--radius);
}

/* Discord DM card (reuses panel look, .pill-button, .eyebrow, .section-title) */

.dm-card {
  display: grid;

  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

  gap: 40px;

  align-items: center;

  padding: 40px;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow);

  transition:
    transform 0.35s var(--spring),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.dm-card:hover {
  transform: translateY(-5px);

  border-color: var(--red);

  box-shadow:
    0 10px 0 var(--ink),
    0 22px 44px rgba(255, 0, 4, 0.2);
}

.dm-card .section-lead {
  margin-bottom: 0;
}

.dm-user {
  padding: 18px 22px;

  background: var(--surface);

  border: 3px solid var(--border);

  border-radius: var(--radius-sm);
}

.dm-user small {
  display: block;

  font-size: 11px;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--muted);
}

.dm-user strong {
  display: block;

  margin-top: 4px;

  font: 700 clamp(26px, 3.4vw, 38px) / 1.1 var(--font-display);

  color: var(--coral);

  overflow-wrap: anywhere;
}

button.pill-button {
  font: inherit;

  font-weight: 700;

  cursor: pointer;
}

.dm-user + .dm-user {
  margin-top: 12px;
}

.dm-user--email strong {
  font-size: clamp(15px, 2vw, 22px);

  overflow-wrap: normal; /* breaks only at the <wbr> after the @, never mid-word */
}

.dm-user--email a {
  transition: color 0.2s ease;
}

.dm-user--email a:hover {
  color: var(--text);
}

.dm-buttons {
  display: flex;

  flex-wrap: wrap;

  gap: 12px;

  margin-top: 18px;
}

.dm-actions [hidden] {
  display: none;
}

.dm-hint {
  margin-top: 16px;

  font-size: 14px;

  font-weight: 600;

  color: var(--muted);
}

/* UI Design carousel (scroll-snap track; images are never cropped) ---------- */

.carousel {
  max-width: 980px;

  overflow: hidden;

  background: var(--panel);

  border: 3px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.carousel:hover {
  border-color: var(--red);

  box-shadow:
    0 8px 0 var(--ink),
    0 22px 44px rgba(255, 0, 4, 0.18);
}

.carousel-stage {
  position: relative;

  border-bottom: 3px solid var(--border);
}

.carousel-track {
  display: flex;

  overflow-x: auto;

  scroll-snap-type: x mandatory;

  overscroll-behavior-x: contain;

  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  position: relative;

  flex: 0 0 100%;

  min-width: 0;

  aspect-ratio: 16 / 9;

  scroll-snap-align: start;

  scroll-snap-stop: always;

  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0)
      0 0 / 22px 22px,
    var(--surface);
}

.carousel-slide img {
  position: absolute;

  inset: 24px;

  width: auto;

  height: auto;

  max-width: calc(100% - 48px);

  max-height: calc(100% - 48px);

  margin: auto;

  object-fit: contain;

  background: none;

  user-select: none;

  -webkit-user-drag: none;
}

.carousel-btn {
  position: absolute;

  top: 50%;

  z-index: 1;

  display: grid;

  place-items: center;

  width: 48px;

  height: 48px;

  padding: 0;

  font: 700 22px/1 var(--font-display);

  color: var(--ink);

  background: var(--red);

  border: 3px solid var(--ink);

  border-radius: 50%;

  box-shadow: 0 4px 0 var(--ink);

  cursor: pointer;

  translate: 0 -50%;

  transition:
    transform 0.25s var(--spring),
    box-shadow 0.2s ease;
}

.carousel-btn--prev {
  left: 14px;
}

.carousel-btn--next {
  right: 14px;
}

.carousel-btn:hover {
  transform: scale(1.12);
}

.carousel-btn:active {
  transform: scale(0.95);

  box-shadow: 0 1px 0 var(--ink);
}

.carousel-caption {
  padding: 24px 26px 8px;
}

.carousel-caption small {
  font-weight: 700;

  letter-spacing: 1px;

  color: var(--coral);
}

.carousel-caption h3 {
  margin: 6px 0 8px;

  font: 600 28px/1.1 var(--font-display);
}

.carousel-caption p {
  max-width: 60ch;

  font-weight: 600;

  color: var(--muted);
}

.carousel-caption .play-link {
  display: inline-flex;

  gap: 10px;

  margin-top: 16px;
}

.carousel-caption [hidden] {
  display: none;
}

@keyframes caption-swap {
  from {
    opacity: 0;

    translate: 22px 0;
  }
}

.carousel-caption.is-swapping > * {
  animation: caption-swap 0.45s var(--spring) backwards;
}

.carousel-caption.is-swapping > :nth-child(2) {
  animation-delay: 0.05s;
}

.carousel-caption.is-swapping > :nth-child(3) {
  animation-delay: 0.1s;
}

.carousel-footer {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 16px;

  padding: 14px 26px 22px;
}

.carousel-dots {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;
}

.carousel-dot {
  width: 12px;

  height: 12px;

  padding: 0;

  background: var(--border);

  border: 2px solid var(--ink);

  border-radius: 999px;

  cursor: pointer;

  transition:
    width 0.35s var(--spring),
    background 0.2s ease;
}

.carousel-dot:hover {
  background: var(--muted);
}

.carousel-dot[aria-current="true"] {
  width: 32px;

  background: var(--red);
}

.carousel-count {
  font-size: 13px;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--muted);
}

/* 8. Community ------------------------------------------------------------- */

.community {
  position: relative;

  padding-block: 100px;

  background: linear-gradient(180deg, #c40003 0%, var(--red-deep) 100%);

  color: #fff;
}

.community::before {
  content: "";

  position: absolute;

  top: -1px;

  left: 0;

  width: 100%;

  height: 24px;

  background: var(--bg);

  clip-path: polygon(0 0, 18% 70%, 35% 10%, 55% 65%, 78% 8%, 100% 60%, 100% 0);
}

.community .container {
  display: flex;

  align-items: center;

  gap: 70px;
}

.community-copy {
  flex: 1;
}

.community .section-title {
  font-size: clamp(40px, 5vw, 55px);

  margin-bottom: 24px;
}

.community .eyebrow {
  color: #ffd3d3;
}

.community-copy > p {
  max-width: 500px;

  font-size: 16px;

  line-height: 1.6;
}

.perks {
  display: grid;

  gap: 15px;

  margin-top: 30px;
}

.perks li {
  display: flex;

  gap: 12px;
}

.perks li::before {
  content: "✦";

  color: #fff;
}

.perks strong {
  display: block;
}

.perks span {
  color: #ffdcdc;
}

.discord-card {
  width: 390px;

  max-width: 100%;

  padding: 26px;

  background: #fff;

  color: var(--ink);

  border: 4px solid var(--ink);

  border-radius: var(--radius);

  box-shadow: 0 6px 0 var(--ink);
}

.discord-card small {
  font-weight: 700;

  letter-spacing: 1px;

  color: var(--red-dark-text);
}

.discord-card > span {
  display: block;

  margin-top: 25px;

  font-size: 12px;

  color: #6a4a49;
}

.discord-card h3 {
  margin: 6px 0;

  font: 700 29px var(--font-display);
}

.discord-card p {
  color: #6a4a49;
}

.channel-list {
  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin: 20px 0;
}

.channel-list li {
  padding: 7px 9px;

  font-size: 12px;

  background: var(--red-soft);

  border-radius: 6px;
}

.discord-card > a {
  display: block;

  padding: 12px;

  font-weight: 700;

  text-align: center;

  color: #fff;

  background: var(--red-deep);

  border-radius: 10px;
}

/* 9. Footer ---------------------------------------------------------------- */

.site-footer {
  padding-block: 44px;

  background: var(--bg);

  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;

  align-items: center;

  gap: 35px;
}

.footer-nav {
  display: flex;

  flex: 1;

  flex-wrap: wrap;
}

.footer-nav a {
  padding: 8px 10px;

  color: var(--muted);
}

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

.site-footer p {
  font-size: 12px;

  line-height: 1.6;

  color: var(--muted);

  text-align: right;
}

/* 10. Motion --------------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

/* Page change: a slanted red-edged wipe instead of a crossfade */

::view-transition-old(root) {
  animation: none;
}

::view-transition-new(root) {
  animation: page-wipe 0.6s cubic-bezier(0.77, 0, 0.18, 1) both;
}

@keyframes page-wipe {
  from {
    clip-path: polygon(0 0, 0 0, -14% 100%, 0 100%);
  }

  to {
    clip-path: polygon(0 0, 114% 0, 100% 100%, 0 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before*,
  ::after* {
    animation-duration: 0.01ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;

    scroll-behavior: auto !important;
  }
}

/* 10b. Cursor glow, reveals & hover polish --------------------------------- */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cursor-glow {
  position: fixed;

  top: 0;

  left: 0;

  z-index: 2;

  width: 460px;

  height: 460px;

  margin: -230px 0 0 -230px;

  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(255, 0, 4, 0.2) 0%,

    rgba(255, 0, 4, 0.08) 38%,

    rgba(255, 0, 4, 0) 68%
  );

  pointer-events: none;

  opacity: 0;

  transition: opacity 0.4s ease;

  will-change: transform;
}

.cursor-glow.is-on {
  opacity: 1;
}

@media (hover: none) {
  .cursor-glow {
    display: none;
  }
}

.scroll-progress {
  position: fixed;

  top: 0;

  left: 0;

  z-index: 60;

  width: 100%;

  height: 3px;

  background: linear-gradient(90deg, var(--red), var(--coral));

  transform: scaleX(var(--scroll, 0));

  transform-origin: left;

  pointer-events: none;
}

/* Scroll motion (classes are added by main.js, so no-JS visitors see everything)
   - cards "stamp" down with a bounce, small items pop, titles slide up word by word */

.reveal:not(.is-in) {
  opacity: 0;
}

@keyframes stamp-in {
  from {
    opacity: 0;

    translate: 0 -34px;

    rotate: -3deg;

    scale: 1.08;

    box-shadow: 0 0 0 var(--ink);
  }

  35% {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;

    scale: 0.55;

    rotate: -8deg;
  }

  40% {
    opacity: 1;
  }
}

.reveal.is-in {
  animation: stamp-in 0.85s var(--spring) var(--d, 0ms) backwards;
}

.reveal.reveal-pop.is-in {
  animation: pop-in 0.65s var(--spring) var(--d, 0ms) backwards;
}

/* Titles: each word slides up from behind a mask */

.w {
  display: inline-block;

  overflow: hidden;

  vertical-align: top;

  padding: 0.12em 0.05em;

  margin: -0.12em -0.05em;
}

.w > span {
  display: inline-block;

  translate: 0 115%;

  rotate: 8deg;

  transform-origin: 0 100%;

  transition:
    translate 0.8s var(--spring),
    rotate 0.8s var(--spring);

  transition-delay: calc(var(--i, 0) * 70ms);
}

.is-in .w > span {
  translate: 0 0;

  rotate: 0deg;
}

/* once the slide has finished, unmask so glows and shadows are not clipped */

.is-done .w {
  overflow: visible;
}

/* Eyebrow: a red line draws itself after the label */

.eyebrow::after {
  content: "";

  display: inline-block;

  width: 0;

  height: 3px;

  margin-left: 12px;

  vertical-align: middle;

  background: currentColor;

  border-radius: 2px;

  transition: width 0.9s var(--ease-out) 0.25s;
}

.eyebrow.is-in::after {
  width: 44px;
}

/* Card spotlight: a soft sheen follows the cursor (position set in main.js) */

.stat-card,
.game-card,
.creation-card,
.social-card,
.discord-card,
.dm-card {
  position: relative;
}

.stat-card::after,
.game-card::after,
.creation-card::after,
.social-card::after,
.discord-card::after,
.dm-card::after {
  content: "";

  position: absolute;

  inset: 0;

  border-radius: inherit;

  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.13),
    transparent 70%
  );

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.3s ease;
}

.discord-card::after {
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 0, 4, 0.14),
    transparent 70%
  );
}

.stat-card:hover::after,
.game-card:hover::after,
.creation-card:hover::after,
.social-card:hover::after,
.discord-card:hover::after,
.dm-card:hover::after {
  opacity: 1;
}

/* Hero card: entrance, idle float, straighten on hover */

@keyframes card-in {
  from {
    opacity: 0;

    scale: 1.3;

    rotate: -10deg;

    translate: 0 -30px;
  }

  30% {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -12px;
  }
}

.hero-card {
  animation:
    card-in 0.9s var(--spring) 0.15s backwards,
    float 6s ease-in-out 1s infinite;

  transition:
    transform 0.45s var(--spring),
    box-shadow 0.3s ease;
}

.hero-card:hover {
  transform: rotate(0deg) scale(1.025);

  box-shadow: 0 12px 0 var(--ink);
}

.hero-card-image img {
  transition: transform 0.6s var(--ease-out);
}

.hero-card:hover .hero-card-image img {
  transform: scale(1.05);
}

.hero-card-bottom a {
  transition: transform 0.3s var(--spring);
}

.hero-card-bottom a:hover {
  transform: scale(1.15) rotate(-8deg);
}

@keyframes badge-pulse {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(-3deg) scale(1.07);
  }
}

.playing-badge {
  animation: badge-pulse 2.6s ease-in-out infinite;
}

@keyframes live-ping {
  0% {
    box-shadow: 0 0 0 0 rgba(114, 214, 138, 0.7);
  }

  100% {
    box-shadow: 0 0 0 9px rgba(114, 214, 138, 0);
  }
}

.data-status[data-live="true"]::before {
  animation: live-ping 1.6s ease-out infinite;
}

@keyframes glow-pulse {
  from {
    text-shadow: 0 0 10px rgba(255, 0, 4, 0.15);
  }

  to {
    text-shadow: 0 0 34px rgba(255, 0, 4, 0.65);
  }
}

.hero h1 em {
  animation: glow-pulse 2.8s ease-in-out infinite alternate;
}

/* Cards: lift, red edge, deeper shadow */

.stat-card,
.update-card,
.game-card,
.featured-strip,
.discord-card,
.social-card {
  transition:
    transform 0.35s var(--spring),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.stat-card:hover,
.update-card:hover,
.game-card:hover {
  transform: translateY(-7px);

  border-color: var(--red);

  box-shadow:
    0 12px 0 var(--ink),
    0 22px 44px rgba(255, 0, 4, 0.22);
}

.featured-strip:hover {
  transform: translateY(-3px);

  border-color: var(--red);
}

.discord-card:hover {
  transform: translateY(-6px) rotate(-0.6deg);

  box-shadow: 0 13px 0 var(--ink);
}

.social-card:hover {
  transform: translateY(-6px) rotate(-1deg);

  box-shadow: 0 11px 0 var(--ink);
}

.stat-card strong {
  transition: color 0.3s ease;
}

.stat-card:hover strong {
  color: var(--coral);
}

.game-card img {
  transition: transform 0.7s var(--ease-out);
}

.game-card:hover img {
  transform: scale(1.07);
}

.game-card {
  overflow: hidden;
}

/* Buttons: shine sweep + arrow nudge */

.pill-button,
.play-link {
  position: relative;

  overflow: hidden;
}

.pill-button::after,
.play-link::after {
  content: "";

  position: absolute;

  top: 0;

  left: -80%;

  width: 55%;

  height: 100%;

  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );

  transform: skewX(-20deg);

  transition: left 0.65s var(--ease-out);

  pointer-events: none;
}

.pill-button:hover::after,
.play-link:hover::after {
  left: 130%;
}

.pill-button span,
.play-link span {
  display: inline-block;

  transition: transform 0.3s var(--spring);
}

.pill-button:hover span,
.play-link:hover span {
  transform: translateX(4px);
}

.play-link {
  transition:
    transform 0.25s var(--spring),
    box-shadow 0.25s ease;
}

.play-link:hover {
  transform: translateY(-3px);

  box-shadow: 0 4px 0 var(--ink);
}

.discord-card > a {
  transition:
    transform 0.25s var(--spring),
    background 0.25s ease;
}

.discord-card > a:hover {
  transform: translateY(-2px) scale(1.02);

  background: var(--red-dark-text);
}

/* Logo wiggle, nav lift, footer underline, small list touches */

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg) scale(1.08);
  }

  75% {
    transform: rotate(8deg) scale(1.08);
  }
}

.logo:hover img {
  animation: wiggle 0.6s ease;
}

.logo strong {
  transition: letter-spacing 0.3s ease;
}

.logo:hover strong {
  letter-spacing: 0.04em;
}

.footer-nav a {
  background: linear-gradient(var(--red), var(--red)) 10px calc(100% - 5px) / 0
    2px no-repeat;

  transition:
    background-size 0.3s var(--ease-out),
    color 0.2s ease;
}

.footer-nav a:hover {
  background-size: calc(100% - 20px) 2px;
}

.perks li::before {
  display: inline-block;

  transition: transform 0.4s var(--spring);
}

.perks li:hover::before {
  transform: rotate(180deg) scale(1.35);
}

.channel-list li {
  transition:
    transform 0.25s var(--spring),
    background 0.2s ease;
}

.channel-list li:hover {
  transform: translateY(-3px);

  background: #ffd0d0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-card,
  .playing-badge,
  .hero h1 em,
  .data-status[data-live="true"]::before {
    animation: none !important;
  }

  .reveal:not(.is-in) {
    opacity: 1;
  }
}

/* 11. Responsive ----------------------------------------------------------- */

@media (max-width: 980px) {
  .hero .container {
    gap: 36px;
  }

  .community .container {
    gap: 40px;
  }
}

@media (max-width: 820px) {
  .hero .container {
    grid-template-columns: minmax(0, 1fr);

    min-height: 0;
  }

  .hero-card {
    box-sizing: border-box;

    max-width: 520px;

    width: 100%;

    margin: 20px auto 0;
  }

  .playing-badge {
    right: -6px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community .container {
    flex-direction: column;

    align-items: stretch;
  }

  .discord-card {
    box-sizing: border-box;

    width: 100%;
  }

  .game-card {
    grid-template-columns: 1fr;

    max-width: 440px;
  }

  .game-card img {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 980px) {
  .creations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dm-card {
    grid-template-columns: 1fr;

    gap: 26px;

    padding: 28px;
  }
}

@media (max-width: 650px) {
  .carousel-slide {
    aspect-ratio: 4 / 3;
  }

  .carousel-slide img {
    inset: 14px;

    max-width: calc(100% - 28px);

    max-height: calc(100% - 28px);
  }

  .carousel-btn {
    width: 40px;

    height: 40px;

    font-size: 18px;
  }

  .carousel-btn--prev {
    left: 8px;
  }

  .carousel-btn--next {
    right: 8px;
  }

  .carousel-caption {
    padding: 20px 20px 6px;
  }

  .carousel-caption h3 {
    font-size: 24px;
  }

  .carousel-footer {
    padding: 12px 20px 18px;
  }

  :root {
    --gutter: 22px;
  }

  .site-header .container {
    min-height: 76px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    /* the wide Header.svg stretches in a tall menu, so use a matching gradient instead */

    background-image:
      linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 45%),
      linear-gradient(180deg, #d90004, #a30003);

    background-size: auto;

    background-position: 0 0;

    position: absolute;

    top: calc(100% + 8px);

    right: var(--gutter);

    display: none;

    flex-direction: column;

    align-items: stretch;

    min-width: 190px;

    padding: 8px;

    border-radius: var(--radius);

    box-shadow: 6px 6px 0 var(--ink);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 11px 14px;
  }

  .nav-indicator {
    display: none;
  }

  .nav a[aria-current="page"] {
    background: var(--ink);
  }

  .section {
    padding-block: 70px;
  }

  .hero {
    padding-block: 40px 84px;
  }

  .updates-grid,
  .creations-grid,
  .social-grid {
    grid-template-columns: 1fr;
  }

  .site-footer .container {
    flex-direction: column;

    align-items: flex-start;

    gap: 20px;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .stat-card {
    padding: 18px;
  }

  .stat-card strong {
    font-size: 32px;
  }

  .hero-actions .pill-button {
    box-sizing: border-box;

    width: 100%;

    justify-content: center;
  }
}
