/* style.css */
/* Base + variables */
:root {
  --primary: #0ea5e9;      /* brand-primary */
  --secondary: #9333ea;    /* brand-secondary */
  --surface: #ffffff;
  --neutral-50: #fafafa;
  --neutral-900: #0a0a0a;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: var(--neutral-900);
  background: var(--neutral-50);
}

/* Utility container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Prose adjustments for readability */
.prose {
  color: #111827;
  max-width: 75ch;
}
.prose p {
  margin: 1rem 0;
  text-wrap: pretty;
}
.prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose ol, .prose ul {
  padding-left: 1.25rem;
}

/* Cards (Listado) */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

@media (max-width: 640px) {
  .grid.sm\:grid-cols-2,
  .grid.lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(400px 180px at 20% -20%, rgba(14,165,233,.15), transparent 50%),
              radial-gradient(300px 160px at 120% 20%, rgba(147,51,234,.12), transparent 50%);
  opacity: .9;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14,165,233,.35);
}
.card-title {
  font-weight: 800;
  margin: 0 0 .35rem 0;
  font-size: 1.1rem;
  letter-spacing: .2px;
}
.card-desc {
  color: #374151;
  font-size: .95rem;
}

/* Focus styles */
a, button, summary, [role="button"] {
  outline: none;
}
a:focus-visible, button:focus-visible, summary:focus-visible {
  box-shadow: 0 0 0 3px rgba(14,165,233,.35);
}

/* Subtle entrance animation */
@media (prefers-reduced-motion: no-preference) {
  .card {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp .6s ease forwards;
  }
  .card:nth-child(1) { animation-delay: .05s; }
  .card:nth-child(2) { animation-delay: .1s; }
  .card:nth-child(3) { animation-delay: .15s; }
  .card:nth-child(4) { animation-delay: .2s; }
  .card:nth-child(5) { animation-delay: .25s; }
  .card:nth-child(6) { animation-delay: .3s; }
  .card:nth-child(7) { animation-delay: .35s; }
  .card:nth-child(8) { animation-delay: .4s; }
  .card:nth-child(9) { animation-delay: .45s; }
  .card:nth-child(10){ animation-delay: .5s; }
  .card:nth-child(11){ animation-delay: .55s; }
  .card:nth-child(12){ animation-delay: .6s; }
  .card:nth-child(13){ animation-delay: .65s; }
  .card:nth-child(14){ animation-delay: .7s; }

  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Dark mode (if toggled) */
html.dark body {
  background: #0b1220;
  color: #e5e7eb;
}
html.dark .card {
  background: #0f172a;
  border-color: rgba(148,163,184,.18);
}
html.dark .prose p,
html.dark .prose li,
html.dark .prose h2,
html.dark .prose h3 {
  color: #e5e7eb;
}
html.dark footer,
html.dark header {
  background: rgba(15,23,42,.75);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none !important; }
  .card:hover { transform: none; }
}