/* =========================================================
   AINEXOAI Cornerstone Hub — premium polish (no redesign)
   ========================================================= */

body.cornerstone-hub {
  position: relative;
}

body.cornerstone-hub::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 12% 8%, rgba(200, 155, 60, 0.12), transparent 60%),
    radial-gradient(700px 380px at 88% 18%, rgba(159, 45, 45, 0.1), transparent 55%),
    radial-gradient(600px 400px at 50% 100%, rgba(200, 155, 60, 0.06), transparent 50%);
}

body.cornerstone-hub .site-header,
body.cornerstone-hub main,
body.cornerstone-hub footer {
  position: relative;
  z-index: 1;
}

.cornerstone-hub .page-hero {
  padding-bottom: 28px;
}

.cornerstone-hub .page-hero .container {
  max-width: 920px;
}

.cornerstone-hub .page-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
  text-shadow: 0 0 40px rgba(200, 155, 60, 0.18);
}

.cornerstone-hub .page-hero .gradient-text {
  background: linear-gradient(120deg, #c89b3c 0%, #e8d5a3 45%, #9f2d2d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cornerstone-hub .page-hero .breadcrumb {
  margin-top: 8px;
  opacity: 0.92;
}

.cs-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.45);
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.16), rgba(159, 45, 45, 0.1));
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(200, 155, 60, 0.2);
  animation: csBadgePulse 3.2s ease-in-out infinite;
}

@keyframes csBadgePulse {
  0%, 100% { box-shadow: 0 0 18px rgba(200, 155, 60, 0.16); }
  50% { box-shadow: 0 0 28px rgba(200, 155, 60, 0.32); }
}

@media (prefers-reduced-motion: reduce) {
  .cs-phase-badge { animation: none; }
}

.cs-hub-intro {
  max-width: 720px;
  margin: 0 0 22px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}

.cs-search-wrap {
  position: relative;
  margin: 0 0 28px;
  max-width: 640px;
}

.cs-search-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 1rem;
}

.cs-search {
  width: 100%;
  box-sizing: border-box;
  height: 54px;
  padding: 0 16px 0 46px;
  border-radius: 16px;
  border: 1px solid rgba(200, 155, 60, 0.4);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-size: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-search::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

.cs-search:focus {
  outline: none;
  border-color: rgba(200, 155, 60, 0.85);
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.18), 0 12px 30px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .cs-search {
  background: #fff;
  border-color: rgba(200, 155, 60, 0.45);
  color: #242424;
}

.cs-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-topic-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  min-height: 100%;
  border: 1px solid rgba(200, 155, 60, 0.22);
  content-visibility: auto;
  contain-intrinsic-size: 260px;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.cs-topic-card:hover {
  transform: translateY(-5px);
  border-color: rgba(200, 155, 60, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.cs-topic-card:focus-visible {
  outline: 2px solid #c89b3c;
  outline-offset: 3px;
}

.cs-topic-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #c89b3c;
  background: linear-gradient(145deg, rgba(200, 155, 60, 0.18), rgba(159, 45, 45, 0.1));
  border: 1px solid rgba(200, 155, 60, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: perspective(420px) rotateX(8deg) rotateY(-8deg);
  transition: transform 0.28s ease;
}

.cs-topic-card:hover .cs-topic-icon {
  transform: perspective(420px) rotateX(0) rotateY(0) scale(1.06);
}

.cs-topic-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.cs-topic-card h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
  color: var(--text);
}

.cs-topic-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  flex: 1;
}

.cs-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cs-chip {
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.28);
  background: rgba(200, 155, 60, 0.08);
  color: var(--muted);
}

.cs-hub-cta .btn {
  border: 1px solid rgba(200, 155, 60, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.cs-hub-cta .btn:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 28px rgba(200, 155, 60, 0.22);
}

.cs-hub-cta .btn:active {
  transform: scale(0.98);
}

.cs-float-orb {
  position: absolute;
  right: 4%;
  top: 120px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(232, 213, 163, 0.55), rgba(200, 155, 60, 0.2) 40%, rgba(159, 45, 45, 0.15) 70%, transparent 75%);
  filter: blur(0.2px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 40px rgba(200, 155, 60, 0.25);
  animation: csOrbFloat 7s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes csOrbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(14px) scale(1.04); }
}

@media (max-width: 900px) {
  .cs-float-orb { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-float-orb,
  .cs-topic-card { animation: none; transition: none; }
}

[data-theme="light"] .cs-topic-card:hover {
  box-shadow: 0 16px 36px rgba(36, 36, 36, 0.1);
}

.cs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px;
  color: var(--muted);
}
