/* ========================================
   GREG FREDA BYTES - Digital Cabinet of Wonders
   ======================================== */

:root {
    --bg-deep: #08080c;
    --bg-surface: #0f0f14;
    --bg-card: #121218;
    --bg-card-hover: #1a1a22;
    
    --accent-primary: #00f5d4;
    --accent-secondary: #f72585;
    --accent-warm: #fca311;
    
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a8;
    --text-muted: #606068;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 245, 212, 0.3);
    
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-deep);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Noise overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Grid background */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.012) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

/* Floating orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -250px;
    right: -150px;
    opacity: 0.07;
    animation: floatOrb1 30s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    bottom: -200px;
    left: -150px;
    opacity: 0.05;
    animation: floatOrb2 25s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-warm) 0%, transparent 70%);
    top: 50%;
    left: 30%;
    opacity: 0.03;
    animation: floatOrb3 20s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, 30px) scale(1.1); }
    66% { transform: translate(-30px, -20px) scale(0.95); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -40px) scale(1.05); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 20px); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    text-decoration: none;
}

.logo-glyphs {
    height: 28px;
    width: auto;
    filter: invert(1) brightness(0.9);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.logo:hover .logo-glyphs {
    opacity: 1;
    filter: invert(1) brightness(1) drop-shadow(0 0 10px rgba(0, 245, 212, 0.3));
}

.nav {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
}

/* Hero */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 245, 212, 0.06);
    border: 1px solid rgba(0, 245, 212, 0.15);
    border-radius: 100px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s var(--ease-out);
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.italic {
    font-style: italic;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero-glyphs {
    animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.hero-glyphs-img {
    height: 40px;
    width: auto;
    filter: invert(1);
    opacity: 0.15;
}

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

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 5rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 5rem;
    animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.stat {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Posts Section */
.posts-section {
    margin-bottom: 6rem;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-line {
    width: 40px;
    height: 1px;
    background: var(--accent-primary);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.75rem;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.post-card:hover::before {
    opacity: 0.03;
}

.post-card.featured {
    grid-column: span 2;
}

.post-card-inner {
    position: relative;
    z-index: 1;
}

.post-category {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-warm);
    margin-bottom: 1rem;
    padding: 0.3rem 0.6rem;
    background: rgba(252, 163, 17, 0.1);
    border-radius: 4px;
}

.post-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.post-card.featured .post-title {
    font-size: 2rem;
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.post-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.post-read {
    font-size: 0.7rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    border-top: 1px solid var(--border-subtle);
}

.about-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about-glyphs {
    height: 35px;
    width: auto;
    filter: invert(1);
    opacity: 0.3;
    margin-bottom: 2rem;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.about-text.muted {
    font-style: italic;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-glyphs {
    margin-bottom: 2rem;
}

.footer-glyphs-img {
    height: 25px;
    width: auto;
    filter: invert(1);
    opacity: 0.2;
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.footer-copy {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.1em;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    animation: modalIn 0.4s var(--ease-out);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.modal-category {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-warm);
    margin-bottom: 1rem;
    padding: 0.3rem 0.6rem;
    background: rgba(252, 163, 17, 0.1);
    border-radius: 4px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.modal-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.modal-body p {
    margin-bottom: 1.25rem;
}

.modal-body h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.modal-body ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

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

.modal-body strong {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo-glyphs {
        height: 22px;
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.65rem;
    }
    
    .hero {
        padding: 4rem 0 3rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .stats {
        gap: 2.5rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card.featured {
        grid-column: span 1;
    }
    
    .post-card.featured .post-title {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.75rem;
    }
}
