:root {
  color-scheme: light dark;
  --bg: #f4f5f8;
  --surface: #f8f9fb;
  --ink: #252a34;
  --muted: #5f6570;
  --accent: #0071e3;
  --accent-soft: #e7f2ff;
  --line: rgba(0, 113, 227, 0.28);
  --shell: min(1054px, calc(100% - 36px));
}

html[data-theme="dark"] {
  --bg: #17191e;
  --surface: #1f2229;
  --ink: #f2f4f8;
  --muted: #b6bbc5;
  --accent: #2997ff;
  --accent-soft: #142c45;
  --line: rgba(41, 151, 255, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 14px;
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 14%, transparent) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: 0;
}
a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}
.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { top: 10px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--accent);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}
.nav {
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}
.signature,
.nav-links,
.nav-tools {
  color: var(--accent);
  font-weight: 700;
}
.signature {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
}
.signature-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #54a9ff);
  color: #fff;
  font-size: 11px;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.24);
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.nav-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
#theme-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.profile-home {
  width: min(760px, calc(100% - 36px));
  margin-inline: auto;
  padding: 30px 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile-home > * {
  width: 100%;
  margin-inline: auto;
}
.profile-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 38px;
  padding: 34px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 30%),
    color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 18px 50px rgba(0, 72, 145, 0.08);
}
.profile-hero::after {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 150px;
  height: 110px;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 40%, transparent) 1.2px, transparent 1.2px);
  background-size: 9px 9px;
  content: "";
  mask-image: linear-gradient(135deg, transparent, #000);
  pointer-events: none;
}
.profile-hero > * { position: relative; z-index: 1; }
.profile-kicker,
.blog-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.profile-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--accent);
  font-size: 42px;
  line-height: 1.15;
  text-align: center;
}
.profile-intro {
  max-width: 980px;
  margin: 20px auto 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}
.profile-summary {
  width: max-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.profile-section { margin-top: 42px; scroll-margin-top: 80px; }
.section-title {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 32px;
}
.section-title::before {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}
#experiencia .section-title::before { content: "01 / DESARROLLO"; }
#formacion .section-title::before { content: "02 / APRENDIZAJE"; }
#proyectos .section-title::before { content: "03 / CÓDIGO"; }
.professional-card,
.project-profile-card {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 12px 36px rgba(0, 72, 145, 0.07);
}
.professional-heading {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  text-align: center;
}
.professional-heading h3,
.project-heading h3 {
  margin: 0;
  font-size: 17px;
}
.professional-role { margin: 3px 0 0; }
.professional-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}
.professional-copy { padding: 15px 18px 10px; }
.professional-point {
  margin: 0 0 7px;
  padding: 0;
  text-align: center;
}
.professional-point::before {
  margin-right: 7px;
  color: var(--accent);
  content: "→";
  font-weight: 800;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px 15px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.profile-tags p {
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.project-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.project-profile-card {
  position: relative;
  display: flex;
  min-height: 285px;
  flex-direction: column;
  margin: 0;
  padding-bottom: 54px;
}
.project-profile-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), #69b6ff);
  content: "";
}
.project-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}
.project-status {
  flex: 0 0 auto;
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.project-description {
  margin: 0;
  padding: 16px 18px 6px;
  color: var(--ink);
  line-height: 1.55;
  text-align: center;
}
.project-profile-card .profile-tags { margin-top: auto; }
.project-link {
  position: absolute;
  inset: auto 0 0;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent), #238cf2);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.project-link:hover { background: linear-gradient(135deg, #005fbe, var(--accent)); }
.career-callout {
  margin-top: 46px;
  padding: 27px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 78%, transparent), transparent),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 14px 38px rgba(0, 72, 145, 0.09);
}
.career-callout h2 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 27px;
}
.career-callout p { max-width: 650px; margin: 0 auto 18px; }
.career-cta {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.career-cta:hover { background: #005fbe; }
.blog-callout {
  margin-top: 46px;
  padding: 26px 28px;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(135deg, #0068cf, #188af4);
  color: #fff;
  box-shadow: 0 18px 44px rgba(0, 91, 184, 0.22);
}
.blog-callout h2 { margin: 0 0 8px; color: #fff; font-size: 27px; }
.blog-callout p { max-width: 650px; margin: 0 auto 18px; }
.profile-cta {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 999px;
  background: #fff;
  color: #0068cf;
  font-weight: 700;
}

.blog-home,
.tag-page {
  width: min(760px, calc(100% - 36px));
  margin-inline: auto;
  min-height: calc(100vh - 142px);
  padding: 30px 0 70px;
  text-align: center;
}
.blog-kicker { text-align: center; }
.page-title,
.blog-home > h1,
.tag-page > h1 {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 38px;
  line-height: 1.15;
  text-align: center;
}
.note-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 46px;
}
.filter-chip {
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 550;
}
.filter-chip:hover,
.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.rss-link {
  margin-left: 0;
  color: var(--ink);
  font-weight: 600;
}
.rss-link:hover { color: var(--accent); }

.notes-grid {
  display: grid;
  width: 100%;
  margin-inline: auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 335px));
  justify-content: center;
  gap: 24px;
}
.note-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 12px 34px rgba(0, 72, 145, 0.08);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 113, 227, 0.12);
}
.note-card-title {
  min-height: 62px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--accent);
  font-size: 18px;
  line-height: 1.15;
}
.note-card-title a::after {
  position: absolute;
  inset: 0;
  content: "";
}
.note-card > a { display: block; }
.note-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.48;
  object-fit: cover;
  border-bottom: 1px solid var(--accent);
}
.note-card-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.note-card-tag {
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 650;
}
.note-card-date {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
}
.tag-notes-grid { margin-top: 44px; }
.tag-page .article-back { margin-bottom: 22px; }

.article-header {
  padding: 30px 0 48px;
  text-align: center;
}
.article-back {
  display: block;
  width: max-content;
  margin: 0 0 22px;
  color: var(--accent);
  font-weight: 650;
}
.article-title {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
}
.article-image {
  display: block;
  width: min(560px, 100%);
  margin: 56px auto 0;
  border: 1px solid var(--accent);
  border-radius: 12px;
}
.article-body {
  width: var(--shell);
  margin: 0 auto 80px;
  text-align: left;
}
.article-body > * { max-width: 100%; }
.article-toc {
  margin: 0 0 46px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
.article-toc-title {
  margin: 0 0 12px !important;
  color: var(--accent) !important;
  font-size: 24px !important;
  font-weight: 750;
}
.article-toc ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: contents;
}
.article-toc li {
  counter-increment: contents;
  font-size: 16px;
}
.article-toc li::before {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  content: counter(contents);
  font-size: 12px;
  font-weight: 700;
}
.article-body h2 {
  margin: 50px 0 16px;
  padding-top: 2px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
}
.article-body h3 { margin: 36px 0 12px; font-size: 21px; }
.article-body p,
.article-body li {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}
.article-body p { margin: 0 0 20px; }
.article-body ul,
.article-body ol { padding-left: 22px; }
.article-body strong,
.article-body a { color: var(--accent); }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.article-body pre {
  overflow: auto;
  padding: 20px;
  border-radius: 10px;
  background: #222731;
  color: #fff;
}
.article-footer { padding-bottom: 60px; text-align: left; }
.back-button {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.site-footer {
  width: min(520px, calc(100% - 24px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 14px 40px rgba(0, 72, 145, 0.16);
  backdrop-filter: blur(10px);
}
.footer {
  width: 100%;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}
.footer p { margin: 0; }
.footer-tech {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}
.footer-tech a {
  color: var(--accent);
  font-weight: 700;
}
.footer-tech a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 9px; font-size: 15px; }
.footer-links a {
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #17191e;
    --surface: #1f2229;
    --ink: #f2f4f8;
    --muted: #b6bbc5;
    --accent: #2997ff;
    --accent-soft: #142c45;
    --line: rgba(41, 151, 255, 0.38);
  }
}

@media (max-width: 850px) {
  .project-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --shell: min(100% - 24px, 520px); }
  body { padding-bottom: 14px; }
  .nav {
    min-height: 56px;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .signature { gap: 7px; font-size: 15px; }
  .signature-mark { width: 27px; height: 27px; border-radius: 8px; }
  .nav-links { justify-content: flex-end; gap: 12px; font-size: 14px; }
  .nav-links a:nth-child(-n+2),
  .nav-tools > a { display: none; }
  .nav-tools { gap: 0; }
  .blog-home,
  .tag-page { padding-top: 24px; }
  .profile-home { padding-top: 18px; }
  .profile-hero { padding: 28px 18px 25px; border-radius: 22px; }
  .profile-title { font-size: 34px; }
  .profile-intro { font-size: 16px; }
  .section-title { font-size: 27px; }
  .project-heading { align-items: center; }
  .career-callout,
  .blog-callout { padding: 24px 20px; }
  .page-title,
  .blog-home > h1,
  .tag-page > h1 { font-size: 32px; }
  .note-filters { margin: 22px 0 30px; }
  .rss-link { margin-left: 0; padding: 7px 0; }
  .notes-grid { grid-template-columns: 1fr; }
  .article-header { padding-top: 24px; }
  .article-title { font-size: 34px; }
  .article-image { margin-top: 36px; }
  .article-body p,
  .article-body li { font-size: 16px; }
  .footer { min-height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
