/* ============================================
   CARLOS NARRO — PERSONAL WEB
   Design System: Dark, Minimal, Accent Lima
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #222;
  --text: #f0f0f0;
  --text-secondary: #888;
  --accent: #c8ff00;
  --accent-subtle: rgba(200, 255, 0, 0.08);
  --accent-glow: rgba(200, 255, 0, 0.15);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --container: 1200px;
  --section-pad: clamp(80px, 12vh, 140px);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.accent {
  color: var(--accent);
}

/* --- ANIMATIONS --- */
.anim-fade {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.3s;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--text);
}

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 120px 24px 60px;
  position: relative;
}

.hero-content {
  max-width: var(--container);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-text {
  flex: 1;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: #d4ff33;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(200, 255, 0, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

/* Photo placeholder */
.hero-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 280px;
  height: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.photo-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-subtle), transparent 60%);
}

.photo-placeholder span {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0.5;
  position: relative;
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  color: var(--text-secondary);
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* --- SECTIONS --- */
.section {
  padding: var(--section-pad) 0;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 64px;
  line-height: 1.7;
}

/* --- PROCESS FLOW --- */
.process-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
  margin-top: 20px;
}

.process-line {
  position: absolute;
  top: 40px;
  left: 60px;
  right: 60px;
  height: 2px;
  z-index: 0;
}

.process-svg {
  width: 100%;
  height: 2px;
}

.process-connector {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 8 4;
}

.process-step {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 8px;
}

.step-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  transition: color 0.4s;
}

.process-step:hover .step-icon {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: scale(1.08);
}

.process-step:hover .step-icon svg {
  color: var(--accent);
}

.step-number {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- MOSAIC — Rectángulos verticales asimétricos --- */
.mosaic {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 40px 0;
  min-height: 600px;
}

.mosaic-item {
  position: relative;
  overflow: hidden;
  display: block;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
  border-radius: 6px;
}

/* Each column: different height + vertical offset — staircase effect */
.mosaic-item:nth-child(1) { height: 520px; margin-top: 0; }
.mosaic-item:nth-child(2) { height: 400px; margin-top: 100px; }
.mosaic-item:nth-child(3) { height: 480px; margin-top: 40px; }
.mosaic-item:nth-child(4) { height: 360px; margin-top: 140px; }
.mosaic-item:nth-child(5) { height: 500px; margin-top: 20px; }
.mosaic-item:nth-child(6) { height: 420px; margin-top: 80px; }

.mosaic-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    hsl(var(--hue), 50%, 8%) 0%,
    hsl(var(--hue), 40%, 16%) 100%
  );
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mosaic-item:hover .mosaic-bg {
  transform: scale(1.08);
}

.mosaic-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 50px var(--accent-glow);
  transform: translateY(-8px);
  z-index: 2;
}

.mosaic-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px;
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.3) 40%, transparent 70%);
  z-index: 1;
}

.mosaic-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.mosaic-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.mosaic-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mosaic-item:hover .mosaic-desc {
  opacity: 1;
  transform: translateY(0);
}

/* --- ENTITIES --- */
.entities {
  display: grid;
  gap: 24px;
}

.entity {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.entity::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.entity:hover {
  border-color: rgba(200, 255, 0, 0.3);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.entity-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: var(--accent-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entity-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.entity-content {
  flex: 1;
}

.entity-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.entity-role {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.entity-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.entity-badge {
  flex-shrink: 0;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(200, 255, 0, 0.2);
  border-radius: 100px;
  background: var(--accent-subtle);
}

/* --- CONTACT --- */
.section-contact {
  text-align: center;
}

.section-contact .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(200, 255, 0, 0.1);
}

/* --- FOOTER --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.footer-sep {
  opacity: 0.3;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .mosaic {
    flex-wrap: wrap;
    min-height: auto;
  }
  .mosaic-item {
    flex: 0 0 calc(33.33% - 10px);
  }
  .mosaic-item:nth-child(1) { height: 420px; margin-top: 0; }
  .mosaic-item:nth-child(2) { height: 340px; margin-top: 60px; }
  .mosaic-item:nth-child(3) { height: 380px; margin-top: 20px; }
  .mosaic-item:nth-child(4) { height: 300px; margin-top: 0; }
  .mosaic-item:nth-child(5) { height: 380px; margin-top: -30px; }
  .mosaic-item:nth-child(6) { height: 320px; margin-top: 40px; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .photo-placeholder {
    width: 200px;
    height: 240px;
  }

  .process-flow {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .process-line {
    display: none;
  }

  .process-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
  }

  .step-icon {
    margin: 0;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }

  .step-icon svg {
    width: 26px;
    height: 26px;
  }

  .mosaic {
    flex-wrap: wrap;
    min-height: auto;
    gap: 12px;
  }

  .mosaic-item {
    flex: 0 0 calc(50% - 6px);
  }

  .mosaic-item:nth-child(1) { height: 320px; margin-top: 0; }
  .mosaic-item:nth-child(2) { height: 260px; margin-top: 50px; }
  .mosaic-item:nth-child(3) { height: 300px; margin-top: -20px; }
  .mosaic-item:nth-child(4) { height: 240px; margin-top: 30px; }
  .mosaic-item:nth-child(5) { height: 280px; margin-top: -10px; }
  .mosaic-item:nth-child(6) { height: 250px; margin-top: 40px; }

  .mosaic-desc {
    opacity: 1;
    transform: none;
  }

  .entity {
    flex-direction: column;
    gap: 16px;
  }

  .entity-badge {
    align-self: flex-start;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 3rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.875rem;
  }
}

/* --- Grain overlay (subtle texture) --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}
