/* =====================================================================
   NAJDI24 · BASE
   Ресет, типографија, позадина („ноќна мапа“), фокус, скролбар,
   view transitions и почитување на reduced-motion.
   ===================================================================== */

@view-transition {
    navigation: auto;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    min-height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--n-nav-h) + 16px);
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    interpolate-size: allow-keywords;
    overflow-x: clip;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    position: relative;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--n-ink-900);
    color: var(--n-text);
    font-family: var(--n-font-sans);
    font-size: var(--n-fs-base);
    font-weight: 450;
    line-height: 1.6;
    letter-spacing: -.003em;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
}

/* Ноќна мапа: суптилна мрежа од улици + топол сјај над хоризонтот */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(1100px 520px at 78% -8%, color-mix(in oklab, var(--n-brand-500) 18%, transparent), transparent 65%),
        radial-gradient(900px 600px at -10% 10%, color-mix(in oklab, #3a5bff 10%, transparent), transparent 60%),
        var(--n-ink-900);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .5;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(28deg, transparent 49.6%, rgba(255, 255, 255, .035) 50%, transparent 50.4%);
    background-size: 64px 64px, 64px 64px, 520px 520px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
}

main {
    flex: 1 0 auto;
}

/* ---------- Типографија ---------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--n-text-strong);
    font-family: var(--n-font-sans);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    text-wrap: balance;
    margin-top: 0;
}

h1, .h1 {
    font-family: var(--n-font-display);
    font-size: var(--n-fs-2xl);
    font-weight: 700;
    letter-spacing: -.035em;
}

h2, .h2 {
    font-family: var(--n-font-display);
    font-size: var(--n-fs-xl);
    font-weight: 600;
    letter-spacing: -.03em;
}

h3, .h3 { font-size: var(--n-fs-lg); }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.08rem; font-weight: 750; letter-spacing: -.01em; }
h6, .h6 { font-size: 1rem; }

p {
    color: var(--n-text-muted);
    line-height: 1.65;
    text-wrap: pretty;
}

strong, b {
    font-weight: 750;
    color: var(--n-text-strong);
}

small, .small {
    font-size: var(--n-fs-sm);
}

a {
    color: var(--n-brand-400);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--n-dur-1) var(--n-ease);
}

a:hover {
    color: var(--n-brand-300);
}

hr {
    border: 0;
    height: 1px;
    background: var(--n-line);
    opacity: 1;
}

img,
video,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

code, kbd, pre {
    font-family: var(--n-font-mono);
}

kbd {
    padding: .1em .45em;
    border-radius: 6px;
    border: 1px solid var(--n-line-strong);
    background: var(--n-ink-700);
    color: var(--n-text-muted);
    font-size: .78em;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .4);
}

::selection {
    background: color-mix(in oklab, var(--n-brand-500) 45%, transparent);
    color: #fff;
}

/* ---------- Пристапност: видлив фокус ---------- */

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--n-brand-400);
    outline-offset: 3px;
    border-radius: 6px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: none;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    box-shadow: var(--n-ring) !important;
    outline: none;
}

.visually-hidden-focusable:focus {
    position: fixed !important;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: .6rem 1rem;
    border-radius: var(--n-r-pill);
    background: var(--n-brand-500);
    color: #fff;
}

/* ---------- Скролбар ---------- */

html {
    scrollbar-color: var(--n-ink-500) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--n-ink-500);
    border: 3px solid var(--n-ink-900);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--n-ink-600);
}

/* ---------- Bootstrap текст-утилити во нашата палета ---------- */

.text-muted,
.text-secondary,
.text-body-secondary {
    color: var(--n-text-muted) !important;
}

.text-white-50 {
    color: rgba(233, 236, 245, .6) !important;
}

.text-warning { color: var(--n-brand-300) !important; }
.text-success { color: var(--n-success) !important; }
.text-danger { color: var(--n-danger) !important; }
.text-info { color: var(--n-info) !important; }
.text-primary { color: var(--n-brand-400) !important; }

.bg-dark,
.bg-black {
    background-color: var(--n-ink-850) !important;
}

.bg-white {
    background-color: var(--n-ink-800) !important;
}

.bg-light {
    background-color: var(--n-ink-750) !important;
    color: var(--n-text) !important;
}

.text-dark {
    color: var(--n-ink-900) !important;
}

/* text-dark на линкови врз темна позадина би бил невидлив */
.nav-link.text-dark,
.btn-link.text-dark {
    color: var(--n-text) !important;
}

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: var(--n-line) !important;
}

/* ---------- Намалено движење ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    @view-transition {
        navigation: none;
    }
}
