/* ============================================
   Portfolio page — clip-style demo animations
   ============================================ */

.portfolio-body { background: #fafdfa; }

.portfolio-hero {
    padding: 140px 0 60px;
    background: linear-gradient(180deg, #f0fbf2 0%, #ffffff 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(46,204,64,0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0,201,167,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.portfolio-hero .hero-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.portfolio-hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    margin-bottom: 18px;
    position: relative;
}

.portfolio-hero .highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.portfolio-hero .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 12px;
    background: var(--primary-light);
    opacity: 0.35;
    border-radius: 4px;
    z-index: -1;
}

.portfolio-subtitle {
    max-width: 640px;
    margin: 0 auto 40px;
    font-size: 1.125rem;
    color: var(--text-light);
    position: relative;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
    margin-top: 36px;
    position: relative;
}

.hero-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stats .stat-num {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.hero-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}

.active.nav-links a, .nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Filter Bar */
.filter-bar {
    padding: 30px 0 10px;
    position: sticky;
    top: 72px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Project Grid */
.projects-section { padding: 50px 0 80px; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.project-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s, opacity 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card.hidden { display: none; }

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--primary-light);
}

.card-clip {
    position: relative;
    aspect-ratio: 16 / 11;
    background: linear-gradient(135deg, #0a1f14 0%, #1B5E20 100%);
    overflow: hidden;
    cursor: pointer;
}

.card-clip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
    z-index: 2;
}

.clip-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 3;
}

.play-overlay {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.3s, opacity 0.3s, background 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.play-overlay svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-dark);
    margin-left: 4px;
}

.card-clip:hover .play-overlay { transform: scale(1.1); background: var(--primary); }
.card-clip:hover .play-overlay svg { fill: white; }

.card-clip.playing .play-overlay { opacity: 0; pointer-events: none; }
.card-clip.playing .clip-duration { opacity: 0.4; }

.card-meta { padding: 22px 24px 24px; }
.card-meta h3 { font-size: 1.25rem; margin-bottom: 8px; }
.card-meta p { color: var(--text-light); font-size: 0.95rem; line-height: 1.55; margin-bottom: 14px; }

.tech-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tech-row span {
    font-size: 0.72rem;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ============================================
   Frames: phone, browser, terminal
   ============================================ */

.clip-frame {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Phone frame */
.phone-frame {
    width: 200px;
    height: calc(100% - 24px);
    margin: 12px auto;
    background: #0a1f14;
    border-radius: 24px;
    padding: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}

.phone-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 14px;
    background: #000;
    border-radius: 8px;
    z-index: 2;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    padding: 20px 12px 8px;
}

/* Browser frame */
.browser-frame {
    width: calc(100% - 32px);
    height: calc(100% - 24px);
    margin: 12px 16px;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.browser-bar {
    height: 28px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
}

.browser-bar .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.browser-bar .dot.r { background: #ff5f57; }
.browser-bar .dot.y { background: #ffbd2e; }
.browser-bar .dot.g { background: #28c940; }

.url-bar {
    margin-left: 14px;
    padding: 2px 12px;
    background: #1a1a1a;
    color: #888;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    flex: 1;
    text-align: center;
    max-width: 70%;
}

.browser-screen {
    width: 100%;
    height: calc(100% - 28px);
    background: #fff;
    overflow: hidden;
    position: relative;
}

/* Terminal frame */
.terminal-frame {
    width: calc(100% - 32px);
    height: calc(100% - 24px);
    margin: 12px 16px;
    background: #0d1117;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.term-bar {
    height: 28px;
    background: #161b22;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
}
.term-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.term-bar .dot.r { background: #ff5f57; }
.term-bar .dot.y { background: #ffbd2e; }
.term-bar .dot.g { background: #28c940; }
.term-title {
    margin-left: 14px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    flex: 1;
    text-align: center;
}

.term-screen {
    padding: 14px 16px;
    height: calc(100% - 28px);
    color: #c9d1d9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    overflow: hidden;
}

/* ============================================
   Common animation helper — clip plays on .playing
   ============================================ */

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulseDot { 0%,100% { opacity: 0.3; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes scanMove { 0% { top: 0; } 100% { top: 100%; } }
@keyframes barFill { from { width: 0; } }
@keyframes drawLine { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }

/* ============================================
   yesJo
   ============================================ */
.demo-yesjo { background: linear-gradient(180deg, #f8fdf8 0%, #fff 100%); }

.yesjo-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px; }
.yesjo-greet { font-size: 0.7rem; font-weight: 700; color: #0f172a; }
.yesjo-bell { width: 14px; height: 14px; border-radius: 50%; background: var(--primary-bg); }

.yesjo-search {
    margin-top: 8px;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.6rem;
    color: #94a3b8;
}

.yesjo-cats { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.cat-pill {
    font-size: 0.55rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
}

.yesjo-task {
    margin-top: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    align-items: center;
}

.task-title-line { height: 6px; width: 70%; background: #cbd5e1; border-radius: 3px; }
.task-meta-line { height: 4px; width: 50%; background: #e2e8f0; border-radius: 2px; }
.task-price { font-size: 0.7rem; font-weight: 700; color: var(--primary-dark); grid-row: 1 / 3; }

.yesjo-tabbar {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.tab-dot.active { background: var(--primary); transform: scale(1.4); }

.playing .demo-yesjo .cat-pill { animation: fadeUp 0.4s both; }
.playing .demo-yesjo .cat-1 { animation-delay: 0.2s; }
.playing .demo-yesjo .cat-2 { animation-delay: 0.35s; }
.playing .demo-yesjo .cat-3 { animation-delay: 0.5s; }
.playing .demo-yesjo .yesjo-task { animation: fadeUp 0.5s both; }
.playing .demo-yesjo .task-1 { animation-delay: 0.7s; }
.playing .demo-yesjo .task-2 { animation-delay: 0.95s; }
.playing .demo-yesjo .task-3 { animation-delay: 1.2s; }

/* ============================================
   Pawfile
   ============================================ */
.demo-pawfile { background: linear-gradient(180deg, #fff7ed 0%, #fff 100%); }
.paw-header { font-size: 0.75rem; font-weight: 700; color: #0f172a; }
.paw-card {
    margin-top: 8px;
    padding: 8px;
    background: white;
    border: 1px solid #fde68a;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 28px 1fr 18px;
    gap: 8px;
    align-items: center;
}

.paw-avatar { width: 28px; height: 28px; border-radius: 50%; background: #fef3c7; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.paw-name { font-size: 0.7rem; font-weight: 700; }
.paw-breed { font-size: 0.55rem; color: #94a3b8; }
.paw-status {
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: white;
}
.paw-status.ok { background: var(--primary); }
.paw-status.warn { background: #f59e0b; }

.paw-section-title { font-size: 0.6rem; font-weight: 700; color: #94a3b8; margin-top: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.paw-event { font-size: 0.6rem; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.ev-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.ev-dot.dot-2 { background: #f59e0b; }

.paw-fab {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 28px; height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700;
    box-shadow: 0 4px 10px rgba(46,204,64,0.4);
}

.playing .demo-pawfile .paw-card,
.playing .demo-pawfile .paw-event { animation: fadeUp 0.4s both; }
.playing .demo-pawfile .paw-1 { animation-delay: 0.2s; }
.playing .demo-pawfile .paw-2 { animation-delay: 0.4s; }
.playing .demo-pawfile .paw-event:nth-of-type(1) { animation-delay: 0.7s; }
.playing .demo-pawfile .paw-event:nth-of-type(2) { animation-delay: 0.85s; }
.playing .demo-pawfile .paw-fab { animation: fadeUp 0.4s 1s both; }

/* ============================================
   PrettyFare
   ============================================ */
.demo-prettyfare { padding: 0; }
.pf-map { height: 100px; background: linear-gradient(180deg, #ddebfa 0%, #f5f9ff 100%); position: relative; }
.pf-map-svg { width: 100%; height: 100%; }
.pf-card {
    margin: 6px 8px 0;
    padding: 6px 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    align-items: center;
    position: relative;
}
.pf-logo {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: #0f172a;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.7rem;
    grid-row: 1 / 3;
}
.pf-logo.didi { background: #f97316; }
.pf-logo.ola { background: #84cc16; }
.pf-row { display: flex; justify-content: space-between; align-items: center; }
.pf-name { font-size: 0.68rem; font-weight: 700; }
.pf-price { font-size: 0.68rem; font-weight: 700; color: #0f172a; }
.pf-best { color: var(--primary-dark); }
.pf-eta { font-size: 0.55rem; color: #94a3b8; }

.playing .demo-prettyfare .pf-card { animation: slideRight 0.4s both; }
.playing .demo-prettyfare .pf-uber { animation-delay: 0.3s; }
.playing .demo-prettyfare .pf-didi { animation-delay: 0.5s; box-shadow: 0 0 0 2px var(--primary); }
.playing .demo-prettyfare .pf-ola { animation-delay: 0.7s; }

/* ============================================
   noJobTooSmall
   ============================================ */
.demo-njts { background: white; }
.njts-header { font-size: 0.75rem; font-weight: 700; }
.njts-step {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
    padding: 6px 8px;
    background: #f8fafc;
    border-radius: 6px;
}
.step-num {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #cbd5e1;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55rem; font-weight: 700;
}
.njts-step.active .step-num { background: var(--primary); }
.step-label { font-size: 0.6rem; }

.njts-photo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 8px; }
.photo-cell { aspect-ratio: 1; background: #e2e8f0; border-radius: 6px; }
.photo-cell.add {
    background: var(--primary-bg);
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

.njts-quotes { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.quote-bar {
    padding: 4px 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 600;
}
.quote-bar.bar-2 { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }

.playing .demo-njts .njts-step { animation: fadeUp 0.3s both; }
.playing .demo-njts .photo-cell { animation: fadeIn 0.4s both; }
.playing .demo-njts .photo-cell:nth-of-type(2) { animation-delay: 0.4s; }
.playing .demo-njts .photo-cell:nth-of-type(3) { animation-delay: 0.6s; }
.playing .demo-njts .quote-bar { animation: slideRight 0.3s both; }
.playing .demo-njts .bar-1 { animation-delay: 0.9s; }
.playing .demo-njts .bar-2 { animation-delay: 1.1s; }
.playing .demo-njts .bar-3 { animation-delay: 1.3s; }

/* ============================================
   Gia
   ============================================ */
.demo-gia { padding: 12px; height: 100%; display: flex; flex-direction: column; gap: 8px; }
.gia-msg { display: flex; gap: 6px; align-items: flex-end; }
.gia-msg.gia-user { justify-content: flex-end; }
.gia-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 700;
    font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.gia-bubble {
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    line-height: 1.45;
    max-width: 75%;
    background: #f1f5f9;
}
.gia-msg.gia-user .gia-bubble {
    background: var(--primary);
    color: white;
}
.gia-typing { display: flex; gap: 3px; }
.gia-typing span {
    width: 5px; height: 5px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pulseDot 1s infinite;
}
.gia-typing span:nth-child(2) { animation-delay: 0.2s; }
.gia-typing span:nth-child(3) { animation-delay: 0.4s; }

.gia-input {
    margin-top: auto;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 16px;
    font-size: 0.65rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gia-send {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
}

.playing .demo-gia .gia-msg { animation: fadeUp 0.4s both; }
.playing .demo-gia .msg-1 { animation-delay: 0.2s; }
.playing .demo-gia .msg-2 { animation-delay: 0.9s; }
.playing .demo-gia .msg-3 { animation-delay: 1.5s; }
.playing .demo-gia .msg-4 { animation-delay: 2.4s; }
.demo-gia .msg-3, .demo-gia .msg-4 { opacity: 0; }
.playing .demo-gia .msg-3 { opacity: 1; }
.playing .demo-gia .msg-4 { opacity: 1; }

/* ============================================
   Stitch OCR
   ============================================ */
.demo-stitch { display: grid; grid-template-columns: 1fr 1fr; gap: 0; height: 100%; }
.stitch-doc {
    padding: 16px 14px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}
.doc-line {
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin-bottom: 8px;
}
.doc-line.short { width: 60%; }
.doc-line.line-1 { width: 40%; height: 6px; background: #94a3b8; }

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 8px var(--primary);
    opacity: 0;
}
.playing .demo-stitch .scan-line {
    animation: scanMove 1.5s ease-in-out;
    opacity: 1;
}

.stitch-extract {
    padding: 14px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.extract-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    padding: 4px 6px;
    background: #f8fdf8;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
    opacity: 0;
}

.ek { color: #94a3b8; }
.ev { font-weight: 700; color: var(--primary-dark); font-family: 'JetBrains Mono', monospace; }

.playing .demo-stitch .extract-row {
    animation: slideRight 0.4s both;
}
.playing .demo-stitch .extract-row:nth-of-type(1) { animation-delay: 1.4s; }
.playing .demo-stitch .extract-row:nth-of-type(2) { animation-delay: 1.55s; }
.playing .demo-stitch .extract-row:nth-of-type(3) { animation-delay: 1.7s; }
.playing .demo-stitch .extract-row:nth-of-type(4) { animation-delay: 1.85s; }
.playing .demo-stitch .extract-row:nth-of-type(5) { animation-delay: 2s; }

/* ============================================
   Seek Scrapper terminal
   ============================================ */
.term-line { white-space: nowrap; opacity: 0; }
.term-line .prompt { color: var(--primary); margin-right: 6px; }
.term-line .ok { color: #58a6ff; margin-right: 6px; }
.term-line .ok-green { color: var(--primary); font-weight: 700; }
.term-line .hl { color: #ffa657; }

.playing .demo-seek .term-line { animation: fadeIn 0.2s forwards; }
.playing .demo-seek .term-1 { animation-delay: 0.1s; }
.playing .demo-seek .term-2 { animation-delay: 0.6s; }
.playing .demo-seek .term-3 { animation-delay: 0.9s; }
.playing .demo-seek .term-4 { animation-delay: 1.1s; }
.playing .demo-seek .term-5 { animation-delay: 1.3s; }
.playing .demo-seek .term-6 { animation-delay: 1.55s; }
.playing .demo-seek .term-7 { animation-delay: 1.8s; }
.playing .demo-seek .term-8 { animation-delay: 2.05s; }
.playing .demo-seek .term-9 { animation-delay: 2.4s; }

/* ============================================
   HubSpot Connect — flow
   ============================================ */
.demo-hubspot { padding: 14px; position: relative; height: 100%; }
.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-line { stroke: #cbd5e1; stroke-width: 1.5; fill: none; stroke-dasharray: 4 3; }
.flow-node {
    position: absolute;
    padding: 4px 8px;
    background: white;
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.n-1 { left: 14px; top: 38px; }
.n-2 { left: 14px; top: 88px; }
.n-3 { left: 14px; top: 138px; }
.n-mid { left: 50%; top: 88px; transform: translateX(-50%); background: var(--primary); color: white; }
.n-out { right: 14px; top: 88px; }

.flow-pulse {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    opacity: 0;
}
@keyframes pulseFlow1 {
    0% { left: 60px; top: 42px; opacity: 1; }
    50% { left: 160px; top: 92px; opacity: 1; }
    100% { left: 280px; top: 92px; opacity: 0; }
}
@keyframes pulseFlow2 {
    0% { left: 60px; top: 92px; opacity: 1; }
    50% { left: 160px; top: 92px; opacity: 1; }
    100% { left: 280px; top: 92px; opacity: 0; }
}
@keyframes pulseFlow3 {
    0% { left: 60px; top: 142px; opacity: 1; }
    50% { left: 160px; top: 92px; opacity: 1; }
    100% { left: 280px; top: 92px; opacity: 0; }
}

.playing .demo-hubspot .pulse-a { animation: pulseFlow1 1.4s 0.4s infinite; }
.playing .demo-hubspot .pulse-b { animation: pulseFlow2 1.4s 0.7s infinite; }
.playing .demo-hubspot .pulse-c { animation: pulseFlow3 1.4s 1s infinite; }

/* ============================================
   Driver onboarding
   ============================================ */
.demo-driver { padding: 14px; }
.driver-progress { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; }
.dp-step {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700;
}
.dp-step.done { background: var(--primary); color: white; }
.dp-step.active { background: white; color: var(--primary); border: 2px solid var(--primary); }

.dp-bar { flex: 1; height: 2px; background: #e2e8f0; position: relative; overflow: hidden; }
.dp-fill { display: block; width: 0; height: 100%; background: var(--primary); }
.playing .demo-driver .dp-fill { animation: barFill 0.6s 0.3s both; width: 100%; }
.playing .demo-driver .dp-fill-2 { animation-delay: 0.7s; }

.driver-section { font-size: 0.7rem; font-weight: 700; margin-bottom: 8px; }
.driver-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.upload-card {
    padding: 10px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    position: relative;
}
.upload-card.scanning { border-color: var(--primary); background: var(--primary-bg); }
.upload-icon { font-size: 1.2rem; }
.upload-text { font-size: 0.55rem; color: #475569; margin-top: 4px; }
.upload-status { font-size: 0.55rem; color: var(--primary-dark); font-weight: 700; margin-top: 2px; }
.upload-bar {
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.upload-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary);
}
.playing .demo-driver .upload-bar span { animation: barFill 1.5s 0.6s both; width: 100%; }

.driver-checks { display: flex; flex-direction: column; gap: 4px; }
.check { font-size: 0.6rem; padding: 4px 6px; border-radius: 4px; }
.check.ok { background: var(--primary-bg); color: var(--primary-dark); }
.check.pending { background: #fef3c7; color: #92400e; }

.playing .demo-driver .check { animation: slideRight 0.3s both; }
.playing .demo-driver .check:nth-of-type(1) { animation-delay: 0.5s; }
.playing .demo-driver .check:nth-of-type(2) { animation-delay: 1s; }
.playing .demo-driver .check:nth-of-type(3) { animation-delay: 1.5s; }

/* ============================================
   Restorafloor
   ============================================ */
.demo-restora { padding: 14px; background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.restora-hero { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.restora-title { font-size: 0.8rem; font-weight: 800; }
.restora-cta { font-size: 0.6rem; padding: 4px 10px; background: #92400e; color: white; border-radius: 6px; font-weight: 700; }

.restora-quoter { background: white; padding: 12px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.rq-step { margin-bottom: 10px; }
.rq-label { font-size: 0.6rem; color: #94a3b8; font-weight: 600; margin-bottom: 4px; }
.rq-pills { display: flex; gap: 4px; }
.rq-pill {
    font-size: 0.6rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}
.rq-pill.active { background: #92400e; color: white; }

.rq-slider {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    position: relative;
    margin: 8px 0;
}
.rq-thumb {
    position: absolute;
    width: 12px; height: 12px;
    background: #92400e;
    border-radius: 50%;
    top: -4px;
    left: 0;
}
.playing .demo-restora .rq-thumb { animation: rqMove 1.5s 0.4s both; }
@keyframes rqMove { from { left: 0; } to { left: 65%; } }

.rq-value { font-size: 0.65rem; font-weight: 700; color: #92400e; }
.rq-result {
    margin-top: 12px;
    padding: 10px;
    background: #fef3c7;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rq-result-label { font-size: 0.6rem; color: #92400e; }
.rq-result-price { font-size: 1.1rem; font-weight: 800; color: #92400e; }

/* ============================================
   Claud Estra
   ============================================ */
.demo-estra { padding: 14px; }
.estra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.estra-listing { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.estra-img { aspect-ratio: 16/9; background: linear-gradient(135deg, #ddebfa 0%, #c7d2fe 100%); }
.l-2 .estra-img { background: linear-gradient(135deg, #fbcfe8 0%, #fdba74 100%); }
.l-3 .estra-img { background: linear-gradient(135deg, #d9f99d 0%, #86efac 100%); }
.l-4 .estra-img { background: linear-gradient(135deg, #fde68a 0%, #fdba74 100%); }
.estra-price { font-size: 0.75rem; font-weight: 800; padding: 4px 8px 0; }
.estra-addr { font-size: 0.55rem; color: #94a3b8; padding: 0 8px 6px; }

.estra-ai-tag {
    margin-top: 12px;
    padding: 6px 10px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: white;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.playing .demo-estra .estra-listing { animation: fadeUp 0.4s both; }
.playing .demo-estra .l-1 { animation-delay: 0.2s; }
.playing .demo-estra .l-2 { animation-delay: 0.35s; }
.playing .demo-estra .l-3 { animation-delay: 0.5s; }
.playing .demo-estra .l-4 { animation-delay: 0.65s; }
.playing .demo-estra .estra-ai-tag { animation: fadeIn 0.6s 0.9s both; }

/* ============================================
   Admin AI Voice Assist
   ============================================ */
.demo-voice {
    padding: 14px;
    background: linear-gradient(180deg, #0a1f14 0%, #061210 100%);
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.va-mic {
    position: relative;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(46,204,64,0.45);
    margin-top: 4px;
    margin-bottom: 8px;
}
.va-mic-icon {
    color: white;
    width: 26px; height: 26px;
    z-index: 2;
}
.va-mic-icon svg { width: 100%; height: 100%; }

.va-mic-pulse, .va-mic-pulse-2 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
}
.playing .demo-voice .va-mic-pulse { animation: vaMicPulse 1.6s infinite; }
.playing .demo-voice .va-mic-pulse-2 { animation: vaMicPulse 1.6s 0.7s infinite; }
@keyframes vaMicPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}

.va-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    margin: 4px 0 10px;
}
.va-wave span {
    display: block;
    width: 3px;
    background: var(--primary-light);
    border-radius: 2px;
    height: 4px;
    opacity: 0.7;
}
.playing .demo-voice .va-wave span {
    animation: vaWave 0.9s ease-in-out infinite;
}
.playing .demo-voice .va-wave span:nth-child(1)  { animation-delay: 0.00s; }
.playing .demo-voice .va-wave span:nth-child(2)  { animation-delay: 0.06s; }
.playing .demo-voice .va-wave span:nth-child(3)  { animation-delay: 0.12s; }
.playing .demo-voice .va-wave span:nth-child(4)  { animation-delay: 0.18s; }
.playing .demo-voice .va-wave span:nth-child(5)  { animation-delay: 0.24s; }
.playing .demo-voice .va-wave span:nth-child(6)  { animation-delay: 0.30s; }
.playing .demo-voice .va-wave span:nth-child(7)  { animation-delay: 0.36s; }
.playing .demo-voice .va-wave span:nth-child(8)  { animation-delay: 0.42s; }
.playing .demo-voice .va-wave span:nth-child(9)  { animation-delay: 0.48s; }
.playing .demo-voice .va-wave span:nth-child(10) { animation-delay: 0.54s; }
.playing .demo-voice .va-wave span:nth-child(11) { animation-delay: 0.60s; }
.playing .demo-voice .va-wave span:nth-child(12) { animation-delay: 0.66s; }
@keyframes vaWave {
    0%, 100% { height: 4px; opacity: 0.5; }
    50%      { height: 26px; opacity: 1; }
}

.va-transcript {
    text-align: center;
    color: #d4d4d8;
    font-size: 0.72rem;
    line-height: 1.4;
    min-height: 18px;
    margin-bottom: 10px;
}
.va-word { opacity: 0; margin-right: 3px; }
.playing .demo-voice .va-word { animation: fadeIn 0.2s both; }
.playing .demo-voice .w-1 { animation-delay: 0.5s; }
.playing .demo-voice .w-2 { animation-delay: 0.7s; }
.playing .demo-voice .w-3 { animation-delay: 0.9s; }
.playing .demo-voice .w-4 { animation-delay: 1.1s; }
.playing .demo-voice .w-5 { animation-delay: 1.3s; }
.playing .demo-voice .w-6 { animation-delay: 1.5s; }

.va-result {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.va-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border-left: 2px solid #f59e0b;
    border-radius: 3px;
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    color: #d4d4d8;
    opacity: 0;
}
.va-amt { color: var(--primary-light); font-weight: 700; }

.playing .demo-voice .va-row { animation: slideRight 0.3s both; }
.playing .demo-voice .va-r1 { animation-delay: 1.9s; }
.playing .demo-voice .va-r2 { animation-delay: 2.05s; }
.playing .demo-voice .va-r3 { animation-delay: 2.2s; }

/* ============================================
   Lean Bike Sim
   ============================================ */
.demo-leanbike { padding: 14px; background: linear-gradient(180deg, #0a1f14 0%, #061210 100%); color: white; }
.bike-stage { aspect-ratio: 16/9; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 8px; }
.bike-svg { width: 100%; height: 100%; }
.bike-rider { transform-origin: 90px 80px; }
.playing .demo-leanbike .bike-rider { animation: leanRider 1.4s ease-in-out infinite alternate; }
@keyframes leanRider {
    from { transform: rotate(-12deg); }
    to { transform: rotate(12deg); }
}

.bike-stats { display: flex; justify-content: space-between; margin-top: 10px; gap: 6px; }
.bs { background: rgba(255,255,255,0.06); padding: 6px 8px; border-radius: 6px; flex: 1; text-align: center; }
.bs-l { display: block; font-size: 0.55rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.bs-v { display: block; font-size: 0.85rem; font-weight: 800; color: var(--primary-light); font-family: 'JetBrains Mono', monospace; }

.bike-graph { margin-top: 10px; height: 36px; background: rgba(255,255,255,0.04); border-radius: 6px; padding: 4px; }
.bike-graph svg { width: 100%; height: 100%; }
.bike-trace { stroke-dasharray: 600; stroke-dashoffset: 600; }
.playing .demo-leanbike .bike-trace { animation: drawTrace 2s 0.4s forwards; }
@keyframes drawTrace { to { stroke-dashoffset: 0; } }

/* ============================================
   Apollo Visualizer
   ============================================ */
.demo-apollo { padding: 14px; background: linear-gradient(180deg, #f8fdf8 0%, #fff 100%); }
.apollo-svg { width: 100%; height: calc(100% - 30px); }
.apollo-nodes circle { transform-origin: center; }
.playing .demo-apollo .apollo-nodes circle { animation: pulseDot 2s infinite; }
.playing .demo-apollo .apollo-nodes circle:nth-child(2) { animation-delay: 0.2s; }
.playing .demo-apollo .apollo-nodes circle:nth-child(3) { animation-delay: 0.4s; }
.playing .demo-apollo .apollo-nodes circle:nth-child(4) { animation-delay: 0.6s; }
.playing .demo-apollo .apollo-nodes circle:nth-child(5) { animation-delay: 0.8s; }
.playing .demo-apollo .apollo-nodes circle:nth-child(6) { animation-delay: 1s; }

.apollo-edges line { stroke-dasharray: 200; stroke-dashoffset: 200; }
.playing .demo-apollo .apollo-edges line { animation: drawEdge 1.5s 0.3s forwards; }
.playing .demo-apollo .apollo-edges line:nth-child(2) { animation-delay: 0.45s; }
.playing .demo-apollo .apollo-edges line:nth-child(3) { animation-delay: 0.6s; }
.playing .demo-apollo .apollo-edges line:nth-child(4) { animation-delay: 0.75s; }
.playing .demo-apollo .apollo-edges line:nth-child(5) { animation-delay: 0.9s; }
.playing .demo-apollo .apollo-edges line:nth-child(6) { animation-delay: 1.05s; }
@keyframes drawEdge { to { stroke-dashoffset: 0; } }

.apollo-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    font-size: 0.6rem;
    color: #475569;
    margin-top: 4px;
}
.apollo-legend i {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.lg-1 { background: var(--primary-dark); }
.lg-2 { background: var(--primary); }
.lg-3 { background: var(--accent); }

/* ============================================
   Warehouse Optimo
   ============================================ */
.demo-warehouse { padding: 14px; position: relative; height: 100%; background: #f8fafc; }
.wh-grid {
    position: absolute;
    inset: 14px 14px 70px 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
}
.wh-cell {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
}
.wh-c1, .wh-c5, .wh-c9 { background: var(--primary-bg); border-color: var(--primary); }

.wh-route {
    position: absolute;
    inset: 14px 14px 70px 14px;
    pointer-events: none;
}
.wh-route-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}
.playing .demo-warehouse .wh-route-line { animation: drawTrace 1.6s 0.4s forwards; }

.wh-bot { display: none; }

.wh-stats {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
}
.ws {
    flex: 1;
    background: white;
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.ws span { display: block; font-size: 0.5rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.ws strong { display: block; font-size: 0.75rem; font-weight: 800; color: #0f172a; font-family: 'JetBrains Mono', monospace; }
.ws-up { color: var(--primary-dark) !important; }

/* ============================================
   Placeit
   ============================================ */
.demo-placeit { display: grid; grid-template-columns: 1fr 1fr; height: 100%; gap: 0; }
.pi-map {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    position: relative;
    overflow: hidden;
}
.pi-pin {
    position: absolute;
    width: 14px; height: 14px;
    background: var(--primary);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.pi-1 { top: 25%; left: 30%; }
.pi-2 { top: 50%; left: 60%; background: var(--accent); }
.pi-3 { top: 70%; left: 25%; background: #f59e0b; }
.pi-4 { top: 35%; left: 75%; background: #f59e0b; }

.pi-heat {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(46,204,64,0.4) 0%, transparent 60%);
    opacity: 0;
}
.playing .demo-placeit .pi-heat { animation: fadeIn 1s 0.4s both; }
.playing .demo-placeit .pi-pin { animation: pinDrop 0.5s both; }
.playing .demo-placeit .pi-1 { animation-delay: 0.2s; }
.playing .demo-placeit .pi-2 { animation-delay: 0.35s; }
.playing .demo-placeit .pi-3 { animation-delay: 0.5s; }
.playing .demo-placeit .pi-4 { animation-delay: 0.65s; }
@keyframes pinDrop {
    from { transform: rotate(-45deg) translateY(-30px); opacity: 0; }
    to { transform: rotate(-45deg) translateY(0); opacity: 1; }
}

.pi-panel { padding: 14px; background: white; display: flex; flex-direction: column; gap: 10px; }
.pi-row { display: flex; justify-content: space-between; align-items: center; }
.pi-row-active { background: var(--primary-bg); padding: 8px; border-radius: 6px; margin: -8px; margin-bottom: 0; }
.pi-label { font-size: 0.6rem; color: #475569; }
.pi-val { font-size: 1rem; font-weight: 800; color: var(--primary-dark); }

.pi-bar { width: 60%; height: 4px; background: #f1f5f9; border-radius: 2px; overflow: hidden; }
.pi-bar-fill { display: block; height: 100%; background: var(--primary); width: 0; }
.playing .demo-placeit .f1 { animation: barFill 1s 0.7s both; width: 75%; }
.playing .demo-placeit .f2 { animation: barFill 1s 0.85s both; width: 40%; }
.playing .demo-placeit .f3 { animation: barFill 1s 1s both; width: 60%; }

/* ============================================
   yesjo.au demo
   ============================================ */
.demo-au { padding: 0; background: white; }
.au-nav {
    height: 24px;
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}
.au-logo { width: 30px; height: 14px; background: var(--primary); border-radius: 3px; }
.au-links { display: flex; gap: 6px; }
.au-links span { width: 18px; height: 4px; background: #cbd5e1; border-radius: 2px; }

.au-hero { padding: 16px 14px; }
.au-tag {
    display: inline-block;
    font-size: 0.55rem;
    padding: 2px 8px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 6px;
}
.au-h1 { font-size: 0.95rem; font-weight: 800; }
.au-sub { height: 4px; background: #cbd5e1; border-radius: 2px; margin-top: 6px; width: 90%; }
.au-sub.short { width: 70%; margin-top: 3px; }

.au-cta-row { margin-top: 8px; display: flex; gap: 6px; }
.au-cta-prim { font-size: 0.55rem; padding: 4px 10px; background: var(--primary); color: white; border-radius: 6px; font-weight: 700; }
.au-cta-sec { font-size: 0.55rem; padding: 4px 10px; border: 1px solid var(--primary); color: var(--primary); border-radius: 6px; font-weight: 700; }

.au-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 14px 14px; }
.au-svc { aspect-ratio: 1; background: var(--primary-bg); border-radius: 6px; }

.playing .demo-au .au-tag { animation: fadeUp 0.3s 0.2s both; }
.playing .demo-au .au-h1 { animation: fadeUp 0.4s 0.4s both; }
.playing .demo-au .au-sub { animation: fadeUp 0.3s 0.6s both; }
.playing .demo-au .au-sub.short { animation: fadeUp 0.3s 0.7s both; }
.playing .demo-au .au-cta-row { animation: fadeUp 0.3s 0.9s both; }
.playing .demo-au .au-svc { animation: fadeUp 0.3s both; }
.playing .demo-au .au-svc:nth-of-type(1) { animation-delay: 1.1s; }
.playing .demo-au .au-svc:nth-of-type(2) { animation-delay: 1.25s; }
.playing .demo-au .au-svc:nth-of-type(3) { animation-delay: 1.4s; }

/* ============================================
   CTA block
   ============================================ */
.cta-block {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.cta-block h2 { color: white; margin-bottom: 12px; }
.cta-block p { color: rgba(255,255,255,0.8); margin-bottom: 24px; font-size: 1.1rem; }

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 768px) {
    .portfolio-hero { padding: 110px 0 40px; }
    .hero-stats { gap: 28px; }
    .hero-stats .stat-num { font-size: 1.8rem; }
    .projects-grid { grid-template-columns: 1fr; gap: 20px; }
    .filter-bar { top: 64px; }
}
