/* ============================================================
   Alejandro Blanco — Personal Website
   CSS Custom Properties — Dark & Light Theme
   ============================================================ */

:root {
  /* Colors — Dark theme (default) */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-code: #252836;
  --text-primary: #e4e6eb;
  --text-secondary: #a0a4b0;
  --text-muted: #6b7084;
  --border: #2a2d3a;
  --accent: #4ecdc4;
  --accent-hover: #3dbdb5;
  --accent-dim: rgba(78, 205, 196, 0.12);
  --tag-bg: rgba(78, 205, 196, 0.1);
  --tag-text: #5ecfca;
  --warning: #f0a040;
  --danger: #e0556a;
  --success: #50c878;
  --link: #4ecdc4;
  --link-hover: #6ddad3;
  --nav-bg: rgba(15, 17, 23, 0.92);
  --hero-bg: linear-gradient(160deg, #0f1117 0%, #1a2040 50%, #0f1117 100%);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-sm: 4px;
}

[data-theme="light"] {
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #f0f2f5;
  --text-primary: #1a1d27;
  --text-secondary: #4a4f5e;
  --text-muted: #7a8090;
  --border: #e2e5ec;
  --accent: #0d9e96;
  --accent-hover: #0b8a83;
  --accent-dim: rgba(13, 158, 150, 0.08);
  --tag-bg: rgba(13, 158, 150, 0.08);
  --tag-text: #0d9e96;
  --nav-bg: rgba(248, 249, 251, 0.92);
  --hero-bg: linear-gradient(160deg, #f8f9fb 0%, #e8f0f8 50%, #f8f9fb 100%);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

main {
  flex: 1;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--link-hover); }

strong { font-weight: 600; }

code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--accent);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--text-primary);
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
li { margin-bottom: 0.35rem; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: 1100px;
}

section {
  padding: 3rem 0;
}

/* ============================================================
   Navigation
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: 960px;
  margin: 0 auto;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
}
.nav-brand:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links li { margin: 0; }

.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  margin-left: 0.5rem;
  transition: color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
  }
  .nav-links.show { display: flex; }
  .nav-links a { padding: 0.6rem 0.5rem; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background: var(--hero-bg);
  padding: 5rem 0 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero .tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #0f1117;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

.card h3 {
  margin-bottom: 0.5rem;
}
.card h3 a {
  color: var(--text-primary);
}
.card h3 a:hover {
  color: var(--accent);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* ============================================================
   Grids
   ============================================================ */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Tags & Badges
   ============================================================ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-status {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ============================================================
   Filters
   ============================================================ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.filter-btn.active {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

/* ============================================================
   Tech Radar List
   ============================================================ */

.radar-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.radar-item:first-child {
  padding-top: 0;
}

.radar-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.radar-source {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Prompt Cards
   ============================================================ */

.prompt-card {
  position: relative;
  margin-bottom: 1.25rem;
}

.prompt-list .card {
  margin-bottom: 1.25rem;
}

.prompt-card pre {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.copied {
  background: var(--success);
  color: #0f1117;
  border-color: var(--success);
}

/* ============================================================
   Article Detail
   ============================================================ */

.article-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-body h2 { margin-top: 2.5rem; }
.article-body h3 { margin-top: 2rem; }

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* ============================================================
   Skills Section
   ============================================================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.skill-group h4 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.skill-list li {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-code);
  padding: 0.15em 0.6em;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.footer-links li { margin: 0; }

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   Search (placeholder for filtering)
   ============================================================ */

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
}
.search-input::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   Resource Categories
   ============================================================ */

.resource-category {
  margin-bottom: 2.5rem;
}

.resource-category h3 {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.resource-link {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  transition: color 0.2s;
}
.resource-link:last-child {
  border-bottom: none;
}
.resource-link:hover {
  color: var(--accent);
}
.resource-link .res-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ============================================================
   Contact
   ============================================================ */

.contact-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-links li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-icon {
  font-size: 1.3rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Utility
   ============================================================ */

.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.reading-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  .site-nav, .site-footer, .hero-actions, .copy-btn { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
