html,
body {
    background: #0a0b0f;
}

::selection {
    background: #5b9dff;
    color: #0a0b0f;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0b0f;
}

::-webkit-scrollbar-thumb {
    background: #232734;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2f3547;
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

.grad {
    background: linear-gradient(100deg, #5b9dff 0%, #9b8cff 55%, #7ef0c3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.grid-bg {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 50% 35%, black 0%, transparent 72%);
    mask-image: radial-gradient(circle at 50% 35%, black 0%, transparent 72%);
}

/* faint diagonal hatch so empty video slots don't look broken */
.slot {
    background-image:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 10px, transparent 10px 20px);
}

.card-glow {
    transition: transform .4s cubic-bezier(.2, .7, .2, 1), border-color .4s, box-shadow .4s;
}

.card-glow:hover {
    transform: translateY(-4px);
    border-color: rgba(91, 157, 255, .45);
    box-shadow: 0 24px 60px -28px rgba(91, 157, 255, .45);
}

.play-btn {
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), background .35s;
}

.demo-card:hover .play-btn {
    transform: scale(1.08);
    background: #5b9dff;
}

.demo-card:hover .play-btn svg {
    color: #0a0b0f;
}

.nav-shrink {
    backdrop-filter: blur(14px);
    background: rgba(10, 11, 15, .78);
    border-bottom: 1px solid #1a1e29;
}

@keyframes floaty {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-9px)
    }
}

.floaty {
    animation: floaty 7s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .25
    }
}

.live-dot {
    animation: pulseDot 1.6s ease-in-out infinite;
}

.chip {
    border: 1px solid #232734;
    background: #12141b;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none;
    }

    .floaty {
        animation: none;
    }
}


/* ===== additions for the automation & AI portfolio ===== */

body {
    overflow-x: hidden;
}

:focus-visible {
    outline: 2px solid #5b9dff;
    outline-offset: 3px;
    border-radius: 6px;
}

/* --- nav --- */
#nav.scrolled {
    backdrop-filter: blur(14px);
    background: rgba(10, 11, 15, .78);
    border-bottom: 1px solid #1a1e29;
}

/* --- marquee --- */
.marquee {
    width: max-content;
    animation: marquee 28s linear infinite;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- carousel --- */
.carousel-viewport { cursor: grab; }
.carousel-viewport.dragging { cursor: grabbing; }

.car-slide {
    width: min(84vw, 420px);
}

@media (min-width: 640px) {
    .car-slide { width: 420px; }
}

.car-slide video,
.car-slide img {
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.car-slide:hover video,
.car-slide:hover img {
    transform: scale(1.04);
}

.car-slide.is-active {
    border-color: rgba(91, 157, 255, .45);
}

.car-dot {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: #232734;
    transition: background .3s, width .3s;
}

.car-dot.on {
    background: #5b9dff;
    width: 40px;
}

/* --- lightbox --- */
#lightbox.open { display: flex; }

@media (prefers-reduced-motion: reduce) {
    .marquee { animation: none; }

    .car-slide:hover video,
    .car-slide:hover img { transform: none; }
}

/* continuous carousel: soften the edges so slides drift in and out */
.carousel-viewport {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 5%, black 95%, transparent 100%);
    touch-action: pan-y;
}

.carousel-track {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* ===== additions for devchat ===== */

.chip-lime  { border-color: rgba(126,240,195,.35); background: rgba(126,240,195,.07); color:#7ef0c3; }
.chip-amber { border-color: rgba(255,196,107,.35); background: rgba(255,196,107,.07); color:#ffc46b; }
.chip-rose  { border-color: rgba(255,138,138,.35); background: rgba(255,138,138,.07); color:#ff8a8a; }
.chip-blue  { border-color: rgba(91,157,255,.35);  background: rgba(91,157,255,.07);  color:#5b9dff; }

/* score meter */
.meter {
    height: 6px;
    border-radius: 999px;
    background: #1a1e29;
    overflow: hidden;
}
.meter > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #5b9dff, #9b8cff);
    width: 0;
    transition: width .8s cubic-bezier(.2,.7,.2,1);
}
.meter.good > span { background: linear-gradient(90deg, #5b9dff, #7ef0c3); }
.meter.warn > span { background: linear-gradient(90deg, #ffc46b, #ff8a8a); }

/* tabs */
.tab {
    border: 1px solid #232734;
    background: #12141b;
    color: #7b8394;
    transition: color .25s, border-color .25s, background .25s;
}
.tab:hover { color: #c7cdd9; border-color: #2f3547; }
.tab.on {
    color: #0a0b0f;
    background: #5b9dff;
    border-color: #5b9dff;
    font-weight: 600;
}

/* assumption chain rail */
.chain { position: relative; padding-left: 26px; }
.chain::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, #5b9dff, rgba(155,140,255,.25));
}
.chain-node { position: relative; }
.chain-node::before {
    content: '';
    position: absolute;
    left: -23px; top: 7px;
    width: 9px; height: 9px;
    border-radius: 999px;
    background: #0a0b0f;
    border: 2px solid #5b9dff;
}

/* region bars */
.region-row { display: grid; grid-template-columns: 1fr 88px; gap: 14px; align-items: center; }

/* textarea */
textarea.idea-input {
    resize: vertical;
    min-height: 84px;
}

/* results fade — one deliberate entrance, not per-card */
.result-enter { animation: resultIn .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes resultIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* busy button */
.busy { position: relative; color: transparent !important; pointer-events: none; }
.busy::after {
    content: '';
    position: absolute; inset: 0; margin: auto;
    width: 16px; height: 16px;
    border: 2px solid rgba(10,11,15,.35);
    border-top-color: #0a0b0f;
    border-radius: 999px;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .result-enter { animation: none; }
    .meter > span { transition: none; }
}

/* ===== additions for docs ===== */

/* search */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.result-row { transition: background .15s; }
.result-row.on,
.result-row:hover { background: rgba(91, 157, 255, .08); }
.result-row.on { box-shadow: inset 2px 0 0 #5b9dff; }

mark.hl {
    background: rgba(91, 157, 255, .22);
    color: #fff;
    border-radius: 4px;
    padding: 0 2px;
}

/* rows & small buttons */
.row-item { transition: border-color .25s, background .25s; }
.row-item:hover { border-color: rgba(91, 157, 255, .35); background: rgba(18, 20, 27, .95); }

.row-item.flash { animation: flash 1.8s ease-out 1; }
@keyframes flash {
    0%, 35% { border-color: #5b9dff; box-shadow: 0 0 0 3px rgba(91, 157, 255, .25); }
    100%    { box-shadow: 0 0 0 0 rgba(91, 157, 255, 0); }
}

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 10px;
    border: 1px solid #232734;
    background: rgba(255, 255, 255, .03);
    color: #7b8394;
    transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: #fff; border-color: rgba(91, 157, 255, .5); }
.icon-btn.primary:hover { color: #0a0b0f; background: #5b9dff; border-color: #5b9dff; }
.icon-btn.danger:hover { color: #ff8a8a; border-color: rgba(255, 138, 138, .5); background: rgba(255, 138, 138, .06); }
.icon-btn:disabled,
.icon-btn:disabled:hover { opacity: .35; cursor: not-allowed; color: #7b8394; border-color: #232734; background: transparent; }
.icon-btn svg { width: 16px; height: 16px; }

@media (hover: hover) {
    .row-actions { opacity: 0; transition: opacity .2s; }
    .group:hover .row-actions,
    .group:focus-within .row-actions { opacity: 1; }
}

/* type tiles */
.type-tile {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 12px; border: 1px solid;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.type-tile.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 8px; }
.chip-violet { border-color: rgba(155,140,255,.35); background: rgba(155,140,255,.07); color:#9b8cff; }
.chip-mute   { border-color: #232734; background: rgba(255,255,255,.03); color:#7b8394; }

/* empty states reuse the hatch */
.empty-box { background-color: rgba(18, 20, 27, .5); }

/* drag & drop */
.drop-overlay { display: none; }
.drop-overlay.on { display: flex; animation: fadeIn .18s ease both; }
.drop-frame { border: 2px dashed rgba(91, 157, 255, .55); background: rgba(91, 157, 255, .04); }
.drop-overlay.blocked .drop-frame { border-color: rgba(255, 196, 107, .55); background: rgba(255, 196, 107, .04); }

/* modals */
.modal-back  { animation: fadeIn .18s ease both; }
.modal-panel { animation: resultIn .32s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

textarea.note-input {
    resize: vertical;
    min-height: 340px;
    line-height: 1.65;
    tab-size: 4;
}

/* toasts */
.toast { animation: resultIn .3s cubic-bezier(.2,.7,.2,1) both; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }

@media (prefers-reduced-motion: reduce) {
    .row-item.flash, .drop-overlay.on, .modal-back, .modal-panel, .toast { animation: none; }
}
