/* ==========================================================================
   Web personal de Claudio Bravo — Diseño premium, sobrio y de alto rendimiento
   ========================================================================== */

/* 1. Reset moderno y variables */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:root {
  --bg-main: #fbfbfa;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f4f6;
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --accent-primary: #1e40af;
  --accent-primary-hover: #1d4ed8;
  --color-whatsapp: #059669;
  --color-whatsapp-hover: #047857;
  --color-focus: #2563eb;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-stage: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  width: 100%;
}

main {
  position: relative;
  z-index: 1;
}

/* 2. Barra de navegación sobria */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(251, 251, 250, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 24px);
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link-cta {
  font-weight: 600;
  color: var(--accent-primary);
}

@media (max-width: 540px) {
  .nav-link:not(.nav-link-cta) {
    display: none;
  }
}

/* 3. Portada principal (Hero) */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(48px, 6vw, 80px);
  width: 100%;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.hero-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-stage);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 780px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 14px;
  background-color: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 100px;
  font-size: clamp(0.72rem, 2.5vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-primary);
  margin-bottom: 20px;
  max-width: 100%;
  line-height: 1.3;
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 16px;
  max-width: 100%;
  word-break: break-word;
}

.hero-lead {
  font-size: clamp(1.1rem, 2.8vw, 1.8rem);
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  max-width: 100%;
  word-break: break-word;
}

.hero-sublead {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 36px;
  word-break: break-word;
}

/* 4. Botones */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
}

@media (min-width: 520px) {
  .btn-group {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 48px;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: #ffffff;
  border: 1.5px solid var(--color-whatsapp);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.btn-whatsapp:hover {
  background-color: var(--color-whatsapp-hover);
  border-color: var(--color-whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.btn-email {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-email:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* 5. Fondo animado interactivo en Canvas */
.canvas-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #fbfbfa;
}

.scroll-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
  transform: translateZ(0);
}

body.frames-ready .scroll-canvas {
  opacity: 1;
}

.canvas-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.5s ease;
}

body.frames-ready .canvas-fallback {
  opacity: 0;
}

html.reduced-motion .scroll-canvas {
  display: none !important;
}

html.reduced-motion .canvas-fallback {
  opacity: 1 !important;
}

/* Indicador sutil de scroll */
.hero-scroll-cue {
  margin-top: clamp(36px, 6vw, 56px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
}

.scroll-mouse-icon {
  width: 14px;
  height: 22px;
  border: 2px solid var(--text-muted);
  border-radius: 10px;
  position: relative;
}

.scroll-mouse-icon::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 5px;
  background-color: var(--accent-primary);
  border-radius: 2px;
  animation: mouseScroll 1.6s infinite ease-in-out;
}

@keyframes mouseScroll {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 7px); opacity: 0; }
}

/* 6. Secciones y encabezados */
.section {
  padding-top: clamp(80px, 12vw, 140px);
  padding-bottom: clamp(80px, 12vw, 140px);
}

/* 6.1 Sección Sobre mí con foto profesional */
.section-about {
  padding-top: clamp(60px, 8vw, 110px);
  padding-bottom: clamp(60px, 8vw, 110px);
}

.about-card {
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: clamp(32px, 5vw, 56px);
  box-shadow: var(--shadow-stage);
  max-width: 1040px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 52px);
  align-items: center;
}

@media (min-width: 820px) {
  .about-grid {
    grid-template-columns: 300px 1fr;
  }
}

.about-photo-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 3px solid #ffffff;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.15);
  display: block;
}

.about-photo-badge {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.badge-status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-whatsapp);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.about-content-col {
  display: flex;
  flex-direction: column;
}

.about-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 6px;
}

.about-role {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 20px;
}

.about-text {
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

@media (min-width: 620px) {
  .about-highlights {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.highlight-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #e0e7ff;
  color: var(--accent-primary);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.highlight-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.highlight-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.highlight-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.about-actions {
  margin-top: 4px;
}

.section-alt {
  background-color: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: clamp(36px, 6vw, 56px);
  max-width: 680px;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 14px;
}

.section-description {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.6;
}

/* 7. Cuadrícula de Servicios */
.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 860px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
}

.card {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 36px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-width: 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 16px;
}

.card-num {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  background-color: #eef2ff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.3;
}

.card-description {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  flex-grow: 1;
}

.card-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.card-link {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.card-link:hover {
  color: var(--accent-primary-hover);
  transform: translateX(4px);
}

/* 8. Portafolio / Trabajo hecho (Trinity) */
.work-card {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  transition: box-shadow 0.3s ease;
  min-width: 0;
}

@media (min-width: 920px) {
  .work-card {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
  }
}

.phone-showcase-container {
  width: 100%;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  padding: clamp(32px, 5vw, 48px) 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-mockup {
  position: relative;
  width: 270px;
  max-width: 85%;
  aspect-ratio: 390 / 600;
  background-color: #000000;
  border-radius: 40px;
  padding: 8px;
  border: 3px solid #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: transform 0.4s ease;
}

.work-card:hover .phone-mockup {
  transform: translateY(-4px) scale(1.02);
}

.phone-camera-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 18px;
  background-color: #000000;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
}

.phone-video,
.phone-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
}

.work-content {
  padding: clamp(32px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work-meta {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.work-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 12px;
}

.work-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.link-external {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--accent-primary);
  text-decoration: none;
  width: fit-content;
  border-bottom: 2px solid #bfdbfe;
  padding-bottom: 4px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.link-external:hover {
  color: var(--accent-primary-hover);
  border-color: var(--accent-primary);
}

.external-icon {
  width: 18px;
  height: 18px;
}

/* 9. Sección Contacto */
.section-contact {
  background-color: transparent;
}

.contact-container {
  display: flex;
  justify-content: center;
}

.contact-box {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: clamp(36px, 6vw, 64px);
  box-shadow: var(--shadow-stage);
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.contact-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

.contact-actions {
  margin-left: auto;
  margin-right: auto;
}

.contact-direct {
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* 10. Pie de página */
.footer {
  margin-top: auto;
  padding-top: 48px;
  padding-bottom: 48px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.footer-copy {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* 11. Accesibilidad */
.btn:focus-visible,
.card-link:focus-visible,
.link-external:focus-visible,
.nav-link:focus-visible,
.brand-logo:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
