:root {
  --black: #0a0a0a;
  --navy: #0b2447;
  --celeste: #38bdf8;
  --celeste-soft: #e0f4fe;
  --white: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg-soft: #f8fafc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--white); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 80px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {
  body { padding: 32px 40px 96px; }
}
@media (min-width: 1024px) {
  body { padding: 40px 56px 120px; }
}

/* ---- Header ---- */
header.site-head {
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  text-align: center;
}
.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-weight: 900;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-mark a { color: inherit; text-decoration: none; }
.brand-mark .legal { color: var(--black); }
.brand-mark .techie { color: var(--celeste); }
.brand-tagline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}
.brand-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
@media (min-width: 768px) {
  header.site-head { padding: 32px 0 24px; margin-bottom: 32px; }
  .brand-mark { font-size: 44px; }
  .brand-tagline { font-size: 11px; margin-top: 10px; }
  .brand-meta { font-size: 14px; margin-top: 10px; }
}
@media (min-width: 1024px) {
  .brand-mark { font-size: 52px; }
}

/* ---- Tabs ---- */
nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
nav.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active { color: var(--black); border-bottom-color: var(--celeste); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
@media (min-width: 768px) {
  nav.tabs { margin-bottom: 40px; }
  .tab-btn { padding: 14px 22px; font-size: 14px; }
}

/* ---- Section headings ---- */
h2.section {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
}
h3.topic-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 28px 0 14px;
}
@media (min-width: 768px) {
  h2.section { font-size: 13px; }
  h3.topic-label { font-size: 12px; }
}
.empty { color: #9ca3af; font-size: 13px; font-style: italic; padding: 8px 0; }

/* ---- News items (LegalTechie News Digest) ---- */
.topic-section { margin-bottom: 28px; }
.topic-section:last-child { margin-bottom: 0; }
.news-list { display: block; }
.news-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-item-body { min-width: 0; }
.news-headline {
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.news-headline a { color: inherit; text-decoration: none; }
.news-headline a:hover { color: var(--navy); text-decoration: underline; }
.news-summary {
  font-size: 14px;
  color: #374151;
  line-height: 1.55;
  margin-bottom: 10px;
}
.news-source {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--celeste);
  text-transform: uppercase;
}
.news-item-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.news-item-img.placeholder.ai { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%); }
.news-item-img.placeholder.privacy { background: linear-gradient(135deg, #065f46 0%, #10b981 100%); }
.news-item-img.placeholder.cybersecurity { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%); }
.news-item-img svg { width: 40%; height: 40%; opacity: 0.95; }
.news-item-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-soft);
}
@media (min-width: 768px) {
  .news-item {
    grid-template-columns: 1fr 200px;
    gap: 24px;
    align-items: start;
  }
  .news-item-img { aspect-ratio: 4 / 3; }
  .news-headline { font-size: 20px; }
}
@media (min-width: 1024px) {
  .news-item { grid-template-columns: 1fr 240px; gap: 28px; }
  .news-headline { font-size: 22px; }
}

/* ---- Blog cards (Blog AI & Data Privacy) ---- */
.blog-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--white);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(11,36,71,0.08);
  border-color: var(--navy);
}
.blog-card-img {
  width: 100%;
  height: 200px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.blog-card-img img { max-width: 80%; max-height: 75%; object-fit: contain; }
.blog-card-img.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--celeste) 100%); }
.blog-card-img.hero svg { color: var(--white); }
.blog-card-body { padding: 20px 22px 24px; }
.blog-card-source {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--celeste);
  text-transform: uppercase;
}
.blog-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 8px 0 10px;
}
.blog-card-summary {
  font-size: 14px;
  color: #374151;
  line-height: 1.55;
  margin-bottom: 12px;
}
.blog-card-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
@media (min-width: 768px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (min-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .blog-card-img { height: 220px; }
  .blog-card-title { font-size: 22px; }
}

/* ---- Tracker (Monitoreo Legislación Chile) ---- */
.tracker-card { padding: 22px 0; border-bottom: 1px solid var(--border); }
.tracker-card:last-child { border-bottom: none; }
.tracker-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.tracker-estado {
  background: var(--navy);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tracker-tipo {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tracker-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}
.tracker-meta { display: grid; gap: 4px; margin-bottom: 12px; }
.tracker-meta .trow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  font-size: 13px;
  color: #374151;
  padding: 4px 0;
}
.tracker-meta dt {
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.tracker-meta dd { color: var(--text); }
.tracker-link { font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: none; }
.tracker-link:hover { text-decoration: underline; }
@media (min-width: 768px) {
  .tracker-title { font-size: 20px; }
  .tracker-meta .trow { grid-template-columns: 180px 1fr; gap: 12px; }
}

/* ---- Legal Prompts & Skills (card grid with icons) ---- */
.ps-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}
.ps-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 24px;
  background: var(--white);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.ps-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(11,36,71,0.08);
  border-color: var(--navy);
}
.ps-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--celeste-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.ps-icon svg { width: 32px; height: 32px; }
.ps-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--celeste);
  text-transform: uppercase;
}
.ps-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 8px 0 10px;
}
.ps-summary {
  font-size: 14px;
  color: #374151;
  line-height: 1.55;
  margin-bottom: 14px;
}
.ps-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
@media (min-width: 768px) {
  .ps-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .ps-title { font-size: 22px; }
}

/* ---- About ---- */
.about-block { max-width: 720px; margin: 24px auto 0; }
.about-logo { text-align: center; margin-bottom: 32px; }
.about-logo .brand-mark { font-size: 48px; }
.about-text p {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 18px;
}
.about-text p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .about-logo .brand-mark { font-size: 56px; }
  .about-text p { font-size: 17px; }
}

/* ---- Footer ---- */
footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ---- Sub-page (post/skill detail) styles ---- */
.subpage-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  margin-bottom: 24px;
}
.subpage-back:hover { text-decoration: underline; }
.post-hero {
  margin: 16px 0 32px;
}
.post-hero.gradient {
  background: linear-gradient(135deg, var(--navy) 0%, var(--celeste) 100%);
  height: 220px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.post-hero.gradient svg { width: 88px; height: 88px; }
.post-hero img { width: 100%; max-height: 280px; object-fit: contain; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 24px; }
.post-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--celeste);
  text-transform: uppercase;
}
.post-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--black);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.post-meta strong { color: var(--text); font-weight: 700; }
.post-body { max-width: 720px; font-size: 16px; color: var(--text); line-height: 1.75; }
.post-body p { margin-bottom: 18px; }
.post-body h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.01em;
  margin: 32px 0 14px;
  line-height: 1.3;
}
.post-body h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin: 26px 0 10px;
  line-height: 1.35;
}
.post-body ol, .post-body ul { margin: 14px 0 18px 24px; }
.post-body li { margin-bottom: 10px; }
.post-body strong { color: var(--black); }
.post-body code {
  background: var(--bg-soft);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--navy);
  border: 1px solid var(--border);
  font-family: 'SF Mono', Menlo, monospace;
}
.post-body blockquote {
  border-left: 3px solid var(--celeste);
  padding: 4px 0 4px 18px;
  margin: 20px 0;
  color: var(--muted);
  font-style: italic;
}
.post-body .source-note {
  margin-top: 36px;
  padding: 18px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.post-body .source-note a { color: var(--navy); font-weight: 700; }
.post-body .disclaimer {
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
@media (min-width: 768px) {
  .post-title { font-size: 36px; }
  .post-body { font-size: 17px; }
  .post-hero.gradient { height: 280px; }
}
@media (min-width: 1024px) {
  .post-title { font-size: 42px; }
}
