/* Page layouts and navigation shared across FETAMIN. */
.section-masthead {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 24px;
}
.section-masthead h1 {
  font-size: clamp(28px, 4vw, 44px) !important;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.auth-panel.section-masthead {
  border-top: 2px solid var(--accent) !important;
  margin-bottom: 24px;
}
.auth-panel.section-masthead h1 {
  font-size: clamp(28px, 4vw, 36px) !important;
}
.page-profile .profile-identity.section-masthead {
  margin-bottom: 0;
}

.topbar .nav-directory:not([hidden]) {
  display: grid;
  gap: 4px;
  width: 288px;
  padding: 12px !important;
  border-radius: 12px !important;
  background: #141317 !important;
  box-shadow: 0 14px 32px #0005 !important;
}
.topbar .nav-directory-title {
  margin: 8px 8px 0;
  font-size: 12px;
  color: #a5a5af;
}
.topbar .nav-directory :is(a, .nav-logout) {
  min-height: 40px;
  border-radius: 8px !important;
  font-size: 13px;
}
.topbar .nav-directory :is(a, .nav-logout) > i,
.topbar .nav-more-trigger > i:last-child {
  display: inline-block;
  color: var(--accent);
}
.topbar .nav-directory a.active {
  background: #26232a;
  color: var(--text) !important;
}
.topbar .nav-directory .inline-form {
  border-color: var(--line);
}

.chat-page .chat-layout {
  grid-template-columns: minmax(184px, 224px) minmax(0, 1fr);
  gap: 24px;
}
.chat-page .chat-category {
  border-left: 2px solid transparent;
}
.chat-page .chat-category.active {
  border-left-color: var(--accent);
}
.chat-page .chat-panel {
  background: var(--bg) !important;
}
.chat-page .chat-stream {
  padding: 20px;
  gap: 16px;
}
.chat-page .chat-bubble {
  background: var(--surface);
  border-color: var(--line);
  padding: 8px 12px;
}
.chat-page .chat-message.mine .chat-bubble {
  border-right: 2px solid var(--accent);
}
.chat-page .chat-composer textarea {
  min-width: 0;
}

:is(.page-forum, .page-category) .category-list,
:is(.page-forum, .page-category) .thread-list {
  border-top: 2px solid var(--accent);
}
.page-forum .forum-side .stats {
  border-radius: 12px !important;
}
.page-forum .forum-side .stats strong {
  font-variant-numeric: tabular-nums;
}
.page-thread .post-author {
  border-right: 1px solid var(--line);
  border-radius: 0 !important;
}

.client-page .client-identity {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  margin-bottom: 24px;
}
.client-page .client-identity > .mc-panel {
  min-width: 0;
  border-top: 2px solid var(--accent) !important;
}
.client-page .mc-config-list .mc-config {
  min-height: 60px;
  padding-inline: 12px;
  border-bottom: 1px solid var(--line);
}
.client-page .mc-config-list .mc-config:hover {
  background-color: var(--surface-2);
}
.client-page .mc-tools {
  border-top: 2px solid var(--accent) !important;
}

.admin-page .admin2-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-page .admin2-tabs > a {
  min-height: 40px;
  border-radius: 8px;
}
.admin-page .admin2-tabs > a.is-on {
  background: var(--accent) !important;
  color: #241505 !important;
}
.admin-page .admin2-panel {
  overflow-x: auto;
}
.admin-page .admin2-table th {
  background: var(--surface-2);
  color: var(--text);
  letter-spacing: normal;
  text-transform: none;
}
.admin-page .admin2-table tbody tr:nth-child(even) {
  background: #ffffff04;
}

.page-marketplace .market-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr));
  gap: 16px;
}
.page-marketplace .market-card {
  min-width: 0;
  border-radius: 12px !important;
}
.page-marketplace .market-card-cover {
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.page-marketplace .market-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-marketplace .market-card .market-title {
  overflow-wrap: anywhere;
}
.page-marketplace .market-filters {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.page-members .directory-total {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.page-members .members-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 204px), 1fr));
  gap: 16px;
}
.page-members .member-card {
  border-radius: 12px !important;
}
.page-members .member-card-banner {
  height: 76px;
  background: var(--surface-2);
}
.page-members .member-card-content {
  min-width: 0;
  padding: 0 16px 16px;
  overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* Pointer lighting inspired by React Bits Spotlight Card. */
  [data-spotlight][data-spotlight-active] {
    background-image: radial-gradient(
      220px circle at var(--spotlight-x) var(--spotlight-y),
      #efc28c19,
      transparent
    ) !important;
  }
}

@media (max-width: 820px) {
  .chat-page .chat-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .chat-page .chat-rail {
    order: 0;
  }
  .chat-page .chat-categories {
    display: flex;
    overflow-x: auto;
  }
  .chat-page .chat-category {
    flex: 0 0 auto;
    max-width: 224px;
  }
  .chat-page .chat-rail-card {
    margin-top: 8px;
  }
  .client-page .client-identity {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 680px) {
  .topbar .nav-directory:not([hidden]) {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 4px;
    box-shadow: none !important;
  }
  .section-masthead {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .chat-page .chat-stream {
    padding: 12px;
  }
  .page-marketplace .market-filters {
    flex-wrap: wrap;
  }
}

.page-marketplace-item .market-detail {
  border-radius: 16px !important;
}
.page-marketplace-item .market-detail h1 {
  font-size: clamp(28px, 4vw, 42px);
  overflow-wrap: anywhere;
}
.page-settings .settings-card {
  border-top: 2px solid var(--line) !important;
}

/* Footer navigation and language selection. */
.site-footer.footer {
  background: #111217 !important;
  padding: 0 !important;
}
.site-footer-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-block: 28px;
}
.site-footer-brand {
  display: grid;
  justify-items: start;
  gap: 8px;
}
.site-footer-brand small {
  color: #a5a5af;
  font-size: 12px;
}
.site-footer .site-footer-brand a {
  color: #f5f2ee !important;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  font-size: 13px;
}
.site-language {
  display: inline-flex;
  justify-self: end;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ffffff16;
  border-radius: 12px;
  background: #09090b;
}
.site-language button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #b0afb9;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.site-language button:hover {
  background: #18181d;
  color: #f5f2ee;
}
.site-language button[aria-current="true"] {
  border-color: #efc28c47;
  background: #242027;
  color: #f5f2ee;
}
.site-language svg {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
}
@media (max-width: 760px) {
  .site-footer-layout {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }
  .site-footer-links {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 380px) {
  .site-footer-layout {
    grid-template-columns: 1fr;
  }
  .site-language {
    justify-self: start;
  }
}

/* Glass is reserved for navigation and interactive controls. */
@supports (backdrop-filter: blur(12px)) {
  body .topbar .topbar-inner {
    background: #17161eb5 !important;
    backdrop-filter: blur(20px) saturate(135%) !important;
  }
  body .topbar.is-scrolled .topbar-inner {
    background: #17161edb !important;
  }
  body .topbar .nav-directory:not([hidden]),
  body .site-select-popup {
    background: #191820e0 !important;
    backdrop-filter: blur(16px) saturate(125%) !important;
  }
  .home-page .island-btn-ghost,
  body:not(.home-page) .button:not(.button-red),
  body .site-language button[aria-current="true"] {
    background: #ffffff12 !important;
    border-color: #ffffff26 !important;
    backdrop-filter: blur(10px);
  }
  .home-page .island-btn-ghost:hover,
  body:not(.home-page) .button:not(.button-red):not(:disabled):hover {
    background: #ffffff20 !important;
    border-color: #ffffff3a !important;
  }
  .home-page .island-btn-primary,
  body:not(.home-page) .button-red {
    background: #efc28ce8 !important;
    backdrop-filter: blur(10px);
  }
  .home-page .island-btn-primary:hover,
  body:not(.home-page) .button-red:hover {
    background: #ffdbad !important;
  }
  @media (max-width: 680px) {
    body .topbar .nav.is-open {
      background: #191820ed !important;
    }
  }
}

@media (prefers-reduced-transparency: reduce) {
  body .topbar .topbar-inner,
  body .topbar .nav-directory:not([hidden]),
  body .topbar .nav.is-open,
  body .site-select-popup,
  .home-page .island-btn-ghost,
  body:not(.home-page) .button:not(.button-red),
  body .site-language button[aria-current="true"] {
    background: #191920 !important;
    backdrop-filter: none !important;
  }
  .home-page .island-btn-primary,
  body:not(.home-page) .button-red {
    background: #efc28c !important;
    backdrop-filter: none !important;
  }
}

/* Motion timing is shared by the landing page and the signed-in interface. */
@media (prefers-reduced-motion: no-preference) {
  :root {
    --motion-enter: cubic-bezier(.22, 1, .36, 1);
  }

  .home-page .hero-inner {
    animation: none;
  }
  .home-page .hero-title {
    animation: fetamin-enter .8s var(--motion-enter) both;
  }
  .home-page .hero-sub {
    animation: fetamin-enter .7s .12s var(--motion-enter) both;
  }
  .home-page .hero-actions {
    animation: fetamin-enter .7s .22s var(--motion-enter) both;
  }
  .home-page .hero-scroll {
    animation: fetamin-fade .6s .45s var(--motion-enter) both;
  }
  .section-masthead,
  .auth-panel.section-masthead {
    animation: fetamin-enter .48s var(--motion-enter) both;
  }
  .motion-entered:not(.step-grid, .access-grid, :focus-within) {
    animation: fetamin-enter .66s var(--motion-enter) both;
  }
  .motion-entered :is(.step-card, .access-card) {
    animation: fetamin-enter .55s var(--motion-enter) both;
  }
  .motion-entered :is(.step-card, .access-card):nth-child(2) {
    animation-delay: 60ms;
  }
  .motion-entered :is(.step-card, .access-card):nth-child(3) {
    animation-delay: 120ms;
  }

  .topbar .nav-directory:not([hidden]) {
    animation: fetamin-menu .28s var(--motion-enter) both;
    transform-origin: top right;
  }
  .topbar .nav-more-trigger > i:last-child {
    transition: transform .24s var(--motion-enter);
  }
  .topbar .nav-more-trigger[aria-expanded="true"] > i:last-child {
    transform: rotate(180deg);
  }
  :is(.island-btn, .market-open, .mc-text-link, .access-card) .bx-right-arrow-alt {
    transition: transform .26s var(--motion-enter);
  }
  :is(.island-btn, .market-open, .mc-text-link, .access-card):is(:hover, :focus-visible) .bx-right-arrow-alt {
    transform: translateX(4px);
  }
  .site-language button {
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  }

}

@keyframes fetamin-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes fetamin-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fetamin-menu {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
