/* ============================================================
   SKELLOTECK CORP. — MAIN DESIGN SYSTEM
   Version 1.0
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Lato:wght@300;400;700&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Color Palette --- */
  --color-bg:            #120e18;
  --color-bg-alt:        #1a1222;
  --color-surface:       #1f1529;
  --color-surface-raised:#271c33;
  --color-surface-high:  #32243f;
  --color-border:        #3d2d52;
  --color-border-light:  #5a4275;

  /* Gold / Accent */
  --color-gold:          #c9a84c;
  --color-gold-light:    #e4c97e;
  --color-gold-muted:    #8a6f35;
  --color-gold-pale:     #f0e0a0;

  /* Brand Purple */
  --color-plum:          #7b3fa0;
  --color-plum-dark:     #4a2068;
  --color-plum-deeper:   #2d1340;
  --color-plum-muted:    #5a3080;

  /* Text */
  --color-ivory:         #faf4e8;
  --color-parchment:     #e8dfc8;
  --color-text:          #d4c8b8;
  --color-muted:         #8a7a9a;
  --color-subtle:        #5a4d6a;

  /* Status */
  --color-dark:          #0a0810;

  /* --- Typography --- */
  --font-display:        'Cinzel Decorative', 'Cinzel', serif;
  --font-heading:        'Cinzel', serif;
  --font-serif:          'Cormorant Garamond', Georgia, serif;
  --font-body:           'Lato', 'Helvetica Neue', Arial, sans-serif;

  /* --- Type Scale --- */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-md:    1.125rem;
  --text-lg:    1.25rem;
  --text-xl:    1.5rem;
  --text-2xl:   1.875rem;
  --text-3xl:   2.25rem;
  --text-4xl:   3rem;
  --text-5xl:   3.75rem;
  --text-6xl:   4.5rem;

  /* --- Spacing --- */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* --- Borders & Radius --- */
  --radius-sm:  3px;
  --radius-md:  6px;
  --radius-lg:  12px;
  --border-width: 1px;

  /* --- Shadows --- */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.8);
  --shadow-gold: 0 0 20px rgba(201,168,76,0.15);
  --shadow-plum: 0 4px 30px rgba(123,63,160,0.25);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* --- Layout --- */
  --max-width:         1200px;
  --nav-height:        72px;
  --section-padding:   var(--space-5xl) var(--space-xl);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

/* Parchment texture overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

/* Display (hero titles) */
.display-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 6vw, var(--text-6xl));
  font-weight: 700;
  color: var(--color-ivory);
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

/* Section headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-ivory);
  line-height: 1.25;
}

h1 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); font-weight: 700; letter-spacing: 0.05em; }
h2 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); font-weight: 600; letter-spacing: 0.04em; }
h3 { font-size: clamp(var(--text-lg), 2vw, var(--text-2xl)); font-weight: 600; letter-spacing: 0.03em; }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Pull quote / serif body */
.serif {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--color-parchment);
}

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
}

/* Labels and tags */
.label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold-muted);
}

/* Gold text utility */
.text-gold {
  color: var(--color-gold);
}
.text-muted {
  color: var(--color-muted);
}
.text-ivory {
  color: var(--color-ivory);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-5xl) var(--space-xl);
  position: relative;
}

.section--alt {
  background-color: var(--color-surface);
}

.section--dark {
  background-color: var(--color-bg-alt);
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ============================================================
   ORNAMENTAL ELEMENTS
   ============================================================ */

/* Gold divider line with diamond center */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold-muted), transparent);
}
.ornament-divider span {
  color: var(--color-gold);
  font-size: var(--text-xs);
}

/* Section header with ornamental underline */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.section-header h2 {
  margin-bottom: var(--space-md);
}
.section-header .underline {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  margin: var(--space-md) auto;
}
.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-size: var(--text-md);
}

/* Border ornament for cards */
.border-ornament {
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 0 4px var(--color-bg),
              inset 0 0 0 5px var(--color-border);
}

/* Corner ornaments via pseudo-elements */
.corner-ornament {
  position: relative;
}
.corner-ornament::before,
.corner-ornament::after {
  content: '✦';
  position: absolute;
  color: var(--color-gold-muted);
  font-size: 10px;
  opacity: 0.6;
}
.corner-ornament::before { top: var(--space-sm); left: var(--space-sm); }
.corner-ornament::after  { bottom: var(--space-sm); right: var(--space-sm); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid;
  transition: all var(--transition-base);
  position: relative;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid;
  opacity: 0.3;
  transition: opacity var(--transition-base);
}

.btn-primary {
  background-color: var(--color-plum);
  border-color: var(--color-gold-muted);
  color: var(--color-ivory);
}
.btn-primary::before { border-color: var(--color-gold); }
.btn-primary:hover {
  background-color: var(--color-plum-dark);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  box-shadow: var(--shadow-plum), var(--shadow-gold);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-gold-muted);
  color: var(--color-gold);
}
.btn-outline::before { border-color: var(--color-gold-muted); }
.btn-outline:hover {
  background-color: rgba(201,168,76,0.08);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover {
  border-color: var(--color-border-light);
  color: var(--color-ivory);
}

/* ============================================================
   BADGE / TAGS
   ============================================================ */

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
}

.badge-familiar { color: #a0c4ff; border-color: #4a7cbf; background: rgba(74,124,191,0.1); }
.badge-elemental { color: #c8a2f8; border-color: #7b5ab8; background: rgba(123,90,184,0.1); }
.badge-undead { color: #c0bdd8; border-color: #5a5878; background: rgba(90,88,120,0.1); }
.badge-general { color: var(--color-gold); border-color: var(--color-gold-muted); background: rgba(201,168,76,0.08); }

/* ============================================================
   FADE-IN ANIMATION (IntersectionObserver)
   ============================================================ */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up.delay-1 { transition-delay: 0.1s; }
.fade-up.delay-2 { transition-delay: 0.2s; }
.fade-up.delay-3 { transition-delay: 0.3s; }
.fade-up.delay-4 { transition-delay: 0.4s; }

/* ============================================================
   RESPONSIVE HELPERS
   ============================================================ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --section-padding: var(--space-3xl) var(--space-lg);
  }
  .section {
    padding: var(--space-3xl) var(--space-lg);
  }
  .container {
    padding: 0 var(--space-lg);
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-2xl) var(--space-md);
  }
  .container {
    padding: 0 var(--space-md);
  }
}
