:root {
    --ln-bg: #08090a;
    --ln-panel: #0f1011;
    --ln-surface: #191a1b;
    --ln-surface-2: #23252a;
    --ln-text: #f7f8f8;
    --ln-text-2: #d0d6e0;
    --ln-text-3: #8a8f98;
    --ln-text-4: #62666d;
    --ln-border: rgba(255, 255, 255, 0.08);
    --ln-border-subtle: rgba(255, 255, 255, 0.05);
    --ln-accent: #7170ff;
    --ln-brand: #5e6ad2;
    --ln-brand-hover: #828fff;
    --ln-success: #10b981;
}

html[data-bs-theme="light"] {
    --ln-bg: #f7f8f8;
    --ln-panel: #ffffff;
    --ln-surface: #f3f4f5;
    --ln-surface-2: #ffffff;
    --ln-text: #131519;
    --ln-text-2: #2a2d33;
    --ln-text-3: #5a5f69;
    --ln-text-4: #6f7682;
    --ln-border: rgba(18, 22, 30, 0.12);
    --ln-border-subtle: rgba(18, 22, 30, 0.08);
}

html,
body {
    background: var(--ln-bg);
    color: var(--ln-text-2);
    font-family: "Inter", "SF Pro Display", -apple-system, system-ui, "Segoe UI", sans-serif;
    font-feature-settings: "cv01", "ss03";
}

body {
    line-height: 1.55;
    letter-spacing: -0.08px;
}

a {
    color: var(--ln-accent);
    text-decoration: none;
}

a:hover {
    color: var(--ln-brand-hover);
}

main.page {
    padding-top: 6.25rem;
}

.portfolio-block {
    padding: 2.75rem 0;
}

.portfolio-block .heading h2,
.portfolio-block h2 {
    color: var(--ln-text);
    font-weight: 510;
    letter-spacing: -0.5px;
}

.portfolio-block h3,
.portfolio-block h4,
.portfolio-block h5,
.portfolio-block h6 {
    color: var(--ln-text);
}

.text-muted,
small,
.form-text {
    color: var(--ln-text-3) !important;
}

.portfolio-navbar {
    background: rgba(8, 9, 10, 0.84) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ln-border-subtle);
    padding: 0.8rem 0.75rem;
    --bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.32);
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.92%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.portfolio-navbar .navbar-brand {
    font-weight: 510;
    color: var(--ln-text) !important;
    letter-spacing: -0.18px;
}

.portfolio-navbar .navbar-brand img {
    width: 44px !important;
    height: 44px !important;
}

.portfolio-navbar .nav-link {
    color: var(--ln-text-2) !important;
    border-radius: 6px;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.93rem;
    font-weight: 510;
}

.portfolio-navbar .nav-link:hover {
    color: var(--ln-text) !important;
    background: rgba(255, 255, 255, 0.04);
}

.portfolio-navbar .nav-link.active,
.portfolio-navbar .nav-link[aria-current="page"] {
    color: var(--ln-text) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--ln-border-subtle) !important;
    box-shadow: none !important;
}

.portfolio-navbar.navbar-scrolled {
    background: rgba(8, 9, 10, 0.92) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.theme-switch {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--ln-border) !important;
    box-shadow: none !important;
}

.theme-switch .theme-option {
    color: var(--ln-text-2);
}

.theme-switch .theme-thumb {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--ln-border) !important;
}

.btn {
    border-radius: 6px;
    font-weight: 510;
    letter-spacing: -0.08px;
}

.btn-primary,
.btn-success {
    background: var(--ln-brand);
    border-color: var(--ln-brand);
    color: #fff;
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--ln-brand-hover);
    border-color: var(--ln-brand-hover);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-info,
.btn-outline-danger {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--ln-border);
    color: var(--ln-text-2);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-danger:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--ln-text);
}

.form-control,
.form-select,
.input-group-text,
textarea,
#markdownEditor {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--ln-text-2) !important;
    border: 1px solid var(--ln-border) !important;
    border-radius: 6px;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(113, 112, 255, 0.75) !important;
    box-shadow: 0 0 0 0.2rem rgba(113, 112, 255, 0.16) !important;
}

.card,
.alert,
.modal-content,
.dropdown-menu,
.portfolio-info-card,
.edit-thought-page .editor-column,
.edit-thought-page .side-column,
#contact-form {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--ln-border) !important;
    border-radius: 10px;
    color: var(--ln-text-2);
    box-shadow: none !important;
}

.card-title,
.card-subtitle,
.table,
.modal-title,
label,
.meta-heading {
    color: var(--ln-text) !important;
}

.badge {
    border: 1px solid var(--ln-border);
    font-weight: 510;
}

.badge.bg-secondary,
.badge.bg-light,
.badge.bg-warning,
.badge.bg-info {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--ln-text-2) !important;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #8cf2cb !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ln-text-2);
    --bs-table-border-color: var(--ln-border-subtle);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
}

.pagination .page-link {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--ln-border);
    color: var(--ln-text-2);
}

.pagination .page-item.active .page-link {
    background: var(--ln-brand);
    border-color: var(--ln-brand);
    color: #fff;
}

.block-intro .about-me p {
    color: var(--ln-text);
    font-size: 1.08rem;
}

.projects-cards .card-img-top,
.portfolio-block .image,
.scale-on-hover,
.zoom-on-hover .image,
.playlist-cover,
.track-cover,
.movie-cover,
.image-library-thumb-wrapper img {
    border-radius: 10px;
    border: 1px solid var(--ln-border-subtle);
}

.call-to-action {
    border-color: var(--ln-border-subtle) !important;
}

.call-to-action h3 {
    color: var(--ln-text-2);
    font-weight: 510;
    line-height: 1.5;
}

.thought-content,
.thought-content p,
.thought-content li {
    color: var(--ln-text-2);
}

.thought-content blockquote,
.movie-comment {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ln-border-subtle);
    border-left: 3px solid var(--ln-accent);
    border-radius: 8px;
}

#commentFormCard .btn-secondary,
#cancelReply {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ln-border);
    color: var(--ln-text-2);
}

.comments-list .card {
    border-radius: 8px;
}

.loading-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: var(--ln-accent);
}

.global-toast {
    background: #141516;
    color: var(--ln-text-2);
    border: 1px solid var(--ln-border);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.global-toast.success {
    border-left-color: var(--ln-success);
}

#imageViewerOverlay.image-viewer-overlay {
    background: rgba(1, 1, 2, 0.92);
}

.image-viewer-nav,
.image-viewer-close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--ln-border);
}

.site-footer {
    background: transparent !important;
    border-top: 1px solid var(--ln-border-subtle);
}

.site-footer p,
.site-footer a,
.site-footer .text-body {
    color: var(--ln-text-3) !important;
}

.site-footer a:hover {
    color: var(--ln-text) !important;
}

.site-footer .bs-icon {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--ln-border);
    color: var(--ln-text) !important;
}

/* Spotify refinements in Linear style */
.spotify-page .spotify-section,
.spotify-page .spotify-user-info,
.spotify-page .playlist-card,
.spotify-page .artist-card,
.spotify-page .track-item,
.spotify-page .spotify-player,
.spotify-page .playlist-detail-panel {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--ln-border) !important;
    box-shadow: none !important;
}

.spotify-page .spotify-tab.active,
.spotify-page .time-range-btn.active,
.spotify-page .player-btn.play-pause,
.spotify-page .btn-spotify {
    background: var(--ln-brand) !important;
    border-color: var(--ln-brand) !important;
    color: #fff !important;
}

.spotify-page .genre-pill,
.spotify-page .progress-bar-fill {
    background: var(--ln-accent) !important;
}

/* Movie page refinements */
#movie-page-root .movie-card,
#movie-page-root .skeleton-card,
#movie-page-root #year-tabs .year-tab-link,
#movie-page-root #back-to-top {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--ln-border) !important;
    color: var(--ln-text-2) !important;
    box-shadow: none !important;
}

#movie-page-root #year-tabs .year-tab-link.active,
#movie-page-root #back-to-top {
    background: var(--ln-brand) !important;
    color: #fff !important;
    border-color: var(--ln-brand) !important;
}

@media (max-width: 991.98px) {
    main.page {
        padding-top: 5.65rem;
    }

    .portfolio-block {
        padding: 2rem 0;
    }
}

/* Round 2 refinements: light-mode parity + page-level polish */
html[data-bs-theme="light"] .portfolio-navbar {
    background: rgba(247, 248, 248, 0.88) !important;
    border-bottom: 1px solid rgba(18, 22, 30, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    --bs-navbar-toggler-border-color: rgba(18, 22, 30, 0.28);
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2818, 22, 30, 0.88%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

html[data-bs-theme="light"] .portfolio-navbar .nav-link {
    color: #2a2d33 !important;
}

html[data-bs-theme="light"] .portfolio-navbar .nav-link:hover,
html[data-bs-theme="light"] .portfolio-navbar .nav-link.active,
html[data-bs-theme="light"] .portfolio-navbar .nav-link[aria-current="page"] {
    background: rgba(94, 106, 210, 0.12) !important;
    color: #1d2230 !important;
    border-color: rgba(94, 106, 210, 0.24) !important;
}

.portfolio-navbar .navbar-toggler {
    border-color: var(--bs-navbar-toggler-border-color) !important;
}

.portfolio-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(113, 112, 255, 0.22);
}

.portfolio-navbar .navbar-toggler-icon {
    filter: none !important;
}

html[data-bs-theme="light"] .theme-switch {
    background: rgba(18, 22, 30, 0.03);
    border-color: rgba(18, 22, 30, 0.18) !important;
}

html[data-bs-theme="light"] .theme-switch .theme-thumb {
    background: #ffffff !important;
    border-color: rgba(18, 22, 30, 0.2) !important;
}

html[data-bs-theme="light"] .form-control,
html[data-bs-theme="light"] .form-select,
html[data-bs-theme="light"] .input-group-text,
html[data-bs-theme="light"] textarea,
html[data-bs-theme="light"] #markdownEditor {
    background: #ffffff !important;
    color: #21242b !important;
    border-color: rgba(18, 22, 30, 0.16) !important;
}

html[data-bs-theme="light"] .card,
html[data-bs-theme="light"] .alert,
html[data-bs-theme="light"] .modal-content,
html[data-bs-theme="light"] .dropdown-menu,
html[data-bs-theme="light"] .portfolio-info-card,
html[data-bs-theme="light"] .edit-thought-page .editor-column,
html[data-bs-theme="light"] .edit-thought-page .side-column,
html[data-bs-theme="light"] #contact-form,
html[data-bs-theme="light"] .spotify-page .spotify-section,
html[data-bs-theme="light"] .spotify-page .spotify-user-info,
html[data-bs-theme="light"] .spotify-page .playlist-card,
html[data-bs-theme="light"] .spotify-page .artist-card,
html[data-bs-theme="light"] .spotify-page .track-item,
html[data-bs-theme="light"] .spotify-page .spotify-player,
html[data-bs-theme="light"] .spotify-page .playlist-detail-panel,
html[data-bs-theme="light"] #movie-page-root .movie-card,
html[data-bs-theme="light"] #movie-page-root .skeleton-card,
html[data-bs-theme="light"] #movie-page-root #year-tabs .year-tab-link {
    background: #ffffff !important;
    border-color: rgba(18, 22, 30, 0.12) !important;
}

html[data-bs-theme="light"] #movie-page-root #year-tabs .year-tab-link.active {
    background: var(--ln-brand) !important;
    color: #fff !important;
    border-color: var(--ln-brand) !important;
}

.btn-danger {
    background: #aa3f55;
    border-color: #aa3f55;
}

.btn-danger:hover {
    background: #be4962;
    border-color: #be4962;
}

.btn-warning {
    background: rgba(255, 183, 77, 0.2);
    border-color: rgba(255, 183, 77, 0.45);
    color: var(--ln-text-2);
}

.btn-warning:hover {
    background: rgba(255, 183, 77, 0.32);
    border-color: rgba(255, 183, 77, 0.6);
    color: var(--ln-text);
}

.btn-info {
    background: rgba(113, 112, 255, 0.18);
    border-color: rgba(113, 112, 255, 0.42);
    color: var(--ln-text);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ln-border);
    color: var(--ln-text-2);
}

html[data-bs-theme="light"] .btn-secondary {
    background: #ffffff;
    border-color: rgba(18, 22, 30, 0.2);
    color: #2a2d33;
}

.badge.bg-danger {
    background: rgba(170, 63, 85, 0.2) !important;
    color: #ffd6df !important;
}

html[data-bs-theme="light"] .badge.bg-danger {
    color: #8a2d43 !important;
}

.badge.bg-primary {
    background: rgba(94, 106, 210, 0.22) !important;
    color: #dbe0ff !important;
}

html[data-bs-theme="light"] .badge.bg-primary {
    color: #3241a3 !important;
}

.thoughts-grid .card-body h6 a,
#commentsList .card-subtitle,
#commentsList .card-text,
#commentFormCard .card-title,
#movie-page-root .movie-title,
#movie-page-root .movie-rating,
.spotify-page .section-header h3,
.spotify-page .playlist-name,
.spotify-page .track-name,
.spotify-page .artist-name,
.spotify-page .player-track-name,
.spotify-page .player-toggle,
.spotify-page .playlist-detail-info h2 {
    color: var(--ln-text) !important;
}

.edit-thought-page {
    background: transparent !important;
}

#thoughtForm .tag-badge,
#thoughtForm .category-badge {
    background: rgba(113, 112, 255, 0.18);
    border: 1px solid rgba(113, 112, 255, 0.3);
    color: var(--ln-text);
}

#movie-page-root #back-to-top {
    background: var(--ln-brand) !important;
    border: 1px solid var(--ln-brand) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.spotify-action-btn-primary {
    background: var(--ln-brand) !important;
    border: 1px solid var(--ln-brand) !important;
    color: #fff !important;
}

.spotify-action-btn-primary:hover {
    background: var(--ln-brand-hover) !important;
    border-color: var(--ln-brand-hover) !important;
}

.spotify-page .track-item.playing {
    background: rgba(94, 106, 210, 0.14) !important;
}

.spotify-page .track-item.playing .track-number,
.spotify-page .player-btn.active {
    color: var(--ln-accent) !important;
}

.spotify-page .playlist-detail-header {
    background: linear-gradient(180deg, rgba(94, 106, 210, 0.25) 0%, transparent 100%) !important;
}

.spotify-page .spotify-loading .spinner,
.spotify-page #playlist-loading-more .spinner {
    border-top-color: var(--ln-brand) !important;
}

.admin-surface,
.search-table-col .table,
.search-table-col .table-bordered,
.results .table {
    background: transparent !important;
    border-color: var(--ln-border-subtle) !important;
}

html[data-bs-theme="light"] .search-table-col .table,
html[data-bs-theme="light"] .search-table-col .table-bordered,
html[data-bs-theme="light"] .results .table {
    border-color: rgba(18, 22, 30, 0.12) !important;
}

#global-toast-container .global-toast.info {
    border-left-color: var(--ln-accent);
}

html[data-bs-theme="light"] .global-toast {
    background: #ffffff;
    color: #2a2d33;
    border-color: rgba(18, 22, 30, 0.14);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

/* Homepage fixes */
.home-page .home-latest-thoughts {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--ln-border-subtle);
    border-bottom: 1px solid var(--ln-border-subtle);
}

.home-page .home-latest-thoughts .item {
    background: transparent;
}

.home-page .home-latest-thoughts .item a {
    display: block;
    background: transparent;
}

.home-page .home-latest-thoughts-caption {
    background: rgba(255, 255, 255, 0.01);
}

.home-special-thanks {
    background: linear-gradient(180deg, rgba(12, 14, 18, 0.85) 0%, rgba(8, 9, 10, 1) 100%) !important;
    border-top: 1px solid var(--ln-border-subtle);
}

.home-special-thanks h3,
.home-special-thanks p,
.home-special-thanks .text p {
    color: var(--ln-text) !important;
}

.home-special-thanks a {
    color: #b7bfff !important;
}

.home-special-thanks a:hover {
    color: var(--ln-brand-hover) !important;
}

html[data-bs-theme="light"] .home-page .home-latest-thoughts {
    background: #f3f4f6;
    border-top-color: rgba(18, 22, 30, 0.08);
    border-bottom-color: rgba(18, 22, 30, 0.08);
}

html[data-bs-theme="light"] .home-page .home-latest-thoughts-caption {
    background: #f7f8f8;
}

html[data-bs-theme="light"] .home-special-thanks {
    background: linear-gradient(180deg, rgba(76, 85, 191, 0.06) 0%, rgba(76, 85, 191, 0.015) 100%) !important;
    border-top: 1px solid rgba(18, 22, 30, 0.08) !important;
    border-bottom: 1px solid rgba(18, 22, 30, 0.05) !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-title {
    color: #1a2232 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-lead {
    color: #2c3443 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-meta {
    color: #5e6575 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-meta a {
    color: #4c55bf !important;
}

/* --- Round 5: thoughts page search panel refinement --- */
.thoughts-list-page .thoughts-head h2 {
    font-size: clamp(1.8rem, 2.8vw, 2.3rem);
    letter-spacing: -0.44px;
}

.thoughts-list-page .search-filter-bar {
    margin: 0 0 1rem;
    max-width: none;
}

.thoughts-list-page .thoughts-filter-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--ln-border);
    border-radius: 12px;
    padding: 12px;
}

.thoughts-list-page .thoughts-filter-main {
    display: grid;
    gap: 10px;
}

.thoughts-list-page .thoughts-filter-row {
    display: grid;
    gap: 10px;
    align-items: end;
}

.thoughts-list-page .thoughts-filter-row-single {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
}

.thoughts-list-page .thoughts-filter-field .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 510;
    color: var(--ln-text-3) !important;
}

.thoughts-list-page .thoughts-filter-search .input-group {
    position: relative;
}

.thoughts-list-page .thoughts-filter-search .input-group-text {
    border-right: 0 !important;
    min-width: 44px;
    justify-content: center;
}

.thoughts-list-page .thoughts-filter-search .form-control {
    border-left: 0 !important;
    padding-right: 42px;
    min-height: 42px;
}

.thoughts-list-page .thoughts-filter-search .form-control::placeholder {
    color: var(--ln-text-4);
}

.thoughts-list-page .thoughts-clear-btn {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ln-border-subtle);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--ln-text-3);
    padding: 0;
    z-index: 5;
}

.thoughts-list-page .thoughts-clear-btn .material-icons {
    font-size: 16px;
}

.thoughts-list-page .thoughts-clear-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--ln-text);
}

.thoughts-list-page .thoughts-filter-actions {
    display: flex;
    gap: 8px;
}

.thoughts-list-page .thoughts-filter-actions .btn {
    min-height: 42px;
    padding: 0.55rem 0.95rem;
    white-space: nowrap;
}

.thoughts-list-page .thoughts-results-meta {
    margin-top: 0.4rem;
}

html[data-bs-theme="light"] .thoughts-list-page .thoughts-filter-form {
    background: #ffffff;
    border-color: rgba(18, 22, 30, 0.12);
}

html[data-bs-theme="light"] .thoughts-list-page .thoughts-clear-btn {
    background: rgba(18, 22, 30, 0.04);
}

@media (max-width: 991.98px) {
    .thoughts-list-page .search-filter-bar {
        max-width: none;
    }

    .thoughts-list-page .thoughts-filter-row-single {
        grid-template-columns: 1fr;
    }

    .thoughts-list-page .thoughts-filter-actions {
        width: 100%;
    }

    .thoughts-list-page .thoughts-filter-actions .btn {
        flex: 1;
    }
}

/* --- Round 4: CV readability and color corrections --- */
.cv-page .portfolio-block.cv {
    font-size: 1.05rem;
}

.cv-page .portfolio-block.cv .group .item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--ln-border-subtle);
}

.cv-page .portfolio-block.cv h2 {
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
}

.cv-page .portfolio-block.cv h3 {
    font-size: 1.14rem;
    font-weight: 510;
}

.cv-page .portfolio-block.cv p,
.cv-page .portfolio-block.cv span,
.cv-page .portfolio-block.cv li,
.cv-page .portfolio-block.cv a {
    color: var(--ln-text-2);
}

.cv-page .portfolio-block.cv .period,
.cv-page .portfolio-block.cv .text-muted {
    color: var(--ln-text-3) !important;
}

.cv-page .portfolio-block.cv .portfolio-info-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--ln-border) !important;
    border-radius: 10px !important;
    padding: 1.15rem;
}

.cv-page .portfolio-block.cv .portfolio-info-card h2 {
    margin-bottom: 0.9rem;
}

.cv-page .portfolio-block.cv .portfolio-info-card .progress {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ln-border-subtle);
    height: 10px;
}

.cv-page .portfolio-block.cv .portfolio-info-card .progress-bar {
    background: var(--ln-brand);
}

.cv-page .portfolio-block.cv .contact-info .icon {
    color: var(--ln-accent);
}

.cv-page .portfolio-block.cv .contact-info span[style] {
    font-size: 1rem !important;
    color: var(--ln-text-2) !important;
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv {
    font-size: 1.08rem;
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv p,
html[data-bs-theme="light"] .cv-page .portfolio-block.cv span,
html[data-bs-theme="light"] .cv-page .portfolio-block.cv a {
    color: #2b313d !important;
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv .portfolio-info-card {
    background: #ffffff !important;
    border-color: rgba(18, 22, 30, 0.14) !important;
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv .portfolio-info-card .progress {
    background: #eef1f6;
    border-color: rgba(18, 22, 30, 0.12);
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv .portfolio-info-card .progress-bar {
    background: #5e6ad2;
}

html[data-bs-theme="light"] .cv-page .portfolio-block.cv h1[style*='var(--bs-light)'] {
    color: #f7f8f8 !important;
}

/* --- Round 4: full homepage redesign styles --- */
.home-page .home-hero {
    padding-top: 3.1rem;
    padding-bottom: 2.2rem;
}

.home-page .home-eyebrow {
    margin-bottom: 0.7rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ln-text-3);
}

.home-page .home-title {
    margin: 0;
    color: var(--ln-text);
    font-size: clamp(2rem, 4.2vw, 3rem);
    font-weight: 510;
    line-height: 1.06;
    letter-spacing: -0.9px;
}

.home-page .home-subtitle {
    margin: 1rem 0 0;
    max-width: 58ch;
    font-size: 1.02rem;
    line-height: 1.72;
    color: var(--ln-text-3);
}

.home-page .home-actions {
    margin-top: 1.2rem;
}

.home-page .home-section-head {
    margin-bottom: 0.45rem;
}

.home-page .home-section-head h2 {
    font-size: clamp(1.55rem, 2.8vw, 2rem);
    letter-spacing: -0.46px;
}

.home-page .home-latest-thoughts,
.home-page .home-projects {
    background: transparent !important;
    border: 0 !important;
    padding-top: 1.4rem;
}

.home-page .home-thought-card {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--ln-border);
    background: rgba(255, 255, 255, 0.03);
    transition: 0.5s ease;
    transform: translateZ(0);
    will-change: transform;
}

.home-page .home-thought-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Keep latest-thoughts hover as one card-level animation (image + text together). */
.home-page .home-latest-thoughts .home-thought-card img,
.home-page .home-latest-thoughts .home-thought-card .home-thought-card-body {
    transform: none !important;
}

.home-page .home-thought-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-bottom: 1px solid var(--ln-border-subtle);
}

.home-page .home-thought-card-body {
    padding: 0.75rem 0.85rem 0.85rem;
}

.home-page .home-thought-card-body h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 510;
    line-height: 1.45;
    color: var(--ln-text);
}


.home-page .home-projects .project-showcase-card {
    height: 100%;
    border-radius: 14px !important;
    border: 1px solid var(--ln-border) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.home-page .home-projects .project-showcase-card .card-body {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 0.9rem;
    padding: 1.2rem;
}

.home-page .home-projects .project-showcase-card .card-title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 510;
    line-height: 1.45;
}

.home-page .home-projects .project-showcase-card .card-text {
    margin: 0;
    color: var(--ln-text-3) !important;
    line-height: 1.66;
}

.home-page .home-projects .project-showcase-card .btn {
    justify-self: start;
    min-width: 122px;
}

.home-page .home-projects .project-showcase-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(113, 112, 255, 0.14);
    border: 1px solid rgba(113, 112, 255, 0.26);
    color: #c5cbff;
    font-size: 1.1rem;
}

.home-page .home-projects .project-showcase-card:hover {
    transform: translateY(-4px);
    border-color: rgba(113, 112, 255, 0.4) !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22) !important;
}

.home-page .home-projects .project-showcase-card:focus-within {
    border-color: rgba(113, 112, 255, 0.56) !important;
    box-shadow: 0 0 0 0.22rem rgba(113, 112, 255, 0.2) !important;
}


.home-special-thanks {
    margin-top: 1.1rem;
    background: transparent !important;
}

.home-special-thanks .home-thanks-shell {
    border-radius: 18px;
    border: 1px solid var(--ln-border);
    background: linear-gradient(150deg, rgba(113, 112, 255, 0.11) 0%, rgba(255, 255, 255, 0.02) 55%, rgba(255, 255, 255, 0.01) 100%);
    padding: clamp(1.15rem, 2vw, 2rem);
}

.home-special-thanks .thanks-title {
    margin-bottom: 0.82rem;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    font-weight: 510;
    letter-spacing: -0.52px;
}

.home-special-thanks .thanks-lead {
    margin-bottom: 0.45rem;
    font-size: 1.02rem;
    color: var(--ln-text-2) !important;
}

.home-special-thanks .thanks-meta {
    margin-bottom: 0;
    font-size: 0.96rem;
    line-height: 1.72;
    color: var(--ln-text-3) !important;
    white-space: normal;
}

.home-special-thanks .thanks-highlight-card {
    border: 1px solid var(--ln-border);
    border-radius: 14px;
    padding: 1rem 1.05rem;
    background: rgba(0, 0, 0, 0.2);
}

.home-special-thanks .thanks-highlight-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    color: var(--ln-text-4);
}

.home-special-thanks .thanks-highlight-text {
    color: var(--ln-text-2);
    line-height: 1.74;
}

.home-special-thanks .thanks-meta a {
    color: #a4acff !important;
}

html[data-bs-theme="light"] .home-page .home-title {
    color: #161d2b;
}

html[data-bs-theme="light"] .home-page .home-subtitle,
html[data-bs-theme="light"] .home-page .home-section-head .text-muted {
    color: #5f6676 !important;
}

html[data-bs-theme="light"] .home-page .home-thought-card {
    background: #ffffff;
    border-color: rgba(18, 22, 30, 0.12);
}

html[data-bs-theme="light"] .home-page .home-projects .project-showcase-card {
    background: #ffffff !important;
    border-color: rgba(18, 22, 30, 0.14) !important;
}

html[data-bs-theme="light"] .home-page .home-projects .project-showcase-card:hover {
    border-color: rgba(94, 106, 210, 0.38) !important;
    box-shadow: 0 14px 30px rgba(30, 39, 73, 0.14) !important;
}

html[data-bs-theme="light"] .home-page .home-projects .project-showcase-icon {
    color: #4957c8;
    background: rgba(94, 106, 210, 0.12);
    border-color: rgba(94, 106, 210, 0.24);
}

html[data-bs-theme="light"] .home-page .home-thought-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.15) !important;
}

html[data-bs-theme="light"] .home-special-thanks {
    background: transparent !important;
}

html[data-bs-theme="light"] .home-special-thanks .home-thanks-shell {
    background: linear-gradient(145deg, rgba(76, 85, 191, 0.1) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 1) 100%);
    border-color: rgba(18, 22, 30, 0.12);
}

html[data-bs-theme="light"] .home-special-thanks .thanks-title {
    color: #1a2232 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-lead {
    color: #2c3443 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-meta {
    color: #5e6575 !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-meta a {
    color: #4c55bf !important;
}

html[data-bs-theme="light"] .home-special-thanks .thanks-highlight-card {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(18, 22, 30, 0.12);
}

@media (max-width: 991.98px) {
    .home-page .home-hero {
        padding-top: 2rem;
    }

    .home-page .home-title {
        letter-spacing: -0.5px;
    }

    .home-page .home-subtitle {
        font-size: 0.98rem;
        line-height: 1.65;
    }
}

/* --- Round 5: requested polish updates --- */

.thoughts-list-page .thoughts-top-shell {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0.85rem;
}

.thoughts-list-page .thoughts-head {
    margin-bottom: 0 !important;
}

.thoughts-list-page .search-filter-bar {
    margin-bottom: 1rem;
}

.thoughts-list-page .thoughts-filter-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--ln-border);
    border-radius: 12px;
    padding: 12px;
}

html[data-bs-theme="light"] .thoughts-list-page .thoughts-top-shell {
    background: transparent;
    border-color: transparent;
}

.spotify-page .spotify-tabs,
.spotify-page .spotify-user-info,
.spotify-page .playlist-card,
.spotify-page .artist-card,
.spotify-page .track-item,
.spotify-page .spotify-section,
.spotify-page .playlist-detail-panel,
.spotify-page .spotify-player,
.spotify-page .player-toggle,
.spotify-page .spotify-tab,
.spotify-page .time-range-btn,
.spotify-page .player-btn,
.spotify-page .progress-bar-wrapper,
.spotify-page .volume-slider {
    border-radius: 12px !important;
}

.spotify-page .spotify-section.tab-content {
    padding: clamp(16px, 1.8vw, 24px);
    margin-bottom: 24px;
}

.spotify-page .spotify-section.tab-content .section-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
}

.spotify-page .spotify-section.tab-content > :last-child {
    margin-bottom: 0;
}

.spotify-page .playlist-cover,
.spotify-page .track-cover,
.spotify-page .artist-image,
.spotify-page .playlist-detail-cover,
.spotify-page .player-track-cover,
.spotify-page .artist-album-cover {
    border-radius: 10px !important;
}

.spotify-page .player-btn.play-pause {
    border-radius: 999px !important;
}

.spotify-page .spotify-player {
    border-radius: 16px !important;
}

.spotify-page .player-toggle {
    border-radius: 14px 14px 0 0 !important;
}

@media (min-width: 992px) {
    .site-footer .row.row-cols-1.row-cols-lg-3 {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        column-gap: clamp(12px, 2vw, 28px);
        margin-left: 0;
        margin-right: 0;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col {
        width: auto;
        max-width: none;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col:first-child {
        justify-self: start;
        text-align: left;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col:first-child .text-body {
        white-space: nowrap;
        letter-spacing: -0.02em;
        margin-bottom: 0;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col:nth-child(2) {
        justify-self: center;
        display: flex;
        justify-content: center;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col:nth-child(2) .list-inline {
        white-space: nowrap;
        margin: 0;
    }

    .site-footer .row.row-cols-1.row-cols-lg-3 > .col:nth-child(3) {
        justify-self: end;
        text-align: right;
    }

    .site-footer .footer-links-col {
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        gap: clamp(0.42rem, 0.9vw, 0.85rem) !important;
        white-space: nowrap;
    }

    .site-footer .footer-links-col a,
    .site-footer .footer-page-views {
        white-space: nowrap;
        font-size: inherit;
    }
}

@media (max-width: 991.98px) {
    .home-page .home-projects .project-showcase-card .btn {
        width: 100%;
        justify-self: stretch;
    }

    .thoughts-list-page .thoughts-top-shell {
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page .home-projects .project-showcase-card,
    .home-page .home-thought-card {
        transition: none;
    }

    .home-page .home-projects .project-showcase-card:hover,
    .home-page .home-thought-card:hover {
        transform: none;
        box-shadow: none !important;
    }
}

/* --- Hotfix: keep thoughts search area full-width with container --- */
.thoughts-list-page .search-filter-bar {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.thoughts-list-page .thoughts-filter-form,
.thoughts-list-page .thoughts-filter-main,
.thoughts-list-page .thoughts-filter-row-single,
.thoughts-list-page .thoughts-filter-search,
.thoughts-list-page .thoughts-filter-search .input-group {
    width: 100%;
    min-width: 0;
}

.thoughts-list-page .thoughts-filter-form {
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.thoughts-list-page .thoughts-filter-field .form-label {
    display: none;
}

