/* ===========================================================================
   AnimeFFA — 3/5 · Layout chrome
   Fixed header, primary navigation, server/Discord/basket pills,
   mobile drawer and the site footer.
   Requires ffa-tokens.css.
   =========================================================================== */

/* -------------------------------------------------------- Site header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding-block: .55rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .28s var(--ease), border-color .28s var(--ease),
              backdrop-filter .28s var(--ease);
}

/* Soft scrim so nav text stays readable over the hero before it sticks. */
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 6, 7, .72), transparent);
  transition: opacity .28s var(--ease);
}

.site-header.is-stuck {
  background: rgba(10, 7, 8, .92);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
.site-header.is-stuck::after { opacity: 0; }

.nav-inner {
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px;
  border-radius: var(--r-sm);
}
.nav-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(211, 37, 63, .45));
  transition: transform .2s var(--ease);
}
.nav-brand:hover img { transform: scale(1.06); }

/* ---------------------------------------------------------- Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: .15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links > li { flex-shrink: 0; }

/* Account link lives in the header pills on desktop, in the drawer on mobile. */
.nav-links-account { display: none; }

.nav-links a {
  position: relative;
  display: block;
  padding: .55rem .72rem;
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: rgba(245, 238, 238, .05); }

.nav-links a::after {
  content: "";
  position: absolute;
  left: .72rem;
  right: .72rem;
  bottom: .3rem;
  height: 2px;
  background: var(--crimson-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* --------------------------------------- Pills: server IP, Discord, basket */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  height: 42px;
  padding: 0 .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(21, 16, 18, .72);
  color: var(--text);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              transform .16s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.pill svg { width: 16px; height: 16px; flex-shrink: 0; }
.pill:hover {
  transform: translateY(-1px);
  border-color: var(--line-red);
  background: rgba(27, 16, 19, .9);
}

.pill-ip { color: #f3d9dd; }
.pill-ip svg { fill: var(--crimson-2); }
.pill-ip:hover { box-shadow: var(--glow-red); }
.pill-ip.is-copied { border-color: #3fa663; color: #9ae3b6; }

.pill-discord { color: #c6cdf7; }
.pill-discord svg { fill: #7a86e8; }
.pill-discord:hover { border-color: rgba(122, 134, 232, .55); }

.pill-basket svg { stroke: var(--crimson-2); fill: none; stroke-width: 2; }

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: var(--r-xs);
  background: rgba(211, 37, 63, .18);
  border: 1px solid var(--line-red);
  font-size: .7rem;
  font-weight: 700;
  color: #f0c3ca;
  font-variant-numeric: tabular-nums;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 42px;
  padding: 0 .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .76rem;
  font-weight: 700;
  color: var(--text-dim);
  max-width: 190px;
}
.nav-user .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.nav-user:hover { border-color: var(--line-red); color: var(--text); }

/* -------------------------------------------------------- Mobile drawer */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: rgba(21, 16, 18, .72);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .22s var(--ease), opacity .18s var(--ease);
}
.nav-toggle span + span { margin-top: 4px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(4, 3, 3, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s var(--ease), visibility .24s;
}
body.nav-open .nav-scrim { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; flex-direction: column; }

  .nav-links {
    position: fixed;
    z-index: 99;
    top: 0; right: 0; bottom: 0;
    width: min(330px, 86vw);
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    padding: 5.5rem 1.25rem 2rem;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--bg-3), var(--bg));
    border-left: 1px solid var(--line-red);
    box-shadow: -24px 0 60px -30px #000;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s var(--ease), visibility .3s;
  }
  body.nav-open .nav-links { transform: none; visibility: visible; }

  .nav-links a {
    padding: .85rem .75rem;
    font-size: .88rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav-links a::after { left: .75rem; right: auto; width: 22px; bottom: .45rem; }
  .nav-links-account { display: block; }

  .nav-actions { gap: .4rem; }
  .pill-label { display: none; }
  .pill { padding: 0 .7rem; }
}

@media (max-width: 720px) {
  .nav-user { display: none; }
  .pill-ip .count-chip { display: none; }
}

/* --------------------------------------------------------------- Footer */
.site-footer {
  position: relative;
  margin-top: var(--section);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  background: linear-gradient(180deg, transparent, rgba(19, 9, 11, .9));
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-red) 30%, var(--line-red) 70%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .footer-grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
}

.footer-brand { display: grid; gap: .75rem; align-content: start; }
.footer-brand img { width: 88px; height: 88px; object-fit: contain; }
.footer-brand p { margin: 0; color: var(--text-faint); font-size: .88rem; max-width: 38ch; }
.footer-brand .pill { align-self: start; }
.footer-brand .pill-label { display: inline; }

.footer-col h3 {
  margin: 0 0 .85rem;
  font-family: var(--font-display);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-col li { font-size: .88rem; color: var(--text-dim); }
.footer-col a,
.footer-col button {
  font-size: .88rem;
  color: var(--text-dim);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.footer-col a:hover,
.footer-col button:hover { color: var(--crimson-2); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 1.6rem;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--text-faint);
}
.footer-bottom p { margin: 0; }
