/* =============================
   FareverGuide — Style
   Fantasy Adventure Theme
   ============================= */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=JetBrains+Mono:wght@400;500;600;700&family=Syne:wght@500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #38bdf8;
  --primary-glow: rgba(14, 165, 233, 0.12);
  --primary-glow-strong: rgba(14, 165, 233, 0.25);

  --accent: #f59e0b;
  --accent-light: #fbbf24;

  --secondary: #111827;
  --bg-dark: #070712;
  --bg-card: #0e0e1a;
  --bg-card-hover: #16162a;
  --text-primary: #f1f0f0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: #1e293b;
  --border-hover: #334155;

  --success: #4ade80;
  --warning: #f59e0b;
  --danger: #ef4444;

  --font-heading: 'Syne', 'Inter', system-ui, sans-serif;
  --font-body: 'DM Sans', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-width: 1200px;
  --header-height: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xl: 16px;
}

/* --- Grain Texture Overlay --- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  background-repeat: repeat;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(14, 165, 233, 0.015) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(245, 158, 11, 0.008) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary); }

/* --- Selection --- */
::selection {
  background: rgba(14, 165, 233, 0.3);
  color: #fff;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.7; }

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header / Nav === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(7, 7, 18, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.logo:hover { color: var(--text-primary); }

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }

.nav-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  font-size: 0.85rem;
  transition: all 0.3s !important;
}
.nav-cta:hover {
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.3) !important;
}
.nav-cta::after { display: none !important; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  z-index: 1001;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  color: #fff;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-2px);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1rem; }

/* === Hero === */
.hero {
  padding: 8rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.06) 0%, transparent 60%);
  pointer-events: none;
  animation: heroOrb 12s ease-in-out infinite alternate;
}
@keyframes heroOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 30px) scale(1.1); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text { opacity: 0; animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
}

.hero h1 { margin-bottom: 1.25rem; }
.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Hero Stats --- */
.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(14, 14, 26, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-light);
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Section === */
.section { padding: 5rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header p {
  max-width: 600px;
  margin: 0.75rem auto 0;
  font-size: 1.05rem;
}

.section-header .badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* === Features Grid === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover {
  border-color: rgba(14, 165, 233, 0.25);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 40px rgba(14, 165, 233, 0.06);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  transition: transform 0.3s;
}
.feature-card:hover .feature-icon { transform: scale(1.1); }

.feature-icon.class { background: rgba(14, 165, 233, 0.15); color: var(--primary-light); }
.feature-icon.build { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.feature-icon.weapon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.feature-icon.craft { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.feature-icon.dungeon { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.feature-icon.news { background: rgba(236, 72, 153, 0.12); color: #ec4899; }

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* === Guides Grid === */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.guide-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 2;
}
.guide-card:hover {
  border-color: rgba(14, 165, 233, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(14, 165, 233, 0.06);
}
.guide-card:hover::before { opacity: 1; }

.guide-card-image {
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background-size: cover !important;
  background-position: center !important;
}
.guide-card-image.has-img {
  font-size: 0;
  line-height: 0;
  color: transparent;
}
.guide-card-image.has-img::after {
  background: linear-gradient(180deg, rgba(7, 7, 18, 0.25) 0%, transparent 30%, rgba(7, 7, 18, 0.7) 90%);
}
.guide-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7, 7, 18, 0.6));
  pointer-events: none;
}
.guide-card-image .guide-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}

.guide-card-body {
  padding: 1.25rem;
  position: relative;
  z-index: 1;
}
.guide-card-body .guide-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}
.guide-card-body h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.guide-card-body h3 a { color: var(--text-primary); }
.guide-card-body h3 a:hover { color: var(--primary-light); }
.guide-card-body p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}
.guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}
.guide-card-footer .guide-tag-sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-light);
  font-weight: 600;
}

/* === Guide Detail === */
.guide-detail {
  padding: 7rem 0 4rem;
}
.guide-detail article {
  max-width: 760px;
  margin: 0 auto;
}
.guide-detail .guide-header { margin-bottom: 2.5rem; }
.guide-detail .guide-header .guide-breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.guide-detail .guide-header h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.75rem; }
.guide-detail .guide-header .guide-meta-large {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.guide-content h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.guide-content h3 { font-size: 1.1rem; margin: 1.75rem 0 0.75rem; }
.guide-content p { margin-bottom: 1rem; line-height: 1.7; }
.guide-content ul, .guide-content ol { margin: 0 0 1.5rem 1.5rem; color: var(--text-secondary); }
.guide-content li { margin-bottom: 0.4rem; }
.guide-content strong { color: var(--text-primary); }

.guide-content .tip-box {
  background: rgba(14, 165, 233, 0.05);
  border-left: 3px solid var(--primary);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}
.guide-content th {
  background: var(--secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}
.guide-content td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* === Blog List === */
.blog-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.blog-card:hover {
  border-color: rgba(14, 165, 233, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(14, 165, 233, 0.06);
}
.blog-card .blog-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}
.blog-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.blog-card h3 a { color: var(--text-primary); }
.blog-card h3 a:hover { color: var(--primary-light); }
.blog-card p { font-size: 0.85rem; color: var(--text-muted); }

/* === CTA Banner === */
.cta-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-banner h2 { margin-bottom: 0.75rem; }
.cta-banner p { max-width: 500px; margin: 0 auto 1.5rem; }

/* === Page Header === */
.page-header {
  padding: 7rem 0 2.5rem;
  text-align: center;
}
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { max-width: 550px; margin: 0 auto; font-size: 1.05rem; }

/* === Scroll Reveal === */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.4), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p { font-size: 0.84rem; margin-top: 0.75rem; max-width: 300px; }
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.85rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Utility === */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* =============================
   Responsive
   ============================= */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { order: -1; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .guides-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background: rgba(7, 7, 18, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.05rem; }
  .mobile-toggle { display: block; position: relative; z-index: 1002; }
  body.menu-open { overflow: hidden; }

  .features-grid { grid-template-columns: 1fr; }
  .guides-grid { grid-template-columns: 1fr; }
  .blog-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .hero-stats { flex-direction: column; gap: 1rem; }
  .hero { padding: 6rem 0 3rem; }
  .page-header { padding: 6rem 0 1.5rem; }
}
