/* =========================================================
   Components
   Reusable pieces. They carry no outer margins; the section
   that uses a component decides where it sits. Hover styles
   only apply on devices that can hover (a tap on a touch
   screen would otherwise leave them stuck on), and hover lifts
   only run when the visitor hasn't asked for reduced motion.
   ========================================================= */

/* ---------------------------------------------------------
   Eyebrow: small uppercase label above headings
   --------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

/* Centred variant (hero, 404): smaller, with a short hairline on each side */
.eyebrow--ruled {
  font-size: var(--text-xs);
}

.eyebrow--ruled::before,
.eyebrow--ruled::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------------------------------------------------------
   Brand: mark + name, links back to the top or home
   --------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 44px;   /* comfortable tap target without changing the look */
  min-height: 44px;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: var(--tracking-display);
}

.brand img {
  flex: none;  /* never let a tight header squash the mark */
  width: var(--mark);
}

@media (max-width: 640px) {
  .brand img {
    width: var(--mark-sm);
  }
}

/* Footer variant: smaller at every width (kept after the media query above) */
.brand--footer img {
  width: var(--mark-footer);
}

.brand--footer span {
  font-size: var(--text-xl);
}

.brand span {
  padding-top: 3px;  /* optically centres Baloo's tall ascent */
}

/* ---------------------------------------------------------
   Pill buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 54px;
  padding: 0 var(--space-6);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              transform var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease);
}

.btn svg {
  flex: none;
  width: 18px;
  height: 18px;
}

/* Primary: cocoa fill, cream text (11:1) */
.btn--primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-btn);
}

/* Secondary: cocoa outline */
.btn--outline {
  background: transparent;
  color: var(--ink);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--ink-deep);
    border-color: var(--ink-deep);
    box-shadow: var(--shadow-btn-hover);
  }

  .btn--outline:hover {
    background: var(--sand);
  }
}

/* Phones: labels may wrap (and at very large text sizes, break inside long
   words such as "@MomuGames"), so enlarged browser text never pushes a button
   off-screen. At the default text size every label still fits on one line. */
@media (max-width: 640px) {
  .btn {
    padding-inline: var(--space-5);
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn:hover {
    transform: translateY(-2px);
  }
}

/* ---------------------------------------------------------
   Social links: a row of circular icon buttons
   --------------------------------------------------------- */
.socials {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--icon-btn);
  height: var(--icon-btn);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: color var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              background-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

/* Glyphs are sized against the button, so they follow it on phones */
.icon-btn svg {
  width: 45%;
  height: 45%;
}

/* Outlined glyphs (mail, gamepad) read lighter than the solid brand glyphs, so they get a touch more size */
.icon-btn .icon--stroke {
  width: 50%;
  height: 50%;
}

.icon-btn:focus-visible {
  border-radius: 50%;
}

/* [href] skips the disabled Discord button, which has no link yet */
@media (hover: hover) {
  a.icon-btn[href]:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--cream);
  }
}

/* Disabled "coming soon" state: dashed ring, softened glyph */
.icon-btn--soon {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-muted);
  cursor: not-allowed;
}

.icon-btn--soon svg {
  opacity: 0.7;
}

/* Phones: smaller, but still a 44px tap target */
@media (max-width: 640px) {
  .icon-btn {
    width: var(--icon-btn-sm);
    height: var(--icon-btn-sm);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.icon-btn[href]:hover {
    transform: translateY(-2px);
  }
}

/* ---------------------------------------------------------
   "Soon" tag: small gold badge pinned under an icon button
   --------------------------------------------------------- */
.soon-tag {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 50%;  /* straddles the button's bottom edge */
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--gold-light);
  color: var(--ink);                    /* 7.2:1 */
  box-shadow: 0 0 0 2px var(--paper);   /* page-coloured ring separates it from the button */
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Cards, laid out by .card-grid
   --------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
  }
}

.card__icon {
  display: grid;
  place-items: center;
  width: var(--card-icon);
  height: var(--card-icon);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--cream);
  color: var(--gold-ink);
}

.card__icon svg {
  width: 52%;  /* of the tile, so it follows it on phones */
  height: 52%;
}

.card__num {
  position: absolute;
  top: var(--card-pad);
  right: var(--card-pad);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--card-icon);  /* centres the number on .card__icon */
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.card h3 {
  margin-top: var(--space-6);
  font-size: var(--text-4xl);
  font-weight: 700;
}

.card p {
  margin-top: var(--space-3);
  font-size: var(--text-lg);
  color: var(--ink-muted);
  text-wrap: balance;  /* even lines in the narrow cards, and fewer awkward breaks */
}

/* Below 1280px, one column of wide cards: icon on the left, text beside it.
   minmax(0, ...) and overflow-wrap let very large browser text wrap
   inside the card instead of widening it past the screen. */
@media (max-width: 1279px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 var(--space-6);
  }

  .card__icon {
    grid-row: span 2;
  }

  .card h3 {
    margin-top: 0;
  }

  .card h3,
  .card p {
    overflow-wrap: anywhere;
  }

  .card__num {
    display: none;
  }
}

@media (max-width: 640px) {
  .card {
    padding: var(--space-5);
    gap: 0 var(--space-4);
  }

  .card__icon {
    width: var(--card-icon-sm);
    height: var(--card-icon-sm);
    border-radius: var(--radius-tile-sm);
  }

  .card h3 {
    font-size: var(--text-2xl);
  }

  .card p {
    font-size: var(--text-base);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover {
    transform: translateY(-3px);
  }
}

/* ---------------------------------------------------------
   Email pill: big mailto link, a cream pill on the cocoa panel
   --------------------------------------------------------- */
.mail-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
  max-width: 100%;
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow-on-ink);
  transition: background-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

@media (hover: hover) {
  .mail-btn:hover {
    background: var(--surface);
  }
}

.mail-btn__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--mail-icon);
  height: var(--mail-icon);
  border-radius: 50%;
  background: var(--gold-light);
  color: var(--ink);
}

.mail-btn__icon svg {
  width: 46%;  /* of the circle, so it follows it on phones */
  height: 46%;
}

/* min-width and overflow-wrap: with enlarged browser text the address breaks
   inside the pill rather than running out of it onto the cocoa panel */
.mail-btn__text {
  min-width: 0;
  overflow-wrap: anywhere;
  padding-top: 3px;  /* optical centring for Baloo */
  font-family: var(--font-display);
  font-size: var(--text-email);
  font-weight: 700;
  line-height: 1;
}

.mail-btn__arrow {
  flex: none;
  width: var(--mail-arrow);
  height: var(--mail-arrow);
  color: var(--gold-ink);
  transition: translate var(--speed) var(--ease);
}

/* Full-width pill on phones, arrow pushed to the far end */
@media (max-width: 640px) {
  .mail-btn {
    width: 100%;
    gap: var(--space-3);
    padding: 6px var(--space-4) 6px 6px;
  }

  .mail-btn__icon {
    width: var(--mail-icon-sm);
    height: var(--mail-icon-sm);
  }

  .mail-btn__arrow {
    margin-left: auto;
  }
}

@media (max-width: 359px) {
  .mail-btn__arrow {
    display: none;  /* decorative; frees room so the address never clips */
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mail-btn:hover {
    transform: translateY(-2px);
  }

  .mail-btn:hover .mail-btn__arrow {
    translate: 2px -2px;
  }
}
