:root {
  --bg: #041127;
  --surface: #0c1a36;
  --surface-soft: #112846;
  --surface-light: #1b3563;
  --accent: #ff8b33;
  --accent-soft: rgba(255, 139, 51, 0.18);
  --text: #f7f9fb;
  --muted: #9bb3cf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(68, 100, 145, 0.16), transparent 28%),
    linear-gradient(180deg, #081a2d 0%, #0f2a4a 50%, #0b203b 100%);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgba(8, 22, 40, 0.88);
  background-image: url("assets/header.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 139, 51, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #d97b23);
  font-weight: 800;
  color: #041127;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.95rem;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--accent);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
}

.flag-icon {
  width: 24px;
  height: 16px;
  display: inline-block;
  background: #012169;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0 0 L60 30 M60 0 L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0 L60 30 M60 0 L0 30' stroke='%23cf142b' stroke-width='4'/%3E%3Cpath d='M30 0 L30 30 M0 15 L60 15' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0 L30 30 M0 15 L60 15' stroke='%23cf142b' stroke-width='6'/%3E%3C/svg%3E");
  background-size: cover;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Bandera española — usada en index-en.html */
.flag-icon--es {
  background-color: #c60b1e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23c60b1e'/%3E%3Crect y='7.5' width='60' height='15' fill='%23f1bf00'/%3E%3C/svg%3E");
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  line-height: 1.05;
}

.hero-text {
  max-width: 620px;
  margin: 1.5rem 0 2rem;
  line-height: 1.8;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(255, 139, 51, 0.18);
  background: rgba(255, 139, 51, 0.14);
}

.cta-button.accent {
  background: linear-gradient(135deg, rgba(255, 139, 51, 0.18), rgba(255, 139, 51, 0.08));
  border-color: rgba(255, 139, 51, 0.3);
}

.icon-phone,
.icon-pdf,
.icon-mail,
.icon-linkedin,
.icon-github,
.icon-location {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
  flex-shrink: 0;
}

.icon-phone::before {
  content: '\260E';
}

.icon-pdf::before {
  content: 'PDF';
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.icon-mail::before {
  content: '\2709';
}

.icon-linkedin::before {
  content: 'in';
  font-weight: 700;
  font-size: 0.9rem;
}

.icon-github::before {
  content: 'GH';
  font-size: 0.9rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.icon-location::before {
  content: '\1F30D';
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Wrapper que porta el marco con relieve */
.avatar-wrapper {
  position: relative;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  flex-shrink: 0;

  /* Anillo exterior con gradiente que simula la luz incidente */
  background: conic-gradient(
    from 120deg,
    rgba(255, 139, 51, 0.85) 0deg,
    rgba(255, 200, 120, 0.95) 60deg,
    rgba(180, 100, 20, 0.6) 140deg,
    rgba(80, 50, 10, 0.4) 200deg,
    rgba(255, 139, 51, 0.7) 270deg,
    rgba(255, 200, 120, 0.9) 320deg,
    rgba(255, 139, 51, 0.85) 360deg
  );
  padding: 5px;

  /* Sombras en capas: elevación + oclusión ambiental */
  box-shadow:
    0 2px 4px rgba(255, 180, 80, 0.5),          /* luz superior — highlight */
    0 -2px 4px rgba(80, 40, 5, 0.6),            /* sombra inferior del anillo */
    0 20px 50px rgba(0, 0, 0, 0.55),            /* sombra de elevación */
    0 40px 90px rgba(0, 0, 0, 0.3),             /* sombra difusa larga */
    inset 0 2px 4px rgba(255, 220, 140, 0.4),   /* brillo interior superior */
    inset 0 -2px 4px rgba(40, 20, 0, 0.5);      /* profundidad interior inferior */
}

/* Segundo anillo interior oscuro — crea la sensación de surco/bisel */
.avatar-wrapper::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(20, 10, 0, 0.7), rgba(60, 30, 5, 0.3));
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.7),
    inset 0 -2px 4px rgba(255, 160, 60, 0.15);
  z-index: 1;
  pointer-events: none;
}

/* Destello especular en la parte superior del anillo */
.avatar-wrapper::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 235, 180, 0.55), transparent);
  filter: blur(4px);
  z-index: 3;
  pointer-events: none;
}

/* El contenedor real de la foto */
.avatar-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.section {
  padding: 4rem 0;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.section-heading span {
  display: inline-block;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 1.15rem;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.section-inner {
  background-color: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 139, 51, 0.14);
  border-radius: 28px;
  padding: 2rem;
}

/* Fondos específicos para secciones */
#about .section-inner {
  background-color: transparent;
  background-image: linear-gradient(rgba(2,12,24,0.85), rgba(2,12,24,0.94)), url("assets/about.png");
  background-size: cover;
  background-position: center right;
  background-attachment: fixed;
}

#skills .section-inner {
  background-color: transparent;
  background-image: linear-gradient(rgba(2,12,24,0.8), rgba(2,12,24,0.88)), url("assets/skills.png");
  background-size: cover;
  background-position: center left;
  background-attachment: fixed;
}

#projects .section-inner {
  background-color: transparent;
  background-image: linear-gradient(rgba(2,12,24,0.8), rgba(2,12,24,0.88)), url("assets/projects.png");
  background-size: cover;
  background-position: center right;
  background-attachment: fixed;
}

#contact .section-inner {
  background-color: transparent;
  background-image: linear-gradient(rgba(2,12,24,0.75), rgba(2,12,24,0.85)), url("assets/footer.png");
  background-size: cover;
  background-position: center right;
  background-attachment: fixed;
  color: var(--text);
}

.about-copy p {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--muted);
  margin-top: 1rem;
}

.accordion-group {
  display: grid;
  gap: 1.2rem;
}

.accordion-card {
  background: rgba(2, 12, 24, 0.9);
  border: 2px solid rgba(255, 139, 51, 0.16);
  border-radius: 20px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  text-align: left;
  padding: 1.4rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  color: var(--text);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.accordion-header::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.accordion-header[aria-expanded='true']::after {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding: 0 1.5rem;
}

.accordion-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 1rem 0 0;
}

.accordion-content ul {
  list-style: none;
  padding: 1rem 0 1.5rem;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.accordion-content li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--muted);
}

.accordion-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.project-preview {
  display: grid;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
}

.project-image {
  min-height: 180px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 139, 51, 0.12), rgba(3, 16, 39, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.95rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.3rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 139, 51, 0.14);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.15s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 139, 51, 0.12);
}

.contact-card h3 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
}

.location-card {
  cursor: default;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  background-image: linear-gradient(rgba(8, 22, 40, 0.96), rgba(8, 22, 40, 0.96)), url("assets/footer.png");
  background-size: cover;
  background-position: center;
}

.footer-inner {
  border-top: 1px solid rgba(255, 139, 51, 0.1);
  padding-top: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* ── Glassmorphism upgrade para section-inner ── */
.section-inner {
  background-color: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 139, 51, 0.14);
  border-radius: 28px;
  padding: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Projects narrative ── */
.projects-narrative {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 2.5rem;
  max-width: 860px;
}

/* ── Project cards grid ── */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ── Enterprise project card ── */
.project-card-enterprise {
  position: relative;
  background: rgba(5, 15, 30, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: default;
}

.project-card-enterprise:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 40px rgba(0, 140, 255, 0.18), 0 24px 60px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 139, 51, 0.4);
}

/* Glow de fondo */
.pce-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  top: -80px;
  right: -80px;
  filter: blur(60px);
}

.project-card-enterprise:hover .pce-glow {
  opacity: 1;
}

.pce-glow--blue  { background: radial-gradient(circle, rgba(0,140,255,0.25), transparent 70%); }
.pce-glow--orange { background: radial-gradient(circle, rgba(255,139,51,0.22), transparent 70%); }

/* Header: icono + meta */
.pce-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.pce-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 140, 255, 0.15);
  border: 1px solid rgba(0, 140, 255, 0.25);
  display: grid;
  place-items: center;
  color: #4db8ff;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.pce-icon svg {
  width: 20px;
  height: 20px;
}

.project-card-enterprise:hover .pce-icon {
  background: rgba(0, 140, 255, 0.25);
  box-shadow: 0 0 14px rgba(0, 140, 255, 0.35);
}

.pce-icon--orange {
  background: rgba(255, 139, 51, 0.14);
  border-color: rgba(255, 139, 51, 0.28);
  color: var(--accent);
}

.project-card-enterprise:hover .pce-icon--orange {
  background: rgba(255, 139, 51, 0.24);
  box-shadow: 0 0 14px rgba(255, 139, 51, 0.3);
}

.pce-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pce-category {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4db8ff;
  font-weight: 600;
}

.pce-category--orange { color: var(--accent); }

.pce-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

/* Description */
.pce-description {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
}

/* Stack tags */
.pce-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pce-stack span {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 120, 255, 0.12);
  border: 1px solid rgba(0, 120, 255, 0.22);
  color: #7dcfff;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.project-card-enterprise:hover .pce-stack span {
  background: rgba(0, 120, 255, 0.2);
  border-color: rgba(0, 120, 255, 0.38);
}

/* Impact list */
.pce-impact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.pce-impact li {
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 1.4rem;
  position: relative;
  line-height: 1.5;
}

.pce-impact li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: #4db8ff;
  font-size: 0.75rem;
  top: 0.1rem;
}

/* Action buttons */
.pce-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pce-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.pce-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.pce-btn--primary {
  background: rgba(255, 139, 51, 0.14);
  border-color: rgba(255, 139, 51, 0.35);
  color: var(--accent);
}

.pce-btn--primary:hover {
  background: rgba(255, 139, 51, 0.26);
  box-shadow: 0 0 18px rgba(255, 139, 51, 0.22);
  color: #ffb070;
}

/* Stack tags — variante naranja (habilidades) */
.pce-stack--orange span {
  background: rgba(255, 139, 51, 0.1);
  border: 1px solid rgba(255, 139, 51, 0.22);
  color: #ffb070;
}

.project-card-enterprise:hover .pce-stack--orange span {
  background: rgba(255, 139, 51, 0.2);
  border-color: rgba(255, 139, 51, 0.38);
}

/* Impact list — variante naranja (habilidades) */
.pce-impact--orange li::before {
  color: var(--accent);
}

@media (max-width: 860px) {
  .project-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav {
    justify-content: center;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .accordion-header {
    padding: 1.2rem 1.3rem;
  }

  .accordion-content {
    padding-left: 1.3rem;
  }
}
