:root{
    --bg:#0b1220;
    --surface:#0f172a;
    --muted:#1e293b;
    --text:#e5e7eb;
    --subtext:#cbd5e1;
    --brand:#22c55e;
    --brand-600:#16a34a;
    --focus:#60a5fa;
    --shadow:0 10px 30px rgba(0,0,0,.25);
    --radius:12px;
    --radius-sm:8px;
    --maxw:1200px;
}
*, *::before, *::after { box-sizing:border-box }
html{ scroll-behavior:smooth }
body{
    margin:0;
    font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    color:var(--text);
    background:var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a{ color:inherit; text-decoration:none }
img{ max-width:100%; display:block }
.container{ max-width:var(--maxw); margin-left:auto; margin-right:auto; padding:0 16px }

header{
    position:sticky;
    top:0;
    z-index:1000;
    background:rgba(15,23,42,.8);
    backdrop-filter:blur(10px);
    border-bottom:1px solid #1f2937;
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; padding-top:12px; padding-bottom:12px; }
.brand img{ height:36px; width:auto }

nav ul{ display:flex; align-items:center; gap:16px; margin:0; padding:0; list-style:none; }
/* Fixed: Made rule more specific to ensure both links and buttons in nav are styled correctly. */
a.nav-link, button.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    /* Fixed: Explicitly set link color for visibility against dark header */
    color: var(--subtext);
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}
.nav-link:hover,.nav-link:focus{ background:var(--muted); color:#fff; outline:none }
.nav-link.active {
    color: #fff;
    background-color: var(--muted);
}
.nav-item{ position:relative }
.submenu{
    position:absolute;
    top:110%;
    left:0;
    min-width:240px;
    background:var(--surface);
    border:1px solid #223049;
    border-radius:12px;
    box-shadow:var(--shadow);
    padding:8px;
    opacity:0;
    visibility:hidden;
    transform:translateY(8px);
    transition:.2s ease;
    display:flex;
    flex-direction:column;
    gap:4px;
}
.nav-item:focus-within > .submenu,
.nav-item:hover > .submenu {
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}
.submenu a{ padding:10px 12px; border-radius:8px; color:var(--subtext) }
.submenu a:hover{ background:var(--muted); color:#fff }
.lang select{ background:var(--muted); color:#fff; border:none; padding:8px 12px; border-radius:10px; }
.menu-toggle{ display:none }

.hero{ padding:48px 0 16px; background:radial-gradient(800px 400px at 20% 0%, rgba(34,197,94,.15), transparent 60%); }
.hero h1{ font-size:clamp(24px,4vw,40px); margin:0 0 8px }
.hero p{ color:var(--subtext); margin:0 }
.main{ padding:24px 0 60px; flex-grow: 1; }
.card{ background:var(--surface); border:1px solid #223049; border-radius:var(--radius); box-shadow:var(--shadow); padding:24px; }
.card h2{ margin:0 0 16px; font-size:20px }
.tools-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr)); gap:16px; margin-top:16px; }
.tool-link{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:12px; border:1px solid #223049; background:#0c162b; transition: all 0.2s ease; }
.tool-link:hover{ border-color:#2e3c59; background:#0e1b35; transform: translateY(-2px); }
.tool-icon{ width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; background:var(--muted); border-radius:8px }

textarea{ width:100%; background:#0c162b; border:1px solid #223049; color:#e5e7eb; border-radius:10px; padding:12px; min-height:180px; resize:vertical; font-family: inherit; font-size: 1rem; }
.input {    width: 100%;    background: #0c162b;    border: 1px solid #223049;    color: #e5e7eb;    border-radius: 10px;    padding: 12px;    font-family: inherit;    font-size: 1rem; margin-bottom: 16px; }
.controls{ display:flex; flex-wrap:wrap; gap:10px; margin:16px 0 }
.btn{ background:var(--brand); color:#071225; border:none; padding:10px 16px; border-radius:10px; font-weight:600; cursor:pointer; transition: background-color 0.2s ease; }
.btn.secondary{ background:#243045; color:#e5e7eb }
.btn:hover{ filter:brightness(1.1) }
.badge{ display:inline-block; background:#1f2937; color:#cbd5e1; padding:6px 10px; border-radius:999px; font-size:12px }

.metrics{ display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px; margin-top:16px }
.metric{ background:#0c162b; border:1px solid #223049; border-radius:10px; padding:12px }
.metric strong{ display:block; font-size:22px; margin-bottom:4px }

footer{ border-top:1px solid #1f2937; background:#0a0f1c; padding-top: 24px; }
.footer-cols{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:24px; padding-bottom: 24px; }
.footer-cols h4{ margin:0 0 8px }
.footer-link{ display:block; color:var(--subtext); padding:6px 0 }
.footer-link:hover{ color:#fff }
.footer-bottom{ border-top:1px solid #1f2937; color:#9aa5b1; padding:16px 0; font-size:14px; text-align: center; }

@media (max-width: 1024px){
    nav ul { gap: 8px; }
    .nav-link { padding: 8px; }
}
@media (max-width: 820px){
    .header-inner{ gap:16px }
    .menu-toggle{ 
        display:inline-flex; 
        align-items:center; 
        gap:8px; 
        background:transparent; 
        border:1px solid #223049; 
        color:#e5e7eb; 
        padding:8px 12px; 
        border-radius:10px; 
        font-size: 1rem; 
        z-index: 1001; 
    }
    
    nav{
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(11, 18, 32, 0.95);
        backdrop-filter: blur(8px);
        padding-top: 80px;
        overflow-y: auto;
    }
    nav.open{ display:block }
    nav ul{ 
        flex-direction:column; 
        padding:16px; 
        gap: 8px; 
        align-items: 
        stretch; 
    }
    .nav-link { 
        justify-content: space-between; 
        padding: 16px; 
        font-size: 1.1rem; 
    }
    
    .submenu{
        position:static;
        opacity:1;
        visibility:visible;
        transform:none;
        box-shadow:none;
        border:none;
        background: none;
        padding: 8px 0 8px 24px;
        min-width: unset;
        display: none;
    }
    .nav-item > button[aria-expanded="true"] + .submenu {
        display: flex;
    }
}
.visually-hidden{ 
    position:absolute; 
    width:1px; 
    height:1px; 
    padding:0; 
    margin:-1px; 
    overflow:hidden; 
    clip:rect(0 0 0 0); 
    white-space:nowrap; 
    border:0 
    
}
