/* Polished UI layer — works with unified tokens in styles.css */

@import url("https://fonts.bunny.net/css?family=geist:400,500,600,700");

body {
  padding-top: 5rem;
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-animated::after {
  background: linear-gradient(
    180deg,
    rgba(7, 8, 9, 0.72) 0%,
    rgba(7, 8, 9, 0.38) 42%,
    rgba(7, 8, 9, 0.9) 100%
  );
}

.site-header {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 1.25rem));
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header .container {
  min-height: 3.1rem;
  padding-inline: 0.5rem;
}

.brand {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.03em;
}

.header-nav {
  gap: 0.25rem;
}

.nav-link,
.dropdown-toggle {
  width: auto;
  min-width: 4.5rem;
  height: 2.25rem;
  line-height: 2.25rem;
  padding-inline: 1rem;
  border-radius: var(--radius-pill);
  border-color: transparent;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 500;
  transition:
    background 0.4s var(--ease-spring),
    transform 0.35s var(--ease-spring),
    border-color 0.35s var(--ease-out);
}

.nav-link:hover,
.nav-link:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.nav-link:active,
.dropdown-toggle:active {
  transform: scale(0.98);
}

.dropdown-menu {
  border-radius: 0.85rem;
  border-color: var(--border-strong);
  background: rgba(12, 14, 18, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.page {
  position: relative;
  z-index: 1;
}

.hero {
  margin-top: 0.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-xl);
}

.hero::after {
  animation: none;
  opacity: 0.65;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 0.85rem;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.hero-title {
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.page-picker {
  margin-top: 2.5rem;
}

.page-picker h2 {
  margin-bottom: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-grid-featured {
  grid-template-columns: 1.35fr 1fr;
  grid-template-areas:
    "about mods"
    "about donation";
  gap: 1rem;
}

.card-grid-featured .mods-card {
  grid-area: mods;
}

.card-grid-featured .about-card {
  grid-area: about;
}

.card-grid-featured .donation-card {
  grid-area: donation;
}

.page-card,
.mods-card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.32);
  animation: none;
}

.page-card:hover,
.page-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

.mods-card-toggle {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.subpage.subpage--wide {
  width: min(920px, calc(100% - 1.5rem));
  margin-top: 0.5rem;
  padding: 1.5rem 1.35rem 1.75rem;
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(12px);
}

.subpage h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.subpage > p {
  margin: 0 0 1.25rem;
  max-width: 52ch;
  line-height: 1.6;
}

.mod-item {
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.4s var(--ease-spring), border-color 0.35s var(--ease-out);
}

.mod-item:hover {
  transform: translateY(-2px);
}

.mod-item-link {
  padding: 1rem 1.1rem;
}

.mod-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.reveal {
  transform: translateY(16px);
  filter: none;
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-spring);
}

.mod-doc-container .mod-doc {
  letter-spacing: -0.01em;
}

.mod-doc-title {
  font-weight: 600;
  letter-spacing: -0.04em;
}

.site-footer {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .site-header {
    border-radius: 16px;
  }
}

@media (max-width: 820px) {
  .card-grid-featured {
    grid-template-columns: 1fr;
    grid-template-areas:
      "about"
      "mods"
      "donation";
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 7.75rem;
  }

  .site-header {
    top: 0.45rem;
    width: calc(100% - 0.85rem);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .site-header .container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    min-height: 0;
  }

  .brand {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .site-header .container > nav {
    width: 100%;
  }

  .header-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .header-nav > li {
    flex: 0 1 auto;
  }

  .nav-link,
  .dropdown-toggle {
    min-width: 0;
    height: 2rem;
    line-height: 2rem;
    padding-inline: 0.6rem;
    font-size: 0.78rem;
  }

  .auth-controls {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .auth-user {
    max-width: 100%;
    font-size: 0.78rem;
  }

  .auth-btn {
    height: 32px;
    padding-inline: 0.7rem;
    font-size: 0.8rem;
  }

  .dropdown-menu {
    position: absolute;
    left: 0;
    right: auto;
    margin-top: 0.35rem;
    min-width: min(100%, 14rem);
    width: max-content;
    max-width: calc(100vw - 2rem);
  }

  .bg-animated::before {
    background: radial-gradient(ellipse 120% 55% at 50% -10%, transparent 0%, rgba(9, 11, 16, 0.35) 100%);
  }

  .bg-animated::after {
    background: linear-gradient(
      180deg,
      rgba(9, 11, 16, 0.5) 0%,
      rgba(9, 11, 16, 0.28) 28%,
      rgba(9, 11, 16, 0.75) 100%
    );
  }

  .bg-animated.bg-animated--mod-page::before {
    background: radial-gradient(ellipse 120% 50% at 50% -8%, transparent 0%, rgba(9, 11, 16, 0.28) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .page-card,
  .mod-item,
  .nav-link {
    transition: none;
  }
}

/* Homepage — darker glass panels */
body.home-page .nav-link,
body.home-page .dropdown-toggle {
  background: rgba(9, 11, 16, 0.58);
  border: 1px solid var(--border);
}

body.home-page .nav-link:hover,
body.home-page .nav-link:focus-visible,
body.home-page .dropdown-toggle:hover,
body.home-page .dropdown-toggle:focus-visible {
  background: rgba(232, 201, 168, 0.12);
  border-color: rgba(232, 201, 168, 0.25);
}

body.home-page .nav-link[aria-current="page"] {
  background: rgba(232, 201, 168, 0.22);
  border-color: rgba(232, 201, 168, 0.45);
  color: var(--text);
}

body.home-page .page-card,
body.home-page .mods-card {
  background: rgba(9, 11, 16, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.28);
}

body.home-page .page-card:hover,
body.home-page .page-card:focus-visible {
  background: rgba(9, 11, 16, 0.68);
}

body.home-page .mods-card-list a {
  background: rgba(9, 11, 16, 0.48);
}

body.home-page .mods-card-list a:hover,
body.home-page .mods-card-list a:focus-visible {
  background: rgba(232, 201, 168, 0.12);
  border-color: rgba(232, 201, 168, 0.35);
}

body.home-page .discord-widget-link {
  background: rgba(9, 11, 16, 0.58);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body.home-page .hero {
  background: rgba(9, 11, 16, 0.58);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 40px rgba(0, 0, 0, 0.28);
}
