@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600;700;800;900&family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap');

/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */

:root {
  --deep-void: #05040a;
  --temple-black: #0b0910;
  --oracle-gold: #c9a84c;
  --illuminated-gold: #e8c97a;
  --ancient-bronze: #7a6030;
  --saturn-red: #8b1a1a;
  --emerald-alchemy: #2a5a3a;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--deep-void);
  color: var(--illuminated-gold);
  font-family: 'EB Garamond', serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: var(--oracle-gold);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--illuminated-gold);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, .cinzel {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  word-break: normal;
  overflow-wrap: break-word;
}

.cinzel-decorative {
  font-family: 'Cinzel Decorative', cursive;
}

.font-garamond {
  font-family: 'EB Garamond', serif;
}

/* ==========================================================================
   2. GLOBAL UI COMPONENTS
   ========================================================================== */

/* Background Starfield Effect */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1a2e 0%, #05040a 100%);
  z-index: -1;
}

.starfield::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 50px 160px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 80px 120px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 110px 210px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 150px 150px, #fff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.3;
  animation: shine 5s infinite;
}

/* Sacred Geometry Divider */
.sacred-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
}

.sacred-divider::before,
.sacred-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ancient-bronze), var(--oracle-gold));
}

.sacred-divider::after {
  background: linear-gradient(270deg, transparent, var(--ancient-bronze), var(--oracle-gold));
}

.sacred-divider span {
  padding: 0 1.5rem;
  font-size: 1.5rem;
  color: var(--oracle-gold);
}

/* Authority Branding */
.authority-line {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--ancient-bronze);
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: 0.8;
}

/* ==========================================================================
   3. COMPLEX COMPONENTS
   ========================================================================== */

/* Navigation */
nav {
  position: relative;
  z-index: 50;
}

.nav-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.5rem;
  width: 100%;
}

.nav-link {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--oracle-gold);
  text-decoration: none !important;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--illuminated-gold);
  text-shadow: 0 0 8px rgba(232, 201, 122, 0.5);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--oracle-gold);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

/* Buttons */
.invoke-btn {
  background: linear-gradient(135deg, var(--oracle-gold), var(--ancient-bronze));
  color: var(--deep-void);
  font-family: 'Cinzel', serif;
  font-weight: bold;
  padding: 1rem 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.2;
}

.invoke-btn:hover {
  background: linear-gradient(135deg, var(--illuminated-gold), var(--oracle-gold));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(201, 168, 76, 0.3);
}

.explore-btn {
  background: transparent;
  color: var(--oracle-gold);
  border: 1px solid var(--oracle-gold);
  font-family: 'Cinzel', serif;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.explore-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--illuminated-gold);
  border-color: var(--illuminated-gold);
}

/* Panels & Cards */
.gold-panel {
  border: 1px solid var(--oracle-gold);
  background: rgba(11, 9, 16, 0.9);
  padding: 2.5rem;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.gold-panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--ancient-bronze);
  opacity: 0.4;
  pointer-events: none;
}

.temple-card {
  background: rgba(11, 9, 16, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  padding: 2.5rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.temple-card:hover {
  border-color: var(--oracle-gold);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}

/* Article Cards */
.article-card-hover {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card-hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.1), transparent);
  transition: 0.5s;
}

.article-card-hover:hover::after {
  left: 100%;
}

.article-card-hover:hover {
  border-color: var(--oracle-gold);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
  transform: translateY(-5px);
}

/* Hero Section */
.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
}

.hero-panel {
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.hero-panel form {
  width: 100%;
}

.hero-panel button,
.hero-panel input {
  width: 100%;
}

.hero-section > .absolute {
  pointer-events: none;
}

/* ==========================================================================
   4. LAYOUT SYSTEM (GRID & FLEX)
   ========================================================================== */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.shrink-0 { flex-shrink: 0; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* Common Grid Wrappers */
.article-grid,
.archive-grid,
.knowledge-grid,
.knowledge-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.article-grid > a,
.archive-grid > a,
.knowledge-grid > a {
  display: block;
  min-width: 0;
  align-self: stretch;
}

.grid > a, .grid > div, .flex > a, .flex > div {
  min-width: 0;
}

/* Spacing Helpers */
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-px { height: 1px; }

/* Padding & Margins */
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
.px-12 { padding-left: 3rem; padding-right: 3rem; }
.px-16 { padding-left: 4rem; padding-right: 4rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.py-32 { padding-top: 8rem; padding-bottom: 8rem; }
.pt-4 { padding-top: 1rem; }
.pt-10 { padding-top: 2.5rem; }
.pl-8 { padding-left: 2rem; }
.pr-8 { padding-right: 2rem; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-20 { margin-top: 5rem; }
.mt-24 { margin-top: 6rem; }
.mt-32 { margin-top: 8rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-14 { margin-bottom: 3.5rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }
.my-12 { margin-top: 3rem; margin-bottom: 3rem; }

.max-w-xs { max-width: 20rem; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }

.min-h-screen { min-height: 100vh; }
.min-h-\[90vh\] { min-height: 90vh; }
.min-h-\[400px\] { min-height: 400px; }

/* ==========================================================================
   5. UTILITY LAYER (STYLING HELPERS)
   ========================================================================== */

/* Typography Helpers */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-7xl { font-size: 4.5rem; }
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-\[12px\] { font-size: 12px; }
.text-\[13px\] { font-size: 13px; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }

.leading-tight { line-height: 1.1; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.75; }

.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.25em; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-\[0\.1em\] { letter-spacing: 0.1em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.tracking-\[0\.3em\] { letter-spacing: 0.3em; }
.tracking-\[0\.4em\] { letter-spacing: 0.4em; }

/* Color Helpers */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-\[\#c9a84c\] { color: #c9a84c; }
.text-\[\#e8c97a\] { color: #e8c97a; }
.text-\[\#7a6030\] { color: #7a6030; }
.text-\[\#d1d5db\] { color: #d1d5db; }
.text-\[\#9ca3af\] { color: #9ca3af; }
.text-\[\#4b5563\] { color: #4b5563; }

.hover\:text-gray-300:hover { color: #d1d5db; }
.hover\:text-\[\#c9a84c\]:hover { color: #c9a84c; }
.group:hover .group-hover\:text-\[\#c9a84c\] { color: #c9a84c; }

/* Background Helpers */
.bg-black { background-color: #000000; }
.bg-black\/90 { background: rgba(0, 0, 0, 0.9); }
.bg-black\/80 { background: rgba(0, 0, 0, 0.8); }
.bg-black\/60 { background: rgba(0, 0, 0, 0.6); }
.bg-\[\#05040a\] { background: #05040a; }
.bg-transparent { background: transparent; }
.bg-cover { background-size: cover; }
.bg-center { background-position: center; }

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--oracle-gold), var(--illuminated-gold));
}
.bg-gradient-to-b {
  background-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4), var(--deep-void));
}

.from-\[\#c9a84c\]\/5.to-transparent.bg-gradient-to-b {
  background-image: linear-gradient(to bottom, rgba(201,168,76,0.05), transparent);
}

.opacity-10 { opacity: 0.1; }
.opacity-20 { opacity: 0.2; }
.opacity-30 { opacity: 0.3; }
.opacity-40 { opacity: 0.4; }
.opacity-80 { opacity: 0.8; }
.overflow-hidden { overflow: hidden; }

/* Border & Shadow Helpers */
.border { border: 1px solid rgba(201, 168, 76, 0.2); }
.border-b { border-bottom: 1px solid rgba(201, 168, 76, 0.2); }
.border-t { border-top: 1px solid rgba(201, 168, 76, 0.2); }
.border-y {
  border-top: 1px solid rgba(201, 168, 76, 0.2);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}
.border-\[\#c9a84c\]\/10 { border-color: rgba(201, 168, 76, 0.1); }
.border-\[\#c9a84c\]\/20 { border-color: rgba(201, 168, 76, 0.2); }
.border-\[\#c9a84c\]\/30 { border-color: rgba(201, 168, 76, 0.3); }
.border-\[\#c9a84c\]\/40 { border-color: rgba(201, 168, 76, 0.4); }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }

.shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.35); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); }
.shadow-\[0_0_30px_rgba\(201\,168\,76\,0\.3\)\] { box-shadow: 0 0 30px rgba(201,168,76,0.3); }
.shadow-\[0_0_40px_rgba\(201\,168\,76\,0\.3\)\] { box-shadow: 0 0 40px rgba(201,168,76,0.3); }
.shadow-\[0_0_50px_rgba\(0\,0\,0\,0\.5\)\] { box-shadow: 0 0 50px rgba(0,0,0,0.5); }
.shadow-\[0_0_50px_rgba\(201\,168\,76\,0\.2\)\] { box-shadow: 0 0 50px rgba(201,168,76,0.2); }

.drop-shadow-\[0_0_25px_rgba\(201\,168\,76\,0\.5\)\] {
  filter: drop-shadow(0 0 25px rgba(201,168,76,0.5));
}

/* Interactions */
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.3s ease; }
.duration-300 { transition-duration: 0.3s; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.backdrop-blur-lg { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

.focus\:outline-none:focus { outline: none; }
.focus\:border-\[\#c9a84c\]:focus { border-color: #c9a84c; }

/* ==========================================================================
   6. ANIMATIONS
   ========================================================================== */

.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-\[spin_12s_linear_infinite\] { animation: spin 12s linear infinite; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shine {
  0% { opacity: 0.2; }
  50% { opacity: 0.4; }
  100% { opacity: 0.2; }
}

/* ==========================================================================
   7. RESPONSIVE OVERRIDES
   ========================================================================== */

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:text-2xl { font-size: 1.5rem; }
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:text-4xl { font-size: 2.25rem; }
  .md\:text-5xl { font-size: 3rem; }
  .md\:text-6xl { font-size: 3.75rem; }
  .md\:text-7xl { font-size: 4.5rem; }
  .md\:p-10 { padding: 2.5rem; }
  .md\:p-12 { padding: 3rem; }
  
  .article-grid, .archive-grid, .knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .article-grid, .archive-grid, .knowledge-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
