:root {
    --bg-color: #0d0d0d;
    --surface-color: #1a1a1a;
    --surface-hover: #262626;
    --primary-color: #ffffff;
    --secondary-color: #a1a1aa;
    --accent-color: #3b82f6; /* Subtle blue accent, can be changed */
    --text-color: #ededed;
    --text-muted: #a1a1aa;
    --border-radius: 16px;
    --font-family: 'Outfit', sans-serif;
    --nav-height: 64px;
    --gap: 24px;
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    user-select: none;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 4px;
}

/* Key Utilities */
.app-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s var(--transition);
    user-select: none;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.nav-link:hover:not(.active) {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.05);
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 100px; /* Space for nav */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Views */
.view {
    animation: fadeIn 0.4s var(--transition);
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.home-view {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(to right, #fff, #a1a1aa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 500px;
    margin-inline: auto;
}

.actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s var(--transition);
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.btn.secondary {
    background-color: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn.icon-only {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grids */
.section-header {
    margin-bottom: 32px;
    margin-top: 20px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.section-header p {
    color: var(--text-muted);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s var(--transition), box-shadow 0.3s var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-image {
    aspect-ratio: 16/9;
    background-color: var(--surface-hover);
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--transition);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.4;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Detail View */
.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    margin-bottom: 24px;
    padding: 8px 0;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--primary-color);
}

.detail-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.detail-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

/* Premium Cover Image Effect */
.detail-cover {
    position: relative;
    width: 100%;
    margin-bottom: 32px;
    border-radius: var(--border-radius);
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio container */
    height: 0;
}

.detail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 2;
    cursor: zoom-in;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.detail-image:hover {
    transform: scale(1.01) translateY(-2px);
}

.detail-glow {
    position: absolute;
    top: 10px;
    left: 4%;
    width: 92%;
    height: 95%;
    background-size: cover;
    background-position: center;
    filter: blur(25px) saturate(150%);
    opacity: 0.4;
    z-index: 1;
    border-radius: var(--border-radius);
    transition: opacity 0.5s ease;
}

.detail-cover:hover .detail-glow {
    opacity: 0.6;
}

.detail-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.detail-links .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Feature List */
.detail-section {
    margin: 32px 0;
}

.detail-section h3 {
    margin-bottom: 16px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature-list li {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: background 0.2s;
}

.feature-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

/* Gallery Grid */
 .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.gallery-grid img {
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s var(--transition), filter 0.3s var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: zoom-in;
    /* Blur effect on thumbnail as requested? 
       "na miniatura fica com blur para nao ofuscar" 
       Interpreting as: Thumbnails have mild blur, focused/hovered one is clear? 
       Or maybe just backdrop blur on lightbox. 
       Let's stick to standard hover zoom for now, user can clarify.
    */
}

.gallery-grid img:hover {
    transform: scale(1.02);
    z-index: 10;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px); /* The "blur" effect for background */
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: block;
}

.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2010;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-btn.close {
    top: 20px;
    right: 20px;
}

.lightbox-btn.prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-btn.prev:hover { transform: translateY(-50%) scale(1.1); }

.lightbox-btn.next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-btn.next:hover { transform: translateY(-50%) scale(1.1); }

@media (max-width: 768px) {
    .lightbox-btn { padding: 8px; }
    .lightbox-btn svg { width: 24px; height: 24px; }
    .lightbox-btn.prev { left: 10px; }
    .lightbox-btn.next { right: 10px; }
}

/* Animation Utilities */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s var(--transition) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .nav-content { gap: 2px; }
    .nav-link { padding: 10px 16px; font-size: 0.85rem; }
    .app-nav { bottom: 16px; width: 90%; max-width: 350px; justify-content: space-between; display: flex; }
    .nav-content { width: 100%; justify-content: space-between; }
    .project-grid { grid-template-columns: 1fr; }
}
