:root {
  --bg: #0A1128;
  --fg: #fff;
  --gray: #1A1A2E;
  --accent: #E63946;
  --font: 'Poppins', sans-serif;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
}

.site-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Tarjetas */
.card {
  background: var(--gray);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* HEADER perfil */
.profile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fg);
}
.profile-info .name {
  font-size: 1.25rem;
  font-weight: 600;
}
.profile-info .role {
  font-size: 0.9rem;
  font-weight: 300;
  opacity: 0.8;
}

.intro-link {
  font-size: 0.8rem;
  color: var(--fg);
  text-align: center;
  margin-top: 0.25rem;
}
.intro-link a {
  color: var(--fg);
  text-decoration: underline;
}

/* HERO / CURSO */
.hero { text-align: center; }
.hero h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.hero-desc {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #ccc;
}

/* Nubecín post */
.nubecin-post {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.nubecin-img-post {
  width: 60px;
  max-width: 15vw;
  height: auto;
}
.nubecin-caption {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* ====== Newsletter (Substack) ====== */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

.newsletter h2{ text-align:center; }
.newsletter-desc{
  text-align:center;
  color:#ccc;
  font-size:1rem;
  font-weight:400;
}

.newsletter-cta{
  display:flex;
  align-items:center;
  gap:.9rem;
  margin-top:.5rem;
  flex-wrap:wrap;
}

.skills-img{
  width:60px;
  max-width:15vw;
  height:auto;
  flex:0 0 auto;
}

.newsletter-form{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:.6rem;
  width:100%;
}

.newsletter-form input{
  padding:.85rem 1rem;
  border:1px solid var(--fg);
  border-radius:10px;
  background:rgba(255,255,255,.04);
  color:var(--fg);
  font-size:1rem;
  width:100%;
}
.newsletter-form input::placeholder{ color:#bfbfbf;opacity:1; }
.newsletter-form input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(230,57,70,.25);
}

.newsletter-form .btn{
  width:auto;
  align-self:center;
  padding:.9rem 1.2rem;
  min-width:220px;
  text-align:center;
}

.newsletter-note{
  margin-top:.5rem;
  font-size:.8rem;
  color:#aaa;
  text-align:center;
}

/* Botones */
.btn {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 2px solid var(--fg);
  border-radius: 8px;
  transition: background 0.3s, color 0.3s, transform 0.2s, filter 0.3s;
  margin: 0.25rem 0;
}
.btn:hover,
.btn:focus {
  filter: brightness(1.1);
  transform: translateY(-2px);
  outline: none;
}
.btn i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
  vertical-align: middle;
}
.btn-accent {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-accent:hover,
.btn-accent:focus {
  background: var(--accent);
  color: var(--bg);
}
.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-solid:hover,
.btn-solid:focus {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Contenido Principal */
.main-content { text-align: center; }
.main-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.link-item {
  background: var(--gray);
  padding: 1rem;
  border-radius: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.link-item:hover,
.link-item:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}
.link-desc {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #ddd;
  opacity: 0.9;
}

/* Colaborador */
.collab-card iframe {
  border-radius: 12px;
  width: 100%;
  height: 232px;
}
.collab-desc {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
  text-align: center;
}

/* Sobre Mí */
.about-card .about-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}
.media-embed h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.media-embed iframe {
  width: 100%;
  border-radius: 8px;
}

/* Modal base (oculto) */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background-color: rgba(0,0,0,0.7);
}

/* Modal abierto (centrado) */
.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal content box */
.modal-content {
  background: var(--gray);
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  position: relative;
}

/* Close button (×) */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Contacto Formspree */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.5rem;
  border: 1px solid var(--fg);
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
}

/* Floating logo */
.floating-logo {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
}
.floating-logo img {
  width: 40px;
  height: auto;
}
.floating-logo:hover img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
  font-size: 0.8rem;
  color: #666;
  opacity: 0.8;
  text-align: center;
  margin-top: 2rem;
}

/* Enlace del footer a la política */
.privacy-link {
  color: #ddd;
  font-size: 0.85rem;
  text-decoration: underline;
  opacity: 0.95;
}
.privacy-link:hover { opacity: 1; }

/* Consentimiento RGPD en el formulario */
.contact-form .consent {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .85rem;
  line-height: 1.3;
}
.contact-form .consent a {
  color: var(--fg);
  text-decoration: underline;
}

/* Nota informativa bajo el botón */
.form-note {
  margin-top: .5rem;
  font-size: .8rem;
  color: #ccc;
}

/* Consentimiento en la newsletter */
.newsletter-form .consent{
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .85rem;
  line-height: 1.35;
  color: #ddd;
  margin-top: .25rem;
  text-align: left;
  cursor: pointer;
}
.newsletter-form .consent a{
  color: var(--fg);
  text-decoration: underline;
}
.newsletter-form .consent input{
  width: 16px;
  height: 16px;
  margin-top: .15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* ====== CyberQuiz ====== */
.quiz { text-align: center; }
.quiz h2{
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.quiz-desc{
  color: #ccc;
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: .5rem;
  text-align: center;
}
.quiz-img{
  display: block;
  margin: .5rem auto 1rem;
  width: 120px;
  max-width: 40%;
  height: auto;
  object-fit: contain;
}
.quiz-btn{
  display: block;
  width: calc(100% - 2rem);
  margin: 0.5rem auto 0;
  padding: 1rem;
  font-size: 1.1rem;
  min-width: 0;
}
@media (min-width: 520px){
  .quiz-img{ width: 140px; max-width: 35%; }
}
