/* =========================================================
   Nelson.AI Portfolio MVC Stylesheet
   Full working refactor for:
   - Public homepage
   - Admin dashboard / CRUD screens
   File: public/assets/css/style.css
   ========================================================= */

:root {
    --bg: #020617;
    --bg-soft: #030712;
    --card: rgba(15, 23, 42, .88);
    --card-strong: rgba(15, 23, 42, .96);
    --line: rgba(96, 165, 250, .28);
    --line-strong: rgba(96, 165, 250, .45);
    --text: #ffffff;
    --muted: #9fb4d8;
    --muted-2: #64748b;
    --blue: #38bdf8;
    --violet: #8b5cf6;
    --green: #22c55e;
    --danger: #ef4444;
    --radius: 24px;
    --shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
    transition: .2s ease;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* =========================================================
   Public Homepage
   ========================================================= */

.site-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.page-bg {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 22%, rgba(56, 189, 248, .16), transparent 32%),
        radial-gradient(circle at 88% 70%, rgba(139, 92, 246, .22), transparent 36%),
        linear-gradient(135deg, #020617, #061226 48%, #020617);
}

.page-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .45;
    background-image:
        linear-gradient(rgba(56, 189, 248, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, .055) 1px, transparent 1px);
    background-size: 42px 42px;
}

.top-nav {
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
}

.logo span {
    color: var(--violet);
}

.menu {
    display: flex;
    gap: 34px;
    color: #dbeafe;
    font-size: 15px;
}

.menu a:hover,
.menu a.active {
    color: var(--blue);
}

.chat-btn {
    border: 1px solid rgba(139, 92, 246, .75);
    background: rgba(15, 23, 42, .62);
    padding: 12px 18px;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
}

.chat-btn:hover {
    color: #fff;
    border-color: var(--blue);
    transform: translateY(-1px);
}

.hero {
    min-height: calc(100vh - 82px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 78px;
    align-items: center;
    padding: 54px 0 80px;
}

.hero-copy {
    min-width: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .62);
    border-radius: 999px;
    color: #dbeafe;
    margin-bottom: 30px;
    font-size: 14px;
}

.status-pill span {
    width: 9px;
    height: 9px;
    background: var(--green);
    border-radius: 50%;
}

.section-kicker {
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(58px, 8vw, 104px);
    line-height: .95;
    letter-spacing: -4px;
    margin: 0 0 26px;
    font-weight: 950;
    color: #fff;
}

.hero-lead {
    max-width: 660px;
    color: var(--muted);
    font-size: 22px;
    line-height: 1.65;
    margin: 0 0 24px;
}

.role-line {
    color: #c9d8f5;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 34px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.primary-btn,
.outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 26px;
    border-radius: 14px;
    font-weight: 800;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    color: #fff;
    box-shadow: 0 18px 44px rgba(56, 189, 248, .16);
}

.outline-btn {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .55);
    color: #fff;
}

.primary-btn:hover,
.outline-btn:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* Q&A Portfolio Assistant */

.qa-card {
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(2, 6, 23, .96));
    border-radius: 30px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    min-width: 0;
}

.qa-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.bot-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 26px;
    background: rgba(56, 189, 248, .12);
    border: 2px solid rgba(139, 92, 246, .9);
    flex: 0 0 auto;
}

.qa-header strong {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

.qa-header small,
.qa-card small {
    color: var(--muted);
}

.chat-window {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.message {
    max-width: 88%;
}

.label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.bubble {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 14px;
}

.message.bot {
    align-self: flex-start;
}

.message.bot .bubble {
    background: rgba(56, 189, 248, .10);
    border: 1px solid rgba(56, 189, 248, .25);
    border-bottom-left-radius: 6px;
}

.message.user {
    align-self: flex-end;
}

.message.user .bubble {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    border-bottom-right-radius: 6px;
}

.quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
}

.quick-pills button {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .75);
    color: #fff;
    border-radius: 999px;
    padding: 9px 13px;
    font-size: 13px;
    cursor: pointer;
}

.quick-pills button:hover {
    border-color: var(--blue);
    background: rgba(56, 189, 248, .10);
}

.chat-input {
    display: flex;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    background: rgba(15, 23, 42, .86);
    margin-bottom: 14px;
}

.chat-input input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 14px;
    padding: 0 8px;
}

.chat-input input::placeholder {
    color: #94a3b8;
}

.chat-input button {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    cursor: pointer;
    flex: 0 0 auto;
}

.ai-tip {
    display: block;
    line-height: 1.5;
}

/* Homepage Sections */

.section {
    background: var(--bg-soft);
    padding: 86px 0;
}

.section.alt {
    background: #020617;
}

.section-head {
    margin-bottom: 34px;
}

.section-head h2,
.contact-cta h2 {
    font-size: 42px;
    font-weight: 900;
    margin: 0 0 10px;
}

.section-head p,
.contact-cta p {
    color: var(--muted);
    max-width: 720px;
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card,
.portfolio-card,
.dark-card,
.panel {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, .90), rgba(2, 6, 23, .96));
    border-radius: var(--radius);
    padding: 28px;
    height: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

.stat-card {
    min-height: 150px;
}

.stat-card strong {
    display: block;
    font-size: 44px;
    line-height: 1;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--blue), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.project-grid,
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card,
.skill-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.badge-pill,
.project-badge {
    display: inline-block;
    width: fit-content;
    color: var(--blue);
    border: 1px solid rgba(56, 189, 248, .35);
    background: rgba(56, 189, 248, .09);
    padding: 7px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
    font-size: 13px;
}

.portfolio-card h3 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
}

.portfolio-card p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 18px;
}

.portfolio-card small {
    color: #c9d8f5;
    line-height: 1.5;
    margin-top: auto;
}

.card-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--blue);
    font-weight: 800;
}

.card-link:hover {
    color: var(--violet);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.skill-list span,
.skill-pill {
    display: inline-block;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .75);
    color: #e5eefc;
    font-size: 14px;
}

.empty-state {
    border: 1px dashed rgba(96, 165, 250, .35);
    border-radius: 20px;
    padding: 28px;
    color: var(--muted);
    background: rgba(15, 23, 42, .35);
}

.contact-cta {
    grid-column: 1 / -1;
    text-align: center;
    padding: 54px 28px;
    background:
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .18), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, .18), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .96));
}

.contact-cta p {
    margin: 0 auto 28px;
    max-width: 620px;
}

.site-footer,
footer {
    background: #020617;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding: 30px 0;
}

/* =========================================================
   Admin Layout / CRUD Screens
   ========================================================= */

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #050b18, #020617);
    border-right: 1px solid var(--line);
    padding: 28px 22px;
}

.nav-title {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 28px 0 12px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dbeafe;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
}

.sidebar a:hover {
    background: rgba(56, 189, 248, .12);
    color: #fff;
    border: 1px solid rgba(56, 189, 248, .28);
}

.admin-main {
    padding: 28px 36px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 34px;
}

.topbar h1 {
    font-size: 30px;
    font-weight: 900;
    margin: 0;
}

.topbar p {
    color: var(--muted);
    margin: 6px 0 0;
}

.admin-user {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 18px;
    color: #dbeafe;
}

.btn-glow {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff !important;
    text-decoration: none;
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
}

.btn-glow:hover {
    color: #fff !important;
    opacity: .95;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5eefc;
    --bs-table-border-color: rgba(96, 165, 250, .18);
}

.form-control,
.form-select {
    background: rgba(15, 23, 42, .85);
    border: 1px solid var(--line);
    color: #fff;
}

.form-control:focus,
.form-select:focus {
    background: rgba(15, 23, 42, .95);
    color: #fff;
    border-color: var(--blue);
    box-shadow: none;
}

.form-control::placeholder {
    color: var(--muted-2);
}

label {
    margin-bottom: 8px;
    color: #dbeafe;
}


/* Activity admin image preview */
.activity-image-preview-card {
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 18px;
    background: rgba(15, 23, 42, .55);
    padding: 14px;
}

.activity-image-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.activity-image-preview-header strong {
    color: #e5eefc;
}

.activity-image-preview-header small {
    color: var(--muted);
    max-width: 360px;
    text-align: right;
}

.activity-image-preview-frame {
    min-height: 220px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, .35);
    background: rgba(2, 6, 23, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.activity-image-preview-frame img {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: contain;
}

.activity-image-preview-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
    word-break: break-word;
}

@media (max-width: 620px) {
    .activity-image-preview-header,
    .activity-image-preview-meta {
        flex-direction: column;
    }

    .activity-image-preview-header small {
        text-align: left;
    }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 980px) {
    .menu {
        display: none;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 42px;
        padding-top: 32px;
    }

    .qa-card {
        max-width: 620px;
    }

    .stats-grid,
    .project-grid,
    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .admin-main {
        padding: 22px;
    }
}

@media (max-width: 620px) {
    .site-container {
        width: min(100% - 32px, 1180px);
    }

    .top-nav {
        height: 72px;
    }

    .hero {
        padding: 36px 0 64px;
    }

    .hero h1 {
        font-size: 54px;
        letter-spacing: -2px;
    }

    .hero-lead {
        font-size: 18px;
    }

    .chat-btn {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
    }

    .primary-btn,
    .outline-btn {
        width: 100%;
    }

    .stats-grid,
    .project-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 72px 0;
    }

    .section-head h2,
    .contact-cta h2 {
        font-size: 34px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Admin Login */
.admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px 20px;
    background:
        radial-gradient(circle at 20% 10%, rgba(56, 189, 248, .16), transparent 32%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, .16), transparent 32%),
        #020617;
}

.admin-login-card {
    width: min(100%, 460px);
    padding: 36px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(2, 6, 23, .98));
    border: 1px solid rgba(96, 165, 250, .28);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    color: #e5eefc;
}

.admin-login-card h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900;
    margin-bottom: 10px;
}

.admin-login-card p,
.admin-login-help {
    color: #9fb4d8;
}

.admin-login-form .form-label {
    color: #dbeafe;
    font-weight: 700;
}

.admin-login-form .form-control {
    background: rgba(15, 23, 42, .8);
    border: 1px solid rgba(96, 165, 250, .3);
    color: #e5eefc;
}

.admin-login-form .form-control:focus {
    background: rgba(15, 23, 42, .95);
    border-color: rgba(56, 189, 248, .75);
    color: #fff;
    box-shadow: 0 0 0 .25rem rgba(56, 189, 248, .12);
}

.logout-link {
    color: #fecaca !important;
}


/* =========================================================
   Public Projects + Project Detail Pages
   ========================================================= */

.section-action {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.projects-page-hero {
    position: relative;
    padding: 92px 0 76px;
    background:
        radial-gradient(circle at 16% 22%, rgba(56, 189, 248, .16), transparent 32%),
        radial-gradient(circle at 88% 70%, rgba(139, 92, 246, .22), transparent 36%),
        linear-gradient(135deg, #020617, #061226 48%, #020617);
    overflow: hidden;
}

.projects-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, .055) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: .45;
    pointer-events: none;
}

.projects-page-hero .site-container {
    position: relative;
    z-index: 2;
}

.back-link {
    display: inline-flex;
    margin-bottom: 28px;
    color: var(--muted);
    font-weight: 700;
}

.back-link:hover {
    color: var(--blue);
}

.projects-page-hero h1 {
    font-size: clamp(44px, 7vw, 82px);
    line-height: .98;
    letter-spacing: -3px;
    margin: 12px 0 20px;
    font-weight: 950;
}

.projects-page-hero p {
    max-width: 760px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.65;
    margin: 0;
}

.projects-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.project-list-card {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.project-list-topline,
.project-detail-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.status-pill {
    display: inline-block;
    width: fit-content;
    color: #dbeafe;
    border: 1px solid rgba(139, 92, 246, .38);
    background: rgba(139, 92, 246, .11);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.project-list-card h2 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 900;
}

.project-tech {
    margin-top: auto;
    color: #c9d8f5;
    line-height: 1.5;
    font-size: 14px;
}

.project-card-actions,
.project-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 18px;
}

.project-card-actions .card-link {
    margin-top: 0;
}

.secondary-link {
    color: var(--muted);
}

.project-detail-hero {
    padding-bottom: 88px;
}

.project-detail-actions {
    margin-top: 32px;
}

.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
    gap: 22px;
    align-items: start;
}

.project-detail-main h2 {
    font-size: clamp(28px, 4vw, 44px);
    margin: 0 0 18px;
    font-weight: 900;
}

.project-detail-main p {
    font-size: 17px;
    line-height: 1.8;
}

.detail-meta-list {
    display: grid;
    gap: 14px;
}

.detail-meta-list div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, .45);
}

.detail-meta-list span,
.detail-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.detail-meta-list strong {
    color: #e5eefc;
}

.detail-tech-block {
    margin-top: 22px;
}

.detail-tech-list {
    margin-top: 12px;
}

.project-screenshot-card {
    margin-top: 22px;
}

.project-screenshot-card img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid var(--line);
}

.project-screenshot-placeholder {
    min-height: 280px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    border-radius: 20px;
    border: 1px dashed rgba(96, 165, 250, .35);
    background:
        radial-gradient(circle at center, rgba(56, 189, 248, .12), transparent 42%),
        rgba(15, 23, 42, .35);
    color: var(--muted);
}

.project-screenshot-placeholder strong {
    color: #e5eefc;
    font-size: 22px;
}

.project-screenshot-placeholder span {
    display: block;
}

@media (max-width: 900px) {
    .project-detail-layout,
    .projects-list-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .projects-page-hero {
        padding: 72px 0 58px;
    }

    .projects-page-hero h1 {
        letter-spacing: -1.5px;
    }

    .project-detail-actions,
    .project-card-actions {
        align-items: stretch;
        flex-direction: column;
    }
}


/* =========================================================
   Public Projects List Thumbnails
   ========================================================= */

.project-list-image {
    margin: -28px -28px 20px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid rgba(96, 165, 250, .18);
    background:
        radial-gradient(circle at center, rgba(56, 189, 248, .12), transparent 42%),
        rgba(15, 23, 42, .45);
}

.project-list-image img {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
    transition: transform .3s ease;
}

.project-list-card:hover .project-list-image img {
    transform: scale(1.03);
}

.project-list-image-placeholder {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

.project-list-image-placeholder strong {
    display: block;
    color: #e5eefc;
    font-size: 18px;
    margin-bottom: 6px;
}

.project-list-image-placeholder span {
    display: block;
    max-width: 280px;
    line-height: 1.5;
    font-size: 14px;
}

@media (max-width: 576px) {
    .project-list-image img,
    .project-list-image-placeholder {
        height: 190px;
        min-height: 190px;
    }
}

/* =========================================================
   Portfolio Assistant UX v2
   Structured assistant cards, in-chat answers, and actions
   ========================================================= */

.chat-window {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
    scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar {
    width: 8px;
}

.chat-window::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .65);
    border-radius: 999px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .55);
    border-radius: 999px;
}

.bubble.portfolio-answer-card {
    padding: 0;
    overflow: hidden;
    min-width: min(100%, 310px);
}

.ai-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 15px;
    border-bottom: 1px solid rgba(56, 189, 248, .18);
    color: #fff;
    font-weight: 850;
    background: rgba(56, 189, 248, .08);
}

.ai-card-title span {
    font-size: 18px;
}

.ai-card-content {
    padding: 14px 15px 4px;
}

.ai-card-content p {
    margin: 0 0 11px;
}

.ai-card-content h4 {
    margin: 0 0 8px;
    color: #e0f2fe;
    font-size: 15px;
}

.ai-card-content ul,
.ai-card-content ol {
    margin: 0 0 12px 20px;
    padding: 0;
}

.ai-card-content li {
    margin-bottom: 7px;
}

.ai-card-content code {
    color: #bae6fd;
    background: rgba(15, 23, 42, .8);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 6px;
    padding: 1px 5px;
}

.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 15px 15px;
}

.ai-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(96, 165, 250, .38);
    background: rgba(15, 23, 42, .82);
    color: #dbeafe;
    text-decoration: none;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    cursor: pointer;
}

.ai-action-link:hover {
    color: #fff;
    background: rgba(56, 189, 248, .12);
    border-color: rgba(56, 189, 248, .75);
}

button.ai-action-link {
    font-family: inherit;
}

@media (max-width: 620px) {
    .chat-window {
        max-height: 360px;
    }

    .bubble.portfolio-answer-card {
        min-width: 0;
    }
}

/* =========================================================
   Portfolio Assistant UX v2.1
   Clean starter state: no duplicated welcome card
   ========================================================= */

.starter-bubble {
    color: #e5f0ff;
    max-width: 100%;
}

.quick-pills button {
    font-weight: 650;
}

.ai-tip {
    color: #93a4c7;
}


/* =========================================================
   NELSON AI Hero Only Patch
   Scope: hero section only; keeps existing homepage sections/modules unchanged
   ========================================================= */

.hero-ai-only {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 0 68px;
}

.hero-ai-console {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 28px 32px 30px;
    border-radius: 32px;
}

.hero-ai-header {
    justify-content: center;
    text-align: left;
    margin-bottom: 24px;
}

.hero-ai-header .bot-avatar {
    width: 58px;
    height: 58px;
    font-size: 26px;
}

.hero-ai-header strong {
    font-size: clamp(28px, 3.4vw, 42px);
    letter-spacing: -1px;
    line-height: 1;
}

.hero-ai-header small {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #9fb6dc;
}

.hero-chat-window {
    max-height: none;
    min-height: 0;
    overflow: hidden;
    padding: 24px 26px;
    margin-bottom: 20px;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .10), transparent 34%),
        rgba(2, 6, 23, .38);
    scrollbar-gutter: stable;
}

.hero-chat-window.is-active {
    max-height: 330px;
    overflow-y: auto;
}

.hero-chat-window.is-active::-webkit-scrollbar {
    width: 7px;
}

.hero-chat-window.is-active::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .55);
    border-radius: 999px;
}

.hero-chat-window.is-active::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .48);
    border-radius: 999px;
}

.hero-chat-window .message {
    max-width: 78%;
}

.hero-chat-window .bubble {
    font-size: 16px;
    line-height: 1.62;
    padding: 16px 18px;
}

.hero-chat-window .label {
    font-size: 13px;
    letter-spacing: .3px;
}

.hero-quick-pills {
    justify-content: center;
    margin-bottom: 20px;
}

.hero-quick-pills button {
    padding: 11px 16px;
    font-size: 14px;
}

.hero-chat-input {
    max-width: 780px;
    margin: 0 auto;
    padding: 12px;
    border-radius: 20px;
}

.hero-chat-input input {
    font-size: 16px;
    padding: 0 12px;
}

.hero-chat-input button {
    width: 52px;
    height: 52px;
    border-radius: 15px;
}

@media (max-width: 980px) {
    .hero-ai-console {
        width: 100%;
    }

    .hero-chat-window .message {
        max-width: 88%;
    }
}

@media (max-width: 620px) {
    .hero-ai-only {
        min-height: auto;
        padding: 30px 0 54px;
    }

    .hero-ai-console {
        padding: 22px;
        border-radius: 26px;
    }

    .hero-ai-header {
        justify-content: flex-start;
        margin-bottom: 20px;
    }

    .hero-ai-header .bot-avatar {
        width: 52px;
        height: 52px;
        font-size: 23px;
    }

    .hero-chat-window {
        padding: 18px;
    }

    .hero-chat-window.is-active {
        max-height: 360px;
    }

    .hero-chat-window .message {
        max-width: 96%;
    }

    .hero-chat-window .bubble {
        font-size: 14px;
    }

    .hero-quick-pills {
        justify-content: flex-start;
    }
}

/* =========================================================
   NELSON AI Hero v4 refinement
   Scope: hero only. Compact conversation-first hero.
   ========================================================= */
.hero-ai-only {
    padding: 36px 0 58px;
}

.hero-ai-console {
    width: min(100%, 920px);
    padding: 24px 32px 26px;
    border-radius: 30px;
}

.hero-ai-header {
    margin-bottom: 18px;
}

.hero-ai-header .bot-avatar {
    width: 52px;
    height: 52px;
    font-size: 23px;
}

.hero-ai-header strong {
    font-size: clamp(25px, 3vw, 36px);
    letter-spacing: -.7px;
}

.hero-ai-header small {
    margin-top: 5px;
    font-size: 12px;
    letter-spacing: 1.25px;
}

.hero-chat-window {
    padding: 18px 24px;
    margin-bottom: 16px;
    border-radius: 24px;
    gap: 12px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .09), transparent 36%),
        rgba(2, 6, 23, .32);
}

.hero-chat-window.is-active {
    max-height: 280px;
    overflow-y: auto;
}

.hero-chat-window .message {
    max-width: 86%;
}

.hero-chat-window .bubble {
    font-size: 15px;
    line-height: 1.55;
    padding: 14px 17px;
}

.hero-chat-window .label {
    font-size: 12px;
    margin-bottom: 5px;
}

.starter-bubble {
    max-width: 100%;
}

.starter-list {
    margin: 10px 0 0 20px;
    padding: 0;
}

.starter-list li {
    margin: 4px 0;
}

.hero-quick-pills {
    margin-bottom: 14px;
    gap: 8px;
}

.hero-quick-pills button {
    padding: 10px 14px;
    font-size: 13px;
}

.hero-chat-input {
    max-width: 760px;
    padding: 10px;
    border-radius: 18px;
}

.hero-chat-input button {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.hero-chat-input input {
    font-size: 15px;
}

@media (max-width: 620px) {
    .hero-ai-only {
        padding: 26px 0 44px;
    }

    .hero-ai-console {
        padding: 20px;
        border-radius: 24px;
    }

    .hero-ai-header {
        margin-bottom: 16px;
    }

    .hero-chat-window {
        padding: 16px;
        border-radius: 20px;
    }

    .hero-chat-window.is-active {
        max-height: 320px;
    }

    .hero-chat-window .message {
        max-width: 96%;
    }

    .hero-quick-pills button {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================
   AI Response Renderer Refactor
   Scope: chat answer display only; keeps hero layout and page sections intact
   ========================================================= */
.hero-chat-window .bubble.ai-answer-bubble {
    max-width: 100%;
    padding: 16px 18px;
}

.hero-chat-window .bubble.ai-answer-bubble p {
    margin: 0 0 10px;
}

.hero-chat-window .bubble.ai-answer-bubble p:last-child {
    margin-bottom: 0;
}

.hero-chat-window .bubble.ai-answer-bubble ul,
.hero-chat-window .bubble.ai-answer-bubble ol {
    margin: 8px 0 0 18px;
    padding: 0;
}

.hero-chat-window .bubble.ai-answer-bubble li {
    margin-bottom: 6px;
}

.hero-chat-window .bubble.ai-answer-bubble h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #ffffff;
}

.hero-chat-window .message.bot {
    max-width: 76%;
}

.hero-chat-window .message.user {
    max-width: 44%;
}

@media (max-width: 768px) {
    .hero-chat-window .message.bot,
    .hero-chat-window .message.user {
        max-width: 92%;
    }
}

/* =========================================================
   NELSON AI Conversation Behavior v5
   Scope: humanized replies and follow-up suggestion chips
   ========================================================= */
.hero-chat-window .bubble.ai-answer-bubble {
    font-size: 14.5px;
    line-height: 1.55;
}

.ai-followups {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .18);
}

.ai-followups-title {
    margin-bottom: 8px;
    color: #aebbe0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ai-followups-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-followup-chip {
    border: 1px solid rgba(99, 102, 241, .42);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(15, 23, 42, .62);
    color: #dbeafe;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.ai-followup-chip:hover {
    border-color: rgba(125, 92, 255, .9);
    background: rgba(30, 41, 59, .88);
    transform: translateY(-1px);
}

@media (max-width: 620px) {
    .ai-followups-list {
        flex-direction: column;
    }

    .ai-followup-chip {
        width: 100%;
        text-align: left;
    }
}

/* =========================================================
   Public Activities / Development Journey Page
   ========================================================= */

.compact-page-bg {
    min-height: auto;
}

/* Activities page: keep the hero background full-width like the Projects page.
   The previous version placed the hero section inside .site-container, which
   visually compressed the gradient background into a boxed area. */
.activities-page-hero {
    padding: 92px 0 76px;
}

.activities-page-hero .back-link {
    margin-bottom: 28px;
}

.activities-page-hero h1 {
    max-width: 980px;
    font-size: clamp(44px, 7vw, 82px);
    line-height: .98;
    margin: 12px 0 20px;
}

.activities-page-hero p {
    max-width: 840px;
    font-size: 20px;
    line-height: 1.65;
}

.activities-list-section {
    padding-top: 72px;
}

.activities-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.activity-list-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.activity-list-image {
    position: relative;
    height: 260px;
    margin: -28px -28px 20px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid rgba(96, 165, 250, .18);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .98)),
        radial-gradient(circle at center, rgba(56, 189, 248, .12), transparent 42%);
}

.activity-list-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 58%, rgba(2, 6, 23, .18));
}

.activity-list-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    transition: transform .35s ease, filter .35s ease;
}

.activity-list-card:hover .activity-list-image img {
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.03);
}

.activity-list-image-placeholder {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    padding: 28px;
}

.activity-list-image-placeholder strong {
    display: block;
    color: #e5eefc;
    font-size: 20px;
    margin-bottom: 8px;
}

.activity-list-image-placeholder span {
    display: block;
    max-width: 320px;
    line-height: 1.5;
    font-size: 14px;
}

.activity-list-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.activity-list-topline .badge-pill {
    margin-bottom: 0;
}

.activity-list-topline time {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.activity-list-card h2 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 900;
}

.related-project-box {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(96, 165, 250, .16);
}

.related-project-box span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 8px;
}

.related-project-box a {
    color: var(--blue);
    font-weight: 850;
}

.section-action {
    gap: 14px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .activities-list-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .activity-list-image {
        height: 210px;
    }

    .activity-list-image-placeholder {
        min-height: 210px;
    }
}

/* =========================================================
   Project Detail Experience Enhancement v1
   ========================================================= */

.showcase-hero {
    padding-bottom: 76px;
}

.project-showcase-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 34px;
    align-items: center;
}

.project-hero-preview {
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 28px;
    padding: 12px;
    background:
        linear-gradient(145deg, rgba(96, 165, 250, .14), rgba(15, 23, 42, .38)),
        rgba(15, 23, 42, .42);
    box-shadow: 0 24px 70px rgba(2, 6, 23, .28);
}

.project-hero-preview img {
    display: block;
    width: 100%;
    height: 340px;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, .18);
}

.project-screenshot-placeholder.compact {
    min-height: 340px;
}

.project-showcase-section {
    padding-top: 72px;
}

.showcase-layout {
    margin-bottom: 22px;
}

.project-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.project-showcase-card h2,
.project-stack-card h2,
.project-links-card h2,
.showcase-screenshot-card h2 {
    margin: 0 0 18px;
    color: #f8fbff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    letter-spacing: -.8px;
}

.showcase-check-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-check-list li {
    position: relative;
    padding: 15px 16px 15px 46px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 16px;
    background: rgba(15, 23, 42, .38);
    color: #dbeafe;
    line-height: 1.6;
}

.showcase-check-list li::before {
    content: "✓";
    position: absolute;
    top: 15px;
    left: 16px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #082f49;
    background: #93c5fd;
    font-weight: 950;
    font-size: 13px;
}

.project-stack-card,
.showcase-screenshot-card,
.project-links-card {
    margin-top: 22px;
}

.stack-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stack-group-card {
    padding: 18px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 18px;
    background: rgba(15, 23, 42, .38);
}

.stack-group-card > span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 12px;
}

.compact-empty {
    padding: 18px;
}

.project-links-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.project-links-card p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.links-only {
    flex-shrink: 0;
    justify-content: flex-end;
    margin-top: 0;
}

@media (max-width: 900px) {
    .project-showcase-hero-grid,
    .project-showcase-grid,
    .stack-group-grid,
    .project-links-card {
        grid-template-columns: 1fr;
    }

    .project-links-card {
        display: grid;
    }

    .links-only {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .project-hero-preview img,
    .project-screenshot-placeholder.compact {
        height: 220px;
        min-height: 220px;
    }

    .showcase-check-list li {
        padding-right: 14px;
    }
}

/* =========================================================
   Hero AI Voice Output v1
   Scope: frontend voice controls only; no backend or module changes
   ========================================================= */
.hero-voice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto 14px;
}

.voice-control-btn {
    border: 1px solid rgba(96, 165, 250, .34);
    border-radius: 999px;
    padding: 9px 14px;
    background: rgba(15, 23, 42, .66);
    color: #dbeafe;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease, opacity .2s ease;
}

.voice-control-btn:hover:not(:disabled) {
    border-color: rgba(125, 211, 252, .9);
    background: rgba(30, 41, 59, .88);
    transform: translateY(-1px);
}

.voice-control-btn[aria-pressed="true"] {
    border-color: rgba(34, 197, 94, .74);
    background: rgba(22, 101, 52, .32);
    color: #dcfce7;
}

.voice-control-btn.secondary {
    color: #c7d2fe;
}

.voice-control-btn:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.voice-status,
.hero-ai-status {
    color: #9fb6dc;
    font-size: 12px;
}

.hero-ai-status {
    min-height: 18px;
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 620px) {
    .hero-voice-controls {
        justify-content: flex-start;
    }

    .voice-control-btn {
        flex: 1 1 auto;
        min-width: 140px;
    }

    .voice-status {
        width: 100%;
    }
}


/* =========================================================
   Activity Detail Page v1
   ========================================================= */

.activity-image-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.activity-card-actions {
    margin-top: auto;
    padding-top: 16px;
}

.activity-detail-hero {
    padding: 72px 0 80px;
    background:
        radial-gradient(circle at 12% 20%, rgba(14, 165, 233, .17), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(139, 92, 246, .15), transparent 30%),
        linear-gradient(180deg, #020617 0%, #071025 100%);
    border-bottom: 1px solid rgba(96, 165, 250, .16);
}

.activity-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: 34px;
    align-items: center;
    margin-top: 24px;
}

.activity-detail-topline,
.activity-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.activity-detail-topline {
    justify-content: flex-start;
    margin-bottom: 18px;
}

.activity-detail-topline time {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.activity-detail-copy h1 {
    max-width: 850px;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(40px, 6vw, 76px);
    line-height: .98;
    letter-spacing: -2.8px;
    font-weight: 950;
}

.activity-detail-lead {
    max-width: 760px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.75;
    margin: 0;
}

.activity-detail-actions {
    justify-content: flex-start;
    margin-top: 30px;
}

.activity-detail-media-card {
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, .26);
    border-radius: 28px;
    background: rgba(15, 23, 42, .55);
    box-shadow: 0 24px 70px rgba(2, 6, 23, .42);
}

.activity-detail-media-card img {
    display: block;
    width: 100%;
    height: 420px;
    object-fit: cover;
    object-position: center;
}

.activity-detail-placeholder {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    padding: 32px;
    color: var(--muted);
}

.activity-detail-placeholder strong {
    color: #e5eefc;
    font-size: 24px;
}

.activity-story-section {
    padding-top: 72px;
}

.activity-story-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr);
    gap: 22px;
    align-items: start;
}

.activity-story-main h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
}

.activity-story-main p {
    color: #dbeafe;
    font-size: 17px;
    line-height: 1.85;
}

.activity-story-points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.activity-story-points div {
    padding: 18px;
    border: 1px solid rgba(96, 165, 250, .18);
    border-radius: 18px;
    background: rgba(15, 23, 42, .45);
}

.activity-story-points strong,
.activity-story-points span {
    display: block;
}

.activity-story-points strong {
    color: #fff;
    margin-bottom: 8px;
}

.activity-story-points span {
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.activity-story-side a {
    color: var(--blue);
}

@media (max-width: 980px) {
    .activity-detail-grid,
    .activity-story-layout,
    .activity-story-points {
        grid-template-columns: 1fr;
    }

    .activity-detail-media-card img,
    .activity-detail-placeholder {
        height: auto;
        min-height: 280px;
        max-height: 420px;
    }
}

@media (max-width: 576px) {
    .activity-detail-hero {
        padding: 54px 0 62px;
    }

    .activity-detail-copy h1 {
        letter-spacing: -1.5px;
    }

    .activity-detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .activity-detail-actions .btn-primary,
    .activity-detail-actions .secondary-link {
        width: 100%;
        text-align: center;
    }
}
