/* ==========================================================================
   Component Styles (Buttons, Cards, Forms, UI Elements) - Sleek & Bento
   ========================================================================== */

/* Buttons - Pill Shaped, Minimalist, High Contrast */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-8);
    /* Wider padding for premium feel */
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-weight: 600;
    /* Bolder button text */
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
    gap: var(--space-2);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, #1f2937 0%, #000000 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, #374151 0%, #111827 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    color: #000000;
    box-shadow: 0 4px 14px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: var(--color-bg-white);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-secondary {
    background-color: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-dark);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-text {
    padding: 0;
    color: var(--color-text-dark);
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid transparent;
}

.btn-text:hover {
    border-bottom: 1px solid var(--color-text-dark);
    opacity: 0.8;
}

.btn-text::after {
    content: '→';
    margin-left: var(--space-2);
    transition: transform var(--transition-fast);
}

.btn-text:hover::after {
    transform: translateX(4px);
}

/* Cards (Premium Inset Design) */
.card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-2xl);
    /* Ultra soft curves */
    padding: var(--space-4);
    /* Inset spacing for the image */
    box-shadow:
        var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 600ms cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.card:hover {
    box-shadow:
        var(--shadow-xl),
        0 32px 64px rgba(10, 10, 10, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 1);
    transform: translateY(-10px) scale(1.015);
}

[data-theme="dark"] .card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .card:hover {
    box-shadow: var(--shadow-glow), 0 24px 48px rgba(14, 165, 233, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Spotlight Border Glow for Cards */
.card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(14, 165, 233, 0.4), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease;
}

/* Spotlight Inner Glare for Cards */
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(14, 165, 233, 0.06), transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease;
}

.card:hover::before,
.card:hover::after {
    opacity: 1;
}

[data-theme="dark"] .card::before {
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.25), transparent 40%);
}

[data-theme="dark"] .card::after {
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.03), transparent 40%);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    /* Aspect ratio 16:10 */
    background-color: var(--color-bg-light);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: var(--space-6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Turn into parallax wrapper behavior natively */
    transform: translateZ(0);
}

.card-img {
    position: absolute;
    top: -12.5%;
    /* Pull up half of the extra 25% height to center parallax */
    left: 0;
    width: 100%;
    height: 125%;
    /* Breathing room for parallax scroll */
    object-fit: cover;
    will-change: transform;
    /* Add slight scale so border edges don't show on extreme scroll pulls */
    transform: scale(1.05) translate3d(0, 0, 0);
    transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card-img {
    /* Base hover scale (if parallax JS isn't doing the hover, css handles it) */
    transform: scale(1.1) translate3d(0, 0, 0);
}

.card-content {
    padding: 0 var(--space-4) var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    letter-spacing: -0.03em;
}

.card-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
    flex-grow: 1;
    line-height: 1.6;
}

.card-actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: var(--space-4);
}

[data-theme="dark"] .card-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tags (Technologies) - Minimal pill design */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tag {
    background: rgba(14, 165, 233, 0.08);
    color: var(--color-accent-blue);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(14, 165, 233, 0.2);
    /* Soft border */
}

[data-theme="dark"] .tag {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.2);
}

/* Sections */
.section {
    padding: var(--space-24) 0;
}

.section-header {
    margin-bottom: var(--space-16);
    text-align: center;
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Forms - Clean, Apple-like inputs */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text-dark);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-light);
    /* Off-white fill */
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-dark);
    transition: all var(--transition-fast);
}

.form-textarea {
    min-height: 160px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    background-color: var(--color-bg-white);
    border-color: var(--color-text-dark);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    /* Subtle focus ring */
}

/* Data-theme Dark Form adjustments */
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* ==========================================================================
   Tech Stack Marquee (Infinite Scroll)
   ========================================================================== */
.tech-marquee-wrapper {
    width: 100%;
    overflow: hidden;
    padding: var(--space-12) 0;
    background-color: transparent;
    /* Remove borders, let it float */
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: var(--space-16);
}

.tech-marquee-wrapper::before,
.tech-marquee-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    width: 15%;
    /* Wider fade */
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.tech-marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg-light) 0%, transparent 100%);
}

.tech-marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg-light) 0%, transparent 100%);
}

/* Respect dark mode for marquee fade */
[data-theme="dark"] .tech-marquee-wrapper::before {
    background: linear-gradient(to right, var(--color-bg-light) 0%, transparent 100%);
}

[data-theme="dark"] .tech-marquee-wrapper::after {
    background: linear-gradient(to left, var(--color-bg-light) 0%, transparent 100%);
}

.tech-marquee {
    display: flex;
    white-space: nowrap;
}

.tech-marquee-content {
    display: flex;
    gap: var(--space-8);
    padding-right: var(--space-8);
    animation: scroll-marquee 40s linear infinite;
    /* Slower, sleeker */
}

.tech-marquee:hover .tech-marquee-content {
    animation-play-state: paused;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tech-item:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.tech-item span {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-dark);
    letter-spacing: -0.01em;
}

.tech-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ==========================================================================
   Category Filter Menu (Sleek Pills)
   ========================================================================== */
.filter-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: var(--space-8) 0 var(--space-12);
    padding: 0 var(--space-4);
    position: relative;
    z-index: 10;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.filter-btn:hover {
    color: var(--color-text-dark);
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background-color: var(--color-text-dark);
    color: var(--color-bg-white);
    font-weight: 600;
}

/* ==========================================================================
   Bento Grid Section (The Core of the New Design)
   ========================================================================== */
.bento-section {
    padding: var(--space-16) 0;
    position: relative;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(280px, auto);
    /* Taller base row for elegance */
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.bento-item {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Soft base border */
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow:
        var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    /* Set default vars in case JS hasn't fired */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Spotlight Border Glow */
.bento-item::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    /* Cover the border */
    border-radius: inherit;
    padding: 1px;
    /* matches border width */
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(14, 165, 233, 0.5),
            /* Blue glow */
            transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease;
}

/* Spotlight Inner Glare */
.bento-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(14, 165, 233, 0.08),
            transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease;
}

[data-theme="dark"] .bento-item {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Inner rim */
}

[data-theme="dark"] .bento-item::before {
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.25),
            /* Bright white glow */
            transparent 40%);
}

[data-theme="dark"] .bento-item::after {
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.03),
            /* Subtle white inner glare */
            transparent 40%);
}

.bento-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        var(--shadow-xl),
        0 24px 48px rgba(14, 165, 233, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 1);
}

[data-theme="dark"] .bento-item:hover {
    box-shadow:
        var(--shadow-glow),
        0 24px 48px rgba(14, 165, 233, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.bento-item:hover::before,
.bento-item:hover::after {
    opacity: 1;
    /* Turn on spotlights on hover */
}

.bento-content {
    padding: var(--space-8);
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bento-icon {
    width: 64px;
    /* Larger icon */
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    background-color: var(--color-bg-white);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.bento-item:hover .bento-icon {
    transform: scale(1.1) rotate(4deg);
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .bento-item:hover .bento-icon {
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.bento-title {
    font-size: var(--text-2xl);
    /* Larger, bolder titles */
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text-dark);
    margin-bottom: var(--space-3);
}

.bento-desc {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

.bento-link {
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-dark);
    display: inline-flex;
    align-items: center;
    transition: opacity var(--transition-fast);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.bento-link:hover {
    opacity: 0.7;
}

/* Specific Grid Sizes for the Boxy Look */
.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-medium {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Wide bento acts like a banner */
.bento-wide {
    grid-column: span 4;
    grid-row: span 1;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.bento-wide .bento-content {
    flex: 1;
    justify-content: center;
    border-top: none;
    /* remove standard link border logic if present */
}

/* Glassmorphism utility for special bento items */
.bento-glass {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

[data-theme="dark"] .bento-glass {
    background: rgba(15, 23, 42, 0.4);
}

/* Graphics and Backgrounds for Bento Items */
.bento-graphic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.5;
    /* Keep them subtle */
    transition: opacity var(--transition-normal);
}

.bento-item:hover .bento-graphic {
    opacity: 0.8;
}

/* A soft glow radial gradient background */
.graphic-glow {
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
}

[data-theme="dark"] .graphic-glow {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-large,
    .bento-wide {
        grid-column: span 2;
    }

    .bento-wide {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-large,
    .bento-medium,
    .bento-small,
    .bento-wide {
        grid-column: span 1;
        grid-row: auto;
    }

    .btn {
        width: 100%;
        /* Full width buttons on mobile */
    }
}

/* ==========================================================================
   Detail Hero Media (API Pages)
   ========================================================================== */
.detail-media-section {
    margin-top: -6rem; /* Pull image up into hero */
    position: relative;
    z-index: 10;
    margin-bottom: var(--space-12);
}

@media (max-width: 768px) {
    .detail-media-section {
        margin-top: -3rem;
    }
}

.detail-main-img-wrapper {
    width: 100%;
    aspect-ratio: 21 / 9;
    background: var(--color-bg-white);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    position: relative;
}

.detail-main-img-wrapper .parallax-img {
    height: 135%; /* Extra height for parallax */
}
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-12);
}

.filter-btn {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
}

[data-theme="dark"] .filter-btn {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

.filter-btn:hover {
    color: var(--color-text-dark);
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .filter-btn:hover {
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background: var(--color-accent-blue);
    color: white;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

[data-theme="dark"] .filter-btn.active {
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}

/* Smooth filtering transition classes */
.bento-item,
.card {
    transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms ease;
    will-change: transform, opacity;
}

.bento-item.filter-hidden,
.card.filter-hidden {
    opacity: 0 !important;
    transform: scale(0.9) !important;
    pointer-events: none;
    position: absolute;
    /* absolute to collapse the space */
}


/* ==========================================================================
   Project Detail Pages (Unified iOS Style, Tight & Premium)
   ========================================================================== */

.detail-hero {
    padding: var(--space-24) 0 var(--space-6);
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg-white) 100%);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .detail-hero {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, var(--color-bg-light) 100%);
}

.detail-hero-content {
    max-width: 960px;
    margin: 0 auto;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-4);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.detail-back-link:hover {
    color: var(--color-text-dark);
    transform: translateX(-4px);
}

.detail-back-link svg {
    width: 16px;
    height: 16px;
}

.detail-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-2);
    color: var(--color-text-dark);
    line-height: 1.1;
}

.detail-subtitle {
    font-size: var(--text-lg);
    line-height: 1.4;
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
    max-width: 800px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .detail-meta-grid {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

.detail-meta-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

[data-theme="dark"] .detail-meta-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-meta-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.detail-meta-value {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text-dark);
}

.detail-meta-value.success {
    color: var(--color-accent-green);
}

.detail-body {
    padding: var(--space-8) 0 var(--space-16);
}

.detail-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    /* Tighter gap */
    align-items: center;
}

.detail-text h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.detail-text p {
    font-size: var(--text-base);
    line-height: 1.5;
    /* Tighter line height */
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.detail-image-card {
    border-radius: var(--radius-2xl);
    background: var(--color-bg-light);
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

@media (max-width: 768px) {
    .detail-body-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .detail-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-title {
        font-size: var(--text-3xl);
    }
}