/* --- CSS Variables --- */
:root {
    --bg-primary: #D6E2DE;
    --bg-alt: #FAE9F0;
    --surface: #FFFFFF;
    --surface-tint: rgba(184, 212, 212, 0.15);

    --border: #B0C2AE;
    --border-soft: #D6E2DE;
    --border-accent: #8DA280;

    --text-dark: #2F3A34;
    --text-muted: #5E6B63;
    --text-light: #FAE9F0;

    --link-color: #4C8C8A;
    --link-hover: #3E726F;
    --link-visited: #7A9C8F;

    --primary: #8DA280;
    --secondary: #B8D4D4;
    --highlight: #EBCDD9;

    /*
     * Colors NOT in the approved system — recommend adding these to your design tokens:
     *
     *   --danger:      #C0392B   (video-link text, error states)
     *   --danger-bg:   #FFF1F0   (video-link background)
     *   --danger-border: #FFD0CC (video-link border)
     *   --success:     #1A7A4A   (interactive-link background)
     *
     * Until then, they are declared here as local fallbacks.
     */
    --_danger:        #C0392B;
    --_danger-bg:     #FFF1F0;
    --_danger-border: #FFD0CC;
    --_success:       #1A7A4A;
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-dark);
}

/* --- Header --- */
.main-header {
    background-color: var(--primary);
    color: var(--surface);
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: normal;
}

.main-header h2 {
    font-size: 1.5rem;
    font-weight: normal;
}

/* --- Controls (UPDATED for Right Alignment) --- */
.controls {
    padding: 2rem 5%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    /* justify-content: space-between;  <-- Removed to let margin-left: auto work */
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--primary);
    background-color: var(--surface);
    color: var(--primary);
    font-weight: 400;
}

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

#search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dark);
    font-size: 0.95rem;
    box-shadow: none;
}

/* --- Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    padding-bottom: 80px;
}

/* --- Cards --- */
.project-card {
    background-color: var(--surface);
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(47, 58, 52, 0.06), 0 4px 16px rgba(141, 162, 128, 0.1);
    border: 1px solid rgba(176, 194, 174, 0.5);
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px rgba(141, 162, 128, 0.22), 0 2px 8px rgba(47, 58, 52, 0.08);
}

/* --- Image Styles --- */
.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-primary);
    position: relative;
}

/* Soft gradient fade at the bottom of the image into the card surface */
.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--surface));
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.logo-small {
    transform: scale(1);
}

.logo-large {
    transform: scale(1.1);
}

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

/* Team badge overlaid on image */
.team-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-dark);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(176, 194, 174, 0.4);
    box-shadow: 0 1px 4px rgba(47, 58, 52, 0.12);
}

.description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.65;

    max-height: 5.3em; /* about 3–4 lines */
    overflow: hidden;
    position: relative;
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .description {
    max-height: 40em;
}

.description::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.6em;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        var(--card-bg, #ffffff)
    );
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.project-card:hover .description::after {
    opacity: 0;
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.keyword-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border: 1px solid var(--primary);
    border-radius: 5px;
}

.keyword {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 11px;
    border: 1px solid var(--highlight);
    border-radius: 5px;
    background-color: var(--bg-alt);
    transition: background-color 0.18s ease, transform 0.18s ease;
    cursor: default;
    letter-spacing: 0.01em;
}

.keyword:hover {
    background-color: var(--highlight);
    transform: translateY(-1px);
}

/* .project-link base styles are defined in the Spring Pill Buttons section below */

.hidden {
    display: none !important;
}

/* --- Footer Section (NEW) --- */
.footer {
    background-color: var(--primary);
    color: var(--surface);
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 5rem;
    box-shadow: 0 -4px 10px rgba(141, 162, 128, 0.2);
}

.contributor {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.9;
}

.contributor::before {
    content: "";
    display: block;
    width: 50px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 auto 15px auto;
}

/* Mobile */
@media (max-width: 768px) {

    .main-header,
    .controls {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .search-container,
    #search-input {
        width: 100%;
    }
}

/* =========================
   NEW: Theme Variables
========================= */
:root {
    --bg: var(--bg-primary);
    --bg-secondary: var(--bg-alt);
    --card-bg: var(--surface);
    --text-main: var(--text-dark);
    --shadow-soft: 0 10px 30px rgba(47, 58, 52, 0.05);
    --shadow-hover: 0 20px 40px rgba(47, 58, 52, 0.14);
    --tag-bg: var(--bg-primary);
    --tag-text: var(--text-muted);
    --controls-bg: rgba(214, 226, 222, 0.85);
    --button-fade: 1;
    --button-move: 8px;
}

body.dark-mode {
    /*
     * Dark mode has no approved tokens. These values are held over from the
     * original CSS. Recommend adding a dark-mode palette to your design system,
     * e.g.: --bg-dark, --surface-dark, --text-dark-mode, --border-dark.
     */
    --bg: #15121d;
    --bg-secondary: #1d1827;
    --card-bg: #211b2d;
    --text-main: #f3f4f6;
    --text-muted: #c3c7cf;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.35);
    --tag-bg: #2d2440;
    --tag-text: #ddd8f0;
    --controls-bg: rgba(25, 21, 35, 0.88);
    --primary: #8DA280;
    --highlight: #EBCDD9;
}

/* Apply variables */
body {
    background-color: var(--bg-primary);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 55%, var(--secondary) 100%);
    padding: 100px 0 60px;
    text-align: center;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.subtitle {
    font-style: italic;
    color: rgba(255, 255, 255, 0.75);
}

.controls {
    background: var(--controls-bg);
    transition: background 0.3s ease;
}

.filter-group,
.right-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn,
.theme-toggle,
.sort-select {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dark);
    transition: all 0.25s ease;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 400;
    box-shadow: none;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.sort-select {
    border-radius: 12px;
    cursor: pointer;
}

.filter-btn:hover,
.theme-toggle:hover,
.sort-select:hover {
    transform: translateY(-1px);
}

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

#search-input {
    background: var(--surface);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

#search-input::placeholder {
    color: var(--text-muted);
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

/* Card theme-layer: ensure bg/border adapt to dark mode */
.project-card {
    background: var(--surface);
    border-color: rgba(176, 194, 174, 0.5);
}

/* Smooth image zoom on hover (defined here for theme-layer specificity) */
.card-image img {
    transition: transform 0.5s ease;
}

/* Subtle element transitions */
.meta-info,
h3,
.description,
.keyword,
.project-link {
    transition: color 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}

/* Button reveal animation on hover — buttons slide up subtly */
.card-links .project-link {
    opacity: 0.9;
    transform: translateY(3px);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover .card-links .project-link {
    opacity: 1;
    transform: translateY(0);
}

.project-card .card-links .project-link:nth-child(1) {
    transition-delay: 0.02s;
}

.project-card .card-links .project-link:nth-child(2) {
    transition-delay: 0.05s;
}

.project-card .card-links .project-link:nth-child(3) {
    transition-delay: 0.08s;
}

/* Make buttons fully visible on touchscreen devices */
@media (hover: none) {
    .card-links .project-link {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-footer {
    padding: 50px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 100%);
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    font-size: 0.95rem;
    box-shadow: 0 -6px 20px rgba(141, 162, 128, 0.18);
}

.main-footer a {
    color: var(--highlight);
    text-decoration: none;
    font-weight: 600;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    .controls-top {
        flex-direction: column;
        align-items: stretch;
    }

    .right-controls,
    .filter-group {
        width: 100%;
    }
}

.controls-top {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.sort-select {
    height: 44px;
    min-width: 220px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 400;
    box-shadow: none;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: menulist;
    display: inline-block;
}

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

.hidden {
    display: none !important;
}

/* Dark mode */
body.dark-mode {
    --bg: #15121d;
    --text-main: #f3f4f6;
    --text-muted: #c3c7cf;
    --surface: #211b2d;
    --primary: #8DA280;
}

body.dark-mode .controls {
    background: rgba(25, 21, 35, 0.88);
}

body.dark-mode #search-input,
body.dark-mode .filter-btn,
body.dark-mode .sort-select,
body.dark-mode .theme-toggle {
    background: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border);
}

body.dark-mode .keyword {
    background: #2d2440;
    color: #ddd8f0;
}

body.dark-mode .subtitle {
    color: rgba(255, 255, 255, 0.75);
}

.controls {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(214, 226, 222, 0.92);
    backdrop-filter: blur(12px);
    padding: 18px 24px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-soft);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
}

.filter-group::-webkit-scrollbar {
    display: none;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: nowrap;
    min-width: 0;
}

.controls-top {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.filter-btn {
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: none;
}

.search-wrapper {
    position: relative;
    width: 340px;
    margin-left: 0;
    max-width: none;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* =========================
   Chatbot
========================= */
.chatbot-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 100%);
    color: var(--surface);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(141, 162, 128, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 36px rgba(76, 140, 138, 0.38);
}

.chatbot-window {
    position: absolute;
    right: 0;
    bottom: 75px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(47, 58, 52, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    opacity: 1;
    transform: scale(1) translateY(0);
    transform-origin: bottom right;
    pointer-events: auto;
    transition:
        opacity 0.22s ease,
        transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-window.hidden-chat {
    opacity: 0;
    transform: scale(0.72) translateY(24px);
    pointer-events: none;
}

.chatbot-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 100%);
    color: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.chatbot-header h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: var(--surface);
}

.chatbot-header p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    opacity: 0.92;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--surface);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-message {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-line;
}

.bot-message {
    white-space: pre-line;
    align-self: flex-start;
    background: var(--bg-alt);
    color: var(--text-dark);
    border: 1px solid var(--border-soft);
}

.user-message {
    align-self: flex-end;
    background: var(--primary);
    color: var(--surface);
}

.chatbot-quick-actions {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.quick-action-btn {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--link-color);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--bg-alt);
}

.chatbot-input-area {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.chatbot-input {
    font-family: inherit;
    font-size: 0.3rem;
    font-weight: 500;
    flex: 1;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 0.92rem;
    outline: none;
    background: var(--surface);
    color: var(--text-dark);
}

.chatbot-input::placeholder {
    font-family: inherit;      /* or 'Inter', sans-serif */
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 1;
}

.chatbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(141, 162, 128, 0.2);
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: var(--surface);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.18s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--link-hover);
    transform: translateY(-1px);
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    opacity: 0.35;
    animation: typingDot 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

body.dark-mode .chatbot-window {
    background: var(--card-bg);
    border-color: var(--border);
}

body.dark-mode .bot-message {
    background: #2a2238;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .quick-action-btn {
    background: #2a2238;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .chatbot-container {
        right: 16px;
        bottom: 16px;
    }

    .chatbot-window {
        width: min(360px, calc(100vw - 24px));
        height: 500px;
    }
}

.main-footer a {
    color: var(--highlight);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.main-footer a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.main-footer {
    padding: 50px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 100%);
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    font-size: 0.95rem;
    border-top: 1px solid var(--border-accent);
}

.main-footer {
    padding: 50px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--link-color) 100%);
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    font-size: 0.95rem;
    border-top: 2px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 -10px 25px rgba(141, 162, 128, 0.22);
}

.main-footer a {
    color: var(--highlight);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.main-footer a:hover {
    text-decoration: underline;
    opacity: 0.85;
    color: var(--bg-alt);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    padding-bottom: 120px;
}


/* =========================
   Premium Card System
========================= */

/* Card content area — generous padding, flex column */
.card-content {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Team member names — quiet, secondary */
.meta-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

/* Title block */
.project-title {
    margin-bottom: 14px;
}

h3.app-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 5px;
}

p.app-context {
    font-size: 0.83rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.45;
    font-weight: 600;
    margin: 0;
}

/* Read more button */
.read-more-btn {
    background: none;
    border: none;
    color: #4C8C8A;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0 14px;
    margin: 0;
    text-align: left;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.read-more-btn:hover {
    color: #2F3A34;
    opacity: 0.85;
}

/* Keywords */
.keywords-container {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

/* Divider + button row */
.card-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(176, 194, 174, 0.3);
    margin-top: 0;
}

/* === Spring Pill Buttons === */
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.78rem;
    border: 1px solid var(--border-accent);
    background: var(--surface);
    color: var(--link-color);
    transition: background-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.project-link:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(141, 162, 128, 0.18);
    text-decoration: none;
}

/* Video: soft teal tint */
.project-link.video-link {
    background: var(--secondary);
    color: var(--link-hover);
    border-color: var(--secondary);
}

.project-link.video-link:hover {
    background: var(--border-soft);
    border-color: var(--border);
}

/* Interactive: sage green pill */
.project-link.interactive-link {
    background: var(--primary);
    color: var(--surface);
    border-color: var(--primary);
}

.project-link.interactive-link:hover {
    background: var(--link-hover);
    border-color: var(--link-hover);
}

/* Dark mode overrides */
body.dark-mode h3.app-name {
    color: var(--text-main);
}

body.dark-mode .card-links {
    border-top-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .keyword {
    background: rgba(235, 205, 217, 0.1);
    border-color: rgba(235, 205, 217, 0.2);
    color: var(--text-muted);
}

body.dark-mode .project-link {
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .project-link:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

body.dark-mode .project-link.video-link {
    background: rgba(184, 212, 212, 0.1);
    color: var(--secondary);
    border-color: rgba(184, 212, 212, 0.2);
}

body.dark-mode .project-link.interactive-link {
    background: var(--primary);
    color: var(--surface);
    border-color: var(--primary);
}

body.dark-mode .team-badge {
    background: rgba(30, 25, 42, 0.88);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Smoother hover abstract reveal */
.description {
    display: block !important;
    max-height: 5.3em;
    overflow: hidden;
    position: relative;
    opacity: 0.92;
    transition:
        max-height 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease;
}

.project-card:hover .description {
    max-height 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 1;
}

.description::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.2em;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        var(--surface)
    );
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.project-card:hover .description::after {
    opacity: 0;
}

/* Nav bar */
.controls {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 20px;
    margin-bottom: 44px;
    background: rgba(214, 226, 222, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(176, 194, 174, 0.35);
}

.controls-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(176, 194, 174, 0.45);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(47, 58, 52, 0.08);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.browse-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.browse-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-btn:hover {
    background: rgba(214, 226, 222, 0.55);
    color: var(--text-dark);
}

.filter-btn.active {
    background: var(--bg-alt);
    color: var(--text-dark);
    border-color: var(--highlight);
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#search-input,
.sort-select,
.theme-toggle {
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(176, 194, 174, 0.65);
    background: var(--surface);
    color: var(--text-dark);
    font-size: 0.88rem;
    font-weight: 400;
    box-shadow: none;
}

#search-input {
    width: 280px;
    padding: 0 14px;
}

.sort-select {
    min-width: 150px;
    padding: 0 12px;
}

.theme-toggle {
    width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#search-input:focus,
.sort-select:focus,
.theme-toggle:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(76, 140, 138, 0.14);
}

/* Mobile */
@media (max-width: 900px) {
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }

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

    .nav-tools {
        width: 100%;
        flex-wrap: wrap;
    }

    #search-input {
        flex: 1;
        min-width: 220px;
    }
}

.chatbot-quick-actions {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.chatbot-window.intro-complete .chatbot-quick-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.typing-cursor {
    display: inline-block;
    margin-left: 2px;
    opacity: 1;
    animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
    0%, 45% {
        opacity: 1;
    }
    46%, 100% {
        opacity: 0;
    }
}

.chatbot-send:disabled,
.quick-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Final nav typography cleanup */
.controls,
.controls-panel,
.browse-label,
.filter-btn,
#search-input,
#search-input::placeholder,
.sort-select,
.theme-toggle {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
}

.browse-label {
    font-size: 0.78rem;
    font-weight: 710;
    letter-spacing: 0.06em;
}

.filter-btn {
    font-weight: 400;
}

.filter-btn.active {
    font-weight: 500;
}

#search-input {
    font-weight: 400;
}

#search-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
    font-weight: 400;
}

.sort-select {
    font-weight: 400;
}