@import url("theme-base.css");

/* Public site — Placa (sin marco/placa-plate en el brand) */
body.placa {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #5a5c60;
}
html[data-theme="paper"] a {
  text-decoration-color: #a0a2a6;
}
a:hover { text-decoration-color: var(--ink); }

.site-header {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 0.9rem 0 0;
  display: flex;
  align-items: baseline;
  gap: 1.15rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  /* Sin borde / doble filete — tipografía limpia */
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  padding-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a.is-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  border-radius: 0;
  align-self: center;
  margin-bottom: 0.35rem;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle .theme-icon {
  display: block;
}

.site-main,
.terminal-screen {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  min-height: 50vh;
}

.clear-line {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.page-content {
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
}

/* Home */
.home-card {
  display: grid;
  gap: 0;
}

.home-intro {
  display: grid;
  gap: 0;
  padding: 0.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}

.home-kicker {
  display: block;
  margin: 0 0 1.1rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

.home-headline {
  margin: 0 0 1rem;
  max-width: 28rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
}

.home-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0 0 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
}

.home-ctas a,
.home-ctas .btn,
.home-ctas .btn.secondary {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #5a5c60;
  cursor: pointer;
  opacity: 1;
}

html[data-theme="paper"] .home-ctas a,
html[data-theme="paper"] .home-ctas .btn,
html[data-theme="paper"] .home-ctas .btn.secondary {
  text-decoration-color: #a0a2a6;
}

.home-ctas a:hover,
.home-ctas .btn:hover,
.home-ctas .btn.secondary:hover {
  text-decoration-color: var(--ink);
  opacity: 1;
}

.home-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-family: var(--font-sans);
}

.home-social a {
  color: var(--muted);
  text-decoration: none;
}

.home-social a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-section {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 0 0.2rem;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.home-section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.home-section-more {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.home-section-more:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-post-list {
  margin-top: 0;
}

.home-post-list h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.home-post-list a:hover h3 {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose :is(h1, h2, h3),
.page-content > h1,
.post-header h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.25;
  margin: 1.2em 0 0.55em;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.prose h1,
.page-content > h1,
.post-header h1 {
  margin-top: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.75rem);
}

.prose p,
.prose li,
.subtitle,
.empty {
  color: var(--ink);
}

.prose p,
.prose li,
.cv-entry-desc {
  font-family: var(--font-serif);
  line-height: 1.65;
}

.prose p,
.empty { margin: 0.65em 0; }

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0.65em 0;
}

.prose li::marker { color: var(--muted); }

.content-image {
  margin: 1rem 0;
  border: 1px solid var(--line);
  padding: 0.35rem;
  background: var(--dim);
}

.content-image img,
.cover {
  display: block;
  max-width: 100%;
  height: auto;
  filter: none;
}

.post-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.subtitle {
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
  font-family: var(--font-serif);
}

.back-link {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.preview-banner {
  margin: 0 0 1rem;
  padding: 0.45rem 0.65rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.series-label {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

.post-header .post-tags {
  margin: 0.45rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.post-header .tag-pill {
  margin-left: 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.post-header .tag-pill:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.meta-sep {
  color: var(--line);
}

.series-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.series-nav a {
  color: var(--muted);
  text-decoration: none;
}

.series-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.series-next {
  margin-left: auto;
}

.toc {
  margin: 0 0 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.toc-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-sans);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-family: var(--font-sans);
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toc-level-3 {
  padding-left: 1rem;
}

.related-posts {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.related-posts h2 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-sans);
}

.related-posts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.related-posts li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.related-posts li:first-child {
  border-top: 0;
  padding-top: 0;
}

.related-posts a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

.related-posts a:hover .related-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.related-title {
  font-family: var(--font-sans);
  font-weight: 600;
}

.related-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.site-footer {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 0 0 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  font-family: var(--font-sans);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.code-figure {
  margin: 1.15rem 0;
  border: 1px solid var(--line);
  background: var(--dim);
}

.code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.code-lang {
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.code-copy {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line);
}

.code-copy:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.prose .code-figure pre.code-block,
.prose pre.code-block {
  margin: 0;
  padding: 0.85rem 0.9rem;
  overflow-x: auto;
  background: transparent;
  border: 0;
}

.prose .code-figure code,
.prose pre.code-block code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.45;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: 0;
  padding: 0.7rem 0;
  border-bottom: 0;
  border-top: 1px solid var(--line);
}

.post-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.post-list a {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 0.2rem;
}

.post-list a:hover h2,
.post-list a:hover h3 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-list h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.post-list p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.4;
}

.blog-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.85rem 0 1rem;
  font-family: var(--font-sans);
}

.blog-search input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
}

.blog-search a.muted {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  font-size: 0.9rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0;
  line-height: 1.4;
  font-family: var(--font-sans);
}

.tag-cloud a {
  color: var(--muted);
  text-decoration: none;
}

.tag-cloud a:hover,
.tag-cloud a.is-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tag-pill {
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font-sans);
}

.tag-pill::before {
  content: "#";
  opacity: 0.7;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin: 0 0 0.25rem !important;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

.featured-mark {
  color: var(--ink);
  text-transform: lowercase;
  font-weight: 500;
}

.results-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
}

.pagination a {
  color: var(--muted);
  text-decoration: none;
}

.pagination a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— CV —— */
.cv-page {
  max-width: 42rem;
}

.cv-page:has(.cv-layout.has-toc) {
  max-width: min(100%, 56rem);
}

.cv-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1rem;
}

.cv-toolbar .btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #5a5c60;
}

.cv-toolbar .btn:hover {
  opacity: 1;
  text-decoration-color: var(--ink);
}

.cv-layout {
  display: block;
}

.cv-layout.has-toc {
  display: grid;
  gap: 1.5rem 2rem;
}

@media (min-width: 720px) {
  .cv-layout.has-toc {
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: start;
  }
}

.cv-toc {
  margin: 0 0 0.5rem;
  padding: 0;
}

@media (min-width: 720px) {
  .cv-toc {
    position: sticky;
    top: 1rem;
    margin: 0;
  }
}

.cv-toc-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

.cv-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

@media (min-width: 720px) {
  .cv-toc ol {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }
}

.cv-toc a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.cv-toc a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-toc-prompt {
  color: var(--muted);
  font-family: var(--font-sans);
}

.cv-intro {
  margin-bottom: 1.75rem;
}

.cv-section {
  margin: 0 0 1.75rem;
  padding: 0;
  scroll-margin-top: 1rem;
}

.cv-section > h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.cv-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.cv-entry,
.cv-timeline-item {
  break-inside: avoid;
  page-break-inside: avoid;
}

.cv-entry-title {
  margin: 0 0 0.15rem;
  font-size: 0.98rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.cv-entry-level {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.92em;
}

.cv-entry-period {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

.cv-entry-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.cv-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.15rem;
  display: grid;
  gap: 0;
  border-left: 1px solid var(--line);
}

.cv-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 0.85rem 1fr;
  gap: 0 0.85rem;
  padding: 0 0 1.15rem 0.15rem;
}

.cv-timeline-item:last-child {
  padding-bottom: 0;
}

.cv-timeline-marker {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  margin-left: -0.45rem;
  border: 1px solid var(--ink);
  background: var(--bg);
  box-sizing: border-box;
}

.cv-timeline-body {
  min-width: 0;
}

.cv-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.cv-chips li,
.cv-skill {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-sans);
}

.cv-skill-mark {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.85em;
  letter-spacing: 0.02em;
}

.cv-chip-level {
  color: var(--muted);
  font-size: 0.85em;
}

.cv-updated {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* —— 404 —— */
.error-404 .shell-prompt {
  color: var(--muted);
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.error-404 .shell-out {
  margin: 0.35em 0;
  font-family: var(--font-serif);
  color: var(--muted);
}

.error-404 .shell-exit {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.error-404 .error-routes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.error-404 .error-routes li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.error-404 .error-routes li:first-child {
  border-top: 0;
  padding-top: 0;
}

.error-404 .error-routes a {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
}

.error-404 .error-routes a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-404 .error-routes .cmd {
  color: var(--muted);
  margin-right: 0.55rem;
  font-weight: 500;
}

.maintenance-screen {
  width: min(100% - 2rem, var(--max));
  margin: 4rem auto;
  font-family: var(--font-sans);
}

.maintenance-screen h1 {
  font-size: clamp(1.45rem, 3.5vw, 1.75rem);
  letter-spacing: -0.025em;
}

.maintenance-screen p {
  color: var(--muted);
  font-family: var(--font-serif);
}

a:focus-visible,
button:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media print {
  html {
    --bg: #ececea;
    --ink: #1a1b1d;
    --muted: #6b6d70;
    --dim: #e2e2de;
    --line: #c8c9cc;
    --danger: #5a5c60;
  }

  body {
    background: var(--bg);
    color: var(--ink);
  }

  .site-header nav,
  .theme-toggle,
  .no-print,
  .cv-toc,
  .cv-toolbar,
  .cv-updated {
    display: none !important;
  }

  .cv-page,
  .cv-page:has(.cv-layout.has-toc) {
    max-width: none;
  }

  .cv-layout.has-toc {
    display: block;
  }

  .site-main,
  .terminal-screen {
    transition: none;
    padding-bottom: 0;
  }

  .cv-timeline {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .cv-timeline-marker {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .content-image img,
  .cover {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
