/* ClickTI remaster layer — preserve the template while improving polish and responsiveness. */
:root {
  --clickti-accent: #e84a64;
  --clickti-accent-bright: #ff7043;
  --clickti-cyan: #54d8e5;
  --clickti-bg: #0b0e14;
  --clickti-panel: #151a23;
  --clickti-border: rgba(255,255,255,.11);
  --clickti-muted: #b4bdc9;
  --clickti-radius: 18px;
}

html { scroll-behavior: smooth; }
body.dark { background: var(--clickti-bg); }
body.dark p { color: #d4dae3; }
body.dark .section { background-color: #10141c; }

/* Video hero: local poster fallback, correct video crop and clear visual layers. */
body.video .home-section .home-content {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #080b12 url('../images/optimized/video-portada-poster.webp') center center / cover no-repeat;
}
body.video #videobg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  transform: none;
  pointer-events: none;
}
body.video .home-section .home-content::before {
  display: block;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7,10,17,.82) 0%, rgba(7,10,17,.55) 52%, rgba(7,10,17,.72) 100%),
              linear-gradient(0deg, rgba(7,10,17,.36), rgba(7,10,17,.12));
  pointer-events: none;
}
body.video .home-section .home-content > .container {
  position: relative;
  z-index: 2;
}
body.video .home-section .home-contact { z-index: 3; }
body.video .right-dotted-shape { z-index: 2; pointer-events: none; opacity: .48; }

/* Typography and hero hierarchy. */
.home-section .hero-section { position: relative; z-index: 2; }
.home-section .hero-section h1.hero-title,
.home-section .hero-section h2 {
  font-size: clamp(3.2rem, 7.8vw, 7.8rem);
  line-height: .99;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.home-section .hero-section h1.hero-title span,
.home-section .hero-section h2 span { color: var(--clickti-accent); }
.home-section .hero-section p {
  max-width: 670px;
  margin: 26px auto 34px;
  color: #eef2f8;
  font-size: clamp(.95rem, 1.5vw, 1.12rem);
  line-height: 1.8;
  text-wrap: pretty;
}
.logo-container { margin-top: 8px; }
.logo-container .logo {
  max-width: 142px;
  width: min(22vw, 142px);
  height: auto;
  border-radius: 18px;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.25));
}

/* Navigation and actions: soft glass surface and stronger focus visibility. */
.navigation-trigger,
#navigation.is-fixed ul {
  border: 1px solid var(--clickti-border);
  background: rgba(14,18,27,.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.navigation-trigger { border-radius: 999px; padding: 12px 18px; }
#main-navigation a { transition: color .2s ease, background-color .2s ease; }
#main-navigation a:focus-visible,
.navigation-trigger:focus-visible,
.btn:focus-visible,
.open-gallery:focus-visible {
  outline: 3px solid var(--clickti-cyan) !important;
  outline-offset: 4px;
}
.btn.main-btn {
  border-radius: 999px;
  padding: 14px 28px;
  letter-spacing: .055em;
  background: linear-gradient(115deg, var(--clickti-accent), #c93655);
  box-shadow: 0 10px 26px rgba(232,74,100,.18) !important;
}
.btn.main-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(232,74,100,.29) !important; }

/* About area and information panels. */
.about-section .photo-brand {
  display: block;
  width: 100%;
  max-width: 450px;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: clamp(28px, 6vw, 70px);
  border: 1px solid var(--clickti-border) !important;
  border-radius: var(--clickti-radius);
  background: radial-gradient(circle at 50% 35%, rgba(232,74,100,.12), transparent 62%), #111620;
}
body.dark .about-section .resume-item,
body.dark .badges,
body.dark .contact-section .box,
body.dark .blog-section .post-content,
body.dark .meta {
  border: 1px solid var(--clickti-border);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.12);
}
.about-section .personal-info li p { line-height: 1.55; }
.login-security-note { color: var(--clickti-muted); font-size: 13px; margin-top: 18px; }

/* Portfolio: consistent image crops, robust card surfaces, accessible hover states. */
.work-section .grid__item { display: flex; }
.project-card {
  width: 100%;
  border: 1px solid var(--clickti-border);
  border-radius: var(--clickti-radius);
  background: linear-gradient(155deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}
.project-card .project-img {
  height: clamp(185px, 20vw, 245px);
  overflow: hidden;
  background: #0d1118;
  border-radius: calc(var(--clickti-radius) - 1px) calc(var(--clickti-radius) - 1px) 0 0;
}
.project-card .project-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.project-card .description { padding: 17px 18px 20px; }
.project-card .description h3 { margin-bottom: 7px; font-size: 1.1rem; line-height: 1.35; }
.project-card .description p { margin-bottom: 0; color: var(--clickti-muted); font-size: .9rem; line-height: 1.65; }
.project-card:hover { transform: translateY(-5px); border-color: rgba(232,74,100,.4); }
.project-card::before { height: 3px; }

/* Contact: consistent input treatment and clearer interaction feedback. */
.contact-section input[type="text"],
.contact-section input[type="email"],
.contact-section textarea {
  border: 1px solid var(--clickti-border);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-section input:focus,
.contact-section textarea:focus {
  outline: none;
  border-color: var(--clickti-accent);
  box-shadow: 0 0 0 3px rgba(232,74,100,.12);
}

/* Blog cards share the same visual system. */
.blog-section .post-content { overflow: hidden; }
.blog-section img { max-width: 100%; }
.blog-section .entry-header a:hover,
.blog-section .link-blog:hover { color: var(--clickti-accent) !important; }

@media (max-width: 767px) {
  body.video .home-section .home-content {
    background-position: center center;
  }
  body.video #videobg { display: none !important; }
  body.video .home-section .home-content::before {
    display: block !important;
    background: linear-gradient(180deg, rgba(7,10,17,.48), rgba(7,10,17,.78));
  }
  .home-section .hero-section h1.hero-title,
  .home-section .hero-section h2 {
    font-size: clamp(2.8rem, 11vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -.035em;
  }
  .home-section .hero-section p { margin: 20px auto 26px; padding: 0 8px; line-height: 1.65; }
  .logo-container .logo { width: 104px; max-width: 104px; border-radius: 14px; }
  .project-card .project-img { height: 205px; }
  .work-section .grid__item { margin-bottom: 16px !important; }
  .about-section .photo-brand { max-width: 340px; margin: 0 auto 28px; aspect-ratio: 1 / 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  body.video #videobg { display: none !important; }
}
