/* ============================================================
   Neural Search — semantic search demo (vanilla port)
   Hero search bar with auto-cycling complex queries.
   Shows model understanding + match scores + typo tolerance.
   ============================================================ */

.ns-section {
    --ns-cyan: #2BA89E;
    --ns-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --ns-display: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
    --ns-ease: cubic-bezier(0.4, 0, 0.2, 1);
    background: #000000;
    color: #FFFFFF;
    padding: 96px 0 112px;
    position: relative;
}

.ns-section__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

.ns-section__head { margin-bottom: 2.5rem; }

.ns-section__label {
    font-family: var(--ns-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.25rem;
    display: block;
}

.ns-section__headline {
    font-family: var(--ns-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 300;
    color: #FFFFFF;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 1rem 0;
    max-width: 820px;
    position: relative;
    display: inline-block;
}

.ns-section__headline::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--neural-purple, #3c1361), var(--neural-orange, #d97706));
    margin-top: 0.875rem;
}

.ns-section__sub {
    font-family: var(--ns-display);
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.7);
    max-width: 720px;
    margin: 1rem 0 0;
}

/* Sticky stage */
.ns-stage-wrap { position: relative; }
.ns-stage-wrap__inner {
    position: sticky;
    top: calc(var(--header-height, 90px) + 20px);
}
.ns-stage-wrap::after {
    content: '';
    display: block;
    height: 50vh;
}

/* ── Shell ─────────────────────────────────────────────── */
.ns-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(43, 168, 158, 0.35);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(43, 168, 158, 0.08),
        0 0 24px rgba(43, 168, 158, 0.18),
        0 0 64px rgba(43, 168, 158, 0.12),
        0 24px 64px rgba(0, 0, 0, 0.4);
}

/* ── Top label strip ────────────────────────────────────── */
.ns-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--ns-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.ns-head__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ns-cyan);
    box-shadow: 0 0 12px var(--ns-cyan);
}

.ns-head__spacer { flex: 1; }

.ns-head__sub {
    color: rgba(255, 255, 255, 0.35);
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* ── Body ───────────────────────────────────────────────── */
.ns-body { padding: 60px 56px 32px; }

/* ── Search bar ─────────────────────────────────────────── */
.ns-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    transition: border-color 0.4s, box-shadow 0.4s, background 0.4s;
}

.ns-bar.is-active {
    border-color: rgba(43, 168, 158, 0.55);
    background: rgba(43, 168, 158, 0.03);
    box-shadow: 0 0 0 6px rgba(43, 168, 158, 0.06);
}

.ns-bar__icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-bar__icon svg {
    width: 18px; height: 18px;
    stroke: var(--ns-cyan);
    fill: none;
    stroke-width: 1.6;
}

.ns-bar__text {
    flex: 1;
    font-size: 22px;
    font-family: var(--ns-display);
    font-weight: 300;
    letter-spacing: -0.4px;
    color: rgba(255, 255, 255, 0.95);
    min-height: 30px;
    position: relative;
}

.ns-bar__cursor {
    display: inline-block;
    width: 2px;
    height: 22px;
    background: var(--ns-cyan);
    margin-left: 2px;
    vertical-align: -3px;
    animation: ns-blink 0.7s infinite;
}

@keyframes ns-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.ns-bar__typo {
    text-decoration: line-through;
    text-decoration-color: rgba(220, 38, 38, 0.7);
    text-decoration-thickness: 1.5px;
    color: rgba(255, 255, 255, 0.55);
}

.ns-bar__corrected {
    color: var(--ns-cyan);
}

.ns-bar__meta {
    position: absolute;
    right: 28px;
    font-family: var(--ns-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s;
}

.ns-bar__meta.is-show { opacity: 1; }

.ns-bar__meta-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--ns-cyan);
    animation: ns-pulse 1.2s ease-in-out infinite;
}

@keyframes ns-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.6); }
}

/* ── Correction line ────────────────────────────────────── */
.ns-correction {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-left: 28px;
    font-family: var(--ns-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s, transform 0.4s;
    min-height: 22px;
}

.ns-correction.is-show { opacity: 1; transform: translateY(0); }

.ns-correction__typo { color: rgba(255, 255, 255, 0.7); }
.ns-correction__arrow { color: var(--ns-cyan); }
.ns-correction__fixed { color: var(--ns-cyan); }

.ns-correction__tag {
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 7px;
    border: 1px solid rgba(43, 168, 158, 0.3);
    background: rgba(43, 168, 158, 0.06);
    color: var(--ns-cyan);
    border-radius: 999px;
}

/* ── Intent chips ───────────────────────────────────────── */
.ns-intent {
    margin-top: 22px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.ns-intent__lbl {
    font-family: var(--ns-mono);
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-right: 4px;
}

.ns-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: -0.1px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px) scale(0.92);
    transition: opacity 0.35s, transform 0.35s;
}

.ns-chip.is-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ns-chip__dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--ns-cyan);
}

/* ── Results grid ───────────────────────────────────────── */
.ns-results {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ns-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s, transform 0.4s, border-color 0.3s, background 0.3s;
}

.ns-card.is-show {
    opacity: 1;
    transform: translateY(0);
}

.ns-card--top {
    border-color: rgba(43, 168, 158, 0.4);
    background: rgba(43, 168, 158, 0.02);
}

.ns-card__art {
    aspect-ratio: 4 / 3;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ns-card__art svg {
    width: 68%;
    height: 68%;
    stroke: rgba(255, 255, 255, 0.55);
    fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ns-card--top .ns-card__art svg {
    stroke: rgba(43, 168, 158, 0.85);
}

.ns-card__score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--ns-mono);
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ns-card--top .ns-card__score {
    color: #000000;
    background: var(--ns-cyan);
    border-color: var(--ns-cyan);
}

.ns-card__rank {
    position: absolute;
    top: 10px;
    right: 12px;
    font-family: var(--ns-mono);
    font-size: 9px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
}

.ns-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ns-card__title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.25;
}

.ns-card__sub {
    font-family: var(--ns-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.4px;
}

.ns-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ns-card__tag {
    font-family: var(--ns-mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}

.ns-card--top .ns-card__tag {
    color: var(--ns-cyan);
    background: rgba(43, 168, 158, 0.08);
}

/* ── Footer — cycle indicator ───────────────────────────── */
.ns-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    gap: 12px;
}

.ns-foot__stack {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--ns-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
}

.ns-foot__dots { display: flex; gap: 6px; }

.ns-foot__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s var(--ns-ease);
}

.ns-foot__dot--active {
    background: var(--ns-cyan);
    width: 26px;
    border-radius: 999px;
}

.ns-foot__powered {
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ns-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
}

.ns-foot__powered strong {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.ns-foot__powered-sep {
    width: 12px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .ns-results { grid-template-columns: repeat(2, 1fr); }
    .ns-body { padding: 40px 24px 24px; }
    .ns-bar__text { font-size: 17px; }
    .ns-bar__meta { display: none; }
}

@media (max-width: 880px) {
    .ns-section { padding: 64px 0 80px; }
    .ns-section__container { padding: 0 1.5rem; }
    .ns-stage-wrap__inner { position: relative; top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ns-bar__cursor,
    .ns-bar__meta-dot { animation: none; }
}
