/* ===================================================
   PORTFOLIO — Modern Monochrome Design System
   Font: Poppins | Themes: Light & Dark
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
    /* Light Theme (default) */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --bg-card: #ffffff;
    --fg-primary: #111111;
    --fg-secondary: #555555;
    --fg-tertiary: #888888;
    --border-color: #e0e0e0;
    --border-subtle: #efefef;
    --accent: #222222;
    --accent-hover: #444444;
    --tag-bg: #f0f0f0;
    --tag-fg: #333333;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.06);
    --progress-bg: #e8e8e8;
    --progress-fill: #333333;
    --dot-active: #222222;
    --dot-inactive: #cccccc;
    --overlay-bg: rgba(250, 250, 250, 0.95);
    --code-bg: #f5f5f5;
    --scrollbar-track: #f0f0f0;
    --scrollbar-thumb: #ccc;
    --carousel-overlay: rgba(255, 255, 255, 0.2);
    --unpublished-bg: #fff3cd;
    --unpublished-fg: #856404;

    /* Shared tokens */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --container-width: 1200px;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #161616;
    --fg-primary: #f0f0f0;
    --fg-secondary: #aaaaaa;
    --fg-tertiary: #666666;
    --border-color: #2a2a2a;
    --border-subtle: #1e1e1e;
    --accent: #e0e0e0;
    --accent-hover: #cccccc;
    --tag-bg: #222222;
    --tag-fg: #cccccc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(20, 20, 20, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
    --progress-bg: #2a2a2a;
    --progress-fill: #e0e0e0;
    --dot-active: #ffffff;
    --dot-inactive: #444444;
    --overlay-bg: rgba(10, 10, 10, 0.95);
    --code-bg: #1e1e1e;
    --scrollbar-track: #1a1a1a;
    --scrollbar-thumb: #333;
    --carousel-overlay: rgba(0, 0, 0, 0.3);
    --unpublished-bg: #332900;
    --unpublished-fg: #ffc107;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-primary);
    color: var(--fg-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    font-size: 15px;
    font-weight: 400;
    transition: background var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-tertiary);
}

/* ---------- Layout ---------- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Header ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    transition: background var(--transition-normal);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    padding: 0 3px;
}

.theme-toggle:hover {
    border-color: var(--fg-tertiary);
}

.theme-toggle-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--fg-primary);
    transition: transform var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(22px);
}

.theme-toggle-icon {
    font-size: 10px;
    color: var(--bg-primary);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-family);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.7;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border: 1px solid var(--fg-primary);
    background: transparent;
    color: var(--fg-primary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:hover {
    background: var(--fg-primary);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.7rem;
}

.btn:disabled {
    border-color: var(--fg-tertiary);
    color: var(--fg-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn:disabled:hover {
    background: transparent;
    color: var(--fg-tertiary);
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    border: none;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--fg-secondary);
    border-radius: var(--radius-sm);
}

.btn-ghost:hover {
    background: var(--border-color);
    color: var(--fg-primary);
}

.btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

/* ---------- Project Grid (Home) ---------- */
.project-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ---------- Project Card (horizontal) ---------- */
.project-card {
    display: grid;
    grid-template-columns: 1fr 400px;
    /* Slightly wider carousel area */
    gap: 0;
    height: 280px;
    /* Fixed height like Play Store */
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.project-card.no-carousel {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 200px;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.project-card-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.project-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.project-name a {
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.project-name a:hover {
    border-bottom-color: var(--fg-primary);
    opacity: 1;
}

.project-status-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-status-badge.published {
    background: var(--tag-bg);
    color: var(--fg-secondary);
}

.project-status-badge.unpublished {
    background: var(--unpublished-bg);
    color: var(--unpublished-fg);
}

.project-desc {
    color: var(--fg-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Project Status Badge (on cards) */
.project-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    white-space: nowrap;
}

.project-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-status.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.project-status.status-completed .status-dot {
    background: #2e7d32;
}

[data-theme="dark"] .project-status.status-completed {
    background: #1b3a1e;
    color: #66bb6a;
}

[data-theme="dark"] .project-status.status-completed .status-dot {
    background: #66bb6a;
}

.project-status.status-in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.project-status.status-in-progress .status-dot {
    background: #1565c0;
}

[data-theme="dark"] .project-status.status-in-progress {
    background: #0d2137;
    color: #42a5f5;
}

[data-theme="dark"] .project-status.status-in-progress .status-dot {
    background: #42a5f5;
}

.project-status.status-currently-working {
    background: #fff3e0;
    color: #e65100;
}

.project-status.status-currently-working .status-dot {
    background: #e65100;
    animation: pulse-dot 1.5s infinite;
}

[data-theme="dark"] .project-status.status-currently-working {
    background: #331a00;
    color: #ff9800;
}

[data-theme="dark"] .project-status.status-currently-working .status-dot {
    background: #ff9800;
}

.project-status.status-abandoned {
    background: #fce4ec;
    color: #c62828;
}

.project-status.status-abandoned .status-dot {
    background: #c62828;
}

[data-theme="dark"] .project-status.status-abandoned {
    background: #2a0a0a;
    color: #ef5350;
}

[data-theme="dark"] .project-status.status-abandoned .status-dot {
    background: #ef5350;
}

.project-status.status-on-hold {
    background: var(--tag-bg);
    color: var(--fg-tertiary);
}

.project-status.status-on-hold .status-dot {
    background: var(--fg-tertiary);
}

.project-status.status-planned {
    background: #ede7f6;
    color: #4527a0;
}

.project-status.status-planned .status-dot {
    background: #4527a0;
}

[data-theme="dark"] .project-status.status-planned {
    background: #1a0a33;
    color: #b39ddb;
}

[data-theme="dark"] .project-status.status-planned .status-dot {
    background: #b39ddb;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.4);
    }
}

/* Tech Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--tag-bg);
    color: var(--tag-fg);
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--border-color);
}

/* Actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* Card Carousel (right side) */
.project-card-carousel {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    height: 100%;
    /* Fill the fixed-height card */
}

.card-carousel-inner {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: var(--bg-tertiary);
}

/* Portrait specific styling inside carousel */
.card-carousel-slide.is-portrait img {
    height: calc(100% - 20px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Landscape styling */
.card-carousel-slide.is-landscape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-carousel-slide img {
    filter: blur(1.5px) brightness(0.9);
    transition: all var(--transition-slow);
}

.project-card:hover .card-carousel-slide img {
    filter: blur(0px) brightness(1);
    transform: scale(1.02);
}

.card-carousel-overlay {
    position: absolute;
    inset: 0;
    background: var(--carousel-overlay);
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.project-card:hover .card-carousel-overlay {
    opacity: 0.3;
}

.card-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.card-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dot-inactive);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    padding: 0;
}

.card-carousel-dot.active {
    background: var(--dot-active);
    width: 16px;
    border-radius: 3px;
}

.no-screenshots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--fg-tertiary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------- Detail Page ---------- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 1rem;
}

.detail-content {
    max-width: 100%;
}

.detail-header {
    margin-bottom: 2rem;
}

.detail-header h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

/* Devicon Tags for Detail Page */
.devicon-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.devicon-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 8px;
    min-width: 42px;
    background: var(--tag-bg);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg-secondary);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.devicon-tag:hover {
    border-color: var(--border-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.devicon-tag i {
    font-size: 1.4rem;
    color: var(--fg-primary);
}

/* If text is present (fallback), add more side padding */
.devicon-tag span {
    padding: 0 4px;
}

/* Meta Info */
.meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--fg-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---------- Carousel (Detail Page) ---------- */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-md);
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    min-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 1rem;
}

/* Play Store Portrait Style: Show multiple but center one */
.portrait-item {
    min-width: 25%;
    /* Show four on desktop as requested */
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .portrait-item {
        min-width: 80%;
        /* Show 'peek' of next one on mobile */
    }
}

.playstore-img {
    height: 550px;
    width: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #000;
}

.landscape-item img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.carousel-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
}

.carousel-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dot-inactive);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    padding: 0;
}

.dot.active {
    background: var(--dot-active);
    width: 16px;
    border-radius: 3px;
}

/* Screenshot section */
.screenshot-section {
    margin-top: 2rem;
}

.screenshot-section h2 {
    margin-bottom: 1rem;
}

.screenshot {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

/* ---------- Markdown Body ---------- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.25rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
    color: var(--fg-secondary);
    line-height: 1.7;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.25rem;
}

.markdown-body code {
    background: var(--code-bg);
    padding: 2px 6px;
    font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    border-radius: var(--radius-xs);
}

.markdown-body pre {
    background: var(--code-bg);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
}

.markdown-body blockquote {
    border-left: 3px solid var(--fg-tertiary);
    padding-left: 1rem;
    color: var(--fg-tertiary);
    font-style: italic;
    margin: 1rem 0;
}

/* ---------- Loader ---------- */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
    color: var(--fg-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.loader-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-top-color: var(--fg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    color: var(--fg-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-top: 1px solid var(--border-subtle);
}

/* ---------- Utility ---------- */
.hidden {
    display: none !important;
}

/* ---------- Admin Table ---------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-table th,
.admin-table td {
    border: 1px solid var(--border-subtle);
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.88rem;
}

.admin-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--fg-secondary);
}

.admin-table tr {
    background: var(--bg-card);
    transition: background var(--transition-fast);
}

.admin-table tr:hover {
    background: var(--bg-tertiary);
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--fg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--fg-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--fg-tertiary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

textarea {
    height: 150px;
    resize: vertical;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .project-card {
        grid-template-columns: 1fr;
    }

    .project-card-carousel {
        min-height: 180px;
        order: -1;
    }

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

    h1 {
        font-size: 1.4rem;
    }

    .header-brand h1 {
        font-size: 1rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* ---------- Fade In Animation ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.project-card:nth-child(1) {
    animation-delay: 0.05s;
}

.project-card:nth-child(2) {
    animation-delay: 0.1s;
}

.project-card:nth-child(3) {
    animation-delay: 0.15s;
}

.project-card:nth-child(4) {
    animation-delay: 0.2s;
}

.project-card:nth-child(5) {
    animation-delay: 0.25s;
}

.project-card:nth-child(6) {
    animation-delay: 0.3s;
}

.project-card:nth-child(7) {
    animation-delay: 0.35s;
}

.project-card:nth-child(8) {
    animation-delay: 0.4s;
}



/* ---------- Markdown Editor Modal ---------- */
.md-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.md-modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 960px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.md-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.md-modal-title {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.md-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.md-tool {
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    color: var(--fg-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 32px;
    text-align: center;
}

.md-tool:hover {
    background: var(--fg-primary);
    color: var(--bg-primary);
    border-color: var(--fg-primary);
}

.md-tool-sep {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 4px;
}

.md-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.md-modal-body textarea {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 1.25rem;
    font-size: 0.9rem;
    font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    resize: none;
    background: var(--bg-secondary);
    color: var(--fg-primary);
    outline: none;
    line-height: 1.7;
    width: 100%;
    height: 100%;
}

.md-preview-pane {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* ---------- Admin UI Enhancements ---------- */
.tag-input-container {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.removable-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fg-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 500;
}

.remove-tag-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.screenshot-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.remove-screenshot-btn {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #c62828;
    border-radius: var(--radius-xs);
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
}

[data-theme="dark"] .remove-screenshot-btn {
    background: #2a0a0a;
    color: #ef5350;
    border-color: #ef5350;
}

/* Fullscreen Editor */
.editor-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: var(--bg-primary);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.editor-fullscreen .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-fullscreen textarea {
    flex: 1;
    height: auto !important;
}

.editor-fullscreen #markdown-preview {
    flex: 1;
    height: auto !important;
    overflow-y: auto;
}