/* ═══════════════════════════════════════════════════
   ELDERTREE NETWORK — Main Stylesheet
   Aesthetic: Dark enchanted forest, medieval Minecraft
═══════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --forest-black:   #070c0a;
  --forest-deep:    #0d1812;
  --forest-mid:     #152419;
  --forest-canopy:  #1e3a26;
  --bark-brown:     #4a3020;
  --bark-light:     #7a5535;
  --moss-green:     #3d6b3a;
  --leaf-bright:    #5db34a;
  --leaf-glow:      #7ee860;
  --gold-old:       #c9a84c;
  --gold-bright:    #f0cc5a;
  --cream:          #e8dfc8;
  --parchment:      #d4c9a8;
  --discord-blue:   #5865F2;
  --stone-gray:     #4a4a5a;
  --glow-green:     rgba(94, 200, 80, 0.35);
  --glow-gold:      rgba(201, 168, 76, 0.4);

  --font-display:   'Cinzel', serif;
  --font-body:      'IM Fell English', serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--forest-black);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ══════════════════════════════════════════════════
   FOREST BACKGROUND
══════════════════════════════════════════════════ */
.forest-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#forestCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fog-layer {
  position: absolute;
  width: 200%;
  height: 35%;
  bottom: 0;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
}
.fog-1 {
  background: radial-gradient(ellipse at center, rgba(30,58,38,0.7) 0%, transparent 70%);
  bottom: -10%;
  left: -50%;
  animation: fogDrift 28s ease-in-out infinite alternate;
}
.fog-2 {
  background: radial-gradient(ellipse at center, rgba(15,35,20,0.6) 0%, transparent 65%);
  bottom: 5%;
  left: -20%;
  width: 180%;
  animation: fogDrift 38s ease-in-out infinite alternate-reverse;
}
.fog-3 {
  background: radial-gradient(ellipse at center, rgba(94,200,80,0.08) 0%, transparent 60%);
  bottom: 15%;
  left: 10%;
  width: 100%;
  height: 40%;
  animation: fogDrift 22s ease-in-out infinite alternate;
}

@keyframes fogDrift {
  from { transform: translateX(0) scaleY(1); }
  to   { transform: translateX(8%) scaleY(1.1); }
}

/* ── Fireflies ── */
.firefly-container { position: absolute; inset: 0; }
.firefly {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--leaf-glow);
  box-shadow: 0 0 6px 2px rgba(126,232,96,0.8);
  animation: fireflyFloat var(--dur, 8s) ease-in-out var(--delay, 0s) infinite alternate;
  opacity: 0;
}
@keyframes fireflyFloat {
  0%   { opacity: 0; transform: translate(0, 0); }
  20%  { opacity: 1; }
  80%  { opacity: 0.8; }
  100% { opacity: 0; transform: translate(var(--tx, 30px), var(--ty, -50px)); }
}

/* ══════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(7,12,10,0.95) 0%, rgba(7,12,10,0.6) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(93,179,74,0.15);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-tree {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(94,200,80,0.6));
  animation: treePulse 4s ease-in-out infinite;
}
@keyframes treePulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(94,200,80,0.6)); }
  50%       { filter: drop-shadow(0 0 16px rgba(94,200,80,0.9)); }
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.logo-sub {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--leaf-bright);
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-link {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--parchment);
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--leaf-glow);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-link:hover { color: var(--leaf-glow); }
.nav-link:hover::after { transform: scaleX(1); }

/* ══════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 32px 80px;
}

.hero-content {
  max-width: 760px;
  animation: heroReveal 1.2s ease-out both;
}
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--leaf-bright);
  margin-bottom: 20px;
  opacity: 0.85;
}

.hero-title {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  margin-bottom: 28px;
}
.title-line-1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 11vw, 120px);
  color: var(--gold-bright);
  text-shadow:
    0 0 40px rgba(240,204,90,0.5),
    0 0 80px rgba(240,204,90,0.25),
    2px 4px 0 rgba(0,0,0,0.8);
  letter-spacing: -0.02em;
}
.title-line-2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 46px);
  color: var(--leaf-bright);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(94,200,80,0.5);
}

.hero-tagline {
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--parchment);
  opacity: 0.8;
  margin-bottom: 48px;
  line-height: 1.8;
}

/* ── Buttons ── */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.07);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--leaf-bright), var(--moss-green));
  color: var(--forest-black);
  box-shadow: 0 4px 24px rgba(93,179,74,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  flex-direction: column;
  gap: 2px;
  padding: 12px 24px;
  max-width: 280px;
  width: 280px;
}
.btn-primary:hover {
  box-shadow: 0 6px 36px rgba(93,179,74,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-text {
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-copy-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  opacity: 0.7;
  font-weight: 400;
}
.btn-icon { font-size: 14px; }

.btn-store {
  background: linear-gradient(135deg, var(--gold-old), #8b6120);
  color: var(--cream);
  box-shadow: 0 4px 24px rgba(201,168,76,0.35);
}
.btn-store:hover {
  box-shadow: 0 6px 36px rgba(201,168,76,0.55);
}

.btn-discord {
  width: 100%;
  justify-content: center;
  background: var(--discord-blue);
  color: white;
  box-shadow: 0 4px 20px rgba(88,101,242,0.4);
  font-size: 14px;
  padding: 14px;
  border-radius: var(--r-sm);
  gap: 8px;
}
.btn-discord:hover {
  box-shadow: 0 6px 30px rgba(88,101,242,0.6);
}

/* ── Copy Toast ── */
.copy-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--leaf-bright);
  color: var(--forest-black);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Scroll Hint ── */
.scroll-hint {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--leaf-bright);
  opacity: 0.6;
  animation: scrollHintFade 2s ease-in-out 2s infinite alternate;
}
@keyframes scrollHintFade {
  from { opacity: 0.4; transform: translateY(0); }
  to   { opacity: 0.8; transform: translateY(6px); }
}
.scroll-arrow {
  width: 18px; height: 18px;
  border-right: 2px solid var(--leaf-bright);
  border-bottom: 2px solid var(--leaf-bright);
  transform: rotate(45deg);
}

/* ══════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  padding: 90px 32px;
}
.section-dark {
  background: rgba(7, 12, 10, 0.7);
  border-top: 1px solid rgba(93,179,74,0.1);
  border-bottom: 1px solid rgba(93,179,74,0.1);
}
.container {
  max-width: 1100px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 56px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(240,204,90,0.3);
  letter-spacing: 0.06em;
  text-align: center;
}
.section-rune {
  color: var(--leaf-bright);
  font-size: 22px;
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════
   SERVER STATUS
══════════════════════════════════════════════════ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* All cards share base styling */
.status-card {
  background: linear-gradient(135deg, rgba(21,36,25,0.92), rgba(13,24,18,0.92));
  border: 1px solid rgba(93,179,74,0.2);
  border-radius: var(--r-md);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden; /* nothing escapes */
  min-width: 0;     /* allow flex children to shrink */
}
.status-card:hover {
  border-color: rgba(93,179,74,0.45);
  box-shadow: 0 0 28px rgba(93,179,74,0.1);
}

/* ── Main card: two rows stacked, full width ── */
.status-card--main {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;       /* padding handled by inner rows */
}
.status-row-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(93,179,74,0.12);
}
.status-row-bottom {
  padding: 14px 24px 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.status-row-bottom:hover {
  background: rgba(93,179,74,0.05);
}
.ip-value {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--leaf-glow);
  display: block;
  margin-top: 3px;
  /* never overflow */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.status-row-bottom:hover .ip-value { color: #ffffff; }
.copy-hint {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--leaf-bright);
  opacity: 0.5;
  margin-top: 2px;
}

/* ── Indicator dot ── */
.status-indicator {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--stone-gray);
  flex-shrink: 0;
  transition: background 0.5s, box-shadow 0.5s;
}
.status-indicator.online {
  background: var(--leaf-bright);
  box-shadow: 0 0 0 4px rgba(93,179,74,0.2), 0 0 10px rgba(93,179,74,0.55);
  animation: statusPulse 2s ease-in-out infinite;
}
.status-indicator.offline {
  background: #e74c3c;
  box-shadow: 0 0 8px rgba(231,76,60,0.4);
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(93,179,74,0.2), 0 0 10px rgba(93,179,74,0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(93,179,74,0.1), 0 0 18px rgba(93,179,74,0.7); }
}

.stat-icon { font-size: 26px; flex-shrink: 0; }
.status-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--leaf-bright);
  opacity: 0.7;
}
.status-value {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--cream);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════
   DISCORD
══════════════════════════════════════════════════ */
.discord-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Widget ── */
.discord-widget {
  background: linear-gradient(160deg, #1e2124, #282b30);
  border: 1px solid rgba(88,101,242,0.25);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.widget-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(88,101,242,0.15);
  border-bottom: 1px solid rgba(88,101,242,0.2);
}
.discord-logo svg { flex-shrink: 0; }
.widget-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
}
.widget-body {
  padding: 20px;
  min-height: 220px;
}
.online-count-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.online-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #3ba55c;
  box-shadow: 0 0 0 3px rgba(59,165,92,0.2);
  animation: statusPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.online-count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.online-label {
  font-size: 13px;
  color: #8e9297;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.member-loading {
  color: #72767d;
  font-style: italic;
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.member-item:hover { background: rgba(255,255,255,0.04); }
.member-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--discord-blue), #7289da);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.member-name {
  font-size: 14px;
  color: #dcddde;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.member-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3ba55c;
  margin-left: auto;
  flex-shrink: 0;
}
.widget-footer {
  padding: 16px 20px 20px;
}

/* ── Feature cards ── */
.discord-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-card {
  background: linear-gradient(135deg, rgba(21,36,25,0.7), rgba(13,24,18,0.7));
  border: 1px solid rgba(93,179,74,0.15);
  border-radius: var(--r-md);
  padding: 26px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  backdrop-filter: blur(4px);
  transition: border-color 0.3s, transform 0.3s;
}
.feature-card:hover {
  border-color: rgba(93,179,74,0.35);
  transform: translateX(4px);
}
.feature-icon { font-size: 30px; flex-shrink: 0; margin-top: 2px; }
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold-bright);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.feature-card p {
  font-size: 14px;
  color: var(--parchment);
  opacity: 0.75;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 52px 32px 36px;
  border-top: 1px solid rgba(93,179,74,0.12);
  background: rgba(7,12,10,0.9);
}
.footer-tree {
  font-size: 38px;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(94,200,80,0.4));
}
.footer-text {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--parchment);
  opacity: 0.6;
  margin-bottom: 6px;
}
.footer-sub {
  font-size: 12px;
  color: var(--parchment);
  opacity: 0.3;
  margin-bottom: 16px;
}
.footer-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--leaf-bright);
  letter-spacing: 0.08em;
}
.footer-links a {
  opacity: 0.7;
  transition: opacity 0.2s;
}
.footer-links a:hover { opacity: 1; }
.footer-links span { opacity: 0.3; }

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .discord-layout {
    grid-template-columns: 1fr;
  }
  .discord-widget { max-width: 420px; margin: 0 auto; width: 100%; }
}

@media (max-width: 600px) {
  .header-inner { padding: 12px 20px; }
  .nav-links { gap: 18px; }
  .nav-link { font-size: 11px; }
  .hero { padding: 100px 20px 60px; }
  .section { padding: 64px 20px; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .btn-primary { flex-direction: row; gap: 8px; }
  .btn-copy-label { display: none; }
  .status-grid { grid-template-columns: 1fr; }
  .status-card { flex-wrap: wrap; }
  .status-ip { margin-left: 0; text-align: left; width: 100%; }
  .feature-card { flex-direction: column; gap: 10px; }
}
