:root {
    --bg: #050505;
    --accent: #00ff88;
    --text: #ffffff;
    --text-dim: #888;
    --glass: linear-gradient(
    145deg, 
    rgba(255, 255, 255, 0.16) 0%, 
    rgba(255, 255, 255, 0.06) 100%
);
    --input-bg: #0c0c0c;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
body, html { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; line-height: 1.6; }

/* LAYOUT & ALIGNMENT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; width: 100%; }

/* HERO WITH SCANLINES */
.hero { 
    position: relative; 
    height: 65vh; 
    width: 100%; 
    display: flex; 
    align-items: flex-end; 
    padding-bottom: 80px; 
    background: #000; 
    overflow: hidden; 
}
.hero-img { 
    position: absolute; 
    inset: 0; 
    background: url('/src/mikko-seppala.webp') no-repeat center center; 
    background-size: cover; 
    z-index: 1; 
    opacity: 0.4; 
    filter: grayscale(1); 
}

/* The "Tactical" Overlay */
.hero::after {
    content: ""; 
    position: absolute; 
    inset: 0; 
    z-index: 2; /* Sits behind text, above image */
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.2) 50%), 
                radial-gradient(circle, transparent 20%, var(--bg) 90%);
    background-size: 100% 4px, 100% 100%;
    pointer-events: none; /* Allows clicks to pass through to links below */
}

/* Content wrapper - Must be higher than z-index: 2 */
.hero-content { 
    position: relative; 
    z-index: 10; 
    pointer-events: auto; /* Ensures links are interactive */
}

h1 { font-size: clamp(3rem, 12vw, 5rem); margin: 0; letter-spacing: -2px; font-weight: 900; line-height: 0.8; position: relative; z-index: 10; }

/* UI ELEMENTS */
.back-btn { position: fixed; top: 30px; left: 30px; z-index: 100; color: #fff; text-decoration: none; font-size: 0.7rem; letter-spacing: 3px; opacity: 0.4; transition: var(--transition); text-transform: uppercase; font-weight: bold; }
.back-btn:hover { opacity: 1; color: var(--accent); }

.section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 4px; color: var(--accent); margin-bottom: 25px; display: block; font-weight: bold; }

.reveal { opacity: 0; transform: translateY(30px); transition: var(--transition); }
.reveal.active { opacity: 1; transform: translateY(0); }

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 
    gap: 25px; 
}

.card { 
    background: var(--glass); 
    border-radius: 12px; 
    overflow: hidden; 
    text-decoration: none; 
    color: inherit; 
    border: 1px solid #1a1a1a; 
    transition: var(--transition); 
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-image { 
    width: 100%; 
    aspect-ratio: 3 / 1.2; 
    background-color: #000;
    background-position: center;
    background-size: cover;
    opacity: 0.5; /* Dimmed by default */
    transition: var(--transition);
    border-bottom: 1px solid #1a1a1a;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 136, 0.1);
}

.card:hover .card-image { 
    opacity: 1; /* Brightens the background image */
    filter: contrast(1.1) brightness(1.1); /* Adds a little punch */
}

.card h3 {
    margin: 0;
    padding: 15px 20px; /* Reduced padding to save more space */
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* EDITOR INPUTS */
input, textarea { width: 100%; background: var(--input-bg); border: 1px solid #222; color: #fff; padding: 18px; border-radius: 8px; font-family: inherit; font-size: 1rem; margin-bottom: 25px; outline: none; transition: 0.3s; }
input:focus, textarea:focus { border-color: var(--accent); background: #151515; box-shadow: 0 0 20px rgba(0, 255, 136, 0.05); }

/* NAVIGATION LINKS */
.links-row { display: flex; gap: 35px; margin-top: 30px; position: relative; z-index: 20; }
.links-row a { color: var(--text); text-decoration: none; font-size: 0.8rem; opacity: 0.5; letter-spacing: 2px; font-weight: bold; text-transform: uppercase; transition: var(--transition); cursor: pointer; }
.links-row a:hover { color: var(--accent); opacity: 1; transform: translateY(-2px); text-shadow: 0 0 15px var(--accent); }

/* BLOG LIST */
.blog-item { display: flex; justify-content: space-between; align-items: center; padding: 20px; text-decoration: none; color: inherit; transition: var(--transition); background: var(--glass); border: 1px solid #1a1a1a; border-radius: 12px;}
.blog-item:hover { color: var(--accent); padding-left: 15px; }
.blog-block h3 { margin: 0; font-size: 1.5rem; }
.blog-tags { font-size: 0.75rem; color: var(--accent); margin-top: 10px; font-weight: bold; }
.blog-date { opacity: 0.3; font-size: 0.9rem; font-weight: bold; }

/* LAYOUT HELPERS */
.main-content { padding-top: 120px; padding-bottom: 120px; }
.section-gap { margin-top: 150px; }

/* PROJECT TAG OVERLAY */
.card-image-wrapper { position: relative; }
.card-tags { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 1; }
.tag-badge { background: rgba(0, 0, 0, 0.7); color: var(--accent); font-size: 0.65rem; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--accent); backdrop-filter: blur(4px); }

/* TYPE FILTER */
.type-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; }
.filter-btn { background: transparent; border: 1px solid #333; color: var(--text-dim); font-size: 0.65rem; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; padding: 6px 14px; border-radius: 4px; cursor: pointer; transition: var(--transition); font-family: inherit; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* POST PAGE */
.post-hero { height: 50vh; display: flex; align-items: flex-end; padding-bottom: 60px; background: #000; position: relative; overflow: hidden; }
.post-hero::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3) 50%); background-size: 100% 4px; pointer-events: none; }
.post-hero-img { position: absolute; inset: 0; background: url('mikko-seppala.JPG') no-repeat center center; background-size: cover; opacity: 0.25; filter: grayscale(1) blur(3px); }
.post-hero .container { position: relative; z-index: 10; }
.post-hero .section-title { margin-bottom: 15px; }
.post-hero h1 { font-size: clamp(2.5rem, 8vw, 5rem); }
.post-tags { color: var(--accent); font-weight: bold; margin-top: 20px; font-size: 0.9rem; }
.post-content { max-width: 800px; margin: 0 auto; padding: 80px 25px; font-size: 1.25rem; line-height: 1.9; color: #ddd; }
.post-content p { margin-bottom: 2.5rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    /* Grid: single column on mobile */
    .grid { grid-template-columns: 1fr; }

    /* Tighter vertical rhythm */
    .main-content { padding-top: 60px; padding-bottom: 60px; }
    .section-gap { margin-top: 80px; }

    /* Loosen tight letter-spacing on smaller font sizes */
    h1 { letter-spacing: -2px; }

    /* Hero links: allow wrapping */
    .links-row { gap: 18px; flex-wrap: wrap; }}

    /* Blog items: stack title and date vertically */
    .blog-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
    .blog-item:hover { padding-left: 12px; }

    /* Post page */
    .post-hero { padding-bottom: 40px; }
    .post-content { padding: 50px 20px; font-size: 1.1rem; }
}