/**
 * =============================================================================
 * SYBILLAE BRAND CSS SYSTEM
 * =============================================================================
 * 
 * This file defines all CSS custom properties (design tokens) and base styles
 * for the Sybillae application. All values are derived from the Brand Guidelines
 * for CSS & UI Components document.
 * 
 * Contents:
 * 1. CSS Custom Properties (Design Tokens)
 * 2. Global Base Styles
 * 3. Typography
 * 4. Animations & Keyframes
 * 5. Utility Classes
 * 
 * =============================================================================
 */


/* =============================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================================= */

:root {
  /* ---- FOUNDATION - THE NIGHT SKY ---- */
  --color-deep-void:       #0A0B14;
  --color-midnight:        #111227;
  --color-indigo-night:    #1A1B3A;
  --color-twilight:        #2D2B55;

  /* ---- SOL (WARM ACCENTS) ---- */
  --color-sol-warm:        #F0C370;
  --color-sol-gold:        #E8A849;
  --color-sol-amber:       #D4943A;

  /* ---- CUSP (COOL ACCENTS) ---- */
  --color-cusp-coral:      #D68F7E;
  --color-cusp-rose:       #C4728F;
  --color-aurora-violet:   #7B6BB5;

  /* ---- NEUTRALS ---- */
  --color-star-silver:     #B8B8D0;
  --color-text-primary:    #E8E6F0;
  --color-text-secondary:  #9896AA;
  --color-text-dim:        #6B6980;

  /* ---- FUNCTIONAL ---- */
  --color-success:         #6BBF8A;
  --color-warning:         #E8A849;
  --color-error:           #D4626E;
  --color-info:            #7B9DD4;

  /* ---- RGB TRIPLETS (for rgba() with theme-aware colors) ---- */
  --accent-rgb:            232, 168, 73;
  --accent-light-rgb:      240, 195, 112;
  --secondary-rgb:         196, 114, 143;
  --glass-rgb:             255, 255, 255;
  --glow-rgb:              232, 168, 73;

  /* ---- DECORATIVE ---- */
  --gradient-divider:      linear-gradient(to right, #E8A849 0%, #D68F7E 25%, #C4728F 50%, #9B7EC8 75%, #7B6BB5 100%);

  /* ---- SURFACE ---- */
  --nav-bg:                rgba(10, 11, 20, 0.92);

  /* ---- BUTTON SHAPE ---- */
  --radius-cta:            9999px;

  /* ---- BORDERS ---- */
  --border-subtle:         1px solid rgba(255, 255, 255, 0.04);
  --border-light:          1px solid rgba(255, 255, 255, 0.06);
  --border-medium:         1px solid rgba(255, 255, 255, 0.10);
  --border-accent-gold:    1px solid rgba(232, 168, 73, 0.20);
  --border-accent-rose:    1px solid rgba(196, 114, 143, 0.20);

  /* ---- GRADIENTS ---- */
  --gradient-horizon:      linear-gradient(135deg, #F0C370 0%, #E8A849 20%, #D68F7E 40%, #C4728F 60%, #7B6BB5 80%, #1A1B3A 100%);
  --gradient-dawn:         linear-gradient(135deg, #0A0B14 0%, #1A1B3A 30%, #2D2B55 50%, #C4728F 75%, #F0C370 100%);
  --gradient-eclipse:      radial-gradient(circle at 40% 50%, #E8A849 0%, #D68F7E 25%, #2D2B55 50%, #0A0B14 80%);
  --gradient-sol-text:     linear-gradient(135deg, #F0C370, #E8A849, #D4943A);
  --gradient-cusp-text:    linear-gradient(135deg, #D68F7E, #C4728F, #7B6BB5);
  --gradient-button:       linear-gradient(135deg, #E8A849, #D4943A);
  --gradient-button-hover: linear-gradient(135deg, #F0C370, #E8A849);
  --gradient-card-featured: linear-gradient(135deg, rgba(232, 168, 73, 0.08), rgba(196, 114, 143, 0.08));

  /* ---- SHADOWS ---- */
  --shadow-sm:             0 2px 8px rgba(0, 0, 0, 0.20);
  --shadow-md:             0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg:             0 8px 32px rgba(0, 0, 0, 0.30);
  --shadow-xl:             0 16px 48px rgba(0, 0, 0, 0.35);
  --shadow-glow-gold:      0 0 20px rgba(232, 168, 73, 0.15);
  --shadow-glow-rose:      0 0 20px rgba(196, 114, 143, 0.15);
  --shadow-glow-intense:   0 0 40px rgba(232, 168, 73, 0.25);

  /* ---- RADII ---- */
  --radius-xs:             4px;
  --radius-sm:             8px;
  --radius-md:             12px;
  --radius-lg:             16px;
  --radius-xl:             24px;
  --radius-2xl:            32px;
  --radius-pill:           9999px;
  --radius-circle:         50%;

  /* ---- SPACING SCALE ---- */
  --space-1:               4px;
  --space-2:               8px;
  --space-3:               12px;
  --space-4:               16px;
  --space-5:               20px;
  --space-6:               24px;
  --space-8:               32px;
  --space-10:              40px;
  --space-12:              48px;
  --space-16:              64px;
  --space-20:              80px;
  --space-24:              96px;

  /* ---- TYPOGRAPHY ---- */
  --font-display:          'Cormorant Garamond', Georgia, serif;
  --font-body:             'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-xs:               11px;
  --text-sm:               12px;
  --text-base:             14px;
  --text-md:               16px;
  --text-lg:               18px;
  --text-xl:               24px;
  --text-2xl:              28px;
  --text-3xl:              36px;
  --text-4xl:              42px;
  --text-5xl:              56px;
  --text-hero:             clamp(48px, 8vw, 96px);

  --leading-tight:         1.15;
  --leading-snug:          1.3;
  --leading-normal:        1.5;
  --leading-relaxed:       1.7;
  --leading-loose:         1.8;

  --tracking-tight:        -0.01em;
  --tracking-normal:       0;
  --tracking-wide:         0.02em;
  --tracking-wider:        0.05em;
  --tracking-widest:       0.15em;
  --tracking-mega:         0.25em;

  /* ---- TRANSITIONS ---- */
  --ease-default:          cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:               cubic-bezier(0.4, 0, 1, 1);
  --ease-out:              cubic-bezier(0, 0, 0.2, 1);
  --ease-breathe:          cubic-bezier(0.45, 0, 0.55, 1);

  --duration-fast:         150ms;
  --duration-normal:       300ms;
  --duration-slow:         600ms;
  --duration-slower:       1000ms;
  --duration-ambient:      8000ms;

  /* ---- Z-INDEX SCALE ---- */
  --z-base:                0;
  --z-raised:              10;
  --z-dropdown:            100;
  --z-sticky:              200;
  --z-overlay:             300;
  --z-modal:               400;
  --z-toast:               500;
  --z-tooltip:             600;
}


/* =============================================================================
   2. GLOBAL BASE STYLES
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--color-deep-void);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Selection styling */
::selection {
  background: rgba(var(--accent-rgb), 0.20);
  color: var(--color-text-primary);
}

::-moz-selection {
  background: rgba(var(--accent-rgb), 0.20);
  color: var(--color-text-primary);
}

/* Custom scrollbar (webkit) */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-deep-void);
}

::-webkit-scrollbar-thumb {
  background: var(--color-twilight);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-twilight) var(--color-deep-void);
}

/* Focus states - Sol Gold, never browser default blue */
:focus-visible {
  outline: 2px solid var(--color-sol-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Links */
a {
  color: var(--color-sol-gold);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-default);
}

a:hover {
  color: var(--color-sol-warm);
}

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


/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

/* ---- HEADINGS (Display - Cormorant Garamond) ---- */

h1, .h1, .text-hero {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-primary);
}

h2, .h2, .text-section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-4xl);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}

h3, .h3, .text-card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}

h4, .h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
}

/* ---- BODY TEXT (Outfit) ---- */

p, .text-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  color: var(--color-text-secondary);
}

.text-body-small {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.text-caption {
  font-size: var(--text-sm);
  font-weight: 300;
  font-style: italic;
  color: var(--color-star-silver);
}

/* ---- LABELS & METADATA (Outfit - uppercase) ---- */

.text-section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-mega);
  text-transform: uppercase;
  color: var(--color-sol-gold);
}

.text-ui-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.text-metadata {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 300;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-dim);
}

/* ---- GRADIENT TEXT ---- */

.text-gradient-sol {
  background: var(--gradient-sol-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-cusp {
  background: var(--gradient-cusp-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-horizon {
  background: var(--gradient-horizon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* =============================================================================
   4. ANIMATIONS & KEYFRAMES
   ============================================================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes slideDown {
  from { transform: translateY(-16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.08); opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* =============================================================================
   5. UTILITY CLASSES
   ============================================================================= */

/* ---- Display ---- */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* ---- Flex utilities ---- */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-col {
  flex-direction: column;
}

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ---- Gap ---- */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ---- Text alignment ---- */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ---- Colors ---- */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-dim { color: var(--color-text-dim); }
.text-gold { color: var(--color-sol-gold); }
.text-rose { color: var(--color-cusp-rose); }

/* ---- Backgrounds ---- */
.bg-void { background-color: var(--color-deep-void); }
.bg-midnight { background-color: var(--color-midnight); }
.bg-indigo { background-color: var(--color-indigo-night); }

/* ---- Padding ---- */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ---- Margin ---- */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ---- Width/Height ---- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ---- Position ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* ---- Overflow ---- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* ---- Border radius ---- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-circle); }
.rounded-pill { border-radius: var(--radius-pill); }

/* ---- Opacity ---- */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ---- Transitions ---- */
.transition-all {
  transition: all var(--duration-normal) var(--ease-default);
}

.transition-opacity {
  transition: opacity var(--duration-normal) var(--ease-default);
}

/* ---- Pointer ---- */
.pointer { cursor: pointer; }
.pointer-none { pointer-events: none; }

/* ---- Animation utilities ---- */
.animate-fadeIn {
  animation: fadeIn var(--duration-slow) var(--ease-default);
}

.animate-fadeUp {
  animation: fadeUp var(--duration-slow) var(--ease-default);
}

.animate-breathe {
  animation: breathe var(--duration-ambient) var(--ease-breathe) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

