/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* ===== Variables ===== */
:root {
    --primary: #f5a623;
    --primary-dark: #d4891a;
    --primary-light: #ffc14a;
    --bg: #0f0f1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-glass: rgba(255,255,255,0.08);
    --text: #e0e0e0;
    --text-muted: #a0a0b0;
    --border: rgba(255,255,255,0.1);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

/* ===== Dark Mode (default) ===== */
body { background: var(--bg); color: var(--text); }
header, footer { background: rgba(15,15,26,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ===== Light Mode (toggle) ===== */
body.light-mode {
    --bg: #f5f5fa;
    --bg-card: rgba(0,0,0,0.04);
    --bg-glass: rgba(255,255,255,0.7);
    --text: #1a1a2e;
    --text-muted: #555;
    --border: rgba(0,0,0,0.08);
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    background: var(--bg);
    color: var(--text);
}
body.light-mode header,
body.light-mode footer {
    background: rgba(245,245,250,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== Header & Nav ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.6rem 1.2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.4s ease, border-color 0.4s ease;
}
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    gap: 1rem;
}
nav > a { flex-shrink: 0; }
nav ul {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}
nav ul li a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}
nav ul li a:hover { color: var(--primary); transform: translateY(-1px); }
nav ul li a:hover::after { width: 100%; }

#darkModeToggle, #mobileMenuToggle {
    font-size: 1.3rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), transform var(--transition);
}
#darkModeToggle:hover, #mobileMenuToggle:hover { background: var(--bg-card); transform: scale(1.05); }
#mobileMenuToggle { display: none; font-size: 1.6rem; }

/* ===== Hero ===== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}
#hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 70%;
    height: 80%;
    background: radial-gradient(circle, rgba(245,166,35,0.15) 0%, transparent 70%);
    pointer-events: none;
}
#hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(245,166,35,0.1) 0%, transparent 70%);
    pointer-events: none;
}
#hero > div { position: relative; z-index: 1; max-width: 800px; }
#hero h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
}
#hero p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
#hero p:first-of-type { font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
#hero p:last-of-type { margin-bottom: 2rem; }
#hero a[role="button"] {
    display: inline-block;
    padding: 0.85rem 2.4rem;
    margin: 0.4rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    background: var(--primary);
    color: #0f0f1a;
    box-shadow: 0 4px 20px rgba(245,166,35,0.3);
}
#hero a[role="button"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(245,166,35,0.5);
    background: var(--primary-light);
}
#hero a[role="button"]:last-child {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}
#hero a[role="button"]:last-child:hover {
    background: var(--primary);
    color: #0f0f1a;
    box-shadow: 0 4px 20px rgba(245,166,35,0.3);
}

/* ===== Sections Common ===== */
section {
    padding: 5rem 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s 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; }

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

section h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    position: relative;
    display: inline-block;
}
section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* ===== About ===== */
#about p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 1rem;
}

/* ===== Services & Features ===== */
#services ul, #features ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}
#services ul li, #features ul li {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    box-shadow: var(--shadow);
}
#services ul li:hover, #features ul li:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.12);
}
#services ul li h3, #features ul li h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text);
}
#services ul li p, #features ul li p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Knowledge ===== */
#knowledge {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}
#knowledge h2 { grid-column: 1 / -1; }
#knowledge article {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow);
}
#knowledge article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
#knowledge article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text);
}
#knowledge article p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}
#knowledge article a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--transition);
}
#knowledge article a:hover { color: var(--primary-light); }

/* ===== FAQ ===== */
#faq dl {
    display: grid;
    gap: 1.2rem;
}
#faq dt {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
    position: relative;
}
#faq dt::after {
    content: '+';
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--primary);
    transition: transform var(--transition);
}
#faq dt:hover { background: rgba(245,166,35,0.1); border-color: var(--primary); }
#faq dt:hover::after { transform: translateY(-50%) rotate(45deg); }
#faq dd {
    padding: 0.6rem 1.2rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: none;
}
#faq dt:hover + dd,
#faq dd:hover { display: block; }

/* ===== HowTo ===== */
#howto ol {
    list-style: decimal;
    padding-left: 1.8rem;
    display: grid;
    gap: 1rem;
    max-width: 700px;
}
#howto ol li {
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.6rem 0;
}
#howto ol li strong { color: var(--text); font-weight: 600; }

/* ===== Contact ===== */
#contact address p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-style: normal;
}

/* ===== Footer ===== */
footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
footer nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
footer nav ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}
footer nav ul li a:hover { color: var(--primary); }
footer p { color: var(--text-muted); font-size: 0.85rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header { padding: 0.5rem 1rem; }
    nav ul { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(15,15,26,0.95); backdrop-filter: blur(16px); flex-direction: column; padding: 1rem 0; border-bottom: 1px solid var(--border); gap: 0; }
    nav ul.open { display: flex; }
    nav ul li { width: 100%; text-align: center; }
    nav ul li a { display: block; padding: 0.8rem 1rem; font-size: 1.1rem; }
    #mobileMenuToggle { display: block; }
    #darkModeToggle { order: 1; }
    .light-mode nav ul { background: rgba(245,245,250,0.95); }

    section { padding: 3rem 1rem; }
    #services ul, #features ul, #knowledge { grid-template-columns: 1fr; }
    #hero h1 { font-size: 2rem; }
    #hero a[role="button"] { padding: 0.7rem 1.8rem; font-size: 0.95rem; }
    footer nav ul { gap: 1rem; }
}

@media (max-width: 480px) {
    #hero { padding: 5rem 1rem 3rem; }
    #hero h1 { font-size: 1.8rem; }
    #hero p { font-size: 0.95rem; }
    #hero a[role="button"] { width: 80%; margin: 0.4rem auto; }
    section h2 { font-size: 1.5rem; }
}

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

/* ===== Selection ===== */
::selection { background: var(--primary); color: #0f0f1a; }

/* ===== Smooth transition for all interactive ===== */
* { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; }