/* ===== Design tokens (Sistema de Diseño) ===== */
/* Paleta extraida por muestreo de pixeles del logotipo GQS real (logo-gqs.png) */
:root {
  --primary: #0B5EA8;
  --primary-mid: #0E4369;
  --primary-dark: #071F38;
  --accent: #1389B5;
  --accent-light: #47C6D9;
  --accent-dark: #0C6E8F;
  --text: #12202E;
  --text-secondary: #55636F;
  --border: #D7E1E8;
  --bg-light: #F2F6F9;
  --white: #FFFFFF;
  --success: #2E7D32;
  --error: #C62828;

  --font-heading: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 64px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --gradient-space: radial-gradient(circle at 25% 20%, var(--primary-mid) 0%, var(--primary-dark) 55%, #030A14 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.narrow { max-width: 760px; }

/* ===== Fade-in on scroll ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gradient-space);
  box-shadow: 0 2px 12px rgba(3, 10, 20, 0.35);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}
.logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
.logo-dot { color: var(--accent-light); }

.site-nav ul { display: flex; gap: var(--space-4); }
.site-nav a {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-2) 0;
  position: relative;
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.site-nav a:hover,
.site-nav a.active { color: var(--accent); }
.site-nav a.active::after,
.site-nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-space);
  color: var(--white);
  padding: var(--space-6) 0;
}
.hero-photo {
  background-image: url("../img/logo-hero-bg.jpg");
  background-size: cover;
  background-position: center 35%;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  padding-top: var(--space-6);
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(7, 31, 56, 0.1) 0%, rgba(7, 31, 56, 0.6) 55%, var(--primary-dark) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.hero-text h1 { font-size: 2.2rem; margin-bottom: var(--space-2); text-shadow: 0 2px 16px rgba(3, 10, 20, 0.6); }
.hero-role { font-size: 1.15rem; color: var(--accent-light); font-weight: 600; margin-bottom: var(--space-1); text-shadow: 0 2px 12px rgba(3, 10, 20, 0.6); }
.hero-tagline { color: rgba(255,255,255,0.9); margin-bottom: var(--space-4); text-shadow: 0 2px 12px rgba(3, 10, 20, 0.6); }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ===== Constellation motif (eco visual del logotipo GQS) ===== */
.constellation-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}
.constellation-bg .node {
  fill: var(--accent-light);
  animation: pulse-node 3.5s ease-in-out infinite;
}
.constellation-bg .link {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.35;
}
@keyframes pulse-node {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .constellation-bg .node { animation: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--gradient-accent); color: var(--white); }
.btn-accent:hover { box-shadow: 0 6px 16px rgba(19, 137, 181, 0.35); }
.btn-secondary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: var(--white); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.6); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

/* ===== Sections ===== */
.section { padding: var(--space-6) 0; }
.section-alt { background: var(--bg-light); }
.section-title { font-size: 1.6rem; margin-bottom: var(--space-4); }
.section-cta { margin-top: var(--space-4); display: flex; gap: var(--space-3); flex-wrap: wrap; }

.page-header {
  position: relative;
  overflow: hidden;
  background: var(--gradient-space);
  color: var(--white);
  padding: var(--space-5) 0;
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { font-size: 1.9rem; margin-bottom: var(--space-2); }

/* ===== Grid & Cards ===== */
.grid { display: grid; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: 0 10px 24px rgba(7, 31, 56, 0.14); transform: translateY(-4px); }

.project-card { display: flex; flex-direction: column; }
.card-media {
  height: 140px;
  background: linear-gradient(135deg, var(--bg-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.card-body { padding: var(--space-3); }
.card-body h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.card-body p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--space-3); }

.skill-group { padding: var(--space-4); }
.skill-group h3 { margin-bottom: var(--space-3); color: var(--primary); }

.media-placeholder {
  height: 320px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-list-large .tag { font-size: 0.95rem; padding: 10px 18px; }
.tag {
  background: var(--bg-light);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
}
.tag-on-dark { background: rgba(255,255,255,0.12); color: var(--white); border-color: rgba(255,255,255,0.3); }

/* ===== Filter bar (Proyectos) ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.filter-btn {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--gradient-accent); color: var(--white); border-color: transparent; }
.empty-state { color: var(--text-secondary); text-align: center; padding: var(--space-5) 0; }

/* ===== About page ===== */
.lead { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: var(--space-4); }
.check-list { margin-bottom: var(--space-4); }
.check-list li {
  padding-left: 28px;
  position: relative;
  margin-bottom: var(--space-2);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ===== Blog ===== */
.blog-item { padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.blog-item:last-child { border-bottom: none; }
.blog-date { font-size: 0.8rem; color: var(--text-secondary); }
.blog-item h3 { margin: var(--space-1) 0 var(--space-2); color: var(--primary); }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-4); align-items: start; }
.contact-form-card, .contact-alt-card { padding: var(--space-4); }
.contact-form-card h3, .contact-alt-card h3 { margin-bottom: var(--space-3); }
#contactForm { display: flex; flex-direction: column; }
#contactForm label { font-size: 0.85rem; color: var(--text-secondary); margin: var(--space-2) 0 4px; }
#contactForm input,
#contactForm textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg-light);
  transition: border-color 0.2s ease;
}
#contactForm input:focus,
#contactForm textarea:focus { outline: none; border-color: var(--accent); }
#contactForm button { margin-top: var(--space-4); align-self: flex-start; }
.form-status { margin-top: var(--space-3); font-size: 0.88rem; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

.contact-alt-card { background: var(--bg-light); display: flex; flex-direction: column; }
.contact-alt-card a { padding: var(--space-2) 0; color: var(--primary); font-weight: 500; }
.contact-alt-card a:hover { color: var(--accent); }

/* ===== Footer ===== */
.site-footer { background: var(--primary-dark); color: var(--white); padding: var(--space-4) 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.footer-links { display: flex; gap: var(--space-4); }
.footer-links a { font-size: 0.85rem; opacity: 0.85; }
.footer-links a:hover { opacity: 1; color: var(--accent); }
.footer-copy { font-size: 0.8rem; opacity: 0.7; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--primary-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-nav.open { max-height: 320px; }
  .site-nav ul { flex-direction: column; padding: var(--space-3) var(--space-4); gap: var(--space-1); }
  .site-nav a { display: block; padding: var(--space-2) 0; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-text h1 { font-size: 1.7rem; }
}
