/* NairNet Core v2026.08.12 */

:root {
    color-scheme: light;

    --nn-brand-blue: rgb(19, 170, 225);
    --nn-brand-blue-hover: #1098ca;
    --nn-brand-grey: rgb(65, 65, 65);

    --nn-page-background: #f3f5f7;
    --nn-footer-background: #e4e8ec;
    --nn-root-background: #e9edf2;
    --nn-surface: #ffffff;
    --nn-surface-soft: rgba(255, 255, 255, 0.72);
    --nn-text: #30343a;
    --nn-muted: #6b7280;
    --nn-border: rgba(0, 0, 0, 0.08);
    --nn-shadow: rgba(0, 0, 0, 0.12);

    --nn-toggle-background: #ffffff;
    --nn-toggle-shadow: rgba(0, 0, 0, 0.12);

    --nn-radius-card: 20px;
    --nn-radius-control: 10px;
    --nn-radius-pill: 999px;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --nn-page-background: #111418;
    --nn-footer-background: #171c22;
    --nn-root-background: #15191e;
    --nn-surface: #1a1f24;
    --nn-surface-soft: rgba(17, 20, 24, 0.78);
    --nn-text: #f1f3f5;
    --nn-muted: #aeb6bf;
    --nn-border: rgba(255, 255, 255, 0.10);
    --nn-shadow: rgba(0, 0, 0, 0.30);

    --nn-toggle-background: #252b31;
    --nn-toggle-shadow: rgba(0, 0, 0, 0.30);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

@font-face {
    font-family: "Roboto";
    src: url("/nairnet-core/fonts/roboto/roboto-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("/nairnet-core/fonts/roboto/roboto-500.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("/nairnet-core/fonts/roboto/roboto-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("/nairnet-core/fonts/roboto-mono/roboto-mono-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("/nairnet-core/fonts/roboto-mono/roboto-mono-500.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("/nairnet-core/fonts/roboto-mono/roboto-mono-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

html {
    min-height: 100%;
    background-color: var(--nn-root-background);
}

body.nn-theme {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--nn-text);
    background-color: var(--nn-page-background);
    transition:
        background-color 200ms ease,
        color 200ms ease;
}

.nn-card {
    color: var(--nn-text);
    background: var(--nn-surface);
    border: 1px solid var(--nn-border);
    border-radius: var(--nn-radius-card);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
    transition:
        background-color 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease;
}

html[data-theme="dark"] .nn-card {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.20);
}

.nn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--nn-muted);
    background: var(--nn-surface-soft);
    border: 1px solid var(--nn-border);
    border-radius: var(--nn-radius-pill);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nn-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 20px;
    font: inherit;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    background: var(--nn-brand-blue);
    border: 0;
    border-radius: var(--nn-radius-control);
    cursor: pointer;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}

.nn-button:hover {
    color: #ffffff;
    background: var(--nn-brand-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(19, 170, 225, 0.25);
}

.nn-button:active {
    transform: translateY(0);
}

.nn-link {
    color: inherit;
    text-decoration: none;
    transition: color 150ms ease;
}

.nn-link:hover {
    color: var(--nn-brand-blue);
}

.nn-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;

    width: 100%;
    padding: 18px 20px;

    text-align: center;
    font-size: 0.875rem;
    color: var(--nn-muted);

    background: var(--nn-surface-soft);
    border-top: 1px solid var(--nn-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* Extend the footer background into Safari's elastic overscroll area */
    box-shadow: 0 100vh 0 100vh var(--nn-footer-background);

    transition:
        color 200ms ease,
        background-color 200ms ease,
        border-color 200ms ease;
}

.nn-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    transition: color 150ms ease;
}

.nn-footer-link:hover {
    color: var(--nn-brand-blue);
}

.nn-footer-logo {
    display: block;
    width: auto;
    height: 18px;
    transform: translateY(-3px);
}

/* Theme toggle */
.nn-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    padding: 0;

    color: var(--nn-text);
    background: var(--nn-toggle-background);
    border: 1px solid var(--nn-border);
    border-radius: 50%;
    cursor: pointer;

    box-shadow: 0 4px 14px var(--nn-toggle-shadow);
    transition:
        transform 150ms ease,
        background-color 200ms ease,
        border-color 200ms ease,
        color 200ms ease,
        box-shadow 200ms ease;
}

.nn-theme-toggle:hover {
    transform: translateY(-1px);
}

.nn-theme-toggle:active {
    transform: scale(0.94);
}

.nn-theme-toggle:focus {
    outline: 3px solid var(--nn-brand-blue);
    outline-offset: 4px;
    box-shadow:
        0 4px 14px var(--nn-toggle-shadow),
        0 0 0 6px rgba(19, 170, 225, 0.18);
}

.nn-theme-toggle:focus:not(:focus-visible) {
    outline: none;
    box-shadow: 0 4px 14px var(--nn-toggle-shadow);
}

.nn-theme-toggle:focus-visible {
    outline: 3px solid var(--nn-brand-blue);
    outline-offset: 4px;
    box-shadow:
        0 4px 14px var(--nn-toggle-shadow),
        0 0 0 6px rgba(19, 170, 225, 0.18);
}

.nn-theme-icon {
    position: absolute;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition:
        opacity 250ms ease,
        transform 350ms ease,
        color 250ms ease;
}

.nn-moon-icon {
    fill: currentColor;
    stroke: none;
    color: #475569;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.nn-sun-icon {
    color: #fbbf24;
    opacity: 0;
    transform: rotate(-90deg) scale(0.55);
}

html[data-theme="dark"] .nn-moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.55);
}

html[data-theme="dark"] .nn-sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@media (max-width: 480px) {
    .nn-theme-toggle {
        top: 14px;
        right: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.nn-theme,
    .nn-card,
    .nn-button,
    .nn-link,
    .nn-footer,
    .nn-footer-link,
    .nn-theme-toggle,
    .nn-theme-icon {
        scroll-behavior: auto;
        transition: none;
        animation: none;
    }
}
