/* Portafolio. Los colores y las fuentes salen de base.css.
   Estilo "luxury": negro cálido, dorado champán, titulares serif y mucho aire.
   Regla de legibilidad: ningún texto por debajo de 0.8rem (≈13 px) y el cuerpo en 1.0625rem. */

:root { --gutter: 28px; --max: 1120px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--amber); color: var(--amber-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* fondo con un leve resplandor dorado arriba */
body { background-image: var(--glow); background-repeat: no-repeat; background-size: 100% 720px; }

/* ---------- barra superior ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent); opacity: 0.55;
}
.nav {
  width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto;
  min-height: 68px; display: flex; align-items: center; gap: 12px;
}
.logo { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: 0.01em; margin-right: auto; }
.logo span { color: var(--amber-text); }
.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.menu a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.menu a:hover, .menu a.active { color: var(--amber-text); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.menu .menu-cta { border: 1px solid var(--amber); color: var(--amber-text); margin-left: 8px; }
.menu .menu-cta:hover { background: var(--amber); color: var(--amber-ink); }
.theme-toggle, .nav-toggle {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 1rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--amber); color: var(--amber-text); }
.nav-toggle { display: none; }

/* ---------- estructura general ---------- */
.hero, .stats, .block { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.block { padding-block: 96px 8px; }
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--amber-text); margin-bottom: 14px;
}
.eyebrow::after { content: ""; height: 1px; width: 56px; background: var(--amber); opacity: 0.6; }
.block h2 { font-size: clamp(2.4rem, 5.4vw, 3.5rem); font-weight: 600; margin-bottom: 36px; }
.section-lead { color: var(--muted); font-size: 1.08rem; max-width: 66ch; margin: -14px 0 32px; }
.sub { font-size: 1.7rem; font-weight: 600; margin: 60px 0 16px; }
.sub-note { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; color: var(--muted); letter-spacing: 0; }
.sub + .section-lead { margin-top: 0; }

.tag {
  display: inline-block; font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--amber-text);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px;
}
.tag-edu { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips span {
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px;
}
.chips.big span { font-size: 0.95rem; padding: 6px 14px; color: var(--ink); background: var(--surface-2); border-color: transparent; }

/* tarjeta base: borde fino, fondo sutil y borde dorado al pasar el cursor */
.t-body, .project, .lang, .skill-card, .sec-card, .soft-card, .help, .contact-card, .cert, .levels, .card-id, .stats {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, #fff 3%), var(--surface));
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.project:hover, .lang:hover, .sec-card:hover, .skill-card:hover, .t-body:hover, .soft-card:hover { border-color: var(--line-strong); }

/* ---------- inicio ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr); gap: 64px; align-items: center; padding-block: 72px 56px; }
.hero-id { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.avatar {
  width: 96px; height: 96px; flex: none; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--amber); padding: 3px; background: var(--bg);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 14%, transparent);
}
.status {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: 0.92rem; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line); border-radius: 22px; padding: 8px 16px; line-height: 1.35;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 24%, transparent); flex: none; }
.hero h1 { font-size: clamp(3.2rem, 8.4vw, 6rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.015em; }
.hero h1 .accent {
  display: block; font-style: italic;
  background: linear-gradient(135deg, #F0D99A, #C9A55C 50%, #A98233);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: 0.08em;
}
:root[data-theme="light"] .hero h1 .accent { background: linear-gradient(135deg, #B8923F, #7A5A18); -webkit-background-clip: text; background-clip: text; }
.role { font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-text); margin-top: 24px; }
.lead { color: var(--muted); font-size: 1.18rem; max-width: 54ch; margin-top: 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn-icon { width: 48px; padding: 0; font-size: 1.2rem; }

.card-id { border-radius: 20px; box-shadow: var(--shadow); padding: 26px 26px 22px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; gap: 2px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts div:last-child { padding-bottom: 0; }
.facts dt { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--amber-text); }
.facts dd { margin: 0; font-size: 1.02rem; line-height: 1.45; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 20px; overflow: hidden; }
.stat { padding: 28px 28px; display: grid; gap: 4px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-num { font-family: var(--font-display); font-size: 3rem; font-weight: 600; line-height: 1; color: var(--amber-text); }
.stat-label { color: var(--muted); font-size: 0.98rem; }

/* ---------- sobre mí ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr); gap: 48px; align-items: start; }
.about-text { display: grid; gap: 18px; max-width: 62ch; }
.about-text p { font-size: 1.1rem; }
.about-text strong { color: var(--amber-text); font-weight: 600; }
.help { border-radius: 18px; padding: 28px; }
.help-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 20px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.help-list li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.help-list i { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--amber-text); }
.help-list strong { display: block; font-weight: 600; }
.help-list span { display: block; color: var(--muted); font-size: 1rem; margin-top: 2px; }

.soft-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.soft-card { display: grid; grid-template-columns: 30px 1fr; gap: 16px; border-radius: 16px; padding: 26px; }
.soft-card > i { font-size: 1.4rem; color: var(--amber-text); padding-top: 4px; }
.soft-card h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 6px; }
.soft-card p { color: var(--muted); font-size: 1rem; }

/* ---------- experiencia ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.t-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; }
.t-date { font-size: 0.95rem; font-weight: 500; letter-spacing: 0.04em; color: var(--amber-text); padding-top: 26px; }
.t-body { border-radius: 16px; padding: 26px 28px; display: grid; gap: 10px; }
.t-body h3 { font-size: 1.55rem; font-weight: 600; }
.t-body > p { color: var(--muted); }
.t-body .tag { justify-self: start; }
.bullets { margin: 4px 0 0; padding-left: 1.15rem; display: grid; gap: 8px; color: var(--muted); }
.bullets li::marker { color: var(--amber); }
.bullets strong { color: var(--ink); font-weight: 600; }
.t-body .chips { margin-top: 8px; }

/* ---------- proyectos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 9px 20px; cursor: pointer; font-weight: 500; font-size: 0.98rem; transition: all 0.2s ease; }
.filter:hover { border-color: var(--amber); color: var(--amber-text); }
.filter.active { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.project { border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project.hide { display: none; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-top > i { font-size: 1.25rem; color: var(--amber-text); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.project h3 { font-size: 1.6rem; font-weight: 600; }
.project > p { color: var(--muted); font-size: 1rem; }
.project .chips { margin-top: auto; padding-top: 8px; }
.project .status {
  display: inline-flex; font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 12px; margin: 0;
}
.project .status.live { color: var(--teal); border-color: var(--teal); }
.project .status.client { color: var(--amber-text); border-color: var(--amber); }
.project .status.wip { color: var(--muted); border-style: dashed; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.project-link {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 8px;
  font-weight: 600; text-decoration: none; color: var(--amber-text); border: 1px solid var(--amber);
  border-radius: 999px; padding: 10px 20px; transition: all 0.2s ease;
}
.project-links .project-link { margin-top: 0; }
.project-link:hover { background: var(--amber); color: var(--amber-ink); }
.project-link.ghost { border-color: var(--line-strong); color: var(--ink); }
.project-link.ghost:hover { border-color: var(--amber); background: transparent; color: var(--amber-text); }

/* ---------- habilidades ---------- */
.langs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lang { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; border-radius: 16px; padding: 20px; align-items: start; }
.lang h4 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; margin: 0 0 4px; }
.lang p { color: var(--muted); font-size: 0.98rem; line-height: 1.5; }
.badge {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.02em;
}
.b-py { background: #3776AB; color: #fff; }
.b-js { background: #F7DF1E; color: #1a1a1a; }
.b-ts { background: #3178C6; color: #fff; }
.b-java { background: #F0932B; color: #1a1a1a; font-size: 0.82rem; }
.b-cs { background: #68217A; color: #fff; }
.b-sql { background: #336791; color: #fff; font-size: 0.85rem; }
.b-html { background: #C93E1B; color: #fff; font-size: 0.82rem; }
.b-css { background: #1572B6; color: #fff; font-size: 0.82rem; }
.b-sh { background: #2B2B30; color: #8FE388; font-size: 0.82rem; border: 1px solid #4A4A52; }

.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.skill-card { border-radius: 16px; padding: 26px; }
.skill-card h3 { font-size: 1.4rem; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.skill-card h3 i { color: var(--amber-text); font-size: 1.05rem; }
.skill-card .chips.logos { margin-top: 18px; }

/* logos de tecnologías: color de la marca cuando existe; si no, dorado del tema */
.chips.logos span { display: inline-flex; align-items: center; gap: 8px; }
.chips.logos i { font-size: 1.05em; width: 1.15em; text-align: center; color: var(--amber-text); flex: none; }
.chips.logos .fa-html5 { color: #E34F26; }
.chips.logos .fa-css3-alt { color: #2965F1; }
.chips.logos .fa-js { color: #F0DB4F; }
.chips.logos .ts { color: #3178C6; }
.chips.logos .fa-angular { color: #DD0031; }
.chips.logos .fa-react { color: #61DAFB; }
.chips.logos .fa-vuejs { color: #4FC08D; }
.chips.logos .tw { color: #06B6D4; }
.chips.logos .fa-bootstrap { color: #7952B3; }
.chips.logos .fa-python { color: #4B8BBE; }
.chips.logos .dj { color: #44B78B; }
.chips.logos .fa-bolt { color: #009688; }
.chips.logos .fa-node-js { color: #539E43; }
.chips.logos .fa-java { color: #ED8B00; }
.chips.logos .sb { color: #6DB33F; }
.chips.logos .fa-microsoft { color: #8A5CD1; }
.chips.logos .mssql { color: #CC2927; }
.chips.logos .mysql { color: #4479A1; }
.chips.logos .pg { color: #4169E1; }
.chips.logos .mongo { color: #47A248; }
.chips.logos .sqlite { color: #4FB3E8; }
.chips.logos .fa-docker { color: #2496ED; }
.chips.logos .fa-git-alt { color: #F05032; }
.chips.logos .fa-github, .chips.logos .fa-unity { color: var(--ink); }
.chips.logos .fa-telegram { color: #26A5E4; }
.chips.logos .fa-figma { color: #F24E1E; }
.chips.logos .fa-jira { color: #2684FF; }
.chips.logos .fa-trello { color: #2D9CDB; }
.chips.logos .fa-windows { color: #5391FE; }
.chips.logos .fa-wordpress { color: #3D8EB9; }
.chips.logos .fa-yoast { color: #C94F9E; }
.chips.logos .postman { color: #FF6C37; }

.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 16px; }
.sec-card { border-radius: 16px; padding: 22px 24px; }
.sec-card h4 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 12px; }
.sec-card h4 i { color: var(--amber-text); width: 22px; text-align: center; font-size: 1rem; }
.sec-card p { color: var(--muted); font-size: 1rem; }

.levels { list-style: none; margin: 0; padding: 0; border-radius: 16px; }
.levels li { display: grid; grid-template-columns: minmax(0, 1fr) auto 140px; gap: 20px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); }
.levels li:first-child { border-top: 0; }
.level-name { font-size: 1.02rem; }
.meter { display: inline-flex; gap: 5px; }
.meter i { width: 28px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #E3C47E, #BF9A4F); }
.meter i.off { background: var(--surface-2); }
.level-tag { font-size: 0.85rem; font-weight: 500; letter-spacing: 0.04em; color: var(--muted); text-align: right; }

/* ---------- certificados ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 20px; }
.cert { text-align: left; cursor: pointer; border-radius: 18px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cert:hover { border-color: var(--amber); transform: translateY(-3px); box-shadow: var(--shadow); }
.cert-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cert-body { display: grid; gap: 8px; padding: 18px 20px 20px; justify-items: start; }
.cert-title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.cert-meta { color: var(--muted); font-size: 0.95rem; }
.cert-meta.dim { font-size: 0.875rem; letter-spacing: 0.03em; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 94vh; color: #fff; overflow: visible; }
.lightbox::backdrop { background: rgba(6, 6, 8, 0.88); }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; }
.lightbox img { max-height: 80vh; max-width: 100%; width: auto; border-radius: 10px; background: #fff; }
.lightbox figcaption { font-size: 1rem; text-align: center; }
.lb-close { position: absolute; top: -14px; right: -6px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--amber); color: var(--amber-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* ---------- contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 18px; }
.contact-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; align-items: start; border-radius: 18px; padding: 28px; text-decoration: none; }
.contact-card > i { font-size: 1.9rem; color: var(--amber-text); padding-top: 2px; }
.contact-card h3 { font-size: 1.5rem; font-weight: 600; }
.contact-card p { color: var(--muted); }
.contact-link:hover { border-color: var(--amber); transform: translateY(-3px); }
.mail { font-size: 1.1rem; font-weight: 500; color: var(--ink) !important; margin: 6px 0 16px; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.site-footer { width: min(var(--max), 100% - 2 * var(--gutter)); margin: 96px auto 0; padding: 30px 0 44px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; color: var(--muted); font-size: 0.95rem; }
.footer-note { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.05rem; color: var(--amber-text); }

/* ---------- pantallas medianas y pequeñas ---------- */
@media (max-width: 960px) {
  .langs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 48px 36px; }
  .about { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .contact-main { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  :root { --gutter: max(22px, env(safe-area-inset-left, 0px)); }
  .nav-toggle { display: grid; }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; padding: 10px 22px 18px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .menu.open { display: flex; }
  .menu a { padding: 14px 12px; font-size: 0.95rem; border-radius: 10px; }
  .menu .menu-cta { margin: 8px 0 0; text-align: center; }
  .nav { position: relative; }
  .t-item { grid-template-columns: 1fr; gap: 8px; }
  .t-date { padding-top: 0; }
  .skills-grid, .soft-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .levels li { grid-template-columns: minmax(0, 1fr) auto; }
  .level-tag { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 560px) {
  :root { --gutter: max(20px, env(safe-area-inset-left, 0px)); }
  body { font-size: 1.0625rem; }
  .block { padding-top: 72px; }
  .block h2 { margin-bottom: 28px; }
  .avatar { width: 80px; height: 80px; }
  .hero-id { gap: 14px; margin-bottom: 24px; }
  .status { font-size: 0.9rem; padding: 7px 14px; }
  .lead { font-size: 1.12rem; }
  .hero-cta .btn:not(.btn-icon) { flex: 1 1 100%; }
  .card-id { padding: 22px; }
  .contact-grid { grid-template-columns: 1fr; }
  .stat { padding: 22px 18px; }
  .stat-num { font-size: 2.4rem; }
  .stat-label { font-size: 0.95rem; }
  .t-body { padding: 22px 20px; }
  .t-body h3 { font-size: 1.45rem; }
  .project { padding: 22px; }
  .langs { grid-template-columns: 1fr; }
  .lang { grid-template-columns: 48px minmax(0, 1fr); }
  .badge { width: 48px; height: 48px; }
  .help, .skill-card, .soft-card, .contact-card { padding: 22px; }
  .levels li { padding: 14px 18px; }
}
