/* --- Custom Properties & Design Tokens --- */
:root {
    --bg-main: #0a0c10;
    --bg-card: rgba(20, 24, 33, 0.65);
    --bg-card-hover: rgba(28, 34, 46, 0.85);
    --border-color: rgba(226, 168, 87, 0.15);
    --border-color-hover: rgba(226, 168, 87, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-gold: #e2a857;
    --accent-gold-hover: #f1bf77;
    --accent-gold-rgb: 226, 168, 87;
    --accent-emerald: #10b981;
    --accent-emerald-rgb: 16, 185, 129;
    --accent-rose: #f43f5e;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --glow-gold: 0 0 20px rgba(226, 168, 87, 0.2);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* --- Background Mesh Glows --- */
.bg-glow {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: -2;
    opacity: 0.15;
    mix-blend-mode: screen;
}

.bg-glow-1 {
    top: -10vw;
    right: -10vw;
    background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
}

.bg-glow-2 {
    top: 40vh;
    left: -20vw;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    opacity: 0.1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center;
    pointer-events: none;
    z-index: -1;
}

/* --- Layout Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Glassmorphism Card Style --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

/* --- Header / Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 80px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-accent {
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 800;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold);
    transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* --- CMS Status Indicator Badge --- */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    position: relative;
}

/* Status States */
.status-badge.connecting .status-dot {
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
    animation: pulse 1.5s infinite ease-in-out;
}

.status-badge.connected {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.status-badge.connected .status-dot {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.status-badge.demo {
    background: rgba(226, 168, 87, 0.05);
    border-color: rgba(226, 168, 87, 0.2);
    color: #fde68a;
}

.status-badge.demo .status-dot {
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
}

.status-badge.error {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fecdd3;
}

.status-badge.error .status-dot {
    background-color: var(--accent-rose);
    box-shadow: 0 0 10px var(--accent-rose);
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent-gold);
    color: #000;
    border: 1px solid var(--accent-gold);
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* --- Section Formatting --- */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
}

.section-subtitle {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* --- Fold 1: Hero Section --- */
.hero-section {
    padding-top: 180px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.category-tag {
    background: rgba(226, 168, 87, 0.1);
    border: 1px solid rgba(226, 168, 87, 0.2);
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-gold) 30%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 520px;
}

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

/* Hero Media Card */
.hero-image-card {
    padding: 16px;
    border-radius: var(--radius-lg);
}

.hero-image-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 6s ease;
}

.hero-image-card:hover .hero-image {
    transform: scale(1.08);
}

.hero-card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 8px 8px 0 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* --- Fold 2: Projects Grid / Services --- */
.projects-section {
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    position: relative;
    padding: 12px;
}

.project-thumbnail-wrapper {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.project-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-thumbnail {
    transform: scale(1.06);
}

.project-info {
    padding: 20px 8px 12px 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.project-card:hover .project-heading {
    color: var(--accent-gold);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    margin-top: auto;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.project-link svg {
    transition: transform 0.3s ease;
}

.project-card:hover .project-link svg {
    transform: translateX(4px);
}

/* --- Bonus Section: Blog Grid --- */
.blog-section {
    background: rgba(255, 255, 255, 0.01);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100%;
}

.blog-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    margin-bottom: 12px;
}

.blog-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 14px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.blog-card:hover .blog-title {
    color: var(--accent-gold);
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.blog-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-decoration: none;
}

.blog-action svg {
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-action svg {
    transform: translateX(4px);
}

/* --- Status Explainer Card --- */
.status-explainer-card {
    padding: 40px;
    border-radius: var(--radius-lg);
}

.explainer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.explainer-icon {
    font-size: 1.8rem;
}

.explainer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.explainer-text {
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 900px;
}

.explainer-endpoints {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.method {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.path {
    font-family: monospace;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.desc {
    color: var(--text-muted);
    margin-left: auto;
}

/* --- Spinner & Feed Loading --- */
.loading-spinner-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-secondary);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border-top-color: var(--accent-gold);
    animation: spin 1s ease-in-out infinite;
}

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

/* --- Footer --- */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 80px 0 40px 0;
    background: #06080a;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 280px;
}

.footer-links h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.performance-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- Animations --- */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up-delayed {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

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

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-content {
        align-items: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-image-container {
        height: 350px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .nav {
        display: none; /* In production, you would add a mobile menu toggle here */
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .projects-grid, .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .explainer-endpoints .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .desc {
        margin-left: 0;
    }
}
