/* ==========================================================================
   skillgem.ai — Luminous Crystalline Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --color-amber: #e11d48;
  --color-amber-light: #fb7185;
  --color-amber-warm: #f43f5e;
  --color-amber-glow: rgba(225, 29, 72, 0.15);
  --color-amber-intense: rgba(251, 113, 133, 0.3);

  --color-teal: #9f1239;
  --color-teal-light: #be123c;

  --color-cream: #fffdf7;
  --color-warm-white: #fefcf6;
  --color-white: #ffffff;
  --color-charcoal: #1a1a2e;
  --color-dark: #0f0f1a;
  --color-gray: #6b6b7b;
  --color-gray-light: #e8e4de;
  --color-gray-lighter: #f5f2ec;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1140px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 60px rgba(225, 29, 72, 0.15);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: 3rem; font-weight: 800; font-style: normal; }
h2 { font-size: 2.2rem; font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 600; }

p {
  font-size: 1.05rem;
  line-height: 1.75;
}

a {
  color: var(--color-amber);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   4. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 2rem;
}

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

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

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 253, 247, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-charcoal);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo:hover { color: var(--color-amber); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-gray);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-amber), var(--color-amber-light));
  transition: width 0.3s ease;
  border-radius: 1px;
}

.nav-links a:hover { color: var(--color-charcoal); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-charcoal);
  font-size: 1.5rem;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: 10rem;
  padding-bottom: 6rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(251, 113, 133, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 70% 60%, rgba(159, 18, 57, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 800px 600px at 50% 40%, rgba(225, 29, 72, 0.06) 0%, transparent 70%);
  animation: heroShimmer 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroShimmer {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate(2%, -1%) scale(1.02); opacity: 1; }
  100% { transform: translate(-1%, 1%) scale(1); opacity: 0.9; }
}

.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  position: relative;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--color-amber) 0%, var(--color-amber-light) 50%, var(--color-amber-warm) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-gray);
  max-width: 580px;
  margin: 0 auto 3rem;
  position: relative;
  line-height: 1.8;
}

/* Animated gem */
.hero-gem-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.hero-gem {
  width: 120px;
  height: 120px;
  animation: gemRotate 8s ease-in-out infinite, gemPulse 4s ease-in-out infinite;
  position: relative;
}

.hero-gem img {
  width: 100%;
  height: 100%;
}

.hero-gem-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.35) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes gemRotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

@keyframes gemPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* --------------------------------------------------------------------------
   7. Section Styling
   -------------------------------------------------------------------------- */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-gray);
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 3.5rem;
}

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

.section-dark {
  background-color: var(--color-charcoal);
  color: var(--color-cream);
}

.section-dark .section-title,
.section-dark h2 { color: var(--color-white); }
.section-dark .section-subtitle { color: rgba(255,255,255,0.6); }

/* --------------------------------------------------------------------------
   8. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-amber), var(--color-amber-light), var(--color-teal));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before { opacity: 1; }

.card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--color-gray);
  font-size: 0.98rem;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-amber-glow), rgba(245, 200, 66, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* --------------------------------------------------------------------------
   9. Gem Visual Motif
   -------------------------------------------------------------------------- */
.gem-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

.gem-icon img {
  width: 100%;
  height: 100%;
}

.gem-sm { width: 28px; height: 28px; }
.gem-md { width: 48px; height: 48px; }
.gem-lg { width: 80px; height: 80px; }

/* --------------------------------------------------------------------------
   10. Steps / How-It-Works
   -------------------------------------------------------------------------- */
.steps {
  counter-reset: step-counter;
  max-width: 640px;
  margin: 0 auto;
}

.step {
  counter-increment: step-counter;
  position: relative;
  padding-left: 4.5rem;
  padding-bottom: 3rem;
  border-left: 2px solid var(--color-gray-light);
  margin-left: 1.25rem;
}

.step:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.step::before {
  content: counter(step-counter);
  position: absolute;
  left: -1.25rem;
  top: -0.15rem;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--color-amber), var(--color-amber-light));
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 2.5rem;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-charcoal);
}

.step-description {
  color: var(--color-gray);
  font-size: 1rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   11. Ecosystem Section
   -------------------------------------------------------------------------- */
.ecosystem {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.ecosystem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
}

.section-dark .ecosystem-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(251, 113, 133, 0.3);
  transform: translateY(-4px);
}

.ecosystem-item strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  display: block;
  margin-bottom: 0.75rem;
}

.section-dark .ecosystem-item strong {
  color: var(--color-amber-light);
}

.ecosystem-item p {
  font-size: 0.92rem;
  line-height: 1.65;
}

.section-dark .ecosystem-item p {
  color: rgba(255, 255, 255, 0.6);
}

.ecosystem-compat {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.95rem;
}

.section-dark .ecosystem-compat { color: rgba(255, 255, 255, 0.45); }

/* --------------------------------------------------------------------------
   12. Docs Layout
   -------------------------------------------------------------------------- */
.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.docs-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
  padding: 1rem 0;
}

.docs-sidebar nav a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--color-gray);
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.docs-sidebar nav a:hover {
  background-color: var(--color-gray-lighter);
  color: var(--color-charcoal);
}

.docs-sidebar nav a.active {
  background: linear-gradient(135deg, var(--color-amber-glow), rgba(245, 200, 66, 0.12));
  color: var(--color-amber);
  font-weight: 600;
}

.docs-content { min-width: 0; }
.docs-content h1 { margin-bottom: 1.5rem; }
.docs-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.docs-content h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.docs-content p { margin-bottom: 1rem; }

.docs-content ul,
.docs-content ol {
  list-style: revert;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-content li { margin-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   13. Code Blocks
   -------------------------------------------------------------------------- */
code {
  background-color: var(--color-gray-lighter);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--color-amber);
}

pre {
  background-color: var(--color-dark);
  color: #e0dcd4;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.88em;
  color: inherit;
}

/* --------------------------------------------------------------------------
   14. Tables
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}

th {
  background-color: var(--color-gray-lighter);
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-gray-light);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   15. Flow Diagrams
   -------------------------------------------------------------------------- */
.flow-diagram {
  background-color: var(--color-dark);
  color: #e0dcd4;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  white-space: pre;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--color-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 0 2rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-amber), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer h4 {
  color: var(--color-white);
  font-family: var(--font-display);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.95rem;
}

.footer a:hover { color: var(--color-amber-light); }

.footer ul li { margin-bottom: 0.6rem; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.85rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  color: rgba(255, 255, 255, 0.35);
}

/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .grid-3, .grid-2, .ecosystem {
    grid-template-columns: 1fr;
  }

  .hero { padding-top: 7rem; padding-bottom: 4rem; }
  .hero h1 { font-size: 2.6rem; }
  .section { padding: 3.5rem 0; }

  .docs-layout { grid-template-columns: 1fr; }

  .docs-sidebar {
    position: static;
    border-bottom: 1px solid var(--color-gray-light);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 253, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 2rem;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .container { padding: 0 1.25rem; }
}

/* --------------------------------------------------------------------------
   18. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

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

/* Floating particles */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-amber-light);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 15%; top: 30%; animation-delay: 0s; animation-duration: 7s; }
.particle:nth-child(2) { left: 45%; top: 70%; animation-delay: 1.5s; animation-duration: 9s; }
.particle:nth-child(3) { left: 75%; top: 25%; animation-delay: 3s; animation-duration: 6s; }
.particle:nth-child(4) { left: 85%; top: 60%; animation-delay: 4.5s; animation-duration: 10s; width: 3px; height: 3px; }
.particle:nth-child(5) { left: 25%; top: 80%; animation-delay: 2s; animation-duration: 8s; width: 3px; height: 3px; }
.particle:nth-child(6) { left: 60%; top: 15%; animation-delay: 5s; animation-duration: 7.5s; width: 2px; height: 2px; }

@keyframes particleFloat {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0); }
  10% { opacity: 0.6; transform: translateY(-10px) scale(1); }
  50% { opacity: 0.3; transform: translateY(-40px) scale(0.8); }
  90% { opacity: 0.5; transform: translateY(-70px) scale(0.6); }
}

/* Subtle grain */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(1) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-5%, -5%); }
  50% { transform: translate(5%, 0); }
  75% { transform: translate(0, 5%); }
}
