/* =========================================================
   Diego Cerritos — Marca personal
   Sistema de diseño compartido (landing + blog)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* Tipografía (tweakable) */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  /* Marca */
  --accent: #c5992e;            /* dorado */
  --accent-deep: #a87f1f;
  --green: oklch(0.36 0.045 155);   /* verde académico profundo */
  --green-soft: oklch(0.52 0.05 155);

  /* Tema claro (por defecto) */
  --bg: #faf9f5;
  --text: #262624;
  --text-soft: #5f5d57;
  --surface: #f3f1e9;
  --surface-2: #ece9df;
  --border: rgba(38, 38, 36, 0.12);
  --border-strong: rgba(38, 38, 36, 0.24);
  --shadow: 0 1px 2px rgba(38,38,36,.05), 0 14px 40px -22px rgba(38,38,36,.28);
  --section-dark-bg: #262624;
  --section-dark-text: #faf9f5;
  --logo-light: block;
  --logo-dark: none;
  --placeholder-1: rgba(38,38,36,.05);
  --placeholder-2: rgba(38,38,36,.10);
}

html[data-theme="dark"] {
  --bg: #262624;
  --text: #faf9f5;
  --text-soft: #b4b1a8;
  --surface: #2f2e2b;
  --surface-2: #36342f;
  --border: rgba(250, 249, 245, 0.14);
  --border-strong: rgba(250, 249, 245, 0.28);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 44px -22px rgba(0,0,0,.7);
  --green: oklch(0.55 0.05 155);
  --green-soft: oklch(0.66 0.05 155);
  --section-dark-bg: #1c1b1a;
  --section-dark-text: #faf9f5;
  --logo-light: none;
  --logo-dark: block;
  --placeholder-1: rgba(250,249,245,.05);
  --placeholder-2: rgba(250,249,245,.10);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 18px;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.serif-italic { font-style: italic; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
html[data-theme="dark"] .eyebrow { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow.center::after {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Layout ---------- */
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.wrap-narrow { width: min(820px, 100% - 48px); margin-inline: auto; }
section { padding: clamp(64px, 9vw, 130px) 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .4s ease, border-color .4s ease;
}
.header-inner {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 78px;
  gap: 16px;
}
.nav-left { justify-self: start; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color .2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.brand-logo { justify-self: center; display: flex; align-items: center; }
.brand-logo img { height: 34px; width: auto; }
.brand-logo .logo-l { display: var(--logo-light); }
.brand-logo .logo-d { display: var(--logo-dark); }

/* Toggle tema */
.theme-toggle {
  width: 58px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  transition: background .3s ease, border-color .3s ease;
  flex-shrink: 0;
}
.theme-toggle .knob {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 4px;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
html[data-theme="dark"] .theme-toggle .knob { transform: translateX(28px); }
.theme-toggle svg { width: 13px; height: 13px; }
.theme-toggle .ico-sun { display: var(--logo-light); }
.theme-toggle .ico-moon { display: var(--logo-dark); }

/* Hamburguesa */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .3s ease;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .18s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(197,153,46,.9);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--text); transform: translateY(-2px); }
.btn-dark {
  background: var(--text);
  color: var(--bg);
}
.btn-dark:hover { transform: translateY(-2px); opacity: .9; }

/* ---------- Placeholder de imagen ---------- */
.ph {
  position: relative;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--placeholder-1) 0,
    var(--placeholder-1) 12px,
    var(--placeholder-2) 12px,
    var(--placeholder-2) 24px
  );
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ph .ph-label {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 8px;
  text-align: center;
  max-width: 80%;
  line-height: 1.4;
}

/* ---------- Utilidades ---------- */
.lead { font-size: clamp(19px, 2.1vw, 23px); color: var(--text-soft); line-height: 1.55; }
.muted { color: var(--text-soft); }
.accent { color: var(--accent-deep); }
html[data-theme="dark"] .accent { color: var(--accent); }
.center { text-align: center; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

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

/* ---------- Footer ---------- */
.site-footer {
  background: var(--section-dark-bg);
  color: var(--section-dark-text);
  padding: 72px 0 40px;
}
.site-footer a { color: var(--section-dark-text); opacity: .8; }
.site-footer a:hover { opacity: 1; color: var(--accent); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(250,249,245,.14);
}
.footer-col h4 { font-family: var(--font-body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-bottom: 18px; font-weight: 600; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 15px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 13.5px;
  opacity: .7;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo { height: 30px; opacity: .95; }

/* ---------- Mobile nav panel ---------- */
.mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateY(-100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  visibility: hidden;
}
.mobile-panel.open { transform: translateY(0); visibility: visible; }
.mobile-panel .mp-top { display: flex; justify-content: space-between; align-items: center; height: 54px; }
.mobile-panel .mp-close { background: none; border: none; font-size: 30px; color: var(--text); line-height: 1; }
.mobile-panel nav { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }
.mobile-panel nav a {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* ---------- Header CTA compacto (tamaño del toggle) ---------- */
.header-cta {
  height: 30px;
  padding: 0 16px;
  font-size: 13px;
  box-shadow: none;
}
.header-cta:hover { box-shadow: none; }

/* ---------- Banda de enfoque (manifiesto) ---------- */
.manifesto { border-block: 1px solid var(--border); padding: clamp(60px, 9vw, 110px) 0; }
.manifesto-quote {
  font-family: var(--font-display);
  font-size: clamp(27px, 4vw, 50px);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin-top: 24px;
}
.manifesto-quote em { font-style: italic; color: var(--accent-deep); }
html[data-theme="dark"] .manifesto-quote em { color: var(--accent); }
.manifesto-by { margin-top: 26px; font-size: 14px; color: var(--text-soft); letter-spacing: .02em; }

/* ---------- Tarjeta de herramienta (Mapa Metodológico) ---------- */
.tool-callout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(28px, 4vw, 52px);
  margin: 8px auto 44px;
}
.tool-callout h3 { font-size: clamp(26px, 3.2vw, 40px); margin: 14px 0 14px; }
.tool-callout p { color: var(--text-soft); margin-bottom: 26px; max-width: 46ch; }
.tool-visual { display: flex; flex-direction: column; gap: 12px; }
.tv-phase {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.tv-phase .tv-k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.tv-phase .tv-pick {
  font-family: var(--font-display); font-size: 18px; color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 4px 14px; border-radius: 999px;
}
.tv-phase.ghost { border-style: dashed; opacity: .65; }
.tv-phase.ghost .tv-dots { font-size: 20px; color: var(--text-soft); letter-spacing: 2px; }

@media (max-width: 860px) {
  .tool-callout { grid-template-columns: 1fr; }
  .tool-visual { order: -1; }
}

/* ---------- Referencias en artículos del blog ---------- */
.article-refs { margin-top: clamp(40px, 5vw, 60px); padding-top: clamp(28px, 3.5vw, 40px); border-top: 1px solid var(--border); }
.article-refs h2 { font-size: clamp(20px, 2.4vw, 26px); margin-bottom: 22px; }
.article-refs ol { list-style: decimal; padding-left: 22px; display: flex; flex-direction: column; gap: 13px; }
.article-refs li { font-size: 14.5px; line-height: 1.6; color: var(--text-soft); padding-left: 6px; }
.article-refs li::marker { color: var(--accent-deep); font-weight: 600; }
html[data-theme="dark"] .article-refs li::marker { color: var(--accent); }
.article-refs li em { font-style: italic; color: var(--text); }
.article-refs a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
html[data-theme="dark"] .article-refs a { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .nav-left .nav-links { display: none; }
  .hamburger { display: flex; }
  .header-cta { display: none; }
  .header-inner { grid-template-columns: 1fr auto 1fr; height: 66px; }
  .brand-logo img { height: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .wrap, .wrap-narrow { width: 100% - 40px; width: calc(100% - 40px); }
}
