/* =========================
   SHARED PAGE LAYOUT
========================= */

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #05070f;
  color: #fff;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* =========================
   GLASS SYSTEM
========================= */

.glass {
  position: relative;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-radius: 18px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);

  overflow: hidden;

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

/* Glass sheen */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 55%,
    transparent 100%
  );

  transform: translateX(-120%);
  animation: sheen 10s infinite;
  pointer-events: none;
}

@keyframes sheen {
  0% { transform: translateX(-120%); }
  40% { transform: translateX(-120%); }
  60% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

/* Mouse glow */
.glass::before {
  content: "";
  position: absolute;
  inset: -40%;

  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 50%),
    rgba(255, 255, 255, 0.12),
    transparent 40%
  );

  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
  pointer-events: none;
}

.glass:hover::before {
  opacity: 1;
}

/* =========================
   NAVIGATION
========================= */

.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);

  width: min(1100px, 92%);

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 18px;
  z-index: 10;
}

/* Keep navbar stable on hover */
.nav:hover {
  transform: translateX(-50%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  color: white;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.brand span {
  font-weight: 600;
  letter-spacing: 2.5px;
  font-size: 0.9rem;
}

.nav a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
  opacity: 0.7;
  font-size: 0.85rem;
}

.nav a:hover {
  opacity: 1;
}

/* Keep clickable brand fully visible */
.nav .brand {
  margin-left: 0;
  opacity: 1;
}

/* =========================
   GENERAL UTILITIES
========================= */

.hidden {
  display: none !important;
}

/* =========================
   MAIN CONTENT
========================= */

.page-shell {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 150px 0 55px;
}

.hero {
  max-width: 720px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 12px;
  color: #a88ad3;
  font-size: 0.66rem;
  letter-spacing: 2.3px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -1.5px;
}

.hero h1 span {
  color: #bd91ff;
}

.hero-copy {
  max-width: 550px;
  margin: 13px auto 24px;
  color: #92909f;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* =========================
   SEARCH
========================= */

.search-box {
  display: flex;
  width: min(470px, 100%);
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 0 15px;
  border: 1px solid #ffffff20;
  border-radius: 11px;
  background: rgba(8, 9, 18, 0.8);
  color: #aaa;
  text-align: left;
}

.search-box span {
  font-size: 1.35rem;
}

.search-box input {
  width: 100%;
  padding: 13px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
}

.search-box:focus-within {
  border-color: #a979dc;
  box-shadow: 0 0 0 3px #a979dc20;
}

.result-count {
  min-height: 17px;
  margin: 12px 0 0;
  color: #777282;
  font-size: 0.72rem;
}

/* =========================
   EGG GRID
========================= */

.egg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.egg-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  color: inherit;
  text-decoration: none;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.egg-card:hover {
  transform: translateY(-4px);
  border-color: #b58aff55;
  background: rgba(255, 255, 255, 0.075);
}

.egg-card-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
}

.egg-image {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid #ffffff18;
  border-radius: 13px;
  background: #ffffff10;
  object-fit: cover;
}

.egg-image-fallback {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border: 1px solid #ffffff18;
  border-radius: 13px;
  background: linear-gradient(145deg, #382452, #141222);
  color: #d5b7ff;
  font-size: 1.25rem;
}

.egg-title {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 600;
  text-overflow: ellipsis;
}

.egg-version {
  margin-top: 4px;
  color: #a995c2;
  font-size: 0.7rem;
}

.egg-description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 44px;
  margin: 0 0 19px;
  color: #9995a4;
  font-size: 0.8rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.egg-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #ffffff12;
  color: #bda0e7;
  font-size: 0.75rem;
}

.egg-card-footer span:last-child {
  color: #8c8498;
  font-size: 1rem;
}

/* =========================
   EMPTY AND NOT-FOUND STATES
========================= */

.empty-state,
.not-found {
  padding: 45px 25px;
  text-align: center;
}

.empty-icon {
  margin-bottom: 10px;
  color: #b58aff;
  font-size: 2rem;
}

.empty-state h2,
.not-found h1 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 500;
}

.empty-state p,
.not-found p {
  margin: 0;
  color: #92909f;
  font-size: 0.82rem;
}

/* =========================
   EGG DETAIL PAGE
========================= */

.detail-shell {
  max-width: 900px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: #bda0e7;
  font-size: 0.82rem;
  text-decoration: none;
}

.back-link:hover {
  color: #fff;
}

.detail-card {
  padding: clamp(22px, 5vw, 40px);
}

.detail-loading {
  padding: 35px 0;
  color: #9995a4;
  text-align: center;
}

.detail-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid #ffffff16;
}

.detail-image {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  border: 1px solid #ffffff20;
  border-radius: 18px;
  background: #ffffff10;
  object-fit: cover;
}

.detail-image-fallback {
  display: grid;
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  place-items: center;
  border: 1px solid #ffffff20;
  border-radius: 18px;
  background: linear-gradient(145deg, #382452, #141222);
  color: #d5b7ff;
  font-size: 2rem;
}

.detail-heading h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 500;
}

.detail-heading p {
  margin: 7px 0 0;
  color: #a995c2;
  font-size: 0.78rem;
}

.detail-description {
  margin: 23px 0 26px;
  color: #b5b1bf;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-section {
  margin-top: 22px;
}

.detail-section h2 {
  margin: 0 0 10px;
  color: #aaa0b9;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.code-value {
  overflow-wrap: anywhere;
  padding: 13px 14px;
  border: 1px solid #ffffff16;
  border-radius: 9px;
  background: #080912b8;
  color: #e2d6f2;
  font-family: monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 29px;
}

.button-link,
.action-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  text-decoration: none;

  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease;
}

.primary-button {
  border-color: #9a6bcb66;
  background: linear-gradient(120deg, #7544ad, #54318b);
  box-shadow: 0 8px 25px #633a9a35;
}

.secondary-button {
  background: #ffffff0c;
}

.button-link:hover,
.action-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.not-found {
  padding: 50px 25px;
}

.not-found .button-link {
  margin-top: 22px;
}

/* =========================
   FOOTER
========================= */

.site-footer {
  display: flex;
  width: min(1100px, 92%);
  justify-content: space-between;
  margin: 0 auto;
  padding: 20px 0 30px;
  border-top: 1px solid #ffffff10;
  color: #716c7b;
  font-size: 0.7rem;
}

/* =========================
   RESPONSIVE LAYOUT
========================= */

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

@media (max-width: 600px) {
  .page-shell {
    padding-top: 125px;
  }

  .hero {
    margin-bottom: 30px;
  }

  .egg-grid {
    grid-template-columns: 1fr;
  }

  .egg-card {
    padding: 17px;
  }

  .detail-heading {
    align-items: flex-start;
    gap: 14px;
  }

  .detail-image,
  .detail-image-fallback {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
  }

  .site-footer {
    gap: 15px;
    flex-direction: column;
  }
}