/* ============================================
   KYNTHOS — Visual Framework Global v2
   ============================================ */

/* --- Variables --- */
:root {
    /* Colores */
    --bg: #F4F1EA;
    --text: #1B222C;
    --surface: #FFFFFF;
    --border: rgba(27, 34, 44, 0.12);
    --text-muted: rgba(27, 34, 44, 0.5);

    /* Tipografía */
    --font-body: 'Nunito', sans-serif;

    /* Espaciado */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 100px;

    /* Layout */
    --max-width: 1100px;
    --header-height: 64px;

    /* Transiciones */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    opacity: 0;
    animation: fadeIn var(--duration-normal) forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Utilidades --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(244, 241, 234, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    animation: slideDown 0.5s var(--ease-out-expo);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    height: 32px;
    width: auto;
    transition: opacity var(--duration-fast) ease;
}

.header__logo:hover {
    opacity: 0.8;
}

.header__nav {
    display: flex;
    gap: 24px;
}

.header__nav a {
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity var(--duration-fast) ease;
    position: relative;
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: width var(--duration-fast) var(--ease-out-expo);
}

.header__nav a:hover,
.header__nav a.active {
    opacity: 1;
}

.header__nav a:hover::after,
.header__nav a.active::after {
    width: 100%;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
    animation: fadeInUp 0.6s var(--ease-out-expo);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer__text {
    font-weight: 600;
    font-size: 0.8rem;
    opacity: 0.4;
}

.footer__links {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.footer__links a {
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity var(--duration-fast) ease;
}

.footer__links a:hover {
    opacity: 1;
}

/* --- Main content wrapper --- */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px 60px;
    min-height: calc(100vh - var(--header-height) - 100px);
    animation: fadeInUp 0.6s var(--ease-out-expo) 0.2s both;
}

/* --- Botones --- */
.btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    display: inline-block;
    transition: transform var(--duration-fast) var(--ease-out-expo), 
                opacity var(--duration-fast) ease,
                box-shadow var(--duration-fast) ease;
    cursor: pointer;
    border: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn--primary {
    background: var(--text);
    color: var(--bg);
}

.btn--primary:hover {
    box-shadow: 0 4px 16px rgba(27, 34, 44, 0.15);
}

.btn--secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--text);
}

.btn--secondary:hover {
    background: var(--text);
    color: var(--bg);
}

/* --- Cards --- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: transform var(--duration-fast) var(--ease-out-expo), 
                box-shadow var(--duration-fast) ease;
    animation: fadeInUp 0.5s var(--ease-out-expo) both;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(27, 34, 44, 0.06);
}

.card--locked {
    background: rgba(27, 34, 44, 0.03);
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.card--locked:hover {
    transform: none;
    box-shadow: none;
}

.card__number {
    font-weight: 800;
    font-size: 0.8rem;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card__title {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 8px 0 4px;
    line-height: 1.2;
}

.card__desc {
    font-weight: 400;
    font-size: 0.9rem;
    opacity: 0.6;
    line-height: 1.4;
}

.card__candado {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* --- Grids --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* --- Tags / Badges --- */
.tag {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    animation: fadeInUp 0.8s var(--ease-out-expo);
}

.hero__logo-img {
    width: clamp(120px, 25vw, 180px);
    height: auto;
    display: block;
    margin: 0 auto 12px;
    animation: fadeInScale 0.6s var(--ease-out-expo);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.hero__tag {
    margin-bottom: 28px;
}

.hero__title {
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero__subtitle {
    font-weight: 400;
    font-size: 1.05rem;
    opacity: 0.55;
    max-width: 380px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.hero__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- Section titles --- */
.section-title {
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative;
}

/* --- Section divider --- */
.section-divider {
    border: none;
    border-top: 2px solid var(--text);
    opacity: 0.12;
    margin: 48px 0;
}

/* --- Toast notification --- */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--text);
    color: var(--bg);
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 999;
    opacity: 0;
    transition: transform 0.3s var(--ease-out-expo), opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast--hidden {
    transform: translateX(-50%) translateY(-120px);
    opacity: 0;
}

/* --- Proyecto a pantalla completa --- */
.proyecto-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    z-index: 200;
    overflow-y: auto;
    animation: fadeIn 0.3s var(--ease-out-expo);
    display: none;
}

.proyecto-fullscreen.active {
    display: block;
}

.proyecto-fullscreen__back {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 210;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out-expo);
    color: var(--text);
    font-family: var(--font-body);
}

.proyecto-fullscreen__back:hover {
    transform: scale(1.05);
}

.proyecto-fullscreen__content {
    width: 100%;
    min-height: 100vh;
}

.proyecto-fullscreen__content iframe {
    width: 100%;
    height: 100vh;
    border: none;
    display: block;
}

/* --- Sobre Mi específico --- */
.sobre-mi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.sobre-mi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s var(--ease-out-expo) both;
}

.sobre-mi-card h3 {
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.sobre-mi-card p,
.sobre-mi-card li {
    opacity: 0.65;
    line-height: 1.7;
    font-size: 0.95rem;
}

.sobre-mi-card ul {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Barra de progreso --- */
.progress-bar {
    background: var(--border);
    border-radius: var(--radius-pill);
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar__fill {
    background: var(--text);
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.6s var(--ease-out-expo);
    width: 0%;
}

/* --- Contacto --- */
.contacto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.contacto-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform var(--duration-fast) var(--ease-out-expo), 
                box-shadow var(--duration-fast) ease;
    animation: fadeInUp 0.5s var(--ease-out-expo) both;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.contacto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(27, 34, 44, 0.06);
}

.contacto-card__icono {
    font-size: 2.5rem;
}

.contacto-card__titulo {
    font-weight: 800;
    font-size: 1.2rem;
}

.contacto-card__subtitulo {
    font-size: 0.9rem;
    opacity: 0.5;
}

/* --- Media queries --- */
@media (max-width: 768px) {
    .header__nav {
        gap: 16px;
    }

    .header__nav a {
        font-size: 0.8rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sobre-mi-grid {
        grid-template-columns: 1fr;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 24px 16px 40px;
    }
}

@media (max-width: 480px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}