:root {
    --color-primary: #b19cd9;
    --color-secondary: #dda0dd;
    --color-accent: #ff69b4;
    --color-bg: #faf8fd;
    --color-surface: #ffffff;
    --color-text: #2a1f3d;
    --color-muted: #6b5a80;
    --color-border: #d4c4ec;
    --color-glow: rgba(177, 156, 217, 0.55);
    --font-display: "Figtree", Helvetica, Arial, sans-serif;
    --font-body: "Noto Sans", Helvetica, Arial, sans-serif;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.75rem;
    --space-xl: 2.75rem;
    --radius: 12px;
    --ni-header-h: 72px;
    --ni-page-w: 1120px;
    --ni-utility-h: 36px;
}

@media (max-width: 768px) {
    :root { --ni-header-h: 64px; }
}

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

html {
    scroll-padding-top: calc(var(--ni-header-h) + var(--ni-utility-h));
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding-top: var(--ni-header-h);
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

body.ni-cookie-open { padding-bottom: 96px; }

img, video, iframe {
    max-width: 100%;
    height: auto;
}

a { color: #5a3d8a; }
a:visited { color: #5a3d8a; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.25;
    margin: 0 0 var(--space-md);
}

p { margin: 0 0 var(--space-md); }

ul, ol { margin: 0 0 var(--space-md); padding-left: 1.25rem; }

code {
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

.ni-container {
    width: min(100% - 2rem, var(--ni-page-w));
    margin-inline: auto;
}

.ni-flex { display: flex; }
.ni-flex-col { flex-direction: column; }
.ni-flex-wrap { flex-wrap: wrap; }
.ni-items-center { align-items: center; }
.ni-items-start { align-items: flex-start; }
.ni-justify-between { justify-content: space-between; }
.ni-justify-center { justify-content: center; }
.ni-gap-sm { gap: var(--space-sm); }
.ni-gap-md { gap: var(--space-md); }
.ni-gap-lg { gap: var(--space-lg); }
.ni-flex-1 { flex: 1; min-width: 0; }
.ni-flex-2 { flex: 2; min-width: 0; }
.ni-bg-primary { background: var(--color-primary); }
.ni-bg-surface { background: var(--color-surface); }
.ni-text-bold { font-weight: 700; }
.ni-text-center { text-align: center; }
.ni-min-0 { min-width: 0; }

.ni-section { padding: var(--space-xl) 0; }

.ni-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--ni-header-h);
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(42, 31, 61, 0.08);
}

.ni-header__row {
    min-height: var(--ni-header-h);
}

.ni-header a,
.ni-header a:visited {
    color: #3d2a5c;
    text-decoration: none;
}

.ni-header__logo img {
    width: 180px;
    height: auto;
    display: block;
}

.ni-nav__link {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
}

.ni-nav__link.is-active {
    color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-glow);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
}

.ni-utility {
    background: linear-gradient(90deg, #efe6f8, #f7eefc);
    border-bottom: 1px solid var(--color-border);
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    color: var(--color-muted);
}

.ni-utility__text,
.ni-utility__note { margin: 0; }

.ni-burger,
.ni-overlay,
.ni-drawer { display: none; }

.ni-burger {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
}

.ni-burger span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #3d2a5c;
    border-radius: 1px;
}

.ni-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #3d2a5c;
    font-family: var(--font-display);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--color-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ni-btn:visited { color: #3d2a5c; }

.ni-btn--primary {
    background: rgba(177, 156, 217, 0.72);
    color: #1f1430;
    border-color: rgba(255, 255, 255, 0.65);
}

.ni-btn--primary:visited { color: #1f1430; }

.ni-hero a.ni-btn,
.ni-hero a.ni-btn:visited {
    color: #3d2a5c;
}

.ni-hero a.ni-btn--primary,
.ni-hero a.ni-btn--primary:visited {
    color: #1f1430;
    background: rgba(255, 105, 180, 0.55);
}

.ni-cta a.ni-btn--primary,
.ni-cta a.ni-btn--primary:visited {
    color: #1f1430;
}

.ni-card {
    background: var(--color-surface);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 0 0 1px var(--color-glow), 0 8px 24px rgba(177, 156, 217, 0.18);
    -webkit-mask: radial-gradient(circle 10px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                   radial-gradient(circle 10px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
    mask: radial-gradient(circle 10px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
          radial-gradient(circle 10px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}

.ni-card--plain {
    -webkit-mask: none;
    mask: none;
    border-radius: var(--radius);
}

.ni-hero {
    background: linear-gradient(135deg, #f3ecfb 0%, #faf8fd 45%, #f7e4f4 100%);
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.ni-hero__title {
    font-size: clamp(1.75rem, 3.5vw, 2.6rem);
    color: #2a1f3d;
}

.ni-hero__text { color: var(--color-muted); max-width: 36rem; }

.ni-hero__mosaic {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    width: min(100%, 420px);
}

.ni-hero__still {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 0 1px var(--color-glow), 0 10px 28px rgba(42, 31, 61, 0.12);
}

.ni-hero__still--a { transform: translateY(12px); }
.ni-hero__still--b { transform: translateY(-8px); }
.ni-hero__still--c { transform: translateY(18px); }

.ni-bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
}

.ni-tile { min-width: 0; }
.ni-tile--span-6 { grid-column: span 6; }
.ni-tile--span-4 { grid-column: span 4; }
.ni-tile--span-2 { grid-column: span 2; }

.ni-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--color-primary);
}

.ni-timeline li {
    padding: 0 0 var(--space-md) var(--space-lg);
    position: relative;
}

.ni-timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.4rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-glow);
}

.ni-timeline time {
    display: block;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 0.25rem;
}

.ni-rank__item { width: 100%; }

.ni-rank__pos {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
    letter-spacing: 0.04em;
}

.ni-rank__name { margin-bottom: 0.25rem; }
.ni-rank__dev,
.ni-rank__desc,
.ni-rank__facts {
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

.ni-rank__facts { overflow-wrap: anywhere; }

.ni-app__icon {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--color-glow);
}

.ni-app__preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
    border-radius: 10px;
}

.ni-review .ni-app__preview {
    max-width: 280px;
    max-height: 280px;
}

.ni-chart {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ni-chart li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ni-chart__label { font-size: 0.85rem; min-width: 0; }
.ni-chart__track {
    height: 10px;
    background: #efe6f8;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.ni-chart__bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 999px;
}

.ni-chart__val { font-weight: 700; font-family: var(--font-display); }

.ni-log {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ni-log li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
}

.ni-cta {
    background: linear-gradient(120deg, #e8d9f5, #f8e6f3);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.ni-footer {
    background: #2a1f3d;
    color: #f3ecfb;
    padding: var(--space-xl) 0 var(--space-lg);
}

.ni-footer a,
.ni-footer a:visited {
    color: #f3ecfb;
}

.ni-footer__sitemap {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.ni-footer__sitemap li { margin: 0; }

.ni-footer__sitemap a,
.ni-footer__link {
    font-size: 0.9rem;
    text-decoration: none;
    background: none;
    border: 0;
    color: #f3ecfb;
    cursor: pointer;
    padding: 0.25rem 0.5rem 0.25rem 0;
    font-family: inherit;
}

.ni-footer__legal,
.ni-footer__copy {
    color: #c9b8df;
    font-size: 0.85rem;
    margin-top: var(--space-lg);
}

.ni-cookie { display: none; }

.ni-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    background: #2a1f3d;
    color: #faf8fd;
    padding: 0.9rem 0;
    box-shadow: 0 -4px 20px rgba(42, 31, 61, 0.25);
}

.ni-cookie a,
.ni-cookie a:visited { color: #ffb6d9; }

.ni-cookie__inner { width: min(100% - 2rem, var(--ni-page-w)); }

.ni-cookie .ni-btn {
    box-shadow: none;
    min-height: 44px;
    color: #1f1430;
}

.ni-cookie .ni-btn:visited { color: #1f1430; }

.ni-cookie .ni-btn--primary {
    background: var(--color-secondary);
}

.ni-breadcrumbs {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: var(--space-lg) 0 var(--space-sm);
}

.ni-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ni-breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    color: var(--color-border);
}

.ni-prose {
    max-width: 760px;
}

.ni-prose h2 { margin-top: var(--space-xl); }

.ni-measure { max-width: 760px; }

.ni-form {
    display: grid;
    gap: var(--space-md);
}

.ni-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

.ni-form input,
.ni-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    box-shadow: 0 0 0 1px transparent;
}

.ni-form input:focus,
.ni-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-glow);
    border-color: var(--color-primary);
}

.ni-form textarea { min-height: 140px; resize: vertical; }

.ni-form__error {
    color: #a1135a;
    font-size: 0.9rem;
}

.ni-form__ok {
    color: #2f6b3a;
    font-size: 0.9rem;
}

.ni-contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--space-lg);
    align-items: start;
}

.ni-topic { margin-bottom: var(--space-xl); }

.ni-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ni-topic-list li {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

.ni-band {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    margin-bottom: 0.75rem;
}

.ni-glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: var(--space-lg);
}

.ni-glossary-nav a {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
}

.ni-glossary dt {
    font-weight: 700;
    margin-top: 0.85rem;
}

.ni-glossary dd {
    margin: 0.2rem 0 0;
    color: var(--color-muted);
}

.is-observe { opacity: 1; }

.is-in {
    animation: ni-k-wipe 0.7s ease both;
    background: linear-gradient(90deg, var(--color-accent) 50%, transparent 50%) right / 200% 100% no-repeat;
}

@keyframes ni-k-wipe {
    from { background-position: left; }
    to { background-position: right; }
}

@media (prefers-reduced-motion: reduce) {
    .is-in { animation: none; background: none; }
    .ni-hero__still--a,
    .ni-hero__still--b,
    .ni-hero__still--c { transform: none; }
}

@media (max-width: 1100px) {
    .ni-nav { display: none; }
    .ni-burger { display: block; }

    .ni-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
    }

    .ni-drawer {
        display: block;
        position: fixed;
        z-index: 210;
        background: var(--color-bg);
        overflow-y: auto;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }

    .ni-drawer--wide {
        top: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        width: min(85vw, 400px);
        padding: 72px 0 24px;
        transform: translateX(100%);
    }

    .ni-drawer a {
        display: block;
        padding: 14px 20px;
        color: #3d2a5c;
        text-decoration: none;
        font-family: var(--font-display);
        font-weight: 600;
    }

    .ni-drawer__close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        font-size: 1.75rem;
        cursor: pointer;
        color: #3d2a5c;
    }

    body.nav-open { overflow: hidden; }
    body.nav-open .ni-overlay { opacity: 1; visibility: visible; }
    body.nav-open .ni-drawer--wide {
        transform: translateX(0);
        visibility: visible;
    }
}

@media (max-width: 900px) {
    .ni-hero__grid { flex-direction: column; }
    .ni-hero__mosaic { width: 100%; }
    .ni-tile--span-4,
    .ni-tile--span-2,
    .ni-tile--span-6 { grid-column: span 6; }
    .ni-contact-grid { grid-template-columns: 1fr; }
    .ni-footer__wide { flex-direction: column; }
    .ni-utility { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
}

@media (max-width: 768px) {
    .ni-bento { grid-template-columns: 1fr; }
    .ni-tile--span-4,
    .ni-tile--span-2,
    .ni-tile--span-6 { grid-column: auto; }
    .ni-header__logo img { width: 120px; }
    .ni-rank__item .ni-app__preview {
        display: block;
        margin: 16px auto 0;
    }
    .ni-hero__actions .ni-btn { width: 100%; }
    .ni-cookie:not([hidden]) {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        border-radius: 12px;
    }
    .ni-cookie__inner { flex-direction: column; align-items: stretch; width: 100%; }
    .ni-chart li { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .ni-rank__item .ni-app__icon { margin-bottom: 0.5rem; }
    .ni-hero__mosaic { grid-template-columns: 1fr 1fr 1fr; gap: 0.4rem; }
}
