* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

body {
  background: radial-gradient(circle at 20% 20%, #1a1a1a, #0e0e0e 60%);
  color: #fff;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ---------- Header ---------- */

header {
  position: fixed;
  top: 0;
  width: 100%;
  background: transparent;
  padding: 30px 80px;
  z-index: 1000;
  transition: all 0.4s ease;
}

header.shrink {
  padding: 18px 80px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

header.hide {
  transform: translateY(-100%);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 45px;
}

nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 1px;
  transition: 0.3s ease;
  position: relative;
}

nav a:hover {
  color: #888;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 1px;
  background: #fff;
  transition: 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 2px;
  transition: 0.3s ease;
}

header.shrink .logo {
  font-size: 20px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10%;
}

#particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 80px;
}

.hero-text {
  flex: 1;
}

.hero-text h1,
.hero-text h2,
.hero-text p,
.hero-btn,
.hero-image img {
  opacity: 0;
  transform: translateY(30px);
}

.hero-text h1 {
  font-size: 60px;
  font-weight: 700;
  animation: heroReveal 0.9s ease forwards;
  animation-delay: 0.2s;
}

.hero-text h2 {
  font-weight: 300;
  margin-top: 10px;
  animation: heroReveal 0.9s ease forwards;
  animation-delay: 0.4s;
}

.hero-text p {
  margin-top: 20px;
  max-width: 500px;
  color: #aaa;
  animation: heroReveal 0.9s ease forwards;
  animation-delay: 0.6s;
}

.hero-btn {
  animation: heroReveal 0.9s ease forwards;
  animation-delay: 0.8s;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-image img {
  width: 340px;
  height: 340px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 40px rgba(255,255,255,0.1);
  transition: 0.4s ease;
  animation: heroImage 1.2s ease forwards;
  animation-delay: 0.5s;
}

.hero-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px rgba(255,255,255,0.25);
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroImage {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  border: 1px solid #fff;
  text-decoration: none;
  color: #fff;
  transition: 0.3s;
}

.btn:hover {
  background: #fff;
  color: #000;
}

.hero-btns {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-btns .btn {
  margin-top: 0;
}

.btn-outline {
  background: #fff;
  color: #000;
}

.btn-outline:hover {
  background: transparent;
  color: #fff;
}

/* ---------- Botón "Ver CV" en el header ---------- */

.cv-nav-btn {
  padding: 8px 22px;
  border: 1px solid #fff;
  border-radius: 50px;
}

.cv-nav-btn::after {
  display: none;
}

.cv-nav-btn:hover {
  background: #fff;
  color: #000;
}

/* ---------- Generic section ---------- */

.section {
  padding: 120px 10%;
}

/* ---------- About ---------- */

.about-section {
  padding: 120px 10%;
}

.about-content {
  display: flex;
  gap: 80px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.about-text {
  flex: 0 1 60%;
}

.about-title {
  font-size: 60px;
  font-weight: 700;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
  letter-spacing: -1px;
}

.about-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -15px;
  width: 60px;
  height: 2px;
  background: #fff;
  transition: 0.4s ease;
}

.about-section:hover .about-title::after {
  width: 120px;
}

.about-text p {
  font-size: 18px;
  line-height: 1.8;
  color: #ccc;
}

.about-info {
  flex: 0 1 35%;
  font-size: 16px;
  color: #aaa;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: flex-start;
}

.about-info p strong {
  color: #fff;
}

.reveal-text span,
.about-info span {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease;
}

.reveal-text span.show,
.about-info span.show {
  opacity: 1;
  transform: translateY(0);
}

.counter {
  display: inline !important;
  transform: none !important;
  opacity: 1 !important;
}

@media (max-width: 900px) {
  .about-content {
    flex-direction: column;
    gap: 40px;
  }

  .about-title {
    font-size: 42px;
  }

  .about-text p {
    font-size: 16px;
  }

  .about-info {
    font-size: 15px;
  }
}

/* ---------- Process ---------- */

.process {
  padding: 120px 10%;
  text-align: center;
}

.process-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-top: 60px;
}

.process-grid::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 0;
}

.step {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(40px);
  transition: 0.6s ease;
}

.step.show {
  opacity: 1;
  transform: translateY(0);
}

.step:hover {
  transform: translateY(-10px);
}

.icon {
  width: 60px;
  height: 60px;
  background: #fff;
  color: #111;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 24px;
  transition: 0.3s;
}

.step:hover .icon {
  transform: scale(1.15);
  background: #000;
  color: #fff;
  border-color: #fff;
}

.step p {
  color: #aaa;
  font-size: 15px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .process-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }
  .process-grid::before {
    display: none;
  }
}

/* ---------- Tools ---------- */

.tools {
  padding: 120px 10%;
  text-align: center;
}

.tools-groups {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: left;
}

.tools-group {
  position: relative;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 30px 24px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  transition: 0.35s ease;
}

.tools-group::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0.3);
  transform-origin: left;
  opacity: 0.6;
  transition: 0.4s ease;
}

.tools-group::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: 0.4s ease;
  pointer-events: none;
}

.tools-group[data-accent="design"]   { --accent: #ff6b6b; --accent-soft: rgba(255,107,107,0.18); }
.tools-group[data-accent="motion"]   { --accent: #a78bfa; --accent-soft: rgba(167,139,250,0.18); }
.tools-group[data-accent="3d"]       { --accent: #fbbf24; --accent-soft: rgba(251,191,36,0.18); }
.tools-group[data-accent="web"]      { --accent: #4ade80; --accent-soft: rgba(74,222,128,0.18); }

.tools-group:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.3);
}

.tools-group:hover::before {
  transform: scaleX(1);
  opacity: 1;
}

.tools-group:hover::after {
  opacity: 1;
}

.tools-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 12px;
  z-index: 1;
}

.tools-group-emoji {
  font-size: 16px;
  filter: grayscale(0.2);
}

.tools-group-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
  opacity: 0.7;
}

.tools-body {
  position: relative;
}

.tools-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.tools-group:hover .tools-grid {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(3px);
  pointer-events: none;
}

/* ---------- Tools: descripción al hover ---------- */

.tools-group-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.tools-group:hover .tools-group-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tools-group-overlay p {
  font-size: 14px;
  line-height: 1.7;
  color: #ddd;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.tool {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  font-weight: 500;
  font-size: 14px;
  color: #ddd;
  transition: 0.25s ease;
}

.tools-group:hover .tool {
  color: #fff;
}

.tool img,
.tool-monogram {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: 0.3s ease;
}

.tool:hover img,
.tool:hover .tool-monogram {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.06);
}

.tool-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

@media (max-width: 900px) {
  .tools-groups {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .tools-groups {
    grid-template-columns: 1fr;
  }
}

/* ---------- Projects / cards ---------- */

#projects {
  position: relative;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 60px;
}

.card {
  position: relative;
  height: 380px;
  overflow: hidden;
  border-radius: 16px;
  background: #151515;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  cursor: pointer;

  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.card.show {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.6s ease;
  display: block;
}

.card:hover img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.92) 10%,
    rgba(0,0,0,0.2) 60%,
    transparent 100%
  );
  opacity: 0;
  transition: 0.5s ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.category {
  font-size: 12px;
  letter-spacing: 2px;
  color: #ccc;
}

.card-overlay h3 {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.2;
  max-width: 90%;
}

.card-overlay p {
  font-size: 14px;
  margin: 10px 0 20px;
  color: #ccc;
}

.card-btn {
  margin-top: 10px;
  width: fit-content;
  text-decoration: none;
  color: #fff;
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.05);
  transition: 0.3s ease;
}

.card-btn:hover {
  background: #fff;
  color: #000;
}

.projects-note {
  margin-top: 30px;
  font-size: 13px;
  color: #777;
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- Behance ---------- */

.behance-section {
  text-align: center;
  padding: 160px 10%;
}

.behance-content {
  max-width: 700px;
  margin: auto;
}

.behance-section h2 {
  font-size: 48px;
  margin-bottom: 20px;
}

.behance-text {
  color: #aaa;
  margin-bottom: 40px;
  font-size: 18px;
}

.behance-btn {
  display: inline-block;
  padding: 14px 32px;
  border: 1px solid #fff;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  transition: 0.3s ease;
}

.behance-btn:hover {
  background: #fff;
  color: #000;
}

/* ---------- Contact ---------- */

.contact-section {
  padding-bottom: 150px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}

.contact-intro h2 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  margin: 24px 0 20px;
  letter-spacing: -1px;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.08);
  border-radius: 50px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9ef0b8;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
  animation: availabilityPulse 2s infinite;
}

@keyframes availabilityPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.contact-subtitle {
  color: #aaa;
  font-size: 17px;
  line-height: 1.6;
  max-width: 420px;
}

.contact-behance-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 4px;
  transition: 0.3s ease;
}

.contact-behance-link .arrow {
  transition: transform 0.3s ease;
}

.contact-behance-link:hover {
  border-color: #fff;
  color: #fff;
}

.contact-behance-link:hover .arrow {
  transform: translateX(4px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 40px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.02);
}

.form-row {
  display: flex;
  gap: 26px;
}

.form-field {
  position: relative;
  flex: 1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 4px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 15px;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  transition: border-color 0.3s ease;
}

.contact-form textarea {
  resize: none;
  height: 110px;
  padding-top: 22px;
}

.contact-form label {
  position: absolute;
  left: 4px;
  top: 14px;
  color: #888;
  font-size: 15px;
  pointer-events: none;
  transition: 0.25s ease;
}

.contact-form textarea + label {
  top: 22px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-bottom-color: #fff;
}

.contact-form input:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:focus + label,
.contact-form textarea:not(:placeholder-shown) + label {
  top: -14px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ccc;
}

.form-btn {
  align-self: flex-start;
  padding: 14px 34px;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.3s ease;
}

.form-btn:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 8px 24px rgba(255,255,255,0.15);
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .contact-intro h2 {
    font-size: 38px;
  }

  .contact-form {
    padding: 28px 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 26px;
  }
}

/* ---------- Responsive: hero & header ---------- */

@media (max-width: 900px) {
  header {
    padding: 20px 30px;
  }

  header.shrink {
    padding: 14px 30px;
  }

  .hero {
    padding: 0 6%;
  }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
  }

  .hero-text h1 {
    font-size: 42px;
  }

  .hero-image img {
    width: 200px;
    height: 200px;
  }

  nav ul {
    gap: 20px;
  }

  .section,
  .about-section,
  .process,
  .tools,
  .behance-section {
    padding: 80px 6%;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- Scroll progress bar ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 2000;
  background: transparent;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fff, #999);
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
  transition: width 0.1s ease-out;
}

/* ---------- Custom cursor ---------- */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 3000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  transition: opacity 0.3s ease, transform 0.15s ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.5);
  transition: opacity 0.3s ease, transform 0.25s ease, width 0.3s ease, height 0.3s ease, background 0.3s ease;
}

body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring {
  opacity: 1;
}

.cursor-ring.cursor-hover {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.8);
}

.cursor-dot.cursor-hover {
  transform: translate(-50%, -50%) scale(0);
}

/* Hide custom cursor on touch devices, restore native cursor */
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  a, button, input, textarea {
    cursor: none;
  }
}

/* ---------- Page loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e0e0e;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-logo {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  opacity: 0;
  animation: loaderPulse 1.1s ease forwards;
}

@keyframes loaderPulse {
  0%   { opacity: 0; transform: scale(0.85); letter-spacing: 10px; }
  50%  { opacity: 1; transform: scale(1.05); letter-spacing: 4px; }
  100% { opacity: 1; transform: scale(1); letter-spacing: 4px; }
}

.loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.loading {
  overflow: hidden;
}

/* ---------- Magnetic buttons ---------- */

.btn,
.card-btn {
  transition: transform 0.25s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.25s ease;
  will-change: transform;
}
