/*
Theme Name: FlavorX7
Theme URI: https://davidrsinger.com
Author: David Singer
Description: Custom dark immersive theme with image gallery canvas navigation
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: dsinger-dark
*/

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    --accent: #00b4d8;
    --accent-glow: rgba(0, 180, 216, 0.3);
    --accent-secondary: #7b2ff7;
    --accent-gradient: linear-gradient(135deg, #00b4d8, #7b2ff7);
    --border: rgba(255, 255, 255, 0.06);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.6);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

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

a:hover {
    color: #fff;
}

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

/* ============================================
   NAVIGATION
   ============================================ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.site-nav.scrolled {
    padding: 0.6rem 2rem;
    background: rgba(10, 10, 15, 0.95);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.nav-brand span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: relative;
    padding: 0.3rem 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 180, 216, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(123, 47, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 180, 216, 0.04) 0%, transparent 60%);
}

/* Animated grid lines */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Floating particles */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 7s; }
.particle:nth-child(2) { left: 25%; animation-delay: 1s; animation-duration: 9s; }
.particle:nth-child(3) { left: 40%; animation-delay: 2s; animation-duration: 6s; }
.particle:nth-child(4) { left: 55%; animation-delay: 0.5s; animation-duration: 8s; }
.particle:nth-child(5) { left: 70%; animation-delay: 1.5s; animation-duration: 10s; }
.particle:nth-child(6) { left: 85%; animation-delay: 3s; animation-duration: 7s; }
.particle:nth-child(7) { left: 15%; animation-delay: 2.5s; animation-duration: 9s; }
.particle:nth-child(8) { left: 60%; animation-delay: 4s; animation-duration: 6s; }

@keyframes particleFloat {
    0% { transform: translateY(100vh); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100px); opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.3s;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.5s;
}

.hero-title .gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.7s;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.9s;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 1.2s;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

/* ============================================
   IMAGE GALLERY MOSAIC GRID
   ============================================ */
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 16px;
}

.mosaic-tile {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mosaic-tile.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Tile sizes for visual variety */
.mosaic-tile.wide { grid-column: span 2; }
.mosaic-tile.tall { grid-row: span 2; }
.mosaic-tile.large { grid-column: span 2; grid-row: span 2; }

.mosaic-tile .tile-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mosaic-tile .tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 15, 0.95) 0%,
        rgba(10, 10, 15, 0.4) 40%,
        rgba(10, 10, 15, 0.1) 100%
    );
    transition: all var(--transition);
}

.mosaic-tile:hover .tile-image {
    transform: scale(1.08);
}

.mosaic-tile:hover .tile-overlay {
    background: linear-gradient(
        to top,
        rgba(10, 10, 15, 0.98) 0%,
        rgba(10, 10, 15, 0.6) 50%,
        rgba(10, 10, 15, 0.3) 100%
    );
}

.tile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
    transform: translateY(10px);
    transition: transform var(--transition);
}

.mosaic-tile:hover .tile-content {
    transform: translateY(0);
}

.tile-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tile-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.tile-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0;
    max-height: 0;
    transition: all 0.5s ease;
    overflow: hidden;
}

.mosaic-tile:hover .tile-excerpt {
    opacity: 1;
    max-height: 60px;
}

.tile-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition);
}

.mosaic-tile:hover .tile-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   TOOLS SECTION (icon-style grid)
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(30px);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 180, 216, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   FEATURED / GITHUB FINDS
   ============================================ */
.featured-strip {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-card) var(--bg-primary);
}

.featured-strip::-webkit-scrollbar {
    height: 6px;
}

.featured-strip::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.featured-strip::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 3px;
}

.featured-card {
    flex: 0 0 350px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.featured-card:hover {
    border-color: rgba(0, 180, 216, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.featured-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.featured-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.featured-card-body {
    padding: 1.5rem;
}

.featured-card-body .tile-category {
    margin-bottom: 0.3rem;
}

.featured-card-body .tile-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.featured-card-body .tile-excerpt {
    opacity: 1;
    max-height: none;
    margin-bottom: 0.75rem;
}

/* ============================================
   SINGLE POST
   ============================================ */
.post-header {
    padding: 8rem 2rem 3rem;
    text-align: center;
    position: relative;
}

.post-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.post-header-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,15,0.7), var(--bg-primary));
}

.post-header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.post-meta .cat {
    color: var(--accent);
}

.post-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-body h2, .post-body h3, .post-body h4 {
    color: #fff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.post-body h2 { font-size: 1.7rem; }
.post-body h3 { font-size: 1.3rem; }

.post-body p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.post-body a {
    border-bottom: 1px solid var(--accent-glow);
}

.post-body a:hover {
    border-bottom-color: var(--accent);
}

.post-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-card);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    color: var(--accent);
}

.post-body pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.post-body ul, .post-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-body img {
    border-radius: var(--radius);
    margin: 2rem auto;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

/* ============================================
   ARCHIVE / CATEGORY PAGES
   ============================================ */
.archive-header {
    padding: 8rem 2rem 3rem;
    text-align: center;
}

.archive-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.page-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        padding: 1rem 2rem 2rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-toggle { display: block; }

    .mosaic-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 180px;
    }
    .mosaic-tile.wide,
    .mosaic-tile.tall,
    .mosaic-tile.large {
        grid-column: span 1;
        grid-row: span 1;
    }

    .hero-title { font-size: 2.2rem; }
    .section { padding: 4rem 1.5rem; }

    .featured-card { flex: 0 0 85vw; }
}

@media (max-width: 480px) {
    .hero { min-height: 90vh; }
    .hero-cta { flex-direction: column; align-items: center; }
    .tools-grid { grid-template-columns: 1fr; }
}
