/* ============================================================
   THE 7TH SON — Global Stylesheet
   File: src/shared/css/global.css
   Author: Divyansh Thapliyal
   Description: Shared fonts, resets, variables and base styles
                used across all 7 trials and hub page.
                Import this in every HTML file.
   ============================================================ */

/* ----------------------------------------------------------
   GOOGLE FONTS — import at top
   ---------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500&display=swap');

/* ----------------------------------------------------------
   CSS VARIABLES — one place to control the entire look
   ---------------------------------------------------------- */
:root {

  /* Core colors */
  --color-black:        #000000;
  --color-white:        #ffffff;
  --color-bg:           #080808;
  --color-bg-secondary: #0f0f0f;
  --color-bg-card:      #131313;
  --color-bg-overlay:   rgba(0, 0, 0, 0.85);

  /* Gold — the bloodline color */
  --color-gold:         #c9a84c;
  --color-gold-light:   #e8c97a;
  --color-gold-dark:    #8a6f2e;
  --color-gold-glow:    rgba(201, 168, 76, 0.15);
  --color-gold-border:  rgba(201, 168, 76, 0.3);

  /* Text */
  --color-text-primary:   #e8e0d0;
  --color-text-secondary: #a09880;
  --color-text-muted:     #5a5448;
  --color-text-gold:      #c9a84c;

  /* State colors */
  --color-unlocked:  #c9a84c;
  --color-completed: #4a7c4e;
  --color-locked:    #2a2620;
  --color-active:    #c9a84c;
  --color-error:     #8b3030;

  /* Borders */
  --border-gold:    1px solid rgba(201, 168, 76, 0.3);
  --border-dark:    1px solid rgba(255, 255, 255, 0.05);
  --border-muted:   1px solid rgba(255, 255, 255, 0.08);

  /* Fonts */
  --font-display:  'Cinzel', serif;           /* headings, trial names */
  --font-body:     'Crimson Text', serif;     /* story text, narrative */
  --font-ui:       'Inter', sans-serif;       /* buttons, labels, UI */
  --font-mono:     'Courier New', monospace;  /* codes, system text */

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-xxl: 80px;

  /* Border radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow:   0.6s ease;

  /* Shadows */
  --shadow-gold:  0 0 20px rgba(201, 168, 76, 0.15);
  --shadow-dark:  0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-card:  0 2px 12px rgba(0, 0, 0, 0.4);

  /* Z-index layers */
  --z-base:    1;
  --z-overlay: 100;
  --z-modal:   200;
  --z-top:     300;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-ui);
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   TYPOGRAPHY
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-primary);
  letter-spacing: 0.05em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.text-gold    { color: var(--color-gold); }
.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-upper   { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.8rem; }

/* ----------------------------------------------------------
   LAYOUT HELPERS
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

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

.full-screen {
  min-height: 100vh;
  width: 100%;
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */
.btn-primary {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-black);
  background: var(--color-gold);
  padding: 14px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gold);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-gold-light);
  border-color: var(--color-gold-light);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  background: transparent;
  padding: 13px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gold-border);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--color-gold-glow);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}

.btn-ghost {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  background: transparent;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--color-text-secondary);
  border-color: rgba(255,255,255,0.15);
}

/* ----------------------------------------------------------
   CARDS
   ---------------------------------------------------------- */
.card {
  background: var(--color-bg-card);
  border: var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

/* ----------------------------------------------------------
   DIVIDERS
   ---------------------------------------------------------- */
.divider {
  width: 60px;
  height: 1px;
  background: var(--color-gold-border);
  margin: var(--space-lg) auto;
}

.divider-full {
  width: 100%;
  height: 1px;
  background: var(--color-border-dark);
  margin: var(--space-xl) 0;
}

/* ----------------------------------------------------------
   NARRATIVE TEXT — for story passages
   ---------------------------------------------------------- */
.narrative {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-text-secondary);
  line-height: 2;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.narrative-reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeReveal 1s ease forwards;
}

@keyframes fadeReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   GLITCH EFFECT — for mystery moments
   ---------------------------------------------------------- */
.glitch {
  position: relative;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  92%            { transform: translate(-2px, 1px); }
  94%            { transform: translate(2px, -1px); }
  96%            { transform: translate(-1px, 2px); }
  98%            { transform: translate(1px, -2px); }
}

/* ----------------------------------------------------------
   PULSE — for active/current trial indicators
   ---------------------------------------------------------- */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

/* ----------------------------------------------------------
   GOLD GLOW — for important elements
   ---------------------------------------------------------- */
.glow-gold {
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.3),
              0 0 40px rgba(201, 168, 76, 0.1);
}

.text-glow-gold {
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.5);
}

/* ----------------------------------------------------------
   ADSENSE CONTAINER — ready for monetization
   ---------------------------------------------------------- */
.ad-container {
  width: 100%;
  text-align: center;
  padding: var(--space-md) 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-container-sidebar {
  width: 300px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.site-footer {
  border-top: var(--border-dark);
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.site-footer p {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.site-footer a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--color-gold);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

/* ----------------------------------------------------------
   SCROLLBAR — custom dark scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}

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

/* ----------------------------------------------------------
   SELECTION — gold highlight when text is selected
   ---------------------------------------------------------- */
::selection {
  background: var(--color-gold-glow);
  color: var(--color-gold-light);
}

/* ----------------------------------------------------------
   RESPONSIVE — mobile first adjustments
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --space-xl:  24px;
    --space-xxl: 48px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  p {
    font-size: 1rem;
  }

  .narrative {
    font-size: 1.05rem;
  }
}