/* ============================================================
   LZR Tech Design System v2.0 — Componentes
   ============================================================ */

/* ---------- LAYOUT SHELL ---------- */
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.shell__aside {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--s-6) var(--s-5);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.shell__aside::-webkit-scrollbar { width: 6px; }
.shell__aside::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: var(--r-full); }
.shell__main {
  padding: var(--s-7) var(--s-7) var(--s-9);
  max-width: var(--container);
  width: 100%;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell__aside { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .shell__main { padding: var(--s-5); }
}

/* ---------- NAV (sidebar) ---------- */
.nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--divider);
}
/* LZR mark — original artwork, proportions locked (338 × 537) */
.nav__brand img,
.lzr-mark {
  height: 44px;
  width: auto;
  aspect-ratio: 338 / 537;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.lzr-mark--sm { height: 32px; }
.lzr-mark--lg { height: 64px; }
.nav__brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.nav__brand-sub { font-size: var(--fs-xs); color: var(--text-3); }

.nav__group { display: flex; flex-direction: column; gap: var(--s-1); }
.nav__group-title {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--s-3);
  margin-bottom: var(--s-2);
}
.nav__link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: all var(--dur-fast) var(--ease);
  position: relative;
}
.nav__link:hover { background: var(--bg-soft); color: var(--text-1); }
.nav__link--active {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}
.nav__link--active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--accent);
  border-radius: var(--r-full);
}
.nav__num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); min-width: 24px; }

/* ---------- HEADER BLOCK (section) ---------- */
.hdr { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-6); }
.hdr__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
}
.hdr__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: var(--tracking-tight); line-height: 1.1; }
.hdr__kicker { color: var(--text-2); font-size: var(--fs-body-lg); max-width: 68ch; }

.section { padding: var(--s-8) 0; border-top: 1px solid var(--divider); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section__grid { display: grid; gap: var(--s-5); }

/* ---------- CARD ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.card--elevated { background: var(--elevated); box-shadow: var(--shadow-sm); }
.card--sunken { background: var(--sunken); }
.card--glow { border-color: var(--accent-bd); box-shadow: 0 0 0 1px var(--accent-bd) inset; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card__title { font-weight: 600; font-size: var(--fs-body); }
.card__meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  min-height: 40px;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  color: var(--text-inv);
  background: linear-gradient(
    110deg,
    var(--accent-hi) 0%,
    var(--accent) 35%,
    var(--accent-lo) 50%,
    var(--accent) 65%,
    var(--accent-hi) 100%
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  animation: btn-shimmer 7s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255,255,255,.18) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
  pointer-events: none;
}
.btn--primary:hover { box-shadow: var(--shadow-accent); animation-duration: 3.5s; }
.btn--primary:hover::before { transform: translateX(120%); }
.btn--primary > * { position: relative; z-index: 1; }
@keyframes btn-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn--primary { animation: none; }
  .btn--primary::before { transition: none; }
}
.btn--secondary { background: var(--surface); color: var(--text-1); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--border-hi); background: var(--bg-soft); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover { color: var(--text-1); background: var(--bg-soft); }
.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent-bg); }
.btn--danger { background: var(--err); color: #fff; }
.btn--danger:hover { filter: brightness(1.05); }
.btn--xs { padding: 4px 8px; min-height: 24px; font-size: var(--fs-xs); }
.btn--sm { padding: 6px 12px; min-height: 32px; font-size: var(--fs-xs); }
.btn--lg { padding: 14px 22px; min-height: 48px; font-size: var(--fs-body); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ---------- TOKEN CHIPS ---------- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3);
}
.swatch {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.swatch__chip { height: 72px; display: flex; align-items: flex-end; padding: var(--s-2) var(--s-3); }
.swatch__chip--sm { height: 48px; }
.swatch__meta { padding: var(--s-2) var(--s-3); font-family: var(--font-mono); font-size: var(--fs-xs); }
.swatch__label { color: var(--text-1); font-weight: 600; }
.swatch__value { color: var(--text-3); font-size: 10px; }
.swatch__star { color: var(--text-inv); font-size: var(--fs-xs); font-weight: 700; mix-blend-mode: normal; }

/* ---------- TOKEN KV ---------- */
.kv {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3) var(--s-4);
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.kv__k { color: var(--text-2); }
.kv__v { color: var(--text-1); }
.kv__c { color: var(--text-3); font-size: var(--fs-xs); }

/* ---------- CODE BLOCK ---------- */
.code {
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s-4) var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-1);
  overflow-x: auto;
}
.code .c-key { color: var(--accent); }
.code .c-str { color: var(--accent2); }
.code .c-num { color: var(--info); }
.code .c-cmt { color: var(--text-3); font-style: italic; }
.code .c-kw { color: var(--lzr-green-400); font-weight: 600; }

[data-theme="day"] .code .c-kw,
[data-theme="sunset"] .code .c-kw { color: var(--lzr-green-700); }

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  height: 22px;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  vertical-align: middle;
}
.badge--ok { background: rgba(46, 139, 87, 0.12); color: var(--ok); border-color: rgba(46, 139, 87, 0.28); }
.badge--warn { background: rgba(200, 144, 32, 0.12); color: var(--warn); border-color: rgba(200, 144, 32, 0.28); }
.badge--err { background: rgba(194, 76, 76, 0.12); color: var(--err); border-color: rgba(194, 76, 76, 0.28); }
.badge--info { background: rgba(61, 143, 174, 0.12); color: var(--info); border-color: rgba(61, 143, 174, 0.28); }
.badge--neutral { background: var(--bg-soft); color: var(--text-2); border-color: var(--border); }
.badge--accent { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-bd); }
.badge--amber { background: var(--accent2-bg); color: var(--accent2); border-color: var(--accent2-bd); }

/* ---------- ALERT ---------- */
.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert__icon { width: 20px; height: 20px; margin-top: 2px; color: var(--text-2); }
.alert__title { font-weight: 600; margin-bottom: 2px; font-size: var(--fs-sm); }
.alert__body { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.alert--ok { border-color: rgba(46, 139, 87, 0.3); background: rgba(46, 139, 87, 0.06); }
.alert--ok .alert__icon { color: var(--ok); }
.alert--warn { border-color: rgba(200, 144, 32, 0.3); background: rgba(200, 144, 32, 0.06); }
.alert--warn .alert__icon { color: var(--warn); }
.alert--err { border-color: rgba(194, 76, 76, 0.3); background: rgba(194, 76, 76, 0.06); }
.alert--err .alert__icon { color: var(--err); }
.alert--info { border-color: rgba(61, 143, 174, 0.3); background: rgba(61, 143, 174, 0.06); }
.alert--info .alert__icon { color: var(--info); }

/* ---------- INPUT ---------- */
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
.input:hover { border-color: var(--border-hi); }
.input:focus { border-color: var(--accent); box-shadow: var(--shadow-ring); outline: none; }
.input--error { border-color: var(--err); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.field__help { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- TABLE ---------- */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}
.tbl thead th {
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.tbl tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl--compact tbody td, .tbl--compact thead th { padding: 8px var(--s-3); }

/* ---------- TAG ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

/* ---------- TOP BAR + THEME TOGGLE ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) 0 var(--s-6);
  margin-bottom: var(--s-6);
  border-bottom: 1px solid var(--divider);
}
.topbar__left { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text-3); }
.topbar__right { display: flex; align-items: center; gap: var(--s-2); }

.tog {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
}
.tog button {
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--dur-fast) var(--ease);
}
.tog button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--text-inv);
}

/* ---------- HERO BLOCK ---------- */
.hero {
  position: relative;
  padding: var(--s-9) var(--s-7);
  border-radius: var(--r-lg);
  background: var(--grad-hero), var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: var(--s-8);
}
.hero__bg-mark {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  height: 380px;
  width: auto;
  object-fit: contain;
  opacity: 0.22;
  pointer-events: none;
}
.hero__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  max-width: 18ch;
  margin-bottom: var(--s-4);
}
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { max-width: 52ch; font-size: var(--fs-body-lg); color: var(--text-2); line-height: var(--lh-loose); }
.hero__meta {
  margin-top: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta .dot { width: 6px; height: 6px; background: var(--accent); border-radius: var(--r-full); }

/* ---------- GENERIC GRID ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- PROSE ---------- */
.prose p { margin: 0 0 var(--s-3); color: var(--text-2); max-width: 72ch; }
.prose ul { margin: 0 0 var(--s-4) var(--s-4); padding: 0; color: var(--text-2); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text-1); font-weight: 600; }
.prose code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  font-size: 0.9em;
  border: 1px solid var(--divider);
}

/* ---------- CALLOUT ---------- */
.callout {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.callout--accent { background: var(--accent-bg); border-color: var(--accent-bd); }
.callout--amber { background: var(--accent2-bg); border-color: var(--accent2-bd); }
.callout__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-2);
}
.callout--amber .callout__eyebrow { color: var(--accent2); }
.callout__title { font-weight: 600; margin-bottom: var(--s-2); }

/* ---------- DO / DONT ---------- */
.donts { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (max-width: 640px) { .donts { grid-template-columns: 1fr; } }
.dont {
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: var(--s-4);
  background: var(--surface);
}
.dont__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.dont--do { border-color: rgba(46, 139, 87, 0.3); }
.dont--do .dont__tag { color: var(--ok); }
.dont--dont { border-color: rgba(194, 76, 76, 0.3); }
.dont--dont .dont__tag { color: var(--err); }

/* ---------- DETAIL LINES ---------- */
.rule-list { display: flex; flex-direction: column; gap: var(--s-3); }
.rule {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--divider);
}
.rule:first-child { border-top: 0; }
.rule__num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); padding-top: 2px; }
.rule__body { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }
.rule__body strong { color: var(--text-1); }

/* ---------- ANCHOR OFFSET ---------- */
.section[id] { scroll-margin-top: var(--s-6); }
