/**
 * ============================================================================
 * THE APPRAISER'S GRIMOIRE - Main Theme Stylesheet
 * ============================================================================
 *
 * Visual Inspiration: Classic fantasy illustration art in the style of the
 * Brothers Hildebrandt, Ted Nasmith, and Greg Hildebrandt. The aesthetic
 * evokes illuminated manuscripts, wizard's studies, and twilight journeys
 * through mystical landscapes.
 *
 * Key Design Principles:
 *   - Painterly quality with rich, detailed oil painting aesthetic
 *   - Twilight atmosphere with deep blue evening skies
 *   - Warm golden accents against cool blues for high contrast
 *   - Mystical serenity with a contemplative, journey-focused mood
 *   - Fantasy landscape elements: stone archways, winding paths, starry skies
 *
 * ============================================================================
 */

/* ============================================================================
   GOOGLE FONTS IMPORT
   Typography inspired by medieval manuscripts and fantasy literature
   ============================================================================ */

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

/* ============================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   The twilight color palette - where warm torchlight meets cool evening sky
   ============================================================================ */

:root {
  /* -------------------------------------------------------------------------
     TWILIGHT SKY - Primary Background
     Deep blues reminiscent of a starlit evening sky, the wizard's preferred
     hour for contemplation and work
     ------------------------------------------------------------------------- */
  --sky-deep: #1a1a3a;          /* Deepest night, near the zenith */
  --sky-twilight: #2d3a6d;      /* The heart of twilight, rich and mysterious */
  --sky-horizon: #4a5a8a;       /* Where sky meets distant lands */

  /* -------------------------------------------------------------------------
     GOLDEN WARMTH - Accents & Highlights
     The warm glow of torchlight, candlelight, and magical illumination
     that guides the wizard on their journey
     ------------------------------------------------------------------------- */
  --gold-bright: #f4c430;       /* Pure golden light, like captured sunlight */
  --gold-warm: #daa520;         /* Goldenrod, the warmth of aged treasure */
  --gold-deep: #b8860b;         /* Dark gold, ancient and valuable */
  --amber-glow: #ff9500;        /* Amber torchlight, welcoming and warm */

  /* -------------------------------------------------------------------------
     STONE & EARTH - Structural Elements
     The timeless grays and browns of castle stone, ancient towers,
     and the sturdy foundations of the wizard's domain
     ------------------------------------------------------------------------- */
  --stone-light: #9a9a8a;       /* Sunlit stone, weathered but enduring */
  --stone-mid: #6a6a5a;         /* Shadowed stone corridors */
  --stone-dark: #4a4a3a;        /* Deep stone, foundation and shadow */
  --earth-warm: #8b7355;        /* Rich earth tones, grounding warmth */

  /* -------------------------------------------------------------------------
     WIZARD BLUE - Interactive Elements
     The mystical blues of a wizard's robe, suggesting wisdom,
     magic, and the promise of discovery
     ------------------------------------------------------------------------- */
  --robe-blue: #4a6a9a;         /* The wizard's traveling cloak */
  --robe-deep: #3a4a7a;         /* Deeper folds of magical fabric */
  --magic-blue: #6a8ac0;        /* Magical aura, enchanted glow */

  /* -------------------------------------------------------------------------
     FOREST & NATURE - Secondary Palette
     The living world that surrounds the wizard's path
     ------------------------------------------------------------------------- */
  --forest-dark: #2a3a2a;       /* Dense woodland shadow */
  --forest-mid: #4a5a4a;        /* Twilight forest canopy */
  --meadow-gold: #9a8a3a;       /* Sun-touched meadow grass */

  /* -------------------------------------------------------------------------
     MOONLIGHT - Special Highlights
     The ethereal glow that illuminates the path forward
     ------------------------------------------------------------------------- */
  --moon-pale: #f0e68c;         /* Soft moonbeam, khaki warmth */
  --moon-glow: #fffacd;         /* Full moon radiance */
  --starlight: #e6e6fa;         /* Distant starlight, lavender shimmer */

  /* -------------------------------------------------------------------------
     NODE STATES - Progress Indicators
     Visual states for the journey through the appraisal workflow
     ------------------------------------------------------------------------- */
  --node-locked: #4a4a5a;       /* Shadowed stone, not yet accessible */
  --node-available: #6a8ac0;    /* Magic blue glow, ready for exploration */
  --node-progress: #daa520;     /* Golden amber, work in progress */
  --node-complete: #f4c430;     /* Bright gold, achievement unlocked */

  /* -------------------------------------------------------------------------
     SEMANTIC COLORS
     Feedback and status indicators within the fantasy theme
     ------------------------------------------------------------------------- */
  --success: #4a8a4a;           /* Forest green, nature's approval */
  --success-glow: #5a9a5a;
  --warning: #b8860b;           /* Deep gold, caution */
  --warning-glow: #daa520;
  --error: #8b3a3a;             /* Ember red, danger */
  --error-glow: #a04040;
  --info: #4a6a9a;              /* Wizard blue, guidance */
  --info-glow: #6a8ac0;

  /* -------------------------------------------------------------------------
     TYPOGRAPHY SCALE
     Harmonious sizing based on classical proportions
     ------------------------------------------------------------------------- */
  --font-size-xs: 0.75rem;      /* 12px - Fine print, annotations */
  --font-size-sm: 0.875rem;     /* 14px - Secondary text, captions */
  --font-size-base: 1rem;       /* 16px - Body text, readable comfort */
  --font-size-md: 1.125rem;     /* 18px - Emphasized body text */
  --font-size-lg: 1.25rem;      /* 20px - Section introductions */
  --font-size-xl: 1.5rem;       /* 24px - Subheadings */
  --font-size-2xl: 2rem;        /* 32px - Major headings */
  --font-size-3xl: 2.5rem;      /* 40px - Page titles */
  --font-size-4xl: 3rem;        /* 48px - Hero titles */

  /* -------------------------------------------------------------------------
     SPACING SCALE
     Consistent rhythm throughout the interface
     ------------------------------------------------------------------------- */
  --space-xs: 0.25rem;          /* 4px */
  --space-sm: 0.5rem;           /* 8px */
  --space-md: 1rem;             /* 16px */
  --space-lg: 1.5rem;           /* 24px */
  --space-xl: 2rem;             /* 32px */
  --space-2xl: 3rem;            /* 48px */
  --space-3xl: 4rem;            /* 64px */

  /* -------------------------------------------------------------------------
     BORDER RADIUS
     Organic, hand-crafted feeling curves
     ------------------------------------------------------------------------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-round: 9999px;

  /* -------------------------------------------------------------------------
     SHADOWS
     Suggesting depth, torchlight, and dimensional space
     ------------------------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);

  /* Glowing shadows for magical elements */
  --glow-gold: 0 0 20px rgba(244, 196, 48, 0.4);
  --glow-gold-strong: 0 0 30px rgba(244, 196, 48, 0.6);
  --glow-blue: 0 0 20px rgba(106, 138, 192, 0.4);
  --glow-blue-strong: 0 0 30px rgba(106, 138, 192, 0.6);
  --glow-amber: 0 0 20px rgba(255, 149, 0, 0.4);

  /* -------------------------------------------------------------------------
     TRANSITIONS
     Smooth, magical-feeling state changes
     ------------------------------------------------------------------------- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-slower: 600ms ease;

  /* -------------------------------------------------------------------------
     Z-INDEX SCALE
     Layering system for proper stacking
     ------------------------------------------------------------------------- */
  --z-base: 0;
  --z-elevated: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-tooltip: 500;
  --z-notification: 600;
}

/* ============================================================================
   BASE RESET & DEFAULTS
   Establishing a consistent foundation
   ============================================================================ */

*,
*::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 STYLING
   The twilight canvas upon which our interface is painted
   ============================================================================ */

body {
  /* Elegant serif font for comfortable reading */
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: 1.7;

  /* The twilight gradient - deep night sky transitioning to horizon glow */
  background: linear-gradient(
    180deg,
    var(--sky-deep) 0%,
    var(--sky-twilight) 40%,
    var(--sky-horizon) 100%
  );

  /* Ensure the gradient covers the full viewport */
  min-height: 100vh;
  background-attachment: fixed;

  /* Text colors for readability against dark backgrounds */
  color: var(--moon-glow);

  /* Prevent horizontal scroll from animations */
  overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   Hierarchy inspired by illuminated manuscripts and ancient tomes
   ============================================================================ */

/* Primary Headings - Ornate, decorative, commanding presence */
h1 {
  font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(244, 196, 48, 0.3);
  margin-bottom: var(--space-lg);
}

/* Secondary Headings - Classic, structured, authoritative */
h2 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: var(--font-size-2xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--gold-warm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: var(--space-md);
}

h3 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: var(--font-size-xl);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--moon-pale);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-md);
}

h4 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: var(--font-size-lg);
  font-weight: 500;
  line-height: 1.4;
  color: var(--starlight);
  margin-bottom: var(--space-sm);
}

h5 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: var(--font-size-md);
  font-weight: 500;
  line-height: 1.4;
  color: var(--stone-light);
  margin-bottom: var(--space-sm);
}

h6 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.4;
  color: var(--stone-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

/* Body Text - Comfortable, readable, elegant */
p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--font-size-md);
  line-height: 1.8;
  color: var(--moon-glow);
  margin-bottom: var(--space-md);
}

/* Lead/Introduction Paragraphs */
.lead {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--starlight);
  line-height: 1.9;
}

/* Small Text */
small,
.text-small {
  font-size: var(--font-size-sm);
  color: var(--stone-light);
}

/* Emphasis */
strong,
b {
  font-weight: 700;
  color: var(--gold-warm);
}

em,
i {
  font-style: italic;
  color: var(--moon-pale);
}

/* ============================================================================
   LINKS
   Golden paths leading to new discoveries
   ============================================================================ */

a {
  color: var(--gold-warm);
  text-decoration: none;
  transition:
    color var(--transition-fast),
    text-shadow var(--transition-fast);
  cursor: pointer;
}

a:hover {
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(244, 196, 48, 0.5);
}

a:focus {
  outline: 2px solid var(--gold-warm);
  outline-offset: 2px;
}

a:active {
  color: var(--amber-glow);
}

/* Subtle link variant for less prominent navigation */
.link-subtle {
  color: var(--stone-light);
}

.link-subtle:hover {
  color: var(--moon-glow);
  text-shadow: none;
}

/* ============================================================================
   LISTS
   Organized wisdom in the wizard's scrolls
   ============================================================================ */

ul,
ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  font-size: var(--font-size-md);
  line-height: 1.7;
  color: var(--moon-glow);
  margin-bottom: var(--space-xs);
}

/* Custom list markers with a fantasy flair */
ul.styled-list {
  list-style: none;
  padding-left: var(--space-md);
}

ul.styled-list li {
  position: relative;
  padding-left: var(--space-lg);
}

ul.styled-list li::before {
  content: '\2726'; /* Four-pointed star */
  position: absolute;
  left: 0;
  color: var(--gold-warm);
  font-size: 0.8em;
}

/* ============================================================================
   CODE & MONOSPACE
   The wizard's technical incantations
   ============================================================================ */

code,
pre,
kbd,
samp,
.data,
.monospace {
  font-family: 'IBM Plex Mono', 'Fira Code', 'Consolas', monospace;
}

code {
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: rgba(74, 74, 58, 0.6);
  border: 1px solid var(--stone-mid);
  border-radius: var(--radius-sm);
  color: var(--moon-pale);
}

pre {
  padding: var(--space-md);
  background: rgba(26, 26, 58, 0.8);
  border: 1px solid var(--stone-dark);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: var(--font-size-sm);
}

/* ============================================================================
   BLOCKQUOTES
   Ancient wisdom, quoted from the grimoire
   ============================================================================ */

blockquote {
  border-left: 4px solid var(--gold-deep);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: linear-gradient(
    90deg,
    rgba(138, 106, 53, 0.15) 0%,
    transparent 100%
  );
  font-style: italic;
  color: var(--moon-pale);
}

blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--stone-light);
  font-style: normal;
}

blockquote cite::before {
  content: '\2014 '; /* Em dash */
}

/* ============================================================================
   HORIZONTAL RULES
   Decorative dividers, like illuminated manuscript separators
   ============================================================================ */

hr {
  border: none;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-deep) 20%,
    var(--gold-warm) 50%,
    var(--gold-deep) 80%,
    transparent 100%
  );
  margin: var(--space-xl) 0;
}

/* Ornamental variant with center flourish */
hr.ornamental {
  height: auto;
  background: none;
  text-align: center;
  overflow: visible;
}

hr.ornamental::before {
  content: '\2726  \2726  \2726'; /* Three stars */
  display: inline-block;
  color: var(--gold-warm);
  font-size: var(--font-size-lg);
  letter-spacing: 1em;
}

/* ============================================================================
   SELECTION STYLING
   When text is selected, maintain the magical theme
   ============================================================================ */

::selection {
  background: rgba(218, 165, 32, 0.4);
  color: var(--moon-glow);
}

::-moz-selection {
  background: rgba(218, 165, 32, 0.4);
  color: var(--moon-glow);
}

/* ============================================================================
   SCROLLBAR STYLING
   Custom scrollbars to match the fantasy aesthetic
   ============================================================================ */

/* WebKit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--sky-deep);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--stone-mid) 0%,
    var(--stone-dark) 100%
  );
  border-radius: var(--radius-md);
  border: 2px solid var(--sky-deep);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--stone-light) 0%,
    var(--stone-mid) 100%
  );
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--stone-mid) var(--sky-deep);
}

/* ============================================================================
   FOCUS STATES
   Accessible focus indicators with magical glow
   ============================================================================ */

:focus-visible {
  outline: 2px solid var(--gold-warm);
  outline-offset: 2px;
  box-shadow: var(--glow-gold);
}

/* ============================================================================
   LAYOUT COMPONENTS
   Structural elements for page organization
   ============================================================================ */

/* Main container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1600px;
}

/* Page sections */
.section {
  padding: var(--space-2xl) 0;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

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

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

/* Flex utilities */
.flex {
  display: flex;
}

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

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

.flex--wrap {
  flex-wrap: wrap;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================================================
   UTILITY CLASSES
   Helper classes for common styling needs
   ============================================================================ */

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

/* Text Colors */
.text-gold { color: var(--gold-bright); }
.text-gold-warm { color: var(--gold-warm); }
.text-stone { color: var(--stone-light); }
.text-moon { color: var(--moon-glow); }
.text-starlight { color: var(--starlight); }

/* Background Classes */
.bg-stone-dark { background-color: var(--stone-dark); }
.bg-sky-deep { background-color: var(--sky-deep); }
.bg-sky-twilight { background-color: var(--sky-twilight); }

/* Spacing Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Visibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   HEADER & NAVIGATION
   The wizard's navigation through the grimoire
   ============================================================================ */

.wizard-header {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    transparent 100%
  );
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--stone-dark);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(8px);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.wizard-nav .logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: var(--font-size-xl);
  color: var(--gold-warm);
  font-weight: 700;
  text-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--space-xl);
  padding: 0;
  margin: 0;
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: var(--font-size-base);
  color: var(--moon-glow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links a:hover {
  color: var(--gold-bright);
}

/* ============================================================================
   FOOTER
   The closing of the tome
   ============================================================================ */

.wizard-footer {
  text-align: center;
  padding: var(--space-xl);
  color: var(--stone-light);
  font-style: italic;
  border-top: 1px solid var(--stone-dark);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

.wizard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl);
  min-height: calc(100vh - 200px);
}

/* Page header styling */
.page-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--stone-dark);
}

.breadcrumb {
  font-size: var(--font-size-sm);
  color: var(--stone-light);
  margin-top: var(--space-sm);
}

.breadcrumb a {
  color: var(--stone-light);
}

.breadcrumb a:hover {
  color: var(--gold-warm);
}

.breadcrumb span {
  margin: 0 var(--space-sm);
  color: var(--stone-mid);
}

/* ============================================================================
   LANDING PAGE
   The entrance to the grimoire
   ============================================================================ */

.landing-page {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.hero h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
}

.tagline {
  font-family: 'Cinzel', serif;
  font-size: var(--font-size-xl);
  color: var(--gold-warm);
  font-style: italic;
  margin-bottom: var(--space-lg);
}

.description {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  font-size: var(--font-size-lg);
  color: var(--starlight);
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--stone-light);
  font-style: italic;
}

/* ============================================================================
   END OF THEME.CSS
   ============================================================================ */
