* {
  box-sizing: border-box;
}

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --dark: #0f172a;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(100% - 2rem, 980px);
  margin: 0 auto;
}

header,
footer {
  background: var(--dark);
  color: #ffffff;
}

header {
  padding: 2rem 0 1.5rem;
}

footer {
  padding: 1.25rem 0;
  margin-top: 2rem;
}

header h1,
header p,
footer p {
  margin: 0;
}

header p {
  margin-top: 0.5rem;
  color: #cbd5e1;
}

main {
  padding: 2rem 0 3rem;
}

.hero,
.home-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.hero {
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.home-block {
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.hero-tagline {
  margin: 0.75rem 0 0;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--muted);
}

.hero-summary {
  margin: 1rem 0 0;
  max-width: 52ch;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease;
}

.button:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  background: #eef2f7;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h3 {
  margin-bottom: 0.75rem;
}

.home-block p {
  margin: 0;
  color: var(--muted);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.site-branding {
  flex: 0 1 340px;
  min-width: 0;
}

.site-branding h1 {
  margin: 0;
  white-space: nowrap;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.site-nav {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 0.85rem;
  row-gap: 0.75rem;
}

.site-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  font-size: 0.98rem;
}

.site-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 1.5rem;
  }

  .hero h2 {
    font-size: 1.6rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    text-align: center;
  }
}

.project-title {
  margin: 0 0 0.5rem;
}

.project-title-link {
  color: inherit;
  text-decoration: none;
}

/* ===== Base móvil ===== */

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

img,
picture,
video,
svg {
  max-width: 100%;
  height: auto;
}

body {
  overflow-x: hidden;
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .hero,
  .hero-grid,
  .home-grid,
  .content-grid,
  .projects-grid,
  .cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-actions,
  .cta-group,
  .button-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero-actions a,
  .cta-group a,
  .button-row a,
  .hero-actions .button,
  .cta-group .button,
  .button-row .button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.4rem;
    line-height: 1.25;
  }

  p,
  li,
  a {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .card,
  .project-card,
  .article-card,
  .cert-card {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .site-nav {
    flex: 0 1 auto;
    align-content: flex-start;
  }
}

@media (max-width: 800px) {
  .site-nav {
    display: grid !important;
    grid-template-columns: repeat(2, max-content) !important;
    justify-content: start !important;
    align-content: start !important;
    gap: 0.75rem 1.25rem !important;
    width: auto !important;
    flex: none !important;
  }
}

@media (max-width: 480px) {
  .site-nav {
    grid-template-columns: 1fr !important;
  }

  .site-nav a {
    white-space: normal !important;
  }
}

@media (max-width: 800px) {
  .site-branding,
  .site-nav {
    flex: 0 0 auto !important;
    width: 100%;
    min-width: 0;
  }
}
