/* ============================================================
   Rogelio Gómez — Portfolio
   Tema principal: minimal editorial (claro, cálido)
   Tema NYRO: brand takeover (oscuro, técnico) — ver sección NYRO
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #F7F5F0;
  --bg-alt: #EFEAE1;
  --card: #FFFFFF;
  --ink: #15140F;
  --ink-soft: #5B584E;
  --ink-faint: #96917E;
  --accent: #E85A2A;
  --accent-light: #F6C9AE;
  --on-accent: #FFF9F5;
  --line: rgba(21, 20, 15, 0.12);
  --line-soft: rgba(21, 20, 15, 0.07);
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 0.8, 0.24, 1);
  --shadow: 0 1px 2px rgba(21,20,15,0.04), 0 12px 32px -12px rgba(21,20,15,0.10);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- Reveal-on-scroll base state (GSAP animates these) ---------- */
.reveal { opacity: 0; transform: translateY(28px); }

/* ---------- Custom cursor (desktop only) ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .2s var(--ease), height .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
  mix-blend-mode: normal;
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .cursor-dot { display: block; }
  body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button { cursor: none; }
}
.cursor-dot.is-hover { width: 40px; height: 40px; background: rgba(232,90,42,0.12); }

/* ---------- Noise overlay ---------- */
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 20px 0;
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(247, 245, 240, 0.78);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
  padding: 14px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-actions { margin-left: auto; }

.nav-logo-mark {
  font-weight: 800; font-size: 15px; letter-spacing: 0.06em;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--bg);
  transition: background .4s var(--ease), color .4s var(--ease);
}

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0;
  transition: color .3s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: currentColor; transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links .nav-link-nyro { font-weight: 700; color: #0047CC; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px;
  display: flex; align-items: center; gap: 4px;
  transition: border-color .3s var(--ease);
}
.lang-sep { font-size: 12px; opacity: 0.3; user-select: none; }
.lang-opt {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; font-family: var(--font-sans);
  color: var(--ink); opacity: 0.32; padding: 0 2px;
  transition: opacity 0.2s ease;
}
.lang-opt.is-active { opacity: 1; }
.lang-opt:hover:not(.is-active) { opacity: 0.65; }
.flag-sm { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; vertical-align: middle; margin-right: 3px; }

.nav-burger { display: none; width: 32px; height: 22px; flex-direction: column; justify-content: space-between; }
.nav-burger span { display: block; height: 2px; width: 100%; background: var(--ink); transition: transform .3s var(--ease), opacity .3s var(--ease), background .3s var(--ease); }
.nav-burger.is-open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: fixed; inset: 0; top: 0; z-index: 45;
  background: var(--bg);
  flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.nav-mobile.is-open { opacity: 1; pointer-events: auto; }
.nav-mobile a { font-size: 24px; font-weight: 700; }
.nav-mobile .nav-link-nyro { color: #0047CC; }

/* ============================================================
   BUTTONS / TAGS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 100px;
  font-size: 14px; font-weight: 600;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 100px; padding: 9px 18px;
}
.tag-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 168px 0 90px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}

.hero-name {
  font-size: clamp(52px, 8vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-name-line { display: block; }

.hero-location {
  display: flex; align-items: center; gap: 6px;
  font-size: 16px; font-weight: 500; color: var(--ink-soft);
  margin-bottom: 20px;
}

.hero-role {
  font-size: clamp(18px, 2.2vw, 23px);
  color: var(--ink-soft);
  max-width: 46ch;
  line-height: 1.5;
  margin-bottom: 22px;
  font-weight: 500;
}

.hero-langs {
  font-size: clamp(18px, 2.2vw, 23px); color: var(--ink-soft); font-weight: 500;
  margin-bottom: 22px;
}

.hero-current {
  font-size: 15px; color: var(--ink-soft);
  line-height: 1.65;
  text-align: center;
  max-width: 36ch;
  position: relative; z-index: 2;
}
.hero-current-link { color: var(--accent); font-weight: 700; }
.hero-current-link:hover { text-decoration: underline; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.hero-avatar {
  position: relative; z-index: 2;
  width: min(100%, 340px); aspect-ratio: 3/4;
  border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--accent) 0%, #F0824F 45%, #FFD9BE 100%);
}
.hero-avatar-placeholder span {
  font-size: 88px; font-weight: 800; color: rgba(255,255,255,0.92); letter-spacing: -0.02em;
}

.hero-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; z-index: 1; animation: floatBlob 12s ease-in-out infinite; }
.hero-blob-1 { width: 280px; height: 280px; background: var(--accent-light); top: -40px; right: -20px; }
.hero-blob-2 { width: 220px; height: 220px; background: #FCE2CE; bottom: -30px; left: -30px; animation-delay: -6s; }
@keyframes floatBlob {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(14px, -18px) scale(1.06); }
}

.scroll-cue {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1.5px solid var(--line); border-radius: 100px;
  display: flex; justify-content: center; padding-top: 7px;
}
.scroll-cue span { width: 4px; height: 8px; border-radius: 4px; background: var(--accent); animation: scrollCue 1.8s ease-in-out infinite; }
@keyframes scrollCue { 0% { transform: translateY(0); opacity: 1;} 70% {opacity: 0;} 100% { transform: translateY(10px); opacity: 0; } }

/* ============================================================
   STATS
   ============================================================ */
.stats { padding: 50px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; padding: 0 12px; }
.stat-number { display: block; font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.stat-label { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }

/* ============================================================
   COMPANIES / LOGO STRIP
   ============================================================ */
.logos-strip { padding: 64px 0; border-bottom: 1px solid var(--line); }
.logos-strip-label { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 40px; }
.logos-strip-grid { display: flex; align-items: center; justify-content: center; gap: 72px; flex-wrap: wrap; }
.logos-strip-grid img { height: 58px; width: 180px; object-fit: contain; filter: grayscale(1) opacity(0.45); transition: filter 0.35s ease; }
.logos-strip-grid img:hover { filter: grayscale(0) opacity(1); }

/* ============================================================
   SECTION SHARED
   ============================================================ */
.section { padding: 80px 0; }
.section::before {
  content: '';
  display: block;
  width: 50%;
  height: 1px;
  background: var(--line);
  margin: 0 auto 80px;
}
.skills { padding-top: 52px; }
.section-head { margin-bottom: 56px; }
.section-head h2 { font-size: clamp(32px, 4vw, 44px); }
.section-head .eyebrow { margin-bottom: 10px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about-item { display: flex; flex-direction: column; gap: 12px; }
.about-label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.about-block { font-size: clamp(19px, 2vw, 23px); line-height: 1.6; color: var(--ink); font-weight: 500; }

/* ---------- Experience / timeline ---------- */
.timeline { position: relative; padding-left: 80px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 56px; }
.timeline-item { position: relative; }
.timeline-logo {
  position: absolute; left: -80px; top: 0;
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transform: translateX(-50%);
  box-shadow: 0 1px 2px rgba(21,20,15,0.08), 0 10px 22px -12px rgba(21,20,15,0.4);
  z-index: 1;
}
.timeline-logo span { font-family: var(--font-sans); font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.timeline-logo svg { width: 100%; height: 100%; display: block; }
.timeline-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.timeline-logo--ml { background: var(--bg); box-shadow: none; }
.timeline-logo--kangu { background: #0EA37A; }
.timeline-logo--kangu span { color: #fff; }
.timeline-logo--tsys { background: #E20074; }
.timeline-logo--tsys span { color: #fff; }
.timeline-logo--vw { background: #fff; }
.timeline-logo--vw span { color: #001E50; font-size: 11px; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.timeline-head h3 { font-size: 21px; }
.timeline-period { font-size: 13px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.timeline-company { font-size: 14px; color: var(--accent); font-weight: 700; margin-bottom: 16px; }
.timeline-company-note { color: var(--ink-faint); font-weight: 400; }
.timeline-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; max-width: 68ch; }
.timeline-list li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.timeline-list li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.timeline-stack { display: flex; gap: 8px; flex-wrap: wrap; }

/* Heading word-mask for animated reveals */
.h-word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.h-word-inner { display: inline-block; }

.education-card {
  margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 20px;
}
.education-logo {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden;
  background: #fff; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(21,20,15,0.08), 0 10px 22px -12px rgba(21,20,15,0.4);
}
.education-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.education-body { flex: 1; }
.education-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.education-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.education-degree { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.education-period { font-size: 13px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.education-school { font-size: 14px; color: var(--ink-soft); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px; }
.skills-group h3 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 20px; font-weight: 700; }
.skills-tags { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Projects ---------- */
.projects-category + .projects-category { margin-top: 56px; }
.category-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(21,20,15,0.18); }
.project-card-nyro { grid-column: span 3; flex-direction: row; background: var(--ink); border-color: var(--ink); }
.project-media {
  position: relative; height: 160px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 26px; letter-spacing: -0.01em;
}
.project-number {
  position: absolute; top: 14px; right: 16px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.25); letter-spacing: 0.05em;
}
.project-card-nyro .project-media { width: 220px; height: auto; flex-shrink: 0; }
.project-media-nyro { background: linear-gradient(155deg, #0047CC, #1A1A1A 75%); color: #fff; }
.project-media-b { background: linear-gradient(155deg, #2E2A24, #6B6355); }
.project-media-c { background: linear-gradient(155deg, #C98A4B, #7A5327); }
.project-media-d { background: linear-gradient(155deg, #4B7A5B, #24392C); }
.project-body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card-nyro .project-body { color: #fff; justify-content: center; }
.project-tag { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.project-card-nyro .project-tag { color: rgba(255,255,255,0.45); }
.project-title { font-size: 20px; letter-spacing: -0.02em; }
.nyro-dot-inline { color: #1A6AFF; }
.project-desc { font-size: 14px; line-height: 1.6; color: var(--ink-soft); flex: 1; }
.project-card-nyro .project-desc { color: rgba(255,255,255,0.65); }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.project-link { font-size: 13px; font-weight: 700; color: #1A6AFF; margin-top: 4px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { text-align: center; }
.contact-title { font-size: clamp(34px, 5vw, 54px); margin-bottom: 18px; }
.contact-sub { font-size: 17px; color: var(--ink-soft); max-width: 50ch; margin: 0 auto 36px; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 32px 0 42px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--ink-faint); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile { display: flex; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: 20px; }
  .hero-avatar { width: 220px; margin: 0 auto; }
  .hero { padding-top: 130px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .logos-strip-grid { gap: 36px; }
  .logos-strip-grid img { height: 34px; width: 110px; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card-nyro { grid-column: span 2; }
}

@media (max-width: 640px) {
  .container { padding: 0 22px; }
  .hero-name { font-size: clamp(36px, 9vw, 52px); }
  .hero-name-line { display: inline; }
  .section { padding: 84px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .logos-strip-grid { gap: 24px; }
  .logos-strip-grid img { height: 28px; width: 90px; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card-nyro { grid-column: span 1; flex-direction: column; }
  .project-card-nyro .project-media { width: 100%; height: 140px; }
  .timeline { padding-left: 60px; }
  .timeline-logo { left: -60px; width: 34px; height: 34px; border-radius: 9px; transform: translateX(-50%); }
  .timeline-logo span { font-size: 11px; }
  .timeline-logo--vw span { font-size: 9px; }
}
