/* Forj Home Website — Brand System CSS
 * Based on FORJ_BRAND_MASTER specifications
 * Version: 1.0 | February 2026
 */

/* ============================================
   IMPORT FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   CSS VARIABLES — THE FORGE Color System
   ============================================ */
:root {
  /* Primary Dark Backgrounds */
  --charcoal-black: #0D0D0D;
  --forge-grey: #1A1A1A;
  --void-grey: #141414;

  /* Accent Colors — Ember Gradient */
  --ember-orange: #E85D04;
  --heat-amber: #F48C06;
  --forge-glow: #FAA307;
  --hot-core: #FF6B35;

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #A8A8A8;
  --text-tertiary: #6B6B6B;
  --cold-steel: #4A4A4A;

  /* UI Colors */
  --border-subtle: rgba(74, 74, 74, 0.5);
  --border-standard: #4A4A4A;
  --border-accent: var(--heat-amber);

  /* Gradients */
  --gradient-signature: linear-gradient(135deg, #E85D04 0%, #F48C06 50%, #FAA307 100%);
  --gradient-signature-horizontal: linear-gradient(90deg, #E85D04 0%, #F48C06 50%, #FAA307 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(248, 140, 6, 0.15) 0%, transparent 70%);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace;

  /* Type Scale */
  --text-display: clamp(2.5rem, 6vw, 3.5rem);
  --text-h1: clamp(2rem, 4vw, 2.5rem);
  --text-h2: clamp(1.5rem, 3vw, 1.75rem);
  --text-h3: clamp(1.25rem, 2vw, 1.5rem);
  --text-h4: 1.125rem;
  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-body-sm: 0.875rem;
  --text-label: 0.75rem;
  --text-caption: 0.75rem;
  --text-data-lg: 2rem;
  --text-data: 1rem;

  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.3;
  --leading-relaxed: 1.4;
  --leading-loose: 1.6;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;

  /* 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;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-glow-sm: 0 0 20px rgba(232, 93, 4, 0.3), 0 0 40px rgba(232, 93, 4, 0.1);
  --shadow-glow-md: 0 0 30px rgba(244, 140, 6, 0.4), 0 0 60px rgba(244, 140, 6, 0.2);
  --shadow-glow-lg: 0 0 40px rgba(250, 163, 7, 0.5), 0 0 80px rgba(250, 163, 7, 0.3);
}

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-loose);
  color: var(--text-primary);
  background-color: var(--charcoal-black);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* Display */
.text-display {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

/* Headings */
.text-h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
}

.text-h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: var(--leading-normal);
}

.text-h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: var(--leading-relaxed);
}

.text-h4 {
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: var(--leading-relaxed);
}

/* Body */
.text-body-lg {
  font-size: var(--text-body-lg);
  font-weight: 400;
  line-height: var(--leading-loose);
}

.text-body {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-loose);
  color: var(--text-secondary);
}

.text-body-sm {
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.5;
}

/* Label & Caption */
.text-label {
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.text-caption {
  font-size: var(--text-caption);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}

/* Data/Mono */
.text-data-lg {
  font-family: var(--font-mono);
  font-size: var(--text-data-lg);
  font-weight: 500;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
}

.text-data {
  font-family: var(--font-mono);
  font-size: var(--text-data);
  font-weight: 400;
  line-height: var(--leading-relaxed);
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

.section-sm {
  padding: var(--space-4xl) 0;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast) var(--ease-standard);
}

.btn-primary {
  background: var(--gradient-signature);
  color: var(--charcoal-black);
  box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--heat-amber);
  border: 1px solid var(--heat-amber);
}

.btn-secondary:hover {
  background: rgba(248, 140, 6, 0.1);
  box-shadow: var(--shadow-glow-sm);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-standard);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--heat-amber);
}

/* Cards */
.card {
  background: var(--forge-grey);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-fast) var(--ease-standard);
}

.card:hover {
  border-color: var(--heat-amber);
  box-shadow: var(--shadow-glow-sm);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--void-grey);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-signature-horizontal);
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-enter);
}

/* Node States (Tech Tree) */
.node {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  font-weight: 500;
  transition: all var(--transition-normal) var(--ease-standard);
}

.node-locked {
  background: transparent;
  border: 2px solid var(--cold-steel);
  color: var(--cold-steel);
}

.node-unlockable {
  background: rgba(248, 140, 6, 0.1);
  border: 2px solid var(--heat-amber);
  color: var(--heat-amber);
}

.node-unlocked {
  background: var(--gradient-signature);
  border: none;
  color: var(--charcoal-black);
}

.node-active {
  background: var(--gradient-signature);
  border: none;
  color: var(--charcoal-black);
  box-shadow: var(--shadow-glow-md);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(232, 93, 4, 0.4), 0 0 40px rgba(232, 93, 4, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(244, 140, 6, 0.5), 0 0 60px rgba(244, 140, 6, 0.3);
  }
}

/* Tier Badge */
.tier-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg) var(--space-2xl);
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.1) 0%, rgba(244, 140, 6, 0.1) 100%);
  border: 2px solid var(--heat-amber);
  border-radius: var(--radius-xl);
}

.tier-value {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.tier-label {
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--heat-amber);
  margin-top: var(--space-sm);
}

/* Pillar Card */
.pillar-card {
  background: var(--forge-grey);
  border-left: 4px solid;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.pillar-biological { border-left-color: var(--forge-glow); }
.pillar-physical { border-left-color: var(--heat-amber); }
.pillar-sovereign { border-left-color: var(--ember-orange); }

/* Connection Lines */
.connector {
  width: 2px;
  height: 60px;
  background: var(--cold-steel);
  position: relative;
}

.connector::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-signature-horizontal);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.connector.active::after {
  opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

.scroll-indicator .arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--heat-amber);
  border-bottom: 2px solid var(--heat-amber);
  transform: rotate(45deg);
  opacity: 0.6;
}

/* Form Placeholder */
.form-container {
  background: var(--forge-grey);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}

.form-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* ============================================
   SECTIONS
   ============================================ */

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-2xl);
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: var(--gradient-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.hero-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-title {
  margin-bottom: var(--space-lg);
}

.hero-subtitle {
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}

.hero-cta {
  margin-bottom: var(--space-3xl);
}

/* Journey Section (Four Tiers) */
.journey-section {
  background: linear-gradient(180deg, var(--charcoal-black) 0%, var(--void-grey) 100%);
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
}

.tier-card {
  background: var(--forge-grey);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  transition: all var(--transition-normal) var(--ease-standard);
}

.tier-card:hover {
  border-color: var(--heat-amber);
  transform: translateY(-4px);
}

.tier-card.active {
  border-color: var(--heat-amber);
  box-shadow: var(--shadow-glow-sm);
}

.tier-card-locked {
  opacity: 0.6;
}

.tier-number {
  font-family: var(--font-mono);
  font-size: var(--text-data-lg);
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.tier-card.active .tier-number {
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tier-name {
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.tier-description {
  font-size: var(--text-body-sm);
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* Framework Section (Three Pillars) */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.pillar-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.pillar-biological .pillar-icon {
  background: rgba(250, 163, 7, 0.1);
}

.pillar-physical .pillar-icon {
  background: rgba(244, 140, 6, 0.1);
}

.pillar-sovereign .pillar-icon {
  background: rgba(232, 93, 4, 0.1);
}

.pillar-icon svg {
  width: 28px;
  height: 28px;
}

.pillar-title {
  font-size: var(--text-h4);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.pillar-biological .pillar-title { color: var(--forge-glow); }
.pillar-physical .pillar-title { color: var(--heat-amber); }
.pillar-sovereign .pillar-title { color: var(--ember-orange); }

.pillar-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.pillar-examples {
  font-size: var(--text-body-sm);
  color: var(--text-tertiary);
}

/* Path Section (Spark → Blueprint → Forge) */
.path-section {
  background: var(--void-grey);
}

.path-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  flex-wrap: wrap;
}

.path-item {
  background: var(--forge-grey);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  min-width: 280px;
  max-width: 320px;
  transition: all var(--transition-normal) var(--ease-standard);
}

.path-item:hover {
  border-color: var(--heat-amber);
  transform: translateY(-4px);
}

.path-item.active {
  border-color: var(--heat-amber);
  box-shadow: var(--shadow-glow-sm);
}

.path-price {
  font-family: var(--font-mono);
  font-size: var(--text-h2);
  font-weight: 700;
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.path-price-free {
  color: var(--forge-glow);
}

.path-name {
  font-size: var(--text-h4);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.path-tagline {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.path-features {
  list-style: none;
  text-align: left;
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.path-features li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
}

.path-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--heat-amber);
}

.path-arrow {
  font-size: 2rem;
  color: var(--cold-steel);
}

/* Spark Form Section */
.spark-section {
  background: linear-gradient(180deg, var(--void-grey) 0%, var(--charcoal-black) 100%);
}

.spark-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.spark-form-wrapper {
  margin-top: var(--space-2xl);
  background: var(--forge-grey);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
}

/* Footer */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer-logo {
  width: 32px;
  height: 32px;
  opacity: 0.6;
}

.footer-tagline {
  font-size: var(--text-body-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

.footer-location {
  font-size: var(--text-caption);
  color: var(--cold-steel);
  letter-spacing: var(--tracking-wide);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s var(--ease-enter) forwards;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-enter) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

/* Ember Frame Animation */
.ember-animation {
  width: 100%;
  height: 100%;
  position: relative;
}

.ember-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ember-frame.active {
  opacity: 1;
}

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

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

  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .path-flow {
    flex-direction: column;
  }

  .path-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 640px) {
  .tiers-grid {
    grid-template-columns: 1fr;
  }

  .hero-glow {
    width: 300px;
    height: 300px;
  }

  .hero-logo {
    width: 80px;
    height: 80px;
  }

  .tier-badge {
    padding: var(--space-md) var(--space-lg);
  }

  .tier-value {
    font-size: 2rem;
  }

  .spark-form-wrapper {
    padding: var(--space-xl);
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
