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

:root {
    --navy: #0B1F3A;
    --navy-mid: #14325C;
    --gold: #C89B3C;
    --gold-light: #E8C06A;
    --cream: #F7F3ED;
    --cream-mid: #EDE8DF;
    --white: #FFFFFF;
    --text-dark: #0B1F3A;
    --text-mid: #3E5070;
    --text-muted: #7A8BA3;
    --card-border: rgba(11,31,58,0.10);
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'DM Sans', system-ui, sans-serif;
    --radius: 20px;
}

body { font-family: var(--sans); background: var(--cream); color: var(--text-dark); min-height: 100vh; overflow-x: hidden; }

/* ═══ HERO ═══ */
.hero { background: var(--navy); position: relative; overflow: hidden; padding: 0 0 60px; }
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 600px 400px at 80% 50%, rgba(200,155,60,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at -10% 80%, rgba(20,50,92,0.8) 0%, transparent 60%);
    pointer-events: none;
}
.hero-grid-lines {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px; pointer-events: none;
}

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 60px; border-bottom: 1px solid rgba(255,255,255,0.08); position: relative; z-index: 2; }
.logo-block { display: flex; align-items: center; gap: 16px; }
.logo-emblem { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-emblem svg { width: 30px; height: 30px; fill: var(--navy); }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: var(--serif); font-size: 22px; color: var(--white); letter-spacing: 0.02em; line-height: 1; }
.logo-sub { font-size: 11px; color: var(--gold-light); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; font-weight: 500; }
.badge-cert { background: rgba(200,155,60,0.15); border: 1px solid rgba(200,155,60,0.35); border-radius: 30px; padding: 6px 16px; font-size: 12px; color: var(--gold-light); letter-spacing: 0.05em; font-weight: 500; }

.hero-content { position: relative; z-index: 2; max-width: 860px; margin: 56px auto 0; padding: 0 60px; text-align: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); font-weight: 600; margin-bottom: 20px; }
.hero-eyebrow::before, .hero-eyebrow::after { content: ''; display: block; width: 28px; height: 1px; background: var(--gold); opacity: 0.6; }
.hero-title { font-family: var(--serif); font-size: clamp(34px, 5vw, 56px); color: var(--white); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 20px; }
.hero-title em { color: var(--gold-light); font-style: italic; }
.hero-desc { font-size: 17px; color: rgba(255,255,255,0.62); line-height: 1.7; max-width: 560px; margin: 0 auto; font-weight: 300; }

.hero-stats { display: flex; justify-content: center; margin-top: 44px; border-top: 1px solid rgba(255,255,255,0.08); padding: 32px 60px 0; position: relative; z-index: 2; }
.stat { flex: 1; max-width: 200px; text-align: center; padding: 0 24px; border-right: 1px solid rgba(255,255,255,0.08); }
.stat:last-child { border-right: none; }
.stat-num { font-family: var(--serif); font-size: 36px; color: var(--gold-light); line-height: 1; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 6px; letter-spacing: 0.05em; text-transform: uppercase; }

/* ═══ SECTION ═══ */
.section { width: 86%; max-width: 1100px; margin: 0 auto; padding: 72px 0 80px; }
.section-header { text-align: center; margin-bottom: 52px; }
.section-tag { display: inline-block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 14px; }
.section-title { font-family: var(--serif); font-size: clamp(26px, 3.5vw, 38px); color: var(--navy); letter-spacing: -0.01em; line-height: 1.2; }

/* ═══ GRID — 1 columna, tarjetas horizontales ═══ */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ═══ CARD — layout horizontal ═══ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    overflow: hidden;
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: 1fr auto;
    min-height: 260px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    /*alto*/
    height:350px;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 56px rgba(11,31,58,0.13);
}

/* Número de orden lateral izquierdo */
.card::before {
    content: attr(data-num);
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    background: var(--navy);
    color: var(--gold-light);
    font-family: var(--serif);
    font-size: 13px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius) 0 0 var(--radius);
    z-index: 2;
    letter-spacing: 0.1em;
}

/* THUMB — ocupa toda la columna izquierda */
.card-thumb {
    position: relative;
    grid-column: 1;
    grid-row: 1 / 3;
    overflow: hidden;
    background: var(--cream-mid);
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }

.card-num { display: none; } /* Oculto — usamos el ::before */

.card-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}
.badge-html { background: rgba(227,78,38,0.14); color: #c03a10; border: 1px solid rgba(227,78,38,0.2); }
.badge-js   { background: rgba(234,189,0,0.18);  color: #7a6000; border: 1px solid rgba(234,189,0,0.3); }
.badge-php  { background: rgba(97,129,172,0.18); color: #2d5580; border: 1px solid rgba(97,129,172,0.3); }
.badge-react{ background: rgba(32,178,209,0.18); color: #0d7390; border: 1px solid rgba(32,178,209,0.3); }
.badge-css  { background: rgba(38,77,228,0.14);  color: #1a40b0; border: 1px solid rgba(38,77,228,0.2); }

/* CONTENIDO — columna derecha, arriba */
.card-body {
    grid-column: 2;
    grid-row: 1;
    padding: 28px 32px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card-category {
    font-size: 11px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 8px;
}
.card-title {
    font-family: var(--serif);
    font-size: clamp(22px, 2.2vw, 30px);
    color: var(--navy);
    line-height: 1.2;
    margin-bottom: 12px;
}
.card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 520px;
}

/* TAGS — columna derecha */
.card-tags {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px;
    padding: 0 32px 0;
}
.tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--cream);
    color: var(--text-mid);
    border: 1px solid var(--cream-mid);
    font-weight: 500;
}

/* FOOTER — se superpone sobre tags en la parte baja derecha */
.card-footer {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding: 14px 28px 20px;
    margin-top: auto;
}

/* Reemplazar card-tags + card-footer: ponemos ambos juntos en una sola fila */
.card-bottom {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px 24px;
    border-top: 1px solid var(--cream-mid);
    gap: 12px;
    margin-top: 8px;
}
.card-bottom .card-tags {
    grid-column: unset;
    grid-row: unset;
    padding: 0;
    flex: 1;
}
.card-bottom .card-footer {
    grid-column: unset;
    grid-row: unset;
    padding: 0;
    border: none;
    flex-shrink: 0;
}

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.qr-container { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: white; border: 1px solid var(--cream-mid); display: flex; align-items: center; justify-content: center; }
.qr-container canvas, .qr-container img { width: 56px !important; height: 56px !important; }
.qr-label { font-size: 9px; color: var(--text-muted); text-align: center; letter-spacing: 0.06em; text-transform: uppercase; }

.card-link-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; border-radius: 30px;
    background: var(--navy); color: var(--white);
    font-size: 12px; font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    border: none; cursor: pointer; white-space: nowrap;
}
.card-link-btn:hover { background: var(--navy-mid); transform: scale(1.03); }
.card-link-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ═══ FOOTER ═══ */
footer { background: var(--navy); padding: 36px 60px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-logo { display: flex; align-items: center; gap: 12px; }
.footer-mini-emblem { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); display: flex; align-items: center; justify-content: center; }
.footer-mini-emblem svg { width: 20px; height: 20px; fill: var(--navy); }
.footer-name { font-family: var(--serif); color: var(--white); font-size: 16px; }
.footer-right { font-size: 12px; color: rgba(255,255,255,0.4); text-align: right; }

/* ═══ ANIMACIONES ═══ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeUp 0.5s ease both; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.14s; }
.card:nth-child(3) { animation-delay: 0.23s; }
.card:nth-child(4) { animation-delay: 0.32s; }
.card:nth-child(5) { animation-delay: 0.41s; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 860px) {
    .card { grid-template-columns: 1fr; grid-template-rows: 280px auto auto; min-height: unset; }
    .card::before { display: none; }
    .card-thumb { grid-column: 1; grid-row: 1; aspect-ratio: 16/9; height: 280px; }
    .card-body { grid-column: 1; grid-row: 2; padding: 20px 20px 10px; }
    .card-bottom { grid-column: 1; grid-row: 3; padding: 12px 20px 20px; }
    .section { width: 95%; }
}
@media (max-width: 560px) {
    .topbar { padding: 16px 20px; }
    .hero-content { padding: 0 20px; margin-top: 36px; }
    footer { padding: 28px 20px; flex-direction: column; }
    .card-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
    .card-footer { width: 100%; justify-content: space-between; }
}
