/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f5f7fa;
    transition: background 0.3s, color 0.3s;
}
a { color: #2b6cb0; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1a365d; }
img { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.5rem; }

/* ===== Theme Variables ===== */
:root {
    --bg: #f5f7fa;
    --text: #1a1a2e;
    --card-bg: rgba(255,255,255,0.85);
    --card-shadow: 0 8px 32px rgba(0,0,0,0.08);
    --glass-border: rgba(255,255,255,0.3);
    --nav-bg: rgba(26,58,92,0.9);
    --nav-text: #e2e8f0;
    --accent: #2b6cb0;
    --accent-hover: #1a365d;
    --gradient-start: #1a3a5c;
    --gradient-end: #2b6cb0;
    --section-padding: 4rem 2rem;
    --border-radius: 20px;
    --transition: 0.3s ease;
}
[data-theme="dark"] {
    --bg: #0f172a;
    --text: #e2e8f0;
    --card-bg: rgba(30,41,59,0.85);
    --card-shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glass-border: rgba(255,255,255,0.08);
    --nav-bg: rgba(15,23,42,0.95);
    --nav-text: #cbd5e1;
    --accent: #63b3ed;
    --accent-hover: #90cdf4;
    --gradient-start: #0f172a;
    --gradient-end: #1e293b;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ===== Header & Navigation ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}
nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0.8rem 1rem;
}
nav li a {
    display: block;
    padding: 0.5rem 1.2rem;
    color: var(--nav-text);
    font-weight: 500;
    border-radius: 50px;
    transition: background var(--transition), transform 0.2s;
    white-space: nowrap;
    font-size: 0.95rem;
}
nav li a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    color: #fff;
}

/* ===== Main & Sections ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
section {
    margin: 2rem auto;
    padding: var(--section-padding);
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }
section:nth-child(8) { animation-delay: 0.7s; }
section:nth-child(9) { animation-delay: 0.8s; }
section:nth-child(10) { animation-delay: 0.9s; }
section:hover {
    transform: translateY(-4px) scale(1.002);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Headings ===== */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}
h1 {
    font-size: 2.4rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
h2 {
    font-size: 1.8rem;
    color: var(--accent);
    border-left: 5px solid var(--accent);
    padding-left: 1rem;
    margin-top: 0;
}
h3 {
    font-size: 1.3rem;
    color: var(--text);
}

/* ===== Paragraphs & Text ===== */
p {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.7;
}
strong { color: var(--accent); }

/* ===== Articles / News ===== */
article {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
article:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}
article h3 { margin-bottom: 0.5rem; }
article p { font-size: 0.95rem; }
article a {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 1.2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
}
article a:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ===== FAQ ===== */
#faq ol {
    list-style: none;
    counter-reset: faq-counter;
    padding: 0;
}
#faq ol li {
    counter-increment: faq-counter;
    padding: 1rem 1rem 1rem 3rem;
    margin-bottom: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    position: relative;
    transition: background 0.2s;
    font-size: 0.95rem;
}
#faq ol li::before {
    content: counter(faq-counter);
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
#faq ol li:hover {
    background: rgba(43,108,176,0.05);
}
#faq ol li strong {
    display: block;
    margin-bottom: 0.3rem;
}

/* ===== HowTo ===== */
#howto ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}
#howto ol li {
    margin-bottom: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}
#howto p {
    margin-bottom: 0.6rem;
}

/* ===== Contact ===== */
#contact p {
    margin-bottom: 0.5rem;
}
#contact p:first-of-type {
    margin-top: 1rem;
}

/* ===== Footer ===== */
footer {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--nav-text);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--nav-text);
}

/* ===== Sitemap / Links ===== */
section:last-of-type ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}
section:last-of-type ul li a {
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    background: rgba(43,108,176,0.08);
    transition: background 0.2s;
}
section:last-of-type ul li a:hover {
    background: rgba(43,108,176,0.2);
}
section:last-of-type p a {
    margin: 0 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(43,108,176,0.08);
    transition: background 0.2s;
}
section:last-of-type p a:hover {
    background: rgba(43,108,176,0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html { font-size: 15px; }
    nav ul { gap: 0.3rem; padding: 0.6rem 0.5rem; }
    nav li a { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
    section { padding: 2.5rem 1.2rem; margin: 1.5rem 0; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.1rem; }
    article { padding: 1rem; }
    #faq ol li { padding: 0.8rem 0.8rem 0.8rem 2.5rem; font-size: 0.9rem; }
    #faq ol li::before { width: 24px; height: 24px; font-size: 0.75rem; left: 0.8rem; top: 0.8rem; }
    section:last-of-type ul { gap: 0.5rem; }
    section:last-of-type ul li a { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    nav ul { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; padding: 0.5rem; }
    nav li a { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
    section { padding: 2rem 1rem; border-radius: 16px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    footer p { font-size: 0.8rem; }
}

/* ===== Dark Mode Support (auto detect) ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --text: #e2e8f0;
        --card-bg: rgba(30,41,59,0.85);
        --card-shadow: 0 8px 32px rgba(0,0,0,0.4);
        --glass-border: rgba(255,255,255,0.08);
        --nav-bg: rgba(15,23,42,0.95);
        --nav-text: #cbd5e1;
        --accent: #63b3ed;
        --accent-hover: #90cdf4;
        --gradient-start: #0f172a;
        --gradient-end: #1e293b;
    }
    body { background: var(--bg); }
    section { background: var(--card-bg); }
    article { background: var(--card-bg); }
    #faq ol li { background: var(--card-bg); }
    #howto ol li { border-bottom-color: rgba(255,255,255,0.08); }
    section:last-of-type ul li a,
    section:last-of-type p a { background: rgba(99,179,237,0.1); }
    section:last-of-type ul li a:hover,
    section:last-of-type p a:hover { background: rgba(99,179,237,0.2); }
}

/* ===== Smooth reveal on scroll (intersection observer fallback) ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Extra polish ===== */
::selection { background: var(--accent); color: #fff; }

/* ===== Floating gradient banner effect for first section ===== */
#brand {
    position: relative;
    overflow: hidden;
}
#brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(43,108,176,0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(26,58,92,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
#brand > * { position: relative; z-index: 1; }

/* ===== Card hover lift for all sections ===== */
@media (hover: hover) {
    section:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    }
}