/* --- THEME VARIABLES --- */
:root {
    --bg: #0a1410;              /* Deep forest night */
    --bg-card: #10201a;         /* Slightly lighter card */
    --bg-soft: #16291f;         /* Hover / soft surface */
    --border: #1c3226;          /* Faint green border */
    --text: #e8f1ea;            /* Soft off-white */
    --text-muted: #8ba494;      /* Muted sage */
    --text-dim: #5f7a6a;        /* Dimmer sage */
    --accent: #3ecf8e;          /* Bright fern green */
    --accent-hover: #34b87c;    /* Slightly darker */
    --accent-deep: #17786e;     /* Teal, from your leaf bg */
    --accent-dark: #0e4a33;     /* Deep leaf shadow */
}

html.light {
    --bg: #f4f8f5;
    --bg-card: #ffffff;
    --bg-soft: #e8f0ea;
    --border: #d7e3da;
    --text: #0a1410;
    --text-muted: #4a6656;
    --text-dim: #6b8576;
    --accent: #1fa36a;
    --accent-hover: #178457;
}

/* --- BASICS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    animation: fadeIn 0.6s ease 0.2s both;
}

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

/* --- SCROLLBAR + SELECTION --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

::selection { background-color: var(--accent); color: #0a1410; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- KEYFRAMES --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes floatSlow  { 0% { transform: translate(0,0); } 50% { transform: translate(-15px,-20px); } 100% { transform: translate(0,0); } }
@keyframes floatSlow2 { 0% { transform: translate(0,0); } 50% { transform: translate(20px,-15px); } 100% { transform: translate(0,0); } }
@keyframes loaderPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.5; } }

/* --- LOADER --- */
.loader {
    position: fixed; inset: 0;
    background-color: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    animation: loaderPulse 1.2s ease-in-out infinite;
}

/* --- TOOLBAR --- */
.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 50px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.5s ease both;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 20px; }
.toolbar-right a { color: var(--text-dim); font-weight: 500; transition: color 0.3s ease; }
.toolbar-right a:hover { color: var(--text); }

.status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-weight: 500;
}
.status-pill .dot { width: 8px; height: 8px; }

/* --- THEME TOGGLE --- */
.theme-toggle {
    width: 28px; height: 28px;
    border-radius: 50%;
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light .theme-toggle .icon-sun  { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

/* --- NAVBAR --- */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 50px;
    position: relative;
    z-index: 100;
    animation: fadeIn 0.6s ease both;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }

.logo-box {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.logo:hover .logo-box { transform: rotate(15deg) scale(1.1); }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
    color: var(--text-muted); font-weight: 600; font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -6px;
    width: 100%; height: 2px;
    background-color: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

/* --- HAMBURGER --- */
.hamburger {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 38px; height: 38px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block; height: 2px; width: 100%;
    background-color: var(--text); border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- MOBILE MENU --- */
.mobile-overlay {
    position: fixed; inset: 0;
    background-color: rgba(10, 20, 16, 0.6);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

.mobile-menu {
    position: fixed; top: 0; right: 0;
    height: 100vh; width: 260px;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 100px 30px 30px;
    display: flex; flex-direction: column; gap: 24px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 300;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { color: var(--text-muted); font-weight: 600; font-size: 1rem; transition: color 0.3s ease; }
.mobile-menu a:hover, .mobile-menu a.active { color: var(--text); }
.mobile-menu-divider { height: 1px; background-color: var(--border); margin: 10px 0; }

/* --- BUTTONS --- */
.btn-primary, .btn-secondary, .btn-discord {
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid transparent;
    transition: background-color 0.3s ease, transform 0.25s ease, border-color 0.3s ease;
    cursor: pointer;
}
.btn-primary { background-color: var(--accent); color: #0a1410; }
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    border-color: var(--accent);
}
.btn-secondary { background-color: var(--bg-card); color: var(--text); }
.btn-secondary:hover {
    background-color: var(--bg-soft);
    transform: translateY(-2px);
    border-color: var(--text-dim);
}
.btn-discord { background-color: #5865F2; color: white; }
.btn-discord:hover {
    background-color: #4752C4;
    transform: translateY(-2px);
    border-color: #a5b4fc;
}
.btn-discord svg { transition: transform 0.4s ease; }
.btn-discord:hover svg { transform: rotate(-15deg) scale(1.1); }

/* --- HERO --- */
main {
    display: flex; align-items: center; justify-content: space-between;
    min-height: calc(100vh - 130px);
    padding: 0 50px;
    position: relative;
    overflow: hidden;
}

.text-side { max-width: 500px; z-index: 2; }

.big-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.1s;
    transition: transform 0.5s ease;
}
.big-logo:hover { transform: rotate(10deg) scale(1.05); }

.text-side h1 {
    font-size: 3.5rem; font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.25s;
}

.text-side p {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 30px;
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.4s;
}

.buttons {
    display: flex; gap: 15px;
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.55s;
}

/* --- FLOATING SHAPES (leaf-inspired) --- */
.visual-side {
    position: absolute; top: 0; right: 0;
    width: 50%; height: 100%;
    pointer-events: none; z-index: 1;
}
.shape { position: absolute; opacity: 0; }

.shape-a {
    width: 90px; height: 90px;
    background-color: var(--accent);
    border-radius: 50% 0 50% 50%;
    top: 20%; right: 20%;
    animation: fadeIn 1s ease 0.6s forwards, floatSlow 6s ease-in-out infinite 1.6s;
}
.shape-b {
    width: 130px; height: 130px;
    background-color: var(--accent-deep);
    border-radius: 50% 0 50% 50%;
    top: 45%; right: 32%;
    animation: fadeIn 1s ease 0.8s forwards, floatSlow2 8s ease-in-out infinite 1.8s;
}
.shape-c {
    width: 60px; height: 60px;
    background-color: var(--accent-dark);
    border-radius: 50% 0 50% 50%;
    top: 62%; right: 14%;
    animation: fadeIn 1s ease 1s forwards, floatSlow 7s ease-in-out infinite 2s;
}
.shape-d {
    width: 100px; height: 100px;
    background-color: var(--accent-hover);
    border-radius: 50% 0 50% 50%;
    top: 28%; right: 46%;
    animation: fadeIn 1s ease 1.2s forwards, floatSlow2 9s ease-in-out infinite 2.2s;
}

/* --- STATS --- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto 100px;
    padding: 0 50px;
    text-align: center;
}
.stat h3 {
    font-size: 2.5rem; font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
    animation: fadeInUp 0.6s ease both;
}
.stat p {
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}
.stat:nth-child(1) h3 { animation-delay: 0.1s; }
.stat:nth-child(2) h3 { animation-delay: 0.2s; }
.stat:nth-child(3) h3 { animation-delay: 0.3s; }
.stat:nth-child(4) h3 { animation-delay: 0.4s; }
.stat:nth-child(1) p { animation-delay: 0.2s; }
.stat:nth-child(2) p { animation-delay: 0.3s; }
.stat:nth-child(3) p { animation-delay: 0.4s; }
.stat:nth-child(4) p { animation-delay: 0.5s; }

/* --- SERVER COUNT WIDGET --- */
#serverCount {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    transition: color 0.3s ease;
}
#serverCount::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background-color: var(--text-dim);
    transition: background-color 0.4s ease;
}
#serverCount.live::before     { background-color: var(--accent); }
#serverCount.fallback::before { background-color: var(--text-dim); }

/* --- FEATURES --- */
.features {
    max-width: 1100px;
    margin: 0 auto 100px;
    padding: 0 50px;
    scroll-margin-top: 100px;
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease both;
}
.section-header h2 {
    font-size: 2.2rem; font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    animation: fadeInUp 0.6s ease both;
}
.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background-color: var(--bg-soft);
}

.feature-icon {
    width: 40px; height: 40px;
    background-color: var(--accent);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
    margin-bottom: 20px;
    opacity: 0.95;
}
.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p  { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* --- SUBPAGES --- */
.page { max-width: 800px; margin: 0 auto; padding: 60px 30px 100px; }
.page h1 {
    font-size: 3rem; font-weight: 800; margin-bottom: 10px;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease both;
}
.page-subtitle {
    color: var(--text-muted); font-size: 1.1rem; margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.15s both;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    animation: fadeInUp 0.7s ease both;
}
.card:nth-of-type(1) { animation-delay: 0.25s; }
.card:nth-of-type(2) { animation-delay: 0.4s; }
.card:nth-of-type(3) { animation-delay: 0.55s; }
.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background-color: var(--bg-soft);
}
.card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.card p  { color: var(--text-muted); line-height: 1.7; }

.status-list { display: flex; flex-direction: column; gap: 12px; }
.status-item {
    display: flex; align-items: center; gap: 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    animation: fadeInUp 0.6s ease both;
}
.status-item:nth-child(1) { animation-delay: 0.25s; }
.status-item:nth-child(2) { animation-delay: 0.35s; }
.status-item:nth-child(3) { animation-delay: 0.45s; }
.status-item:nth-child(4) { animation-delay: 0.55s; }
.status-item:hover {
    transform: translateX(6px);
    border-color: var(--accent);
    background-color: var(--bg-soft);
}
.status-name { font-weight: 600; flex: 1; }
.status-msg  { color: var(--text-muted); font-size: 0.95rem; }

.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background-color: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.15); }
.dot-yellow { background-color: #eab308; box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15); }
.dot-red    { background-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

/* --- FOOTER --- */
footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 50px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-dim);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-dim); transition: color 0.3s ease; }
.footer-links a:hover { color: var(--text-muted); }

/* --- MOBILE --- */
@media (max-width: 900px) {
    .toolbar { padding: 8px 20px; font-size: 0.75rem; }
    .toolbar-right a { display: none; }

    nav { padding: 16px 20px; }
    .nav-links { display: none; }
    .nav-actions .btn-primary { display: none; }
    .hamburger { display: flex; }

    main {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
        min-height: auto;
    }
    .text-side { max-width: 100%; }
    .text-side h1 { font-size: 2.5rem; }
    .buttons { justify-content: center; flex-wrap: wrap; }
    .visual-side { display: none; }

    .stats { grid-template-columns: repeat(2, 1fr); padding: 0 20px; margin-bottom: 60px; gap: 30px 20px; }
    .stat h3 { font-size: 2rem; }

    .features { padding: 0 20px; margin-bottom: 60px; }
    .section-header h2 { font-size: 1.8rem; }
    .features-grid { grid-template-columns: 1fr; gap: 16px; }

    .page { padding: 40px 20px 80px; }
    .page h1 { font-size: 2.2rem; }

    footer { flex-direction: column; gap: 12px; padding: 20px; text-align: center; }
}

/* --- ToS / long-form pages --- */
.page .card {
    padding: 28px 32px;
}

.page .card h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text);
}

.page .card p {
    font-size: 0.98rem;
    line-height: 1.8;
}

.page .card a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.page .card a:hover {
    border-bottom-color: var(--accent);
}