/* === Base Reset & Variables === */
:root {
    --fredy-primary: #2563eb;
    --fredy-primary-rgb: 37, 99, 235;
    --fredy-secondary: #4f46e5;
    --fredy-accent: #7c3aed;
    --fredy-dark: #0f172a;
    --fredy-light: #f8fafc;
    --fredy-text: #1e293b;
    --fredy-text-light: #475569;
    --fredy-text-muted: #64748b;
    --fredy-border: #e2e8f0;
    --fredy-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fredy-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --fredy-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --fredy-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--fredy-font);
    line-height: 1.6;
    color: var(--fredy-text);
    background: var(--fredy-light);
}

/* === Navigation === */
.site-nav {
    background: var(--fredy-dark);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--fredy-transition);
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* === Main Content === */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* === Portfolio Wrapper === */
.fredy-portfolio-wrapper {
    line-height: 1.6;
    color: var(--fredy-text);
    position: relative;
    isolation: isolate;
}

/* === Header === */
.fredy-header {
    background: linear-gradient(135deg, var(--fredy-dark), #1e3a8a);
    color: white;
    padding: 4rem 2rem 3rem;
    text-align: center;
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: var(--fredy-shadow-lg);
}

.fredy-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M20 20h20v20H20zm0-20h20v20H20z'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.fredy-header-content { position: relative; z-index: 1; }

.fredy-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(45deg, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fredy-fadeIn 0.8s ease-out;
}

.fredy-header p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #e2e8f0;
    margin-bottom: 2rem;
    animation: fredy-slideUp 0.6s ease-out 0.3s both;
}

/* === Social Links === */
.fredy-social-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

.fredy-social-icon {
    background: rgba(255,255,255,0.1);
    color: white;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: var(--fredy-transition);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.fredy-social-icon:hover {
    background: white;
    color: var(--fredy-primary);
    transform: translateY(-3px);
    box-shadow: var(--fredy-shadow-lg);
}

/* === About Section === */
.fredy-about {
    background: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--fredy-shadow-lg);
    border: 1px solid var(--fredy-border);
    margin-bottom: 3rem;
    position: relative;
}

.fredy-about::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--fredy-primary), var(--fredy-accent));
    border-radius: 1.5rem 1.5rem 0 0;
}

.fredy-section-label {
    display: inline-block;
    background: var(--fredy-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.fredy-about h2, .fredy-projects h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--fredy-dark);
    margin-bottom: 1.5rem;
}

/* === Tech Tags === */
.fredy-tech-stack { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.fredy-tech-tag {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: var(--fredy-text-light);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--fredy-transition);
    border: 1px solid transparent;
}

.fredy-tech-tag:hover {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: var(--fredy-accent);
    transform: translateY(-2px);
}

.fredy-about-text {
    font-size: 1.1rem;
    color: var(--fredy-text-light);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* === Contact Grid === */
.fredy-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.fredy-contact-item {
    background: var(--fredy-light);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: var(--fredy-transition);
    border: 1px solid var(--fredy-border);
}

.fredy-contact-item:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: var(--fredy-shadow);
}

.fredy-contact-icon {
    width: 48px; height: 48px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--fredy-accent);
}

.fredy-contact-item h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--fredy-text); }
.fredy-contact-item p { color: var(--fredy-text-muted); font-size: 0.95rem; }

/* === Info Grid === */
.fredy-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.fredy-info-section {
    background: var(--fredy-light);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--fredy-border);
}

.fredy-info-section h3 {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.1rem; font-weight: 600;
    color: var(--fredy-text);
    margin-bottom: 1rem;
}

.fredy-info-section .icon {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: var(--fredy-accent);
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}

.fredy-language-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.fredy-language-item:last-child { border-bottom: none; }

.fredy-language-level {
    background: linear-gradient(135deg, var(--fredy-primary), var(--fredy-secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.fredy-fun-fact {
    font-style: italic;
    color: var(--fredy-text-light);
    line-height: 1.6;
    position: relative;
    padding-left: 1rem;
}
.fredy-fun-fact::before { content: '☕'; position: absolute; left: 0; top: 0; font-style: normal; }

/* === Hobbies === */
.fredy-hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.fredy-hobby-item {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--fredy-border);
    transition: var(--fredy-transition);
}
.fredy-hobby-item:hover { transform: translateY(-3px); box-shadow: var(--fredy-shadow); }
.fredy-hobby-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.fredy-hobby-name { font-size: 0.875rem; font-weight: 500; color: var(--fredy-text); }

/* === Projects === */
.fredy-projects { margin-top: 3rem; }

.fredy-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.fredy-project-card {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--fredy-shadow);
    border: 1px solid var(--fredy-border);
    transition: var(--fredy-transition);
    position: relative;
    overflow: hidden;
}

.fredy-project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--fredy-primary), var(--fredy-accent));
    transition: width 0.3s ease;
}

.fredy-project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(var(--fredy-primary-rgb), 0.2);
}
.fredy-project-card:hover::before { width: 8px; }

.fredy-project-card h3 {
    font-size: 1.4rem; font-weight: 700;
    color: var(--fredy-dark);
    margin: 1rem 0;
}

.fredy-project-description {
    color: var(--fredy-text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* === Buttons === */
.fredy-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--fredy-primary), var(--fredy-secondary));
    color: white;
    text-decoration: none;
    border-radius: 2rem;
    font-weight: 600;
    transition: var(--fredy-transition);
    position: relative;
    overflow: hidden;
}

.fredy-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 100%;
    background: linear-gradient(135deg, var(--fredy-accent), var(--fredy-secondary));
    transition: width 0.4s ease;
    z-index: 0;
}
.fredy-btn:hover::before { width: 100%; }
.fredy-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -4px rgba(var(--fredy-primary-rgb), 0.4); }
.fredy-btn span, .fredy-btn svg { position: relative; z-index: 1; }
.fredy-btn svg { transition: transform 0.3s ease; }
.fredy-btn:hover svg { transform: translateX(3px); }

/* === Footer === */
.fredy-footer {
    background: var(--fredy-dark);
    color: white;
    text-align: center;
    padding: 3rem 2rem 2rem;
    border-radius: 1.5rem;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

.fredy-footer::before {
    content: '';
    position: absolute;
    top: -25px; left: 0;
    width: 100%; height: 50px;
    background: var(--fredy-light);
    transform: skewY(-2deg);
    z-index: 0;
}

.fredy-footer-content { position: relative; z-index: 1; }
.fredy-footer .fredy-social-links { margin-bottom: 1.5rem; }
.fredy-footer .fredy-social-icon { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); }
.fredy-footer .fredy-social-icon:hover { background: white; color: var(--fredy-primary); transform: translateY(-3px) scale(1.05); }
.fredy-footer-text { color: #cbd5e1; font-size: 0.95rem; opacity: 0.9; }

/* === Animations === */
@keyframes fredy-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fredy-slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* === Responsive === */
@media (max-width: 768px) {
    .fredy-header { padding: 3rem 1.5rem 2rem; }
    .fredy-about { padding: 1.5rem; }
    .fredy-projects-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .fredy-contact-grid { grid-template-columns: 1fr; }
    .fredy-project-card { padding: 1.5rem; }
    .fredy-info-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .fredy-hobbies-grid { grid-template-columns: repeat(2, 1fr); }
    .site-main { padding: 1rem; }
    .nav-container { justify-content: center; }
    .nav-links { justify-content: center; }
}

@media (max-width: 480px) {
    .fredy-header { padding: 2rem 1rem 1.5rem; margin-bottom: 2rem; }
    .fredy-social-links { gap: 0.75rem; }
    .fredy-social-icon { width: 44px; height: 44px; }
    .fredy-footer { padding: 1.5rem 0.75rem 1rem; margin-top: 1.5rem; }
    .fredy-footer::before { top: -10px; height: 20px; }
    .fredy-footer-text { font-size: 0.875rem; }
}

/* === Accessibility === */
:focus-visible { outline: 2px solid var(--fredy-primary); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
