/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL
   ========================================================================== */
:root {
    --bg: #f8f7f4;          /* Un fondo hueso/crema sutil y elegante */
    --text: #1a1a1a;        /* Negro suave para mejor lectura */
    --muted: #767670;       /* Gris cálido para metadatos y estados secundarios */
    --accent: #0f3ba2;      /* Azul profundo institucional (tomado de tu logo) */
    --btn-bg: #ffffff;      /* Fondo blanco limpio para los botones */
    --btn-border: #e2e1dc;  /* Borde suave */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Georgia', serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. ESTRUCTURA HOME
   ========================================================================== */
.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

/* Contenedor para el logo y tu nombre */
.home-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px; /* Separación con la frase */
}

/* Logo más grande y con más presencia */
.logo {
    width: min(160px, 40vw); /* Crece hasta 160px en escritorio (antes era 70px) */
    height: auto;
    margin-bottom: 16px;
    opacity: 0.95;
}

/* Tu nombre como elemento secundario y sofisticado */
.artist-name {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em; /* Espaciado amplio para look de galería de arte */
    color: var(--muted);  /* Gris cálido (no negro) para que sea secundario */
    text-align: center;
}

.phrase {
    max-width: 680px;
    text-align: center;
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.5vw, 38px); /* Reducida un poco para que el logo destaque más */
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 52px;
    letter-spacing: -0.01em;
}
/* ==========================================================================
   3. RETÍCULA DE CATÁLOGO (GRID)
   ========================================================================== */
.code-grid {
    display: grid;
    /* El grid ahora es completamente fluido y se adapta al espacio disponible */
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 800px; /* Ancho máximo contenedor */
    margin: 0 auto;
}

/* ==========================================================================
   4. BOTONES DE OBRAS (CÓDIGOS)
   ========================================================================== */
.code-btn {
    aspect-ratio: 1 / 1; /* Cuadrados perfectos automáticos */
    border: 1px solid var(--btn-border);
    background-color: var(--btn-bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Efecto Hover: Elegante y minimalista */
.code-btn:hover {
    transform: translateY(-4px);
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 59, 162, 0.18);
}

/* ==========================================================================
   5. RESPONSIVE / ADAPTABILIDAD MOBILE
   ========================================================================== */
@media (max-width: 600px) {
    .home {
        padding: 40px 16px;
    }

    .phrase {
        margin-bottom: 40px;
    }

    .code-grid {
        /* En pantallas muy pequeñas, forzamos 4 columnas para mantener orden */
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}


.artwork-page {
    min-height: 100vh;
    padding: 32px;
    background: #f7f6f2;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    text-decoration: none;
    color: #111;
    font-size: 14px;
    letter-spacing: .04em;
}

.artwork-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 420px;
    gap: 48px;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}

.artwork-image-wrap {
    background: #fff;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.08);
}

.artwork-image {
    width: 100%;
    max-height: 76vh;
    object-fit: contain;
    display: block;
}

.artwork-details {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 22px;
    padding: 34px;
}

.detail-logo {
    width: 86px;
    display: block;
    margin: 0 auto 28px;
}

.artwork-code {
    font-size: 13px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #777;
}

.artwork-details h1 {
    font-size: 34px;
    line-height: 1.05;
    margin: 8px 0 22px;
}

.meta p {
    margin: 8px 0;
    font-size: 15px;
}

.description {
    margin-top: 26px;
    font-size: 16px;
    line-height: 1.7;
}

.qr-box {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,.12);
    text-align: center;
}

.qr-box img {
    width: 130px;
    height: 130px;
}

.qr-box p {
    font-size: 12px;
    color: #777;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .artwork-layout {
        grid-template-columns: 1fr;
    }

    .artwork-page {
        padding: 18px;
    }

    .artwork-details h1 {
        font-size: 28px;
    }
}