/* Import Google Fonts: Syne for artistic titles, Inter for clean UI & body */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Syne:wght@500;700;800&display=swap');

:root {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #0a0a0a;
    --accent: #e5c158; /* Warm amber/gold accent */
    --accent-hover: #f0d175;
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-active: rgba(255, 255, 255, 0.25);
    --glass-bg: rgba(18, 18, 18, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    scroll-padding-top: 80px; /* Avoid header overlap on scroll */
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- Grainy Analog Texture Overlay --- */
.grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background: transparent;
    filter: url(#noiseFilter);
    opacity: 0.16;
    pointer-events: none;
    z-index: 9999;
    animation: grain-animation 8s steps(10) infinite;
}

@keyframes grain-animation {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

.hidden-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Header / Fixed Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
}

.logo span {
    color: var(--accent);
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--accent);
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Edit Mode Toggle Switch */
.edit-mode-container {
    display: none; /* Hidden by default for production. Show with ?admin URL query parameter. */
    align-items: center;
    gap: 8px;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.btn-toggle-edit {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-toggle-edit:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-toggle-edit.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.3);
}

.btn-mobile-nav {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition-smooth);
}

/* --- Main Layout --- */
main {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    padding: 0;
}

#main-portfolio-view .section {
    display: block;
    padding: 100px 6%;
}

#sobre-mi {
    background-color: #000000;
    border: none;
}

/* --- Centered Title Styles --- */
.section-header-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    text-align: center;
}

.section-title-centered {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.title-underline-centered {
    width: 60px;
    height: 2px;
    background-color: var(--text-primary);
}

.section {
    display: none;
    padding: 100px 6%;
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Section: Sobre Mí --- */
.about-section {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.about-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/profile.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: var(--transition-smooth);
}

.about-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.about-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: 80px 4% 100px 4%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.about-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.about-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.about-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}

.about-description.editing {
    border: 1px dashed var(--accent);
    padding: 15px;
    background: rgba(18, 18, 18, 0.8);
    outline: none;
    border-radius: 4px;
}

.about-socials {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.social-link:hover {
    color: var(--accent);
}

.edit-actions {
    display: none;
    gap: 12px;
    margin-top: 15px;
}

body.admin-mode .edit-actions {
    display: flex;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* --- Section: Proyectos (Folder Gallery) --- */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.projects-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
}

/* Padding adjustments for full bleed project cards (specificity fix) */
#main-portfolio-view #proyectos {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

#proyectos .section-header-centered {
    padding: 0 6%;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0px; /* Zero gap between blocks */
    width: 100%;
    margin-top: 40px;
}

.project-folder {
    background: #000000;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Minimal line separator */
    border-radius: 0px; /* Sharp corners */
    overflow: hidden;
    cursor: pointer;
    position: relative;
    width: 100%;
    height: 60vh; /* Aspect ratio of hero block */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
    transition: var(--transition-smooth);
}

.project-folder::before {
    display: none;
}

.project-folder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55); /* Darkening filter */
    transition: var(--transition-smooth);
    z-index: 1;
}

.project-folder:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

.project-folder-tab {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.project-folder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    transition: var(--transition-smooth);
}

.project-folder:hover .project-folder-image {
    transform: scale(1.03); /* Zoom on hover */
}

.project-folder-info {
    position: relative;
    z-index: 2;
    padding: 40px;
    background: transparent;
    text-align: center;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.project-folder-title {
    font-family: var(--font-heading);
    font-size: 2.8rem; /* Large uppercase titles */
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    margin-bottom: 0;
}

.project-folder-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    max-width: 600px;
}

/* Project Actions in Edit Mode */
.project-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: none;
    gap: 8px;
}

body.admin-mode .project-actions {
    display: flex;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.btn-icon.delete:hover {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

/* --- Section: Detalle de Proyecto --- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 30px;
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition-smooth);
}

.btn-back:hover {
    color: var(--accent);
    transform: translateX(-5px);
}
.project-detail-header {
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-detail-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.project-detail-desc {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Columns Masonry Layout for Uncropped, Clean Staggered Gallery */
.media-masonry {
    column-count: 3;
    column-gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding: 0 20px;
}

@media (max-width: 992px) {
    .media-masonry {
        column-count: 2;
        column-gap: 20px;
    }
}

@media (max-width: 600px) {
    .media-masonry {
        column-count: 1;
        column-gap: 0px;
        padding: 0 10px;
    }
}

.media-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 24px;
    background: transparent;
    border: none;
    border-radius: 0px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    break-inside: avoid;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.media-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
}

.media-thumbnail-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.media-thumbnail {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: var(--transition-smooth);
}

.media-card:hover .media-thumbnail {
    transform: scale(1.03);
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.75);
    border: 2px solid var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    z-index: 2;
}

.media-card:hover .video-badge {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    transform: translate(-50%, -50%) scale(1.1);
}

.media-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, rgba(10, 10, 10, 0.9));
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 3;
}

.media-card:hover .media-card-overlay {
    opacity: 1;
}

.media-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.media-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Media Item Controls in Edit Mode */
.media-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: none;
    gap: 6px;
}

body.admin-mode .media-actions {
    display: flex;
}

.media-reorder-actions {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
    display: none;
    gap: 6px;
}

body.admin-mode .media-reorder-actions {
    display: flex;
}

.btn-small-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-smooth);
}

.btn-small-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-small-icon.delete:hover {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

/* Add Item Button Card */
.add-media-card {
    display: none;
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 40px;
    border: 2px dashed var(--border-color);
    border-radius: 0px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    break-inside: avoid;
}

body.admin-mode .add-media-card {
    display: inline-flex;
}

.add-media-card:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(229, 193, 88, 0.02);
}

.add-media-card i {
    font-size: 1.8rem;
}

/* --- Fullscreen Lightbox --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.98);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content-wrapper {
    position: relative;
    width: 90%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: zoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-video {
    width: 100%;
    height: 100%;
    max-width: 1000px;
    max-height: 70vh;
    outline: none;
}

.lightbox-control {
    position: absolute;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 2010;
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

.lightbox-control:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.lightbox-prev {
    left: 3%;
}

.lightbox-next {
    right: 3%;
}

.lightbox-close {
    top: 3%;
    right: 3%;
}

.lightbox-info {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 18px 30px;
    border-radius: 8px;
    backdrop-filter: blur(12px);
    z-index: 2010;
}

.lightbox-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.lightbox-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Modals and Admin Popups --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 25px 20px;
}

.modal-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.modal-input, .modal-textarea, .modal-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.modal-input:focus, .modal-textarea:focus, .modal-select:focus {
    border-color: var(--accent);
}

.modal-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Custom File Upload Button */
.file-upload-wrapper {
    position: relative;
    border: 1px dashed var(--border-color);
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.file-upload-wrapper:hover {
    border-color: var(--accent);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-preview {
    margin-top: 10px;
    max-height: 150px;
    max-width: 100%;
    border-radius: 4px;
    display: none;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- Notification System --- */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.notification.active {
    transform: translateY(0);
    opacity: 1;
}

.notification-message {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Responsive Adjustments relocated to the bottom of the file */

/* --- Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    margin-top: -80px; /* Offset the header height so it goes full screen */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/hero_bg.jpg'); /* Default cover photo */
    background-size: cover;
    background-position: center;
    transition: filter 0.5s ease, transform 0.5s ease;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.3) 0%, rgba(5, 5, 5, 0.8) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.hero-title.editing, .hero-desc.editing {
    border: 1px dashed var(--accent);
    padding: 10px;
    background: rgba(18, 18, 18, 0.8);
    outline: none;
    border-radius: 4px;
}

.hero-desc {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    max-width: 700px;
    line-height: 1.6;
}

.btn-hero {
    display: inline-block;
    padding: 14px 36px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    background: transparent;
    border: 1.5px solid var(--text-primary);
    border-radius: 0px;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-hero:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.15);
}

.btn-change-bg {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-change-bg:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Contact Form Section --- */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 15px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .contact-form-row {
        grid-template-columns: 1fr;
    }
}

.contact-form-group {
    width: 100%;
}

.contact-input, .contact-textarea {
    width: 100%;
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 18px 20px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    border-radius: 0px; /* Sharp corners */
    transition: var(--transition-smooth);
}

.contact-input:focus, .contact-textarea:focus {
    border-color: var(--text-primary);
    background-color: #050505;
}

.contact-textarea {
    resize: vertical;
    min-height: 150px;
}

.btn-contact-submit {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-primary);
    background-color: transparent;
    border: 1.5px solid var(--text-primary);
    border-radius: 0px; /* Sharp corners */
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 10px;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

.btn-contact-submit:hover {
    background-color: var(--text-primary);
    color: #000000;
}

.contact-socials-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 20px;
}

.contact-socials-row a {
    color: var(--text-secondary);
    font-size: 1.6rem;
    transition: var(--transition-smooth);
}

.contact-socials-row a:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Mini footer */
.mini-footer {
    padding: 50px 0 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 80px;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Social inputs edit mode styling */
.social-edit-inputs {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
    align-self: center;
    text-align: left;
}

.social-edit-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.social-edit-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-edit-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    border-radius: 0px;
    transition: var(--transition-smooth);
}

.social-edit-input:focus {
    border-color: var(--accent);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header {
        padding: 0 5%;
    }
    
    .btn-mobile-nav {
        display: block;
    }
    
    /* Sliding Navigation Drawer */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 35px;
        z-index: 999;
        transition: var(--transition-smooth);
        padding: 40px;
    }
    
    nav.nav-open {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.25rem;
        letter-spacing: 2px;
        padding: 10px 0;
    }
    
    .edit-mode-container {
        border-left: none;
        padding-left: 0;
        margin-top: 15px;
    }
    
    .btn-toggle-edit span {
        display: inline !important; /* Always show label text in mobile drawer */
    }
    
    /* Hero scaling */
    .hero-title {
        font-size: 2.8rem;
        letter-spacing: 2px;
    }
    
    .hero-desc {
        font-size: 0.95rem;
        letter-spacing: 2px;
        margin-bottom: 25px;
        max-width: 90%;
    }
    
    .btn-hero {
        padding: 12px 28px;
        font-size: 0.8rem;
    }
    
    /* Project Folder scale fixes to avoid overflow */
    .project-folder {
        height: 45vh;
        min-height: 280px;
    }
    
    .project-folder-title {
        font-size: 1.8rem !important; /* Scale down titles to avoid overflow */
        letter-spacing: 1px;
    }
    
    .project-folder-desc {
        font-size: 0.9rem;
        max-width: 90%;
    }
    
    .project-folder-info {
        padding: 20px;
    }
    
    /* About scaling */
    .about-title {
        font-size: 2.4rem;
    }
    
    .about-subtitle {
        font-size: 0.9rem;
    }
    
    .about-description {
        font-size: 0.9rem;
        line-height: 1.6;
        max-width: 95%;
    }
    
    .about-content {
        padding: 60px 4% 80px 4%;
    }
}

/* Specific styling for narrow phone viewports */
@media (max-width: 480px) {
    header {
        height: 70px;
        padding: 0 6%;
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }
    
    main {
        margin-top: 70px; /* Offset the mobile header height */
    }
    
    .hero-section {
        margin-top: -70px;
        height: 100vh;
        min-height: 450px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        letter-spacing: 1.5px;
    }
    
    .hero-desc {
        font-size: 0.85rem;
        letter-spacing: 1.5px;
    }
    
    .logo {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .project-detail-title {
        font-size: 2rem;
    }
    
    .project-detail-desc {
        font-size: 0.9rem;
    }
    
    /* Extra scaling for project titles on small viewports */
    .project-folder-title {
        font-size: 1.5rem !important;
    }
    
    .project-folder {
        height: 40vh;
        min-height: 250px;
    }
    
    .lightbox-control {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .lightbox-info {
        width: 90%;
        padding: 12px 16px;
    }
}

