/* ============================================================
   Portfolio — Carlos Miyén Brandolino
   Sistema de diseño: navy ejecutivo / fintech
   ============================================================ */

:root {
  --bg: #0B1526;            /* navy muy oscuro */
  --bg-deep: #081020;
  --surface: #13233B;       /* azul petróleo */
  --surface-2: #182C49;
  --line: rgba(110, 160, 220, 0.14);
  --line-strong: rgba(110, 160, 220, 0.28);
  --accent: #4CC6F2;        /* cyan suave */
  --accent-2: #2F7BF6;      /* azul eléctrico */
  --text: #E8F0FA;
  --muted: #97ACC8;
  --muted-2: #6D82A3;
  --radius: 14px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(76, 198, 242, 0.28); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 16, 32, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 20px;
}
.brand {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.14em;
  color: var(--text); font-weight: 600; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-size: 14px; padding: 7px 11px;
  border-radius: 8px; transition: color .18s, background .18s;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.lang {
  margin-left: 8px; font-family: var(--font-mono); font-size: 12.5px;
  color: var(--muted); border: 1px solid var(--line-strong);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  transition: color .18s, border-color .18s;
}
.lang:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 56px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 340px at 85% -10%, rgba(47, 123, 246, 0.14), transparent 65%),
    radial-gradient(520px 300px at 5% 110%, rgba(76, 198, 242, 0.07), transparent 60%);
}
.hero .wrap { position: relative; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(34px, 5.4vw, 56px); line-height: 1.08;
  letter-spacing: -0.02em; max-width: 15ch;
}
.hero__lead {
  margin-top: 22px; max-width: 62ch; color: var(--muted); font-size: 18px;
}
.hero__lead strong { color: var(--text); font-weight: 600; }

/* Firma: doble trayectoria que converge */
.tracks { margin: 44px 0 8px; }
.tracks svg { width: 100%; height: auto; display: block; }
.tracks text { font-family: var(--font-mono); font-size: 11.5px; fill: var(--muted); letter-spacing: 0.08em; }
.tracks .t-strong { fill: var(--text); font-weight: 600; }
.tracks .t-accent { fill: var(--accent); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 20px;
}
.stat b {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 30px; letter-spacing: -0.01em; color: var(--accent);
}
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* ---------- Secciones ---------- */
section { padding: 72px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.sec-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 10px;
}
.sec-eyebrow::before { content: "// "; color: var(--accent-2); }
h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.015em; margin-bottom: 26px;
}
.prose { max-width: 68ch; color: var(--muted); }
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--text); font-weight: 600; }

.callout {
  margin-top: 26px; max-width: 68ch;
  background: linear-gradient(135deg, rgba(47,123,246,.12), rgba(76,198,242,.06));
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 20px 24px;
  color: var(--text); font-size: 16.5px;
}

/* ---------- Habilidades ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  margin-bottom: 6px;
}
.card .sub { color: var(--muted-2); font-size: 14px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.chip--soft { color: var(--muted); }

/* ---------- Proyectos ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj { display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.proj:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.proj .tag {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.proj p { color: var(--muted); font-size: 15px; flex: 1; }
.proj .links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.proj .links a { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Formación ---------- */
.edu { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.edu-item + .edu-item { margin-top: 16px; }
.edu-item h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.edu-item .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); margin: 4px 0 8px; }
.edu-item p { color: var(--muted); font-size: 15px; }
.cert {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 16px 18px;
}
.cert + .cert { margin-top: 12px; }
.cert .dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex-shrink: 0;
  background: var(--accent); box-shadow: 0 0 10px rgba(76,198,242,.6);
}
.cert .badge-img { width: 52px; height: 52px; flex-shrink: 0; }
.cert b { display: block; font-size: 15px; font-weight: 600; }
.cert span { color: var(--muted); font-size: 13.5px; font-family: var(--font-mono); }

/* ---------- Experiencia ---------- */
.xp { border-left: 1px solid var(--line-strong); margin-left: 6px; padding-left: 28px; max-width: 780px; }
.xp-item { position: relative; padding-bottom: 36px; }
.xp-item:last-child { padding-bottom: 0; }
.xp-item::before {
  content: ""; position: absolute; left: -33.5px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.xp-item .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); }
.xp-item h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 4px 0 2px; }
.xp-item .org { color: var(--muted-2); font-size: 14.5px; margin-bottom: 10px; }
.xp-item ul { list-style: none; }
.xp-item li { color: var(--muted); font-size: 15px; padding-left: 18px; position: relative; margin-top: 6px; }
.xp-item li::before { content: "—"; position: absolute; left: 0; color: var(--accent-2); }

/* ---------- Blog ---------- */
.posts { display: grid; gap: 14px; max-width: 780px; }
.post-link {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; color: var(--text);
  transition: border-color .2s, transform .2s;
}
.post-link:hover { text-decoration: none; border-color: var(--accent); transform: translateX(4px); }
.post-link b { font-weight: 600; font-size: 16px; }
.post-link time { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted-2); white-space: nowrap; }

/* ---------- Contacto ---------- */
.contact-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong);
  padding: 12px 20px; border-radius: 10px;
  transition: border-color .2s, background .2s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); background: var(--surface-2); }
.btn--primary { background: var(--accent-2); border-color: var(--accent-2); }
.btn--primary:hover { background: #2568d6; border-color: #2568d6; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 34px 0 44px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
footer p { color: var(--muted-2); font-size: 13.5px; font-family: var(--font-mono); }

/* ---------- Blog: página de artículo ---------- */
.article { max-width: 760px; margin: 0 auto; padding: 64px 24px 90px; }
.article .back {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  display: inline-block; margin-bottom: 36px;
}
.article .back:hover { color: var(--accent); text-decoration: none; }
.article h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -0.02em;
}
.article time {
  display: block; font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); margin: 14px 0 40px;
}
.article h2 {
  font-size: 23px; margin: 42px 0 14px; padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.article h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.article p { color: var(--muted); margin-bottom: 14px; }
.article strong { color: var(--text); }
.article ul, .article ol { margin: 0 0 14px 22px; color: var(--muted); }
.article li { margin-top: 6px; }
.article .update {
  margin-top: 48px; background: var(--surface); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 22px 26px;
}
.article .update .u-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.article .cta-repo { margin-top: 34px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .proj:hover, .post-link:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar__inner { height: auto; padding: 10px 18px; flex-wrap: wrap; }
  .nav { width: 100%; order: 3; margin-left: 0; padding-bottom: 4px; overflow-x: auto; flex-wrap: nowrap; }
  .lang { margin-left: auto; }
  .hero { padding: 56px 0 44px; }
  .stats { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  section { padding: 54px 0; }
  .post-link { flex-direction: column; gap: 6px; }
  .xp { padding-left: 22px; }
}
