/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --bg-color: #0d0d0d;
  --card-bg: #161616;
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --accent: #ffc500;
  --accent-soft: rgba(255, 197, 0, 0.1);
  --accent-color: #ffc500;
  --font-main: "Outfit", sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(255, 197, 0, 0.02) 0%,
      transparent 25%
    );
}

/* =========================================
   2. GLOBAL LAYOUT & UTILITIES
   ========================================= */
.main-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 1200px;
}

.bento-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #fff, #aaa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover:not(.stack-card):not(.lang-card) {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* =========================================
   3. PROFILE SECTION (Hero)
   ========================================= */
.profile-card {
  padding: 0;
  display: flex;
  min-height: unset;
  overflow: hidden;
}

.profile-split-layout {
  display: flex;
  width: 100%;
}

.profile-image-container {
  width: 30%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.hero-img-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.profile-info {
  flex-grow: 1;
  padding: 24px 28px 24px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.profile-top-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 5px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #2ecc71;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #2ecc71;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.profile-text-block h1 {
  font-size: 1.8rem;
  margin: 0 0 5px 0;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  overflow-wrap: break-word;
}

.gradient-text {
  font-size: 1.2rem;
  margin-bottom: 15px;
  font-weight: 600;
  display: inline-block;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-text-block p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 95%;
  margin-bottom: 75px;
}

/* Inspirational Quotes */
.quotes-container {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border-left: 3px solid var(--accent-color);
  backdrop-filter: blur(5px);
  width: 100%;
}

.quote-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quote-icon {
  color: var(--accent-color);
  font-size: 0.9rem;
  opacity: 0.7;
}

.quote-item p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.typing-quote {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 1.2s ease-out forwards;
  animation-delay: 0.2s;
}

.fade-quote {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 1.2s ease-out forwards;
  animation-delay: 0.6s;
}

/* =========================================
   4. LANGUAGES & CONTACT CARD
   ========================================= */
.lang-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  padding: 0;
}

.ios-folder {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 14px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.lang-app {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #333;
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  font-size: 0.9rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

#btn-es {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("https://portfolio-items-karlos.s3.eu-south-2.amazonaws.com/assets/imgs/ES.webp");
}
#btn-ca {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("https://portfolio-items-karlos.s3.eu-south-2.amazonaws.com/assets/imgs/CAT.webp");
}
#btn-en {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("https://portfolio-items-karlos.s3.eu-south-2.amazonaws.com/assets/imgs/EN.webp");
}

.lang-app:hover {
  filter: brightness(1.2);
  border-color: rgba(255, 255, 255, 0.8);
}
.lang-app.active {
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-soft);
  color: #fff;
}

.divider-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 5px 0;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  justify-content: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.icon-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
  color: #fff;
}

.contact-item.whatsapp .icon-box {
  background: #25d366;
}
.contact-item.linkedin .icon-box {
  background: #0077b5;
}
.contact-item.email .icon-box {
  background: #555;
}
.contact-item.cv .icon-box {
  background: #9b59b6;
}
.contact-item.projects .icon-box {
  background: #3498db;
}

.contact-text {
  font-size: 0.9rem;
  color: #ddd;
  font-weight: 500;
}

/* =========================================
   5. ABOUT SECTION
   ========================================= */
.about-card {
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.05),
    rgba(46, 204, 113, 0.05)
  );
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.about-card h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: #fff;
}

.about-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.highlight {
  color: #3498db;
  font-weight: 600;
}
.highlight-green {
  color: #2ecc71;
  font-weight: 600;
}
.highlight-orange {
  color: #e67e22;
  font-weight: 600;
}
.highlight-purple {
  color: #9b59b6;
  font-weight: 600;
}

/* =========================================
   6. TECH STACK (Skills)
   ========================================= */
.stack-card {
  background: var(--card-bg);
}

.stack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.stack-card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.bento-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.3s;
}

.tab.active {
  background: var(--card-bg);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.panels-container {
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
}

.panel {
  grid-area: 1 / 1 / 2 / 2;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.panel.active-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  justify-content: center;
  padding: 10px 0;
  max-width: 800px;
  margin: 0 auto;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 95px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-item i {
  font-size: 3rem;
  margin-bottom: 5px;
  transition: all 0.3s;
}

/* Brand Colors */
.tech-item:nth-child(1) i {
  color: #e34c26;
} /* HTML5 */
.tech-item:nth-child(2) i {
  color: #264de4;
} /* CSS3 */
.tech-item:nth-child(3) i {
  color: #f0db4f;
} /* JS */
.tech-item:nth-child(4) i {
  color: #61dafb;
} /* React */
.tech-item:nth-child(5) i {
  color: #f24e1e;
} /* Figma */
.tech-item:nth-child(6) i {
  color: #21759b;
} /* WordPress */
.tech-item:nth-child(7) i {
  color: #ff9900;
} /* AWS */
.tech-item:nth-child(8) i {
  color: #fcc624;
} /* Linux */
.tech-item:nth-child(9) i {
  color: #3776ab;
} /* Python */
.tech-item:nth-child(10) i {
  color: #339933;
} /* Node.js */
.tech-item:nth-child(11) i {
  color: #777bb4;
} /* PHP */
.tech-item:nth-child(12) i {
  color: #f05032;
} /* Git */
.tech-item:nth-child(13) i {
  color: #ffffff;
} /* GitHub */
.tech-item:nth-child(14) i {
  color: #007acc;
} /* VSCode */

.tech-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tech-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-6px) scale(1.05);
}

/* Soft Skills */
.soft-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.soft-list li {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.soft-list li:hover {
  border-color: rgba(52, 152, 219, 0.5);
  background: rgba(52, 152, 219, 0.1);
  transform: translateY(-2px);
  color: #fff;
}

/* =========================================
   7. PROJECTS SECTION
   ========================================= */
.projects-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card-v2 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
}

.p-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  filter: brightness(0.7) contrast(1.1) saturate(1.1);
  image-rendering: -webkit-optimize-contrast;
}

.p-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 32px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card-v2:hover .p-overlay {
  transform: translateY(0);
  opacity: 1;
}

.project-card-v2:hover .p-bg {
  transform: scale(1.08);
  filter: brightness(0.2) contrast(1.2);
}

.p-overlay h3 {
  font-size: 1.8rem;
  color: #fff;
  margin: 0;
}
.p-overlay p {
  color: #ccc;
  font-size: 1rem;
  margin-bottom: 16px;
}

.p-link-btn {
  align-self: flex-start;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-link-btn:hover {
  background: #fff;
  color: #000;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #aaa;
}

.project-icon-wrapper {
  margin-bottom: 20px;
}
.project-icon-large {
  font-size: 3rem;
  color: #2ecc71;
}

/* =========================================
   8. FOOTER
   ========================================= */
.main-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.footer-social:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}

/* =========================================
   9. MEDIA QUERIES (Responsiveness)
   ========================================= */

/* Desktop Bento Layout */
@media (min-width: 900px) {
  .bento-container {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
  }
  .profile-card {
    grid-column: span 2;
  }
  .lang-card {
    grid-column: span 1;
  }
  .about-card {
    grid-column: span 3;
  }
  .stack-card {
    grid-column: span 3;
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .profile-split-layout {
    flex-direction: column;
  }
  .profile-image-container {
    width: 100%;
    height: 300px;
  }
  .hero-img-full {
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    object-position: center 20%;
  }
  .profile-info {
    padding: 20px;
  }
  .profile-text-block h1 {
    font-size: 2rem;
  }
  .status-badge {
    align-self: flex-start;
  }

  /* Tech Stack Mobile Fix */
  .stack-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .tech-item {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
  }
  .tech-item i {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }
  .tech-item span {
    font-size: 0.6rem;
    display: none;
  }

  /* Soft Skills Mobile Fix */
  .soft-list {
    gap: 6px;
  }
  .soft-list li {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Project Card Mobile Fix */
  .p-overlay {
    padding: 16px;
  }
  .p-overlay h3 {
    font-size: 1.3rem;
  }
  .project-icon-wrapper {
    margin-bottom: 8px;
  }
  .project-icon-large {
    font-size: 1.8rem;
  }
  .p-link-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
@keyframes blink {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--accent-color);
  }
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
