/* =====================================================
   PORTFOLIO V3 – Premium Apple-Level Design System
   David Sánchez Fernández – UI/UX Senior
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ---- TOKENS ---- */
:root {
  --bg:          #000000;
  --bg-2:        #0a0a0a;
  --bg-3:        #111111;
  --bg-card:     rgba(255,255,255,0.04);
  --border:      rgba(255,255,255,0.08);
  --border-glow: rgba(255,255,255,0.18);
  --text:        #f5f5f7;
  --text-2:      #a1a1a6;
  --text-3:      #6e6e73;
  --accent:             #0071e3;
  --accent-pink:        #ff375f;
  --accent-gradient:    linear-gradient(135deg, #0071e3 0%, #ff375f 100%);
  --accent-gradient-2:  linear-gradient(135deg, #6e40c9 0%, #0071e3 60%, #00c6ff 100%);
  --glow-blue:   rgba(0, 113, 227, 0.3);
  --glow-pink:   rgba(255, 55, 95, 0.3);
  --radius-sm:   12px;
  --radius-md:   20px;
  --radius-lg:   28px;
  --radius-xl:   40px;
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

/* ---- UTILITY ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  padding: 1.2rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: all 0.4s var(--ease-smooth);
}
.nav-brand {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.04em;
  background: var(--accent-gradient-2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 2.5rem; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-2);
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 0.6rem 1.4rem; border-radius: 30px;
  background: var(--text); color: #000;
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.3s var(--ease-smooth);
}
.nav-cta:hover { transform: scale(1.05); background: #e0e0e0; }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; text-align: center;
  padding: 10rem 2rem 6rem;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(0,113,227,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%,  rgba(255,55,95,0.10) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at  0% 100%, rgba(110,64,201,0.12) 0%, transparent 50%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0%   { opacity: 0.8; }
  100% { opacity: 1;   }
}
.hero-grid-lines {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 30px;
  border: 1px solid var(--border-glow);
  background: rgba(255,255,255,0.05);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}
.hero-badge span { color: #30d158; font-size: 0.7rem; }
.hero-title {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin-bottom: 1.5rem;
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-2);
  max-width: 680px; margin: 0 auto 1rem;
  font-weight: 400; line-height: 1.6;
}
.hero-typing-wrap {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-3);
  margin-bottom: 3rem;
  height: 1.6em;
}
.typed-cursor { color: var(--accent); }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  padding: 0.9rem 2rem; border-radius: 30px;
  background: var(--text); color: #000;
  font-weight: 700; font-size: 1rem;
  transition: all 0.3s var(--ease-smooth);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary:hover { transform: scale(1.05); background: #e8e8e8; box-shadow: 0 0 30px rgba(255,255,255,0.2); }
.btn-secondary {
  padding: 0.9rem 2rem; border-radius: 30px;
  border: 1px solid var(--border-glow);
  background: transparent; color: var(--text);
  font-weight: 600; font-size: 1rem;
  transition: all 0.3s var(--ease-smooth);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); }
.hero-scroll-indicator {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: var(--text-3); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  animation: bounce 2s ease-in-out infinite;
}
.hero-scroll-indicator::before {
  content: ''; display: block; width: 1px; height: 50px;
  background: linear-gradient(to bottom, transparent, var(--text-3));
}
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* Mock profile ring */
.hero-profile {
  width: 160px; height: 160px; border-radius: 50%;
  overflow: hidden; margin: 0 auto 2.5rem;
  border: 2px solid var(--border-glow);
  box-shadow: 0 0 0 8px rgba(0,113,227,0.08), 0 0 60px rgba(0,113,227,0.2);
  transition: all 0.4s var(--ease-smooth);
}
.hero-profile:hover { box-shadow: 0 0 0 12px rgba(0,113,227,0.15), 0 0 80px rgba(0,113,227,0.35); transform: scale(1.03); }
.hero-profile img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================
   PILLARS SECTION
   ===================================================== */
.pillars { padding: 6rem 0; background: var(--bg-2); }
.pillars-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 2px;
  margin-top: 3rem; border-radius: var(--radius-lg); overflow: hidden;
}
.pillar-card {
  padding: 3rem 2rem;
  background: var(--bg-3);
  display: flex; flex-direction: column; gap: 1rem;
  transition: background 0.3s;
  border: 1px solid var(--border);
}
.pillar-card:hover { background: rgba(255,255,255,0.05); }
.pillar-icon {
  font-size: 2.5rem;
  width: 3.5rem; height: 3.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pillar-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; }
.pillar-desc { color: var(--text-2); font-size: 0.95rem; line-height: 1.7; }

/* =====================================================
   ABOUT
   ===================================================== */
.about { padding: 8rem 0; }
.about-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: center;
}
.about-photo {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}
.about-photo img { width: 100%; display: block; }
.about-photo-badge {
  position: absolute; bottom: 2rem; left: 2rem;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md); padding: 1rem 1.5rem;
  display: flex; gap: 2rem;
}
.about-stat { text-align: center; }
.about-stat strong { display: block; font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; }
.about-stat strong.blue { color: var(--accent); }
.about-stat span { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.about-copy { display: flex; flex-direction: column; gap: 1.5rem; }
.about-copy h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.about-copy p { color: var(--text-2); font-size: 1.05rem; line-height: 1.75; }
.about-timeline { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.timeline-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  transition: border-color 0.3s;
}
.timeline-item:hover { border-color: var(--border-glow); }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-gradient); flex-shrink: 0; margin-top: 5px;
}
.timeline-text strong { display: block; font-size: 0.9rem; font-weight: 600; }
.timeline-text span { font-size: 0.8rem; color: var(--text-3); }

/* =====================================================
   PROJECTS
   ===================================================== */
.projects { padding: 6rem 0; background: var(--bg-2); }
.projects-header { text-align: center; margin-bottom: 4rem; }
.projects-header h2 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.04em; }
.projects-header p { color: var(--text-2); margin-top: 1rem; font-size: 1.1rem; max-width: 600px; margin-inline: auto; }

/* Featured Project (big) */
.project-featured {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 0;
  border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 2rem;
  background: var(--bg-3);
  transition: all 0.4s var(--ease-smooth);
}
.project-featured:hover { border-color: var(--border-glow); box-shadow: 0 40px 100px rgba(0,0,0,0.4); transform: translateY(-4px); }
.project-featured.reverse { grid-template-columns: 1fr 1.3fr; direction: rtl; }
.project-featured.reverse > * { direction: ltr; }
.project-img-big { overflow: hidden; max-height: 480px; }
.project-img-big img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-smooth); }
.project-featured:hover .project-img-big img { transform: scale(1.04); }
.project-info {
  padding: 3rem;
  display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
}
.project-tag {
  display: inline-block; padding: 0.3rem 0.9rem; border-radius: 20px;
  background: rgba(0,113,227,0.1); border: 1px solid rgba(0,113,227,0.3);
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  align-self: flex-start;
}
.project-info h3 { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.project-info p { color: var(--text-2); font-size: 0.95rem; line-height: 1.75; }
.project-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.project-meta-item { display: flex; flex-direction: column; gap: 0.25rem; }
.project-meta-item label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.project-meta-item span { font-size: 0.9rem; font-weight: 600; }
.project-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--accent); font-weight: 600; font-size: 0.9rem;
  transition: gap 0.2s; align-self: flex-start;
}
.project-link:hover { gap: 0.8rem; }

/* Small project cards grid */
.projects-grid-small {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem;
  margin-top: 2rem;
}
.project-card-sm {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-3);
  transition: all 0.4s var(--ease-smooth);
  cursor: pointer;
}
.project-card-sm:hover { transform: translateY(-6px) scale(1.01); border-color: var(--border-glow); box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.project-card-sm-img { overflow: hidden; height: 200px; }
.project-card-sm-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-smooth); }
.project-card-sm:hover .project-card-sm-img img { transform: scale(1.06); }
.project-card-sm-body { padding: 1.5rem; }
.project-card-sm-body h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.project-card-sm-body p { font-size: 0.85rem; color: var(--text-2); }

/* =====================================================
   E-LEARNING SHOWCASE
   ===================================================== */
.elearning { padding: 8rem 0; }
.elearning-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center;
}
.elearning-copy { display: flex; flex-direction: column; gap: 1.5rem; }
.elearning-copy h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.elearning-copy p { color: var(--text-2); font-size: 1.05rem; line-height: 1.75; }
.elearning-bullets { display: flex; flex-direction: column; gap: 0.75rem; }
.elearning-bullet {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.95rem; color: var(--text-2);
}
.elearning-bullet::before {
  content: ''; display: block;
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-gradient);
}
.elearning-mockup {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.elearning-mockup img {
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
  transition: transform 0.4s var(--ease-smooth);
}
.elearning-mockup:hover img { transform: scale(1.02) translateY(-5px); }
.elearning-cta-badge {
  position: absolute; bottom: -1.5rem; right: -1rem;
  background: var(--accent-gradient); padding: 1rem 1.5rem;
  border-radius: var(--radius-md); display: flex; flex-direction: column;
  box-shadow: 0 20px 40px var(--glow-blue);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.elearning-cta-badge strong { color: #fff; font-size: 0.9rem; }
.elearning-cta-badge span { color: rgba(255,255,255,0.7); font-size: 0.75rem; }

/* =====================================================
   SKILLS
   ===================================================== */
.skills { padding: 8rem 0; background: var(--bg-2); }
.skills-header { text-align: center; margin-bottom: 4rem; }
.skills-header h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; }
.skills-category { margin-bottom: 3rem; }
.skills-cat-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.skill-items { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.skill-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1.2rem; border-radius: 30px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: 0.9rem; font-weight: 500;
  transition: all 0.3s var(--ease-smooth);
}
.skill-item:hover { border-color: var(--border-glow); background: rgba(255,255,255,0.07); transform: translateY(-2px); }
.skill-item .ms { font-size: 1rem; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* AI skills get a glow treatment */
.skill-item.ai {
  border-color: rgba(255,55,95,0.3);
  background: rgba(255,55,95,0.06);
}
.skill-item.ai:hover { border-color: rgba(255,55,95,0.6); box-shadow: 0 0 20px rgba(255,55,95,0.2); }
.skill-item-pct {
  font-size: 0.75rem; font-weight: 700;
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* =====================================================
   PARALLAX SECTIONS
   ===================================================== */
.parallax-banner {
  height: 55vh; min-height: 400px;
  background-attachment: fixed;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.parallax-banner::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(1px);
}
.parallax-banner-content {
  position: relative; z-index: 1; text-align: center; padding: 2rem;
}
.parallax-banner-content h2 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; }
.parallax-banner-content p { color: #e0e0e0; margin-top: 0.75rem; font-size: 1.1rem; }

.pb-fce    { background-image: url('https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=2000&q=90'); }
.pb-ai     { background-image: url('https://images.unsplash.com/photo-1620712943543-bcc4688e7485?auto=format&fit=crop&w=2000&q=90'); }
.pb-design { background-image: url('https://images.unsplash.com/photo-1561070791-2526d30994b5?auto=format&fit=crop&w=2000&q=90'); }

/* =====================================================
   TRUSTED BY MARQUEE
   ===================================================== */
.trusted { padding: 4rem 0; overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trusted-label { text-align: center; margin-bottom: 2rem; }
.marquee-track {
  display: flex; gap: 4rem; align-items: center;
  animation: marquee 25s linear infinite;
  width: max-content;
}
.marquee-track img {
  height: 36px; width: auto;
  filter: grayscale(100%) brightness(0.5);
  transition: filter 0.3s;
  flex-shrink: 0;
}
.marquee-track img:hover { filter: grayscale(0%) brightness(1); }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* =====================================================
   CONTACT
   ===================================================== */
.contact { padding: 8rem 0; text-align: center; position: relative; overflow: hidden; }
.contact-glow {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(0,113,227,0.12) 0%, transparent 60%);
}
.contact-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.contact-inner h2 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1.0; margin-bottom: 1.5rem; }
.contact-inner p { color: var(--text-2); font-size: 1.1rem; margin-bottom: 3rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.contact-form input, .contact-form textarea {
  padding: 1rem 1.5rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 1rem;
  outline: none; transition: border-color 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--border-glow); }
.contact-form textarea { resize: none; height: 120px; }
.contact-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.contact-social { display: flex; gap: 1rem; margin-top: 2rem; justify-content: center; }
.contact-social a {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-card);
  transition: all 0.3s;
}
.contact-social a:hover { border-color: var(--border-glow); background: rgba(255,255,255,0.08); transform: translateY(-3px); }

/* =====================================================
   FOOTER
   ===================================================== */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
}
footer strong { color: var(--text-2); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .about-inner, .elearning-inner { grid-template-columns: 1fr; gap: 3rem; }
  .about-photo { max-width: 500px; margin: 0 auto; }
  .project-featured, .project-featured.reverse { grid-template-columns: 1fr; direction: ltr; }
  .project-img-big { max-height: 300px; }
  .pillars-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .projects-grid-small { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2.5rem, 10vw, 4rem); }
}
