* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: inherit;
    line-height: 1.6;
    color: var(--text-ink);
    background: var(--bg-paper);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Regional Font & Direction Mapping */
html[lang="ar"] {
    direction: rtl;
    font-family: var(--font-ar);
}

html[lang="ku"] {
    direction: rtl;
    font-family: var(--font-ku);
}

html[lang="en"] {
    direction: ltr;
    font-family: var(--font-en);
}

/* Visible keyboard focus */
:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--accent-cyan), inset 0 0 8px rgba(2, 132, 199, 0.4) !important;
    border-color: var(--accent-cyan) !important;
}

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

.container {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0;
}

/* Skeuomorphic Metallic Progress Bar Track */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), #0284c7);
    box-shadow: 0 0 10px var(--accent-cyan);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Tactile 3D Button Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    color: var(--text-ink);
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-drop);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 999;
}

.scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-drop-hover);
    color: var(--accent-cyan);
}

.scroll-top:active {
    transform: translateY(0);
    box-shadow: var(--shadow-pressed);
}

.scroll-top.show {
    display: flex;
}

/* Custom Tactile Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-paper);
    box-shadow: var(--shadow-inset);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 5px;
    box-shadow: var(--shadow-drop);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Animated Canvas Background */
#neuralCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}

input, select, textarea { font: inherit; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .hero-console { transform: none !important; }
    #neuralCanvas { display: none; }
}
