/*
Theme Name: Christian Ostos
Theme URI: https://christianostos.com
Author: Christian Ostos
Author URI: https://christianostos.com
Description: Tema High-End con efectos visuales avanzados (Canvas, Tilt, Cursor).
Version: 2.1.0
Text Domain: christianostos
*/

:root {
  /* Premium Dark Palette */
  --bg-dark: #080c10;
  --bg-dark-acc: #0e141b;
  --primary: #0E3950;
  --gold: #ECAD20;

  --text-main: #f0f0f0;
  --text-muted: #8892b0;

  --glass: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --easing-smooth: cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 1. Global Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  cursor: none;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  margin: 0;
}

/* 2. Custom Cursor */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--gold);
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(236, 173, 32, 0.5);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-outline.cursor-hover {
  width: 70px;
  height: 70px;
  background-color: rgba(236, 173, 32, 0.1);
  border-color: transparent;
  backdrop-filter: blur(2px);
}

/* 3. Typography & Section Titles */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -1px;
  margin-top: 0;
}

h1.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.1;
  margin-bottom: 2rem;
  background: linear-gradient(to right, #ffffff, #b0b0b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1.hero-title .hero-name {
  color: var(--gold);
  display: inline-block;
  -webkit-text-fill-color: var(--gold);
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Unified Centered Title */
h2.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  display: table;
  /* Ensures margin auto works */
  margin-left: auto;
  margin-right: auto;
}

h2.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--gold);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Modifer for Left Aligned if specifically requested, but default is centered */
.section-title.text-left {
  text-align: left;
  margin-left: 0;
}

.section-title.text-left::after {
  margin-left: 0;
}

p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--easing-smooth);
}

/* 4. Canvas Hero */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #0f172a 0%, var(--bg-dark) 100%);
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 2rem;
}

.hero-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  /* Responsive wrap */
}

/* 5. Buttons - Modern Pill Style */
.btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.3s var(--easing-smooth);
  border: 1px solid transparent;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-dark);
  box-shadow: 0 10px 30px rgba(236, 173, 32, 0.3);
}

.btn-primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(236, 173, 32, 0.5);
  background: #ffc13b;
}

.btn-outline-white {
  background: transparent;
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-white:hover {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-5px);
}

/* 6. Filter Buttons - Redesigned */
.projects-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  /* Explicit for cursor tool */
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  color: var(--bg-dark);
  border-color: var(--gold);
  box-shadow: 0 5px 15px rgba(236, 173, 32, 0.3);
  transform: translateY(-2px);
}

/* 7. Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  /* Bigger cards */
  gap: 3rem;
  padding: 0;
}

.project-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  transform-style: preserve-3d;
  transform: perspective(1000px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.project-image {
  height: 250px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark-acc);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--easing-smooth);
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-content {
  padding: 2rem;
  transform: translateZ(20px);
}

.project-title {
  color: var(--text-main);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* 8. Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 2rem 0;
  z-index: 100;
  transition: all 0.4s var(--easing-smooth);
}

.site-header.scrolled {
  padding: 1rem 0;
  background: rgba(8, 12, 16, 0.85);
  /* Darker for readability */
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-main);
}

.site-logo span {
  color: var(--gold);
}

.site-nav {
  display: flex;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 2rem;
}

.site-nav a:hover {
  color: var(--gold);
}

.menu-toggle {
  display: none;
}

/* Hide on desktop */

/* 9. Container & Section Vars */
.section {
  padding: 2rem 0;
}

.section-bg-light {
  background-color: var(--bg-dark-acc);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* 10. Utils */
.text-center {
  text-align: center;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--easing-smooth);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

/* 11. Responsive Design */
@media (max-width: 768px) {
  .hero-content {
    padding: 0 1rem;
    margin-top: -5vh;
    /* Levantar un poco el contenido */
  }

  h1.hero-title {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 1rem;
  }

  h1.hero-title .hero-name {
    display: block;
    font-size: 1.1em;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    padding: 0;
  }

  h2.section-title {
    font-size: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    /* Stack on mobile */
  }

  .resume-grid {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }

  /* Mobile Nav (Simplified for now, needs JS for toggle in future or just stack) */
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .site-nav.active {
    transform: translateX(0);
  }

  /* Requires JS toggle logic if we want burger menu */
  /* For now, just hide standard nav on mobile and show simple stack or scroll overflow if needed. 
     Better approach for "Wow" factor: keep it clean. */
  .site-header {
    padding: 1rem 0;
  }

  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .site-nav {
    position: static;
    height: auto;
    transform: none;
    background: transparent;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-nav a {
    margin: 0 0.75rem;
    font-size: 0.8rem;
  }

  /* Desactivar cursor personalizado en móviles */
  *,
  *::before,
  *::after {
    cursor: auto !important;
  }

  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}

/* Contact Form Styles - High End */
.contact-form {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  /* Subtle border */
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px rgba(236, 173, 32, 0.15);
}

.form-control option {
  background-color: var(--bg-dark);
  color: var(--text-main);
  padding: 1rem;
}

/* Custom Checkbox */
.checkbox-group {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px !important;
  /* Larger hit area */
  height: 24px !important;
  border: 2px solid rgba(255, 255, 255, 0.5);
  /* Stronger border */
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.05);
  /* Slight fill */
  cursor: pointer;
  position: relative;
  margin-right: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  /* Prevent squishing */
}

input[type="checkbox"]:hover {
  border-color: var(--gold);
  background: rgba(236, 173, 32, 0.1);
}

input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.05);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid var(--bg-dark);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .contact-form {
    padding: 1.5rem;
  }
}

/* Success Message High-End */
.contact-success-message {
  background: rgba(14, 57, 80, 0.6);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-left: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUpFade 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.success-icon {
  width: 60px;
  height: 60px;
  background: rgba(236, 173, 32, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--gold);
}

.success-icon svg {
  width: 32px;
  height: 32px;
}

.success-title {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.success-text {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   About Section Styles & Mobile Fixes
   ========================================= */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-content .lead {
  font-size: 1.125rem;
  color: var(--color-gray-text);
  margin-bottom: 1.5rem;
}

.about-body {
  margin-bottom: 2rem;
}

.about-stats {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-visual {
  position: relative;
  width: 100%;
}

.about-visual .image-wrapper {
  position: relative;
  z-index: 2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  aspect-ratio: 4/5;
  /* Mantener proporción vertical */
  background: #000;
}

.about-visual .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-visual .placeholder-image {
  background-color: var(--color-primary);
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.about-visual .decorative-border {
  position: absolute;
  top: 20px;
  right: -20px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--gold);
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
}

/* Responsive Fixes */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .about-stats {
    justify-content: center;
    gap: 2rem;
  }

  .about-visual {
    max-width: 400px;
    margin: 0 auto;
    /* Image below text is standard for mobile intros if text is long */
  }

  .about-visual .decorative-border {
    top: 15px;
    right: -15px;
  }
}

@media (max-width: 576px) {
  .about-visual {
    max-width: 320px;
    /* Reduced from 100% to avoid it being huge */
    padding: 0;
    margin: 0 auto;
  }

  .about-visual .image-wrapper {
    aspect-ratio: 1/1;
    /* Square on mobile might be better or keep 4/5 but smaller width */
    /* Let's keep 4/5 but constrained by max-width above */
    aspect-ratio: 4/5;
  }

  .about-visual .decorative-border {
    top: 10px;
    right: 0px;
    width: 100%;
    left: 10px;
    /* Offset slightly */
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* 12. Project Redesign Support */
.project-glass-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 4rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}

/* 13. Services Section (Premium Glassmorphism + 3D) */
.services-section {
  background: radial-gradient(circle at top right, rgba(236, 173, 32, 0.03) 0%, transparent 40%);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-top: 2rem;
}

.service-card {
  position: relative;
  perspective: 1000px;
}

.service-card {
  position: relative;
  perspective: 1000px;
  z-index: 1;
}

.service-card:hover {
  z-index: 10;
}

.service-card-inner {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 4rem 2rem;
  height: 100%;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  /* Ocultar el brillo que se desplaza a la izquierda */
  position: relative;
}

.service-card:hover .service-card-inner {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--gold);
  transform: translateY(-15px) rotateX(5deg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(236, 173, 32, 0.1);
}

.service-icon-wrapper {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, rgba(236, 173, 32, 0.1) 0%, rgba(236, 173, 32, 0.05) 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
  color: var(--gold);
  font-size: 2.5rem;
  transition: all 0.5s ease;
  border: 1px solid rgba(236, 173, 32, 0.2);
}

.service-card:hover .service-icon-wrapper {
  background: var(--gold);
  color: var(--bg-dark);
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 15px 35px rgba(236, 173, 32, 0.5);
}

.service-title {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.service-excerpt {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.service-card-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(45deg, transparent, rgba(236, 173, 32, 0.05), transparent);
  transform: translateX(-100%);
  transition: transform 0.8s ease;
}

.service-card:hover .service-card-inner::after {
  transform: translateX(100%);
}


/* 12. Project Single Post Redesign (High-End) */
.project-glass-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 4rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  position: relative;
}

.project-featured-image-inline {
  position: relative;
  margin-bottom: 4rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-featured-image-inline img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1s var(--easing-smooth);
}

.project-featured-image-inline:hover img {
  transform: scale(1.02);
}

.content-text-wrap {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.content-text-wrap h2,
.content-text-wrap h3 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.content-text-wrap p {
  margin-bottom: 2rem;
}

.content-text-wrap a {
  color: var(--gold);
  border-bottom: 1px solid rgba(236, 173, 32, 0.3);
}

.content-text-wrap a:hover {
  border-bottom-color: var(--gold);
}

/* Mobile Adjustments for Project Single */
@media (max-width: 768px) {
  .project-glass-card {
    padding: 2rem;
    border-radius: 16px;
  }

  .project-featured-image-inline {
    margin-bottom: 2rem;
  }

  .project-header.section-bg-dark {
    padding-top: 7rem !important;
    padding-bottom: 4rem !important;
  }
}