/* Normal cursor (boat cursor removed) */
html,
body,
body * {
  cursor: auto;
}

/* Pointer cursor on clickable elements */
a,
button,
[role="button"],
[type="button"],
[type="submit"],
[type="reset"],
input[type="checkbox"],
input[type="radio"],
select,
label[for],
.cursor-pointer {
  cursor: pointer;
}

/* Header: remove the right-most colored "Contact me" button (keep the Contact nav link) */
header nav a.bg-primary,
header nav .bg-primary {
  display: none !important;
}

/* Home page Projects section: two cards side by side with good spacing */
.home-projects-two-cards {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 2rem 2.5rem !important;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .home-projects-two-cards {
    gap: 2.5rem 3rem !important;
  }
}
@media (max-width: 767px) {
  .home-projects-two-cards {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Home page Projects section: three cards horizontal, same style */
.home-projects-three-cards {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2rem 2.5rem !important;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .home-projects-three-cards {
    gap: 2.5rem 3rem !important;
  }
}
@media (max-width: 1023px) {
  .home-projects-three-cards {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 767px) {
  .home-projects-three-cards {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* ----- Dark mode: ensure all text and UI use theme colors ----- */
html {
  color-scheme: light;
}
html.dark {
  color-scheme: dark;
}

body,
#root {
  color: hsl(var(--foreground));
}

/* Override any hardcoded light text in dark mode so content stays readable */
.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6,
.dark p,
.dark span:not([class*="text-"]),
.dark li,
.dark label {
  color: hsl(var(--foreground));
}

.dark .text-white {
  color: hsl(var(--foreground)) !important;
}

.dark .text-white\/80 {
  color: hsl(var(--foreground) / 0.9) !important;
}

/* Muted text in dark mode */
.dark .text-muted-foreground {
  color: hsl(var(--muted-foreground)) !important;
}

/* ----- Top controls: translate + dark mode ----- */
.top-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.translate-wrap {
  position: relative;
}

.translate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.75rem;
  padding: 0 0.85rem;
  border: none;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 8px hsl(var(--foreground) / 0.1);
  transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.translate-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  transform: scale(1.02);
  box-shadow: 0 4px 12px hsl(var(--accent) / 0.3);
}

.translate-btn:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.translate-btn-label {
  display: none;
}

@media (min-width: 480px) {
  .translate-btn-label {
    display: inline;
  }
}

/* Translate dropdown */
.translate-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.5rem;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  box-shadow: 0 10px 40px hsl(var(--foreground) / 0.12), 0 0 0 1px hsl(var(--border) / 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.dark .translate-dropdown {
  box-shadow: 0 10px 40px hsl(0 0% 0% / 0.4), 0 0 0 1px hsl(var(--border));
}

.translate-dropdown-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.translate-dropdown-header {
  padding: 0.5rem 0.75rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

.translate-local-note {
  display: none;
  padding: 0.4rem 0.75rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.3;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
}

.translate-option {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.translate-option:hover {
  background: hsl(var(--accent) / 0.15);
  color: hsl(var(--accent));
}

.translate-option:focus {
  outline: none;
  background: hsl(var(--accent) / 0.2);
}

/* Dark mode toggle (inside .top-controls) */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  box-shadow: 0 2px 8px hsl(var(--foreground) / 0.1);
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.theme-toggle-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  transform: scale(1.05);
}

.theme-toggle-btn:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.theme-toggle-btn .theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn .theme-icon.hidden {
  display: none !important;
}

/* ----- Dark mode: keep end/footer in same light colors as white mode ----- */
.dark footer,
.dark [class*="footer"] {
  background-color: hsl(200 20% 98%) !important;
  color: hsl(210 50% 15%) !important;
  border-color: hsl(200 20% 88%);
}

.dark footer *,
.dark [class*="footer"] * {
  color: hsl(210 50% 15%) !important;
}

.dark footer .text-muted-foreground,
.dark [class*="footer"] .text-muted-foreground {
  color: hsl(210 20% 45%) !important;
}

.dark footer a:hover,
.dark [class*="footer"] a:hover {
  color: hsl(195 65% 35%) !important;
}

/* Dark mode hover effects for all navigation links */
.dark nav a,
.dark header a,
.dark [role="menuitem"] {
  transition: color 0.2s ease;
}

.dark nav a:hover,
.dark header a:hover,
.dark [role="menuitem"]:hover {
  color: hsl(var(--primary)) !important;
}

/* Dark mode hover for buttons */
.dark button:hover,
.dark [role="button"]:hover {
  color: hsl(var(--primary-foreground)) !important;
}

/* Dark mode hover for value cards text */
.dark .value-card h3 {
  transition: color 0.3s ease;
}

.dark .value-card:hover h3 {
  color: hsl(var(--primary)) !important;
}

/* Footer logo: blue tint in dark mode (works on img) */
.dark footer img[src*="logo"],
.dark footer img:first-of-type,
.dark [class*="footer"] img[src*="logo"],
.dark [class*="footer"] img:first-of-type {
  filter: brightness(0) saturate(100%) invert(27%) sepia(98%) saturate(2000%) hue-rotate(210deg);
}

/* ----- Smooth page transition ----- */
body {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== About page scoped styles (do not override global) ========== */
.about-container {
  /* Uses existing container/space from design system */
}

/* Clear fixed header: extra top spacing so first topic is not covered */
.about-hero-section {
  padding-top: 7.5rem; /* Slightly more than pt-24 so "Sobre mí" sits below header */
}

/* ----- About hero: two-column layout ----- */
.about-hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: stretch;
}
@media (min-width: 768px) {
  .about-hero {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }
  .about-hero__passage { flex: 1; min-width: 0; }
  .about-hero__slideshow { flex: 1; min-width: 0; }
}

.about-hero__passage {
  color: hsl(var(--foreground));
}
.about-hero__passage .text-gradient {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-image: var(--ocean-gradient);
}

/* ----- Slideshow: track and slides ----- */
.about-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--muted));
  box-shadow: var(--shadow-soft);
}
.about-slideshow__track {
  position: relative;
  width: 100%;
  height: 100%;
}
.about-slideshow__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.about-slideshow__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.about-slideshow__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0) scale(1);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  box-shadow: 0 10px 40px hsl(var(--foreground) / 0.12);
}
.about-slideshow:hover .about-slideshow__img {
  transform: translateZ(0) scale(1.05);
  box-shadow: 0 20px 50px hsl(var(--primary) / 0.2);
}
@keyframes about-float {
  0%, 100% { transform: translateZ(0) translateY(0); }
  50% { transform: translateZ(0) translateY(-8px); }
}
.about-slideshow__slide.is-active .about-slideshow__img {
  animation: about-float 6s ease-in-out infinite;
}
.about-slideshow__slide.is-active:hover .about-slideshow__img {
  animation: none;
}

/* ----- Slideshow arrows ----- */
.about-slideshow__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  opacity: 0.9;
  font-size: 1.5rem;
  line-height: 1;
  transform: translateY(-50%) translateZ(0);
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.about-slideshow__arrow:hover {
  opacity: 1;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  transform: translateY(-50%) translateZ(0) scale(1.05);
}
.about-slideshow__arrow--prev { left: 0.75rem; }
.about-slideshow__arrow--next { right: 0.75rem; }

/* ----- Slideshow dots ----- */
.about-slideshow__dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  transform: translateX(-50%) translateZ(0);
}
.about-slideshow__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: none;
  background: hsl(var(--muted-foreground) / 0.5);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.about-slideshow__dot:hover {
  background: hsl(var(--muted-foreground));
  opacity: 1;
}
.about-slideshow__dot.is-active {
  background: hsl(var(--primary));
  transform: scale(1.2);
}

/* ----- Mission block: staggered reveal + hover ----- */
.about-mission {
  /* Uses existing grid/card from design system */
}
.about-mission__card {
  opacity: 0;
  transform: translateY(24px) translateZ(0);
  animation: about-reveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.about-mission .grid:nth-of-type(1) .about-mission__card:nth-child(1) { animation-delay: 0.1s; }
.about-mission .grid:nth-of-type(1) .about-mission__card:nth-child(2) { animation-delay: 0.25s; }
.about-mission .grid:nth-of-type(2) .about-mission__card:nth-child(1) { animation-delay: 0.4s; }
.about-mission .grid:nth-of-type(2) .about-mission__card:nth-child(2) { animation-delay: 0.55s; }
@keyframes about-reveal {
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}
.about-mission .about-image {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-soft);
}
.about-mission .about-image:hover {
  transform: scale(1.05) translateZ(0);
  box-shadow: var(--shadow-elevated);
}
@keyframes about-mission-float {
  0%, 100% { transform: translateY(0) translateZ(0); }
  50% { transform: translateY(-6px) translateZ(0); }
}
.about-mission .about-image {
  animation: about-mission-float 5s ease-in-out infinite;
}
.about-mission .about-image:hover {
  animation: none;
}
