/* ============================================================
   DOFUS RETRO LORE HUB — Main Stylesheet
   Green fantasy palette with retro-modern aesthetics
   ============================================================ */

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Green palette */
  --forest-deep:    #0d1f0a;
  --forest-dark:    #132c0e;
  --forest-mid:     #1e4a14;
  --forest-main:    #2d5016;
  --forest-light:   #3d6b1e;
  --emerald:        #50c878;
  --emerald-dim:    #3da05f;
  --lime:           #32cd32;
  --lime-soft:      #7ecf7e;
  --moss:           #4a7c3f;

  /* Gold/accent */
  --gold:           #c9a227;
  --gold-light:     #f0c060;
  --gold-dim:       #8a6e1a;
  --amber:          #e8a020;

  /* Neutral */
  --parchment:      #f2eed8;
  --parchment-dim:  #d4ceaa;
  --ink:            #e8e8d0;
  --ink-dim:        #a8a898;
  --shadow:         rgba(0, 0, 0, 0.6);

  /* Typography */
  --font-heading:   'Cinzel', 'Georgia', serif;
  --font-display:   'Uncial Antiqua', 'Palatino Linotype', serif;
  --font-body:      'Lato', 'Helvetica Neue', sans-serif;

  /* Spacing */
  --gap-xs:   0.5rem;
  --gap-sm:   1rem;
  --gap-md:   2rem;
  --gap-lg:   4rem;
  --gap-xl:   6rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --border-glow: 1px solid rgba(80, 200, 120, 0.3);

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--forest-deep);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--forest-dark); }
::-webkit-scrollbar-thumb { background: var(--forest-main); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--emerald-dim); }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

h5, h6 { font-family: var(--font-body); }

a {
  color: var(--emerald);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
a:hover { color: var(--lime); }

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

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 31, 10, 0.98) 0%, rgba(13, 31, 10, 0.0) 100%);
  pointer-events: none;
}

.site-header.scrolled {
  background: rgba(13, 31, 10, 0.97);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(50, 205, 50, 0.05);
}

.site-header.scrolled::before { display: none; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--parchment);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.logo-accent { color: var(--emerald); }

.main-nav { display: flex; align-items: center; }

.nav-list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--parchment-dim);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--emerald);
  background: rgba(80, 200, 120, 0.1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid rgba(80, 200, 120, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--emerald);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
}

.btn-primary {
  background: linear-gradient(135deg, var(--forest-main), var(--emerald-dim));
  color: var(--parchment);
  border: 1px solid var(--emerald);
  box-shadow: 0 0 20px rgba(80, 200, 120, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--forest-light), var(--emerald));
  color: var(--forest-deep);
  box-shadow: 0 0 35px rgba(80, 200, 120, 0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--emerald);
  border: 1px solid rgba(80, 200, 120, 0.4);
}

.btn-ghost:hover {
  background: rgba(80, 200, 120, 0.1);
  border-color: var(--emerald);
  color: var(--lime);
  transform: translateY(-2px);
}

/* === SECTION HEADER === */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--emerald);
  background: rgba(80, 200, 120, 0.1);
  border: 1px solid rgba(80, 200, 120, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.35rem 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--parchment);
  margin-bottom: 1rem;
  text-shadow: 0 0 40px rgba(80, 200, 120, 0.2);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--ink-dim);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.8;
}

/* === DECORATIVE DIVIDERS === */
.section::before {
  content: '';
  display: block;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--emerald), transparent);
  margin: 0 auto 0;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(45, 80, 22, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 30% 70%, rgba(80, 200, 120, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 70% 20%, rgba(50, 205, 50, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 31, 10, 0.3) 0%,
    rgba(13, 31, 10, 0.5) 40%,
    rgba(13, 31, 10, 0.85) 80%,
    rgba(13, 31, 10, 1.0) 100%
  );
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatParticle linear infinite;
  opacity: 0;
}

@keyframes floatParticle {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  10%  { opacity: 1; }
  90%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-80vh) scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--emerald);
  background: rgba(80, 200, 120, 0.08);
  border: 1px solid rgba(80, 200, 120, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1.2rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
}

.hero-title-line {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 900;
  color: var(--parchment);
  text-shadow:
    0 0 60px rgba(80, 200, 120, 0.3),
    0 4px 20px rgba(0,0,0,0.5);
  line-height: 1;
  letter-spacing: 0.05em;
}

.hero-title-accent {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  color: var(--emerald);
  text-shadow:
    0 0 40px rgba(80, 200, 120, 0.5),
    0 0 80px rgba(80, 200, 120, 0.2);
  line-height: 1.1;
  letter-spacing: 0.08em;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--ink-dim);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.9;
  font-weight: 300;
  font-style: italic;
}

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

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
  animation: fadeInUp 1s 2s both;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--emerald);
  border-bottom: 2px solid var(--emerald);
  transform: rotate(45deg);
  margin: 0.5rem auto 0;
  animation: bounceArrow 2s infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
  50% { transform: rotate(45deg) translateY(4px); opacity: 1; }
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  background: linear-gradient(180deg, var(--forest-deep) 0%, var(--forest-dark) 50%, var(--forest-deep) 100%);
}

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

.about-heading {
  font-size: 1.4rem;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.about-text p,
.about-dofus p {
  color: var(--ink-dim);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 1rem;
}

.lore-quote {
  border-left: 3px solid var(--emerald-dim);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0 0;
  background: rgba(80, 200, 120, 0.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.lore-quote p {
  font-style: italic;
  color: var(--parchment-dim);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.lore-quote cite {
  font-size: 0.78rem;
  color: var(--emerald-dim);
  letter-spacing: 0.05em;
  font-style: normal;
}

/* Dofus cards */
.dofus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.dofus-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.12);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

.dofus-card:hover {
  border-color: rgba(80, 200, 120, 0.35);
  background: rgba(80, 200, 120, 0.05);
  transform: translateY(-2px);
}

.dofus-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

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

.dofus-info h4 {
  font-size: 0.8rem;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.dofus-info p {
  font-size: 0.75rem;
  color: var(--ink-dim);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   TIMELINE SECTION
   ============================================================ */
.timeline-section {
  background: var(--forest-deep);
  position: relative;
  overflow: hidden;
}

.timeline-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(45, 80, 22, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* Center line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--forest-main) 10%,
    var(--emerald-dim) 50%,
    var(--forest-main) 90%,
    transparent 100%
  );
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  margin-bottom: 3rem;
}

.timeline-item[data-side="left"] .timeline-content {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  padding-right: 2rem;
}

.timeline-item[data-side="left"] .timeline-marker {
  grid-column: 2;
  grid-row: 1;
}

.timeline-item[data-side="right"] .timeline-content {
  grid-column: 3;
  grid-row: 1;
  padding-left: 2rem;
}

.timeline-item[data-side="right"] .timeline-marker {
  grid-column: 2;
  grid-row: 1;
}

.timeline-marker {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--emerald-dim);
  border: 3px solid var(--forest-deep);
  box-shadow: 0 0 0 2px var(--emerald-dim), 0 0 20px rgba(80, 200, 120, 0.4);
  transition: box-shadow 0.3s, background 0.3s;
}

.timeline-item:hover .timeline-dot {
  background: var(--emerald);
  box-shadow: 0 0 0 2px var(--emerald), 0 0 30px rgba(80, 200, 120, 0.7);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.3s, background 0.3s;
}

.timeline-content:hover {
  border-color: rgba(80, 200, 120, 0.3);
  background: rgba(80, 200, 120, 0.05);
}

.timeline-era {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 0.4rem;
}

.timeline-title {
  font-size: 1rem;
  color: var(--parchment);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.8;
  margin: 0;
}

/* ============================================================
   CLASSES SECTION
   ============================================================ */
.classes-section {
  background: linear-gradient(180deg, var(--forest-deep) 0%, var(--forest-dark) 100%);
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.class-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--emerald-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.class-card:hover {
  transform: translateY(-5px);
  border-color: rgba(80, 200, 120, 0.35);
  box-shadow: 0 10px 40px rgba(80, 200, 120, 0.1), 0 0 0 1px rgba(80, 200, 120, 0.1);
}

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

.class-icon-wrap {
  background: linear-gradient(135deg, var(--forest-mid), var(--forest-dark));
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(80, 200, 120, 0.1);
}

.class-icon {
  width: 64px;
  height: 64px;
  transition: transform 0.3s;
}

.class-card:hover .class-icon {
  transform: scale(1.1);
}

.class-body {
  padding: 1.25rem;
}

.class-name {
  font-size: 1.1rem;
  color: var(--parchment);
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.class-deity {
  font-size: 0.7rem;
  color: var(--emerald);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.class-lore {
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 1.7;
  margin: 0;
}

/* ============================================================
   GEOGRAPHY SECTION
   ============================================================ */
.geography-section {
  background: var(--forest-deep);
  position: relative;
}

.geography-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 10% 50%, rgba(45, 80, 22, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 50%, rgba(45, 80, 22, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

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

.geo-featured {
  grid-column: 1 / -1;
}

.geo-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
  position: relative;
  z-index: 1;
}

.geo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(80, 200, 120, 0.3);
}

.geo-card-inner {
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.geo-featured .geo-card-inner {
  flex-direction: row;
}

.geo-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

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

.geo-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 0.4rem;
}

.geo-name {
  font-size: 1.3rem;
  color: var(--parchment);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.geo-content p {
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.geo-lore-tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--gold-light);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 50px;
  padding: 0.25rem 0.75rem;
  font-style: italic;
}

/* ============================================================
   GALLERY SECTION
   ============================================================ */
.gallery-section {
  background: linear-gradient(180deg, var(--forest-deep) 0%, var(--forest-dark) 100%);
}

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

.gallery-wide {
  grid-column: 1 / -1;
}

.gallery-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(80, 200, 120, 0.3);
}

.gallery-img-wrap {
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--forest-dark);
}

.gallery-wide .gallery-img-wrap {
  aspect-ratio: 21/9;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.05);
}

.gallery-caption {
  padding: 1rem 1.25rem;
}

.gallery-caption h4 {
  font-size: 0.9rem;
  color: var(--parchment);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.gallery-caption p {
  font-size: 0.78rem;
  color: var(--ink-dim);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   COMMUNITY SECTION
   ============================================================ */
.community-section {
  background: var(--forest-deep);
  position: relative;
}

.community-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(45, 80, 22, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.community-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(80, 200, 120, 0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, background 0.3s;
}

.community-card:hover {
  transform: translateY(-5px);
  border-color: rgba(80, 200, 120, 0.3);
  background: rgba(80, 200, 120, 0.04);
}

.community-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
}

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

.community-card h3 {
  font-size: 1rem;
  color: var(--parchment);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.community-card p {
  font-size: 0.83rem;
  color: var(--ink-dim);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.community-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald);
  border-bottom: 1px solid rgba(80, 200, 120, 0.3);
  padding-bottom: 0.1rem;
  transition: color 0.2s, border-color 0.2s;
}

.community-link:hover {
  color: var(--lime);
  border-color: var(--lime);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--forest-dark);
  border-top: 1px solid rgba(80, 200, 120, 0.15);
  padding: 4rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(80, 200, 120, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo-link {
  margin-bottom: 1rem;
  display: inline-flex;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: rgba(168, 168, 152, 0.5);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

.footer-nav-group h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(80, 200, 120, 0.15);
}

.footer-nav-group ul {
  list-style: none;
}

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

.footer-nav-group ul a {
  font-size: 0.85rem;
  color: var(--ink-dim);
  transition: color 0.2s;
}

.footer-nav-group ul a:hover {
  color: var(--emerald);
}

.footer-bottom {
  border-top: 1px solid rgba(80, 200, 120, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: var(--ink-dim);
  opacity: 0.6;
  margin: 0;
}

.footer-quote {
  font-style: italic;
  color: var(--emerald-dim) !important;
  opacity: 0.8 !important;
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: rgba(45, 80, 22, 0.9);
  border: 1px solid rgba(80, 200, 120, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  z-index: 99;
  backdrop-filter: blur(8px);
}

.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--forest-main);
  box-shadow: 0 0 20px rgba(80, 200, 120, 0.3);
}

.scroll-to-top img {
  width: 20px;
  height: 20px;
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-timeline {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-up { transform: translateY(30px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-timeline { transform: translateY(20px); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-timeline.visible {
  opacity: 1;
  transform: translate(0);
}

/* Stagger delay for grid children */
.classes-grid .class-card:nth-child(1) { transition-delay: 0.05s; }
.classes-grid .class-card:nth-child(2) { transition-delay: 0.10s; }
.classes-grid .class-card:nth-child(3) { transition-delay: 0.15s; }
.classes-grid .class-card:nth-child(4) { transition-delay: 0.20s; }
.classes-grid .class-card:nth-child(5) { transition-delay: 0.25s; }
.classes-grid .class-card:nth-child(6) { transition-delay: 0.30s; }
.classes-grid .class-card:nth-child(7) { transition-delay: 0.35s; }
.classes-grid .class-card:nth-child(8) { transition-delay: 0.40s; }

.geo-grid .geo-card:nth-child(1) { transition-delay: 0.05s; }
.geo-grid .geo-card:nth-child(2) { transition-delay: 0.10s; }
.geo-grid .geo-card:nth-child(3) { transition-delay: 0.15s; }
.geo-grid .geo-card:nth-child(4) { transition-delay: 0.20s; }
.geo-grid .geo-card:nth-child(5) { transition-delay: 0.25s; }
.geo-grid .geo-card:nth-child(6) { transition-delay: 0.30s; }

.community-grid .community-card:nth-child(1) { transition-delay: 0.05s; }
.community-grid .community-card:nth-child(2) { transition-delay: 0.12s; }
.community-grid .community-card:nth-child(3) { transition-delay: 0.19s; }
.community-grid .community-card:nth-child(4) { transition-delay: 0.05s; }
.community-grid .community-card:nth-child(5) { transition-delay: 0.12s; }
.community-grid .community-card:nth-child(6) { transition-delay: 0.19s; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .classes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

  .geo-featured {
    grid-column: 1 / -1;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --gap-xl: 4rem;
    --gap-lg: 2.5rem;
  }

  /* Mobile nav */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(13, 31, 10, 0.98);
    border-left: 1px solid rgba(80, 200, 120, 0.15);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    transition: right 0.35s var(--ease-out);
    backdrop-filter: blur(20px);
  }

  .main-nav.open { right: 0; }

  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .nav-toggle { display: flex; }

  /* Timeline */
  .timeline::before { left: 20px; }

  .timeline-item {
    grid-template-columns: 40px 1fr;
  }

  .timeline-item[data-side="left"] .timeline-content,
  .timeline-item[data-side="right"] .timeline-content {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding-left: 1.5rem;
    padding-right: 0;
  }

  .timeline-item[data-side="left"] .timeline-marker,
  .timeline-item[data-side="right"] .timeline-marker {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  /* Grids */
  .classes-grid {
    grid-template-columns: 1fr 1fr;
  }

  .geo-grid,
  .gallery-grid,
  .community-grid {
    grid-template-columns: 1fr;
  }

  .gallery-wide { grid-column: 1; }
  .geo-featured { grid-column: 1; }

  .gallery-wide .gallery-img-wrap {
    aspect-ratio: 16/9;
  }

  .geo-card-inner {
    flex-direction: column;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

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

  .hero-title-line {
    font-size: 2.2rem;
  }

  .hero-title-accent {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }
}

/* ============================================================
   SECTION ALTERNATING BACKGROUNDS
   ============================================================ */
.about-section    { background: linear-gradient(180deg, rgba(13,31,10,1) 0%, rgba(19,44,14,0.8) 100%); }
.timeline-section { background: rgba(10, 26, 8, 1); }
.classes-section  { background: linear-gradient(180deg, rgba(19,44,14,1) 0%, rgba(13,31,10,1) 100%); }
.geography-section { background: rgba(10, 26, 8, 1); }
.gallery-section  { background: linear-gradient(180deg, rgba(13,31,10,1) 0%, rgba(19,44,14,0.8) 100%); }
.community-section { background: rgba(10, 26, 8, 1); }

/* === NOISE TEXTURE OVERLAY === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.3;
}

/* === SELECTION HIGHLIGHT === */
::selection {
  background: rgba(80, 200, 120, 0.25);
  color: var(--parchment);
}
