/*
   ____  _   _ ____    _    _   _   _
  |  _ \| | | | __ )  / \  | | | | | |
  | | | | | | |  _ \ / _ \ | | | | | |
  | |_| | |_| | |_) / ___ \| |_| |_| |
  |____/ \___/|____/_/   \_\_____\___/

  Dubalu — Plataforma Buen Gobierno · 2026
*/

/* =========================================================
   PLATAFORMA BUEN GOBIERNO — Design Tokens v2
   Modern public-service · white + light gray + cinabrio PT
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* —— Palette ———————————————————————————————————— */
  --ink-900: #1A1B1F;       /* primary text / dark surfaces */
  --ink-700: #3A3D44;
  --ink-500: #6B6F78;
  --ink-300: #B0B4BC;
  --ink-100: #DDE0E5;

  --gray-50:  #FAFBFC;      /* alt surface */
  --gray-100: #F5F6F8;      /* card surface ★ */
  --gray-200: #EEF0F3;
  --gray-300: #E2E5EA;
  --gray-400: #C9CDD3;

  --red-900: #7E0E16;
  --red-700: #A8131D;
  --red-600: #D31F2A;       /* primary PT ★ */
  --red-500: #E2333E;
  --red-100: #FDE3E5;
  --red-50:  #FEF2F3;       /* icon-tile bg */

  --jade-700: #1E6B47;
  --jade-500: #2F8A5D;
  --jade-100: #DCF1E5;

  --sky-700: #1F4F7E;
  --sky-500: #2E73AF;
  --sky-100: #DCEAF6;

  --amber-700: #8B5A00;
  --amber-500: #C58A00;
  --amber-100: #FBEFCE;

  --violet-700: #5733A8;
  --violet-100: #ECE3FB;

  /* —— Semantic ————————————————————————————————— */
  --bg:           #FFFFFF;
  --bg-alt:       var(--gray-50);
  --bg-deep:      var(--ink-900);
  --surface:      #FFFFFF;
  --surface-card: var(--gray-100);   /* default cards */
  --surface-card-2: var(--gray-50);  /* sub-cards */
  --text:         var(--ink-900);
  --text-muted:   var(--ink-500);
  --text-soft:    var(--ink-700);
  --text-invert:  #FFFFFF;
  --border:       rgba(26,27,31,.08);
  --border-strong:rgba(26,27,31,.16);
  --hairline:     rgba(26,27,31,.05);
  --accent:       var(--red-600);
  --accent-ink:   var(--red-700);

  /* —— Type ————————————————————————————————————— */
  --font-display: "Geist", "Inter", system-ui, sans-serif;
  --font-sans:    "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-md:   1.125rem;
  --t-lg:   1.375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-3xl:  3rem;
  --t-4xl:  3.75rem;
  --t-5xl:  4.5rem;

  /* —— Space ———————————————————————————————————— */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 0 rgba(26,27,31,.03);
  --shadow-sm: 0 1px 2px rgba(26,27,31,.05), 0 1px 0 rgba(26,27,31,.02);
  --shadow:    0 4px 12px -4px rgba(26,27,31,.10), 0 1px 3px rgba(26,27,31,.04);
  --shadow-lg: 0 16px 40px -20px rgba(26,27,31,.20), 0 6px 14px -8px rgba(26,27,31,.08);

  --container:  1280px;
  --container-wide: 1440px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --dur: 280ms;
}

/* =========================================================
   Reset & base
   ========================================================= */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01","ss02","cv11";
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ink-900); color: #fff; }

/* =========================================================
   Typography
   ========================================================= */
.display, h1.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(2.25rem, 5vw + .5rem, 4.5rem);
}
.display em, .serif em {
  font-style: normal;
  color: var(--accent);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.kicker .dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); vertical-align: middle; margin: 0 8px 2px 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500;
}

.h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.025em; }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.25rem); line-height: 1.15; letter-spacing: -.02em; }
.h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 1.4vw, 1.35rem); line-height: 1.25; letter-spacing: -.012em; }
.h4 { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; letter-spacing: -.005em; }
.lead { font-size: clamp(1rem, .8vw + .8rem, 1.2rem); line-height: 1.55; color: var(--text-soft); max-width: 60ch; }
.body { font-size: 1rem; line-height: 1.6; color: var(--text-soft); }
.small { font-size: var(--t-sm); color: var(--text-muted); }

.serif { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; }
.serif-num { font-family: var(--font-display); font-feature-settings: "tnum","lnum"; }

/* =========================================================
   Layout
   ========================================================= */
.container { width: min(100% - 48px, var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 32px, var(--container-wide)); margin-inline: auto; }
.section { padding-block: clamp(56px, 7vw, 112px); }
.section-sm { padding-block: clamp(40px, 4vw, 72px); }
.hairline { height: 1px; background: var(--border); }
.hairline-strong { height: 1px; background: var(--border-strong); }

.grid { display: grid; gap: var(--s-6); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols-3, .cols-4, .cols-6 { grid-template-columns: repeat(2, 1fr); } .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.row { display:flex; align-items:center; gap: var(--s-4); flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  --bg: var(--ink-900); --fg: #FFFFFF; --bd: transparent;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-weight: 500; font-size: 14px; letter-spacing: -.005em;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn .arr { transition: transform var(--dur) var(--ease); }
.btn:hover .arr { transform: translateX(2px); }
.btn-primary { --bg: var(--red-600); --fg: #fff; }
.btn-primary:hover { --bg: var(--red-700); }
.btn-ghost { --bg: #fff; --fg: var(--ink-900); --bd: var(--border-strong); }
.btn-ghost:hover { --bg: var(--gray-100); }
.btn-quiet { --bg: transparent; --fg: var(--ink-900); --bd: transparent; padding-inline: 4px; }
.btn-quiet:hover { color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 16px 26px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; justify-content: center; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--ink-900);
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--gray-100); }

/* =========================================================
   Cards (unified)
   ========================================================= */
.card {
  background: var(--surface-card);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { background: #fff; border-color: var(--border); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.card-bare { background: transparent; padding: 0; border: 0; }
.card-deep { background: var(--ink-900); color: #fff; border-color: transparent; }
.card-white { background: #fff; border-color: var(--border); }
.card-lg { padding: 32px; border-radius: var(--radius-xl); }

.media-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  isolation: isolate; background: var(--gray-100);
}
.media-card img { width:100%; height:100%; object-fit: cover; transition: transform 600ms var(--ease); }
.media-card:hover img { transform: scale(1.03); }
.media-card .veil { position:absolute; inset:0; background: linear-gradient(180deg, transparent 40%, rgba(26,27,31,.65) 100%); z-index: 1; }
.media-card .meta { position:absolute; left:24px; right:24px; bottom:22px; z-index: 2; color:#fff; }

/* =========================================================
   Tags / pills
   ========================================================= */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--gray-100); color: var(--ink-700);
  font-size: 12px; font-weight: 500; border: 1px solid transparent;
}
.tag .dot { width:6px; height:6px; border-radius:999px; background: var(--accent); }
.tag-dark { background: var(--ink-900); color: #fff; }
.tag-red { background: var(--red-50); color: var(--red-700); }
.tag-jade { background: var(--jade-100); color: var(--jade-700); }
.tag-sky { background: var(--sky-100); color: var(--sky-700); }
.tag-amber { background: var(--amber-100); color: var(--amber-700); }
.tag-outline { background: transparent; border-color: var(--border-strong); }

/* =========================================================
   Inputs
   ========================================================= */
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 12px;
  font: inherit; color: var(--text);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink-900); box-shadow: 0 0 0 4px rgba(26,27,31,.06);
}
.field { display:flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-soft); font-family: var(--font-sans); font-weight: 500; }

.search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 6px 6px 6px 16px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--ink-900); box-shadow: 0 0 0 4px rgba(26,27,31,.06); }
.search input { flex:1; border: 0; background: transparent; padding: 10px 0; font: inherit; }
.search input:focus { outline: none; }
.search .btn { padding: 10px 16px; }

/* =========================================================
   Top bar / Header
   ========================================================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; color: var(--text-muted);
  font-size: 12.5px;
}
.topbar a { color: inherit; }
.topbar a:hover { color: var(--ink-900); }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  background: var(--jade-500); margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(47,138,93,.5);
  animation: status-pulse 1.8s infinite;
}
@keyframes status-pulse { 70% { box-shadow: 0 0 0 6px rgba(47,138,93,0); } 100% { box-shadow: 0 0 0 0 rgba(47,138,93,0); } }

.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display:flex; align-items:center; justify-content: space-between; padding: 14px 0; }
.brand { display:flex; align-items:center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display:grid; place-items:center;
  background: var(--red-600); color: #fff; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.05em;
  position: relative;
}
.brand-mark::after {
  content:""; position:absolute; inset:3px; border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.16);
  pointer-events: none;
}
.brand-text { line-height: 1; }
.brand-text .name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; letter-spacing: -.012em; display:block; }
.brand-text .sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; display: block; }

.nav { display:flex; align-items:center; gap: 24px; }
.nav a { font-size: 14px; font-weight: 500; color: var(--text-soft); transition: color var(--dur) var(--ease); position: relative; }
.nav a:hover { color: var(--ink-900); }
.nav a.active { color: var(--ink-900); }
.nav a.active::after { content:""; position:absolute; left:0; right:0; bottom:-17px; height:2px; background: var(--accent); }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: var(--ink-900); color: var(--ink-100);
  padding: 72px 0 32px;
  margin-top: 96px;
  position: relative; overflow: hidden;
}
.footer-brand { display:flex; align-items: center; gap: 14px; }
.footer-brand .brand-mark { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; }
.footer-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: #fff; }
.footer-brand .sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-300); margin-top: 4px; text-transform: uppercase; display: block; }

.footer-grid { display:grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; margin-top: 56px; padding-top: 48px; border-top: 1px solid rgba(255,255,255,.10); }
@media (max-width: 900px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-300); margin: 0 0 18px; font-weight: 500; }
.footer a { color: var(--ink-100); display:block; padding: 4px 0; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer-bottom { display:flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: var(--ink-300); flex-wrap: wrap; gap: 14px; }

/* =========================================================
   Reveals (CSS-only)
   ========================================================= */
@keyframes revealIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.reveal { animation: revealIn 600ms var(--ease) both; animation-delay: 60ms; }
.reveal:nth-of-type(2) { animation-delay: 120ms; }
.reveal:nth-of-type(3) { animation-delay: 180ms; }
.reveal:nth-of-type(4) { animation-delay: 240ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* =========================================================
   Misc
   ========================================================= */
.text-accent { color: var(--accent); }
.bg-deep { background: var(--ink-900); color: #fff; }
.bg-card { background: var(--surface-card); }
.bg-white { background: #fff; }

/* Subtle dotted divider */
.dot-divider {
  display: flex; align-items: center; gap: 12px; color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.dot-divider::before, .dot-divider::after { content:""; flex:1; height: 1px; background: var(--border); }

/* =========================================================
   Compatibility shims (v1 → v2)
   Keep older variable names working so existing markup
   renders correctly with the new palette.
   ========================================================= */
:root {
  --bone-50: #FFFFFF;
  --bone-100: var(--gray-100);
  --bone-200: var(--gray-200);
  --bone-300: var(--gray-300);

  --gold-100: var(--amber-100);
  --gold-500: var(--amber-500);
  --gold-600: var(--amber-700);

  --red-100: var(--red-50);
}
