/* ============================================================
   SP Portfolio Theme — AI/Tech Aesthetic
   ============================================================ */

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

:root {
    --bg-deep: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --accent: #dc2626;
    --accent-hover: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.3);
    --text: #f5f5f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.06);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --radius-sm: 6px;
    --max-width: 1200px;
    --status-live: #22c55e;
    --status-experiment: #eab308;
    --status-archive: #6b7280;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover);
}

/* --- Dot Grid Background Pattern --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.sp-site {
    position: relative;
    z-index: 1;
}

/* --- Section Shared --- */
.sp-section {
    padding: 80px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.sp-section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
}
.sp-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================================
   HERO / ABOUT ME
   ============================================================ */
.sp-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 80px;
    position: relative;
    overflow: hidden;
}

/* Animated gradient background */
.sp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(220,38,38,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(220,38,38,0.05) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes heroGlow {
    0%   { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.sp-hero-inner {
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: var(--max-width);
    width: 100%;
    position: relative;
    z-index: 1;
    justify-content: center;
}

.sp-hero-photo {
    flex-shrink: 0;
}
.sp-hero-photo img {
    width: 240px;
    height: 240px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(220,38,38,0.1);
}

.sp-hero-content {
    flex: 1;
}

.sp-hero-name {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
}

.sp-hero-tagline {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}
.sp-hero-tagline::before {
    content: '> ';
    color: var(--text-muted);
}

.sp-hero-bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.7;
}

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.sp-projects {
    padding-bottom: 40px;
}

.sp-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* Card */
.sp-project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}
.sp-project-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-glow);
    box-shadow: 0 8px 32px rgba(220,38,38,0.15), 0 0 0 1px var(--accent-glow);
}

.sp-project-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.sp-project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.sp-project-card:hover .sp-project-card-image img {
    transform: scale(1.04);
}

.sp-project-card-body {
    padding: 20px;
}

.sp-project-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.sp-project-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sp-project-status-dot--live       { background: var(--status-live); box-shadow: 0 0 6px var(--status-live); }
.sp-project-status-dot--experiment { background: var(--status-experiment); box-shadow: 0 0 6px var(--status-experiment); }
.sp-project-status-dot--archive    { background: var(--status-archive); }

.sp-project-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.sp-project-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sp-project-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: rgba(220,38,38,0.1);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(220,38,38,0.2);
    letter-spacing: 0.02em;
}

/* ============================================================
   PROJECT MODAL
   ============================================================ */
.sp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}
.sp-modal-overlay.active {
    display: flex;
}

.sp-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.sp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}
.sp-modal-close:hover {
    background: var(--accent);
}

.sp-modal-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.sp-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-modal-body {
    padding: 32px;
}

.sp-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sp-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.sp-modal-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sp-modal-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}
.sp-modal-description p {
    margin-bottom: 12px;
}

.sp-modal-learnings {
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--accent);
    padding: 20px 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 24px;
}
.sp-modal-learnings-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sp-modal-learnings-content {
    color: var(--text-secondary);
    line-height: 1.7;
}
.sp-modal-learnings-content p {
    margin-bottom: 8px;
}

.sp-modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.sp-modal-gallery img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}
.sp-modal-gallery img:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

/* Lightbox for full-size image viewing */
.sp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
}
.sp-lightbox.active {
    display: flex;
}
.sp-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.sp-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}
.sp-modal-link:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   TWITTER / X FEED
   ============================================================ */
.sp-twitter {
    text-align: center;
}
.sp-twitter-embed {
    max-width: 550px;
    margin: 0 auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
.sp-footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px;
    text-align: center;
}

.sp-footer-socials {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.sp-footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.2s;
}
.sp-footer-social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

.sp-footer-social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sp-footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sp-footer-email {
    margin-top: 8px;
}
.sp-footer-email a {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.sp-footer-email a:hover {
    color: var(--accent);
}

/* ============================================================
   SCROLL ANIMATION
   ============================================================ */
.sp-fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.sp-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sp-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sp-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
    .sp-hero-bio {
        max-width: 100%;
    }
    .sp-hero-name {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .sp-projects-grid {
        grid-template-columns: 1fr;
    }
    .sp-hero {
        min-height: auto;
        padding: 60px 16px;
    }
    .sp-hero-photo img {
        width: 160px;
        height: 160px;
    }
    .sp-hero-name {
        font-size: 1.8rem;
    }
    .sp-section {
        padding: 48px 16px;
    }
    .sp-modal-body {
        padding: 20px;
    }
}
