/*
Theme Name: evfolio
Theme URI: https://eduardovega.net
Author: Eduardo Vega
Author URI: https://eduardovega.net
Description: Portfolio Theme
Version: 1.1
Text Domain: portfolio
*/

/* ==========================================================================
   TABLE OF CONTENTS:
   1. CSS Variables
   2. Base Styles & Typography
   3. Layout & Grid
   4. Navigation
   5. Buttons & Interactive Elements
   6. Form Elements
   7. Utilities & Helper Classes
   8. Animations
   9. Media Queries
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */

   :root {
    /* Color System - Primary Palette */
    --color-bg-dark: #0a0709;
    --color-bg-dark-soft: #121212;
    --color-text-primary: #ffffffb3;
    --color-text-heading: #e2e8f0;
    --color-text-muted: #64748b;
    --color-accent-primary: rgb(177 157 249); /* Purple/Lilac */
    --color-accent-teal: #14b8a6;

    /* Color Aliases & Functional Colors */
    --color-text: #94a3b8;
    --color-heading: #e2e8f0;
    --color-accent: rgba(89, 69, 161, 1);
    --color-card: rgba(0, 0, 0, 0.4);
    --color-card-hover: rgba(89, 69, 161, 0.2);
    --color-card-active: rgba(89, 69, 161, 0.2);
    --color-border: rgba(100, 116, 139, 0.2);
    --color-badge-bg: rgba(89, 69, 161, 0.1);
    --color-overlay-background: rgba(9, 7, 17, 0.5);
    --color-background: #0a0709;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-family-variable: InterVariable, sans-serif;
    --line-height: 1.6;

    /* Spacing System */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 1rem;
    --border-radius: 8px;
    --border-radius-circle: 50%;
    --border-radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-middle: 0.3s ease;
    --transition-slow: 0.8s ease-in-out;
    
    /* Borders */
    --border-width: 4px;
    
    /* Layout */
    --container-max-width: 1200px;
    
    /* Components */
    --card-min-width: 100px;
    --card-image-height: 180px;
    --modal-max-width: 600px;
    --modal-max-height: 90vh;
    --modal-content-height: 180px;
    
    /* Button & Icon Sizes */
    --button-size-sm: 24px;
    --button-size-md: 30px;
    --icon-size-sm: 10px;
    --icon-size-md: 18px;
    --icon-size-lg: 24px;
    
    /* Media */
    --image-max-height: 350px;
    
    /* Visual Effects */
    --gradient: conic-gradient(
        from 90deg at 50% 50%,
        rgb(251, 55, 60),
        rgba(252, 114, 28, 1),
        rgba(255, 220, 0, 1),
        rgba(27, 206, 255, 1),
        rgba(42, 107, 255, 1),
        rgba(217, 41, 255, 1),
        rgba(255, 10, 92, 1)
    );
}

/* ==========================================================================
   2. Base Styles & Typography
   ========================================================================== */

/* Font Settings */
:root {
    font-family: Inter, sans-serif;
    font-feature-settings: 'liga' 1, 'calt' 1; /* Fix for Chrome */
}

@supports (font-variation-settings: normal) {
    :root {
        font-family: InterVariable, sans-serif;
    }
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-dark);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-height: 100vh;
}

/* Selection Styling */
::selection {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
}
  
::-moz-selection {
    background-color: var(--color-accent); 
    color: var(--color-text-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-heading);
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    margin-bottom: 15px;
    font-size: 1.25rem;
    line-height: 1.5;
}

.section-title {
    font-size: calc(2rem + 3.5vw); /* Grows proportionally with viewport */
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -3px;
    margin-bottom: 1rem;
    color: var(--color-accent-primary);
    text-transform: uppercase;
}

/* ==========================================================================
   3. Layout & Grid
   ========================================================================== */

.background-f {
    width: 100vw;
    height: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.fh {
    height: 100vh;
}

.sticky {
    position: sticky;
    top: 100px;
}




/* ==========================================================================
   4. Navigation
   ========================================================================== */

.nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 9;
    background: var(--color-bg-dark);
    padding-top: 15px;
    padding-bottom: 15px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    gap: 3rem;
}

.nav a {
    text-decoration: none;
    font-size: 1.5rem;
    position: relative;
    perspective: 800px;
    overflow: hidden;
    padding: 5px 0;
    padding-top: 10px;
    color: var(--color-text-primary);
    transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

.icon-active {
    position: absolute;
    top: -10px;
    left: 50%;
    padding-top: 0;
    display: inline-block;
    overflow: auto;
    font-size: 14px;
    margin-left: -8px;
    animation: moveDown 1.1s ease-in-out infinite;
    animation-delay: 1s;
    display: none;
}

/* ==========================================================================
   5. Buttons & Interactive Elements
   ========================================================================== */

/* Outline Button */
.btn-ouline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    position: relative;
    overflow: hidden;
    color: var(--color-text-primary);
    border: solid 2px var(--color-accent-primary);
    z-index: 1;
    margin-bottom: 15px;
    background: transparent;
    cursor: pointer;
}

.btn-ouline:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-ouline-icon {
    margin-left: 8px;
    width: 14px;
    height: 14px;
}

.icon-arrow {
    display: inline-block;
    margin-left: 0.2rem;
}

/* Morph Reveal Effect */
.morph-reveal {
    transition: all 0.5s ease-out;
}

.morph-reveal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.6, 0.01, 0.05, 1);
    z-index: -1;
}

.morph-reveal span {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.morph-reveal:hover {
    color: white;
    border-radius: 50px;
    transition: all 0.5s ease-out;
}

.morph-reveal:active {
    transform: scale(1.05);
    transition: all 0.2s ease-out;
    position: relative;
}

.morph-reveal:hover::before {
    transform: scaleX(1);
}

.morph-reveal:hover span {
    transform: translateX(0px);
}

.morph-reveal-active {
    color: white;
    border-radius: 50px;
    transition: all 0.5s ease-out;
}

.morph-reveal-active span {
    transform: translateX(0px);
}

.morph-reveal-active::before {
    transform: scaleX(1);
}

/* Submit Button */
.btn-submit {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Base state */
    background-color: var(--color-accent-primary);
    color: white;
    border: none;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Hover Effect */
.btn-submit:hover {
    background-color: rgba(89, 69, 161, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Active/Pressed State */
.btn-submit:active {
    transform: translateY(1px);
    background-color: rgba(89, 69, 161, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Disabled State */
.btn-submit:disabled {
    background-color: var(--color-bg-dark-soft);
    color: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Loading State */
.btn-submit.loading {
    cursor: wait;
    pointer-events: none;
    opacity: 0.7;
}

/* Outline Variant */
.btn-submit-outline {
    background-color: transparent;
    color: var(--color-accent-primary);
    border: 2px solid var(--color-accent-primary);
    transition: all 0.3s ease;
}

.btn-submit-outline:hover {
    background-color: var(--color-accent-primary);
    color: white;
}

/* Button Size Variants */
.btn-submit-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-submit-sm {
    padding: 10px 20px;
    font-size: 14px;
}

/* Full Width Button */
.btn-submit-block {
    width: 100%;
}

/* Loading Indicator Animation */
.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* ==========================================================================
   6. Form Elements
   ========================================================================== */

/* Base Input Styles */
input,
textarea,
select {
    width: 100%;
    padding: var(--spacing-md);
    background-color: var(--color-card-active);
    color: var(--color-text-primary);
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    border: 0;
}

/* Focus State */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Placeholder Text */
input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Disabled State */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--color-bg-dark-soft);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Validation States */
input.error,
textarea.error,
select.error {
    border-color: #ff4d4d;
}

input.success,
textarea.success,
select.success {
    border-color: var(--color-accent-teal);
}

/* Specific Input Types */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: var(--spacing-sm);
}

input[type="file"] {
    padding: var(--spacing-sm);
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 120px;
}

/* Select */
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-primary) 50%),
        linear-gradient(135deg, var(--color-text-primary) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
        calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

/* Form Group */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-heading);
    font-weight: 600;
}

/* Form Error Message */
.error-message {
    color: #ff4d4d;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ==========================================================================
   7. Utilities & Helper Classes
   ========================================================================== */

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.486);
    border-radius: 50%;
    border-top-color: rgba(108, 91, 185, 1);
    animation: spin 1s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: -10px;
    margin-left: -10px;
    z-index: 10;
}

/* Background Highlight Classes */
.hightlight {
    background-color: rgba(89, 69, 161, 0.2);
    border-radius: 1rem;
}

.hightlight-negative {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 1rem;
}


/* Item home Styles */
.bio {
    padding: 2rem;
}

/* Item Card Styles */
.item {
    background-color: var(--color-card);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, background-color 0.3s ease;
    user-select: none;
    border: 1px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.item:focus {
    outline: none;
}

.item.active {
    background-color: var(--color-card-active);
}

.item-caption {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-caption h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-heading);
}

.item-caption p {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    flex-grow: 1;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-badge-bg);
    color: var(--color-accent);
    border-radius: 100px;
}

/* ==========================================================================
   8. Animations
   ========================================================================== */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(5px);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.6;
    }
    100% {
        transform: translateY(5px);
        opacity: 1;
    }
}

/* ==========================================================================
   9. Media Queries
   ========================================================================== */

/* Medium Screens */
@media screen and (max-width: 1200px) {
    .nav {
        display: flex;
        margin-bottom: 0;
        margin-right: 0;
        position: sticky;
        top: 0;
        z-index: 9;
        padding-top: 15px;
        padding-bottom: 15px;
        width: 100%;
        background-color: var(--color-bg-dark);
        justify-content: left;
        gap: 1.5rem;
    }
}

/* Small Screens */
@media screen and (max-width: 768px) {
    /* Form Elements */
    input,
    textarea,
    select {
        padding: var(--spacing-sm);
    }
    
    /* Buttons */
    .btn-submit {
        padding: 12px 24px;
        font-size: 14px;
    }

    .btn-submit-lg {
        padding: 14px 28px;
        font-size: 16px;
    }

    .btn-submit-sm {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* Layout */
    .fh {
        height: auto;
    }

    .sticky {
        position: auto;
        top: auto;
    }
    
    .btn-ouline {
        width: 100% !important;
    }

    .section-title {
        font-size: calc(2rem + 8vw);
    }
}