/* Viewport sections for scrolling beats */
.section {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 160px 0 100px;
    position: relative;
}

.section.compact { min-height: auto; }

.hero {
    padding-top: 180px;
}

.hero-grid,
.split-grid,
.two-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    gap: 40px;
    align-items: center;
}

.two-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eyebrow,
.status-pill,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 14px;
}

/* Cinematic Structural Act Markers (binj.com layout style) */
.act-marker {
    display: block;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.85rem;
    color: var(--muted);
    opacity: 0.7;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 700;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3), 0 0 10px rgba(16, 185, 129, 0.45);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0), 0 0 10px rgba(16, 185, 129, 0.45); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 0 10px rgba(16, 185, 129, 0.45); }
}

h1,
h2,
h3 {
    margin: 0;
    font-family: Inter, sans-serif;
    letter-spacing: -0.03em;
    line-height: 0.98;
}

h1 {
    margin-top: 16px;
    max-width: 880px;
    font-size: clamp(3.8rem, 6.5vw, 6.8rem);
    font-weight: 900;
}

h2 {
    max-width: 860px;
    font-size: clamp(2.4rem, 4.6vw, 4.2rem);
    font-weight: 900;
    line-height: 1.05;
}

h3 {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(90deg, #fff, var(--blue) 45%, var(--green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    max-width: 680px;
    margin: 26px 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    line-height: 1.62;
}

.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.metric {
    min-width: 160px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.metric:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.metric strong {
    display: block;
    color: #fff;
    font-family: Inter, sans-serif;
    font-size: 1.4rem;
    line-height: 1.1;
}

.metric span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Enhanced card styling matching binj.com layouts */
.panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: var(--panel);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.04) 42%, transparent 58%);
    transform: translateX(-140%);
    animation: panelSheen 10s var(--ease) infinite;
}

@keyframes panelSheen {
    0%, 55% { transform: translateX(-140%); opacity: 0; }
    65% { opacity: 1; }
    85%, 100% { transform: translateX(140%); opacity: 0; }
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-body { padding: 20px; }

/* Rotate setup dynamically updated by scroll progression */
.sandbox {
    overflow: hidden;
    transform: rotate(calc(-1.2deg + (var(--sec-progress, 0) * 1.2deg)));
    transition: transform 0.1s linear;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 20px;
    top: 50%;
    width: 24px;
    transform: translateY(-50%);
    color: var(--blue);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    outline: none;
    color: #fff;
    background: rgba(4, 7, 16, 0.65);
    transition: all 260ms var(--ease);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(4, 7, 16, 0.8);
}

.search-input {
    height: 66px;
    padding: 0 20px 0 56px;
    font-size: 1.15rem;
    font-weight: 800;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.result-column {
    /* Fixed height prevents the sandbox from resizing as results appear/disappear.
       overflow:hidden clips the itemRise animation without layout reflow. */
    height: 340px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.015);
    /* contain layout so inner changes never bubble to the page */
    contain: layout style;
}

.column-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.latency {
    color: var(--green);
    font-variant-numeric: tabular-nums;
}

.result-item,
.rank-item,
.facet-result {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    background: rgba(3, 5, 12, 0.5);
    transition: transform 420ms var(--ease), border-color 240ms var(--ease), background 240ms var(--ease);
    animation: itemRise 480ms var(--ease) both;
    /* GPU-composited animation — no layout recalculation on every frame */
    will-change: transform, opacity;
}

@keyframes itemRise {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-item:hover,
.rank-item:hover,
.facet-result:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.035);
}

.item-title {
    font-weight: 900;
    color: #fff;
}

mark {
    border-radius: 4px;
    padding: 0 3px;
    color: #06111c;
    background: linear-gradient(135deg, var(--green), var(--blue));
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.match-pill {
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.16);
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.06);
    font-variant-numeric: tabular-nums;
}

.empty {
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   Landing polish layer — hero treatment, page chrome, motion
═══════════════════════════════════════════════════════════ */

/* Cinematic hero title: living gradient sweep + soft depth glow */
.hero h1 {
    background: linear-gradient(
        110deg,
        #ffffff 0%,
        #cdd9ff 28%,
        #ffffff 48%,
        #bff0d3 68%,
        #ffffff 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
    filter: drop-shadow(0 12px 46px rgba(120, 160, 255, 0.16));
    animation: heroShimmer 11s linear infinite;
}

@keyframes heroShimmer {
    to { background-position: 220% center; }
}

.hero .lead { opacity: 0.92; }

/* Top scroll-progress meter — driven by landing_page.js */
.scroll-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 200;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--blue), var(--green) 70%, var(--purple));
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    pointer-events: none;
    will-change: transform;
}

[dir="rtl"] .scroll-progress { transform-origin: 100% 50%; }

/* Nav scrollspy — highlight the section currently in view */
.navlinks a.active {
    color: #fff;
    border-color: var(--border);
    background: rgba(99, 102, 241, 0.1);
}

/* Whisper-thin luminous seam between scrolling acts */
.section + .section:not(.compact)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, calc(100vw - 48px));
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.28), transparent);
    pointer-events: none;
}

/* Respect users who prefer calm interfaces */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-element {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

