/* =========================================================
   OS </> — Design tokens
   ========================================================= */
:root {
  --bg-primary: #0D0D0D;
  --bg-secondary: #171717;
  --bg-tertiary: #2B2B2B;
  --bg-elevated: #1C1C1C;
  --text-primary: #F5F5F5;
  --text-secondary: #A3A3A3;
  --text-muted: #6B6B6B;
  --accent: #FF6A00;
  --accent-dim: #B34C00;
  --accent-glow: rgba(255, 106, 0, 0.35);
  --border-subtle: rgba(245, 245, 245, 0.08);
  --border-strong: rgba(245, 245, 245, 0.16);
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--accent); color: #0D0D0D; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

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

/* Faint film-grain / noise overlay for premium hardware feel */
.grain-overlay {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: .025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Custom cursor (desktop, pointer:fine only — see JS) */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none; border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .2s ease, width .2s var(--ease), height .2s var(--ease);
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-ring {
  width: 32px; height: 32px; border: 1px solid var(--accent-glow);
  transition: opacity .2s ease, transform .15s var(--ease);
}
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }
body.cursor-active .cursor-ring { transform: translate(-50%, -50%) scale(1.6); border-color: var(--accent); }

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   Buttons
   ========================================================= */
.btn-accent, .btn-outline-tech {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  padding: .85rem 1.75rem; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn-accent {
  background: var(--accent); color: #0D0D0D;
  box-shadow: 0 0 0 0 rgba(255,106,0,0);
}
.btn-accent:hover {
  background: #ff7d1f; color: #0D0D0D;
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-2px);
}
.btn-outline-tech {
  background: transparent; color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-outline-tech:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
}
.btn-sm-accent { padding: .55rem 1.3rem; font-size: .85rem; }

/* =========================================================
   Navbar
   ========================================================= */
.os-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 1.25rem 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease), padding .35s var(--ease);
}
.os-navbar.scrolled {
  background: rgba(13, 13, 13, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: .85rem 0;
}
.os-navbar__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.os-brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  letter-spacing: .5px; color: var(--text-primary);
}
.os-brand--sm { font-size: 1.2rem; }
.os-navbar__menu {
  display: flex; align-items: center; gap: 2.25rem;
}
.os-navbar__links {
  display: flex; align-items: center; gap: 2rem;
}
.nav-link-item {
  font-size: .92rem; font-weight: 500; color: var(--text-secondary);
  position: relative; padding: .3rem 0;
  transition: color .25s ease;
}
.nav-link-item::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-link-item:hover, .nav-link-item.active { color: var(--text-primary); }
.nav-link-item:hover::after, .nav-link-item.active::after { width: 100%; }

.os-navbar__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px; z-index: 1001;
}
.os-navbar__toggle span {
  width: 22px; height: 2px; background: var(--text-primary);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.os-navbar__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.os-navbar__toggle.open span:nth-child(2) { opacity: 0; }
.os-navbar__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 140px 0 80px;
  overflow: hidden;
  background: var(--bg-primary);
}
.hero__grid-lines {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 100%);
  opacity: .6;
}
.hero__glow {
  position: absolute; top: -10%; right: -10%; z-index: 0;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(40px); opacity: .5;
}
.hero__container { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: 1.5px;
  color: var(--text-secondary); border: 1px solid var(--border-subtle);
  border-radius: 30px; padding: .4rem .9rem; margin-bottom: 1.75rem;
}
.dot-blink {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.hero__logo {
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  font-weight: 700; line-height: .95; letter-spacing: -2px;
  margin-bottom: .75rem;
}
.hero__name {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600; color: var(--text-primary); margin-bottom: .5rem;
}
.hero__role {
  font-family: var(--font-mono); font-size: 1rem; color: var(--accent);
  margin-bottom: 1.75rem;
}
.hero__role .sep { color: var(--text-muted); margin: 0 .4rem; }
.hero__tagline {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 600;
  max-width: 620px; margin-bottom: 1rem; color: var(--text-primary);
}
.hero__text {
  font-size: 1.02rem; color: var(--text-secondary);
  max-width: 560px; margin-bottom: 2.25rem;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.scroll-cue {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  z-index: 1; width: 26px; height: 42px; border: 1px solid var(--border-strong);
  border-radius: 20px; display: flex; justify-content: center; padding-top: 8px;
}
.scroll-cue span {
  width: 4px; height: 8px; border-radius: 2px; background: var(--accent);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* Terminal */
.terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
.terminal__bar {
  display: flex; align-items: center; gap: 8px;
  padding: .8rem 1rem; background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; background: #4a4a4a; }
.terminal__dot:nth-child(1) { background: #565656; }
.terminal__title {
  margin-left: .5rem; font-family: var(--font-mono); font-size: .75rem;
  color: var(--text-muted);
}
.terminal__body {
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.9;
  padding: 1.5rem; min-height: 280px; color: var(--text-secondary);
  white-space: pre-wrap;
}
.terminal__body .line-cmd { color: var(--text-primary); }
.terminal__body .line-item { color: var(--accent); }
.terminal__body .line-status { color: var(--text-primary); font-weight: 700; }
.terminal__cursor {
  display: inline-block; width: 7px; height: 1em; background: var(--accent);
  vertical-align: text-bottom; animation: blink 1s steps(1) infinite;
}

/* =========================================================
   Sections — shared
   ========================================================= */
.section { padding: 120px 0; position: relative; }
.section--alt { background: var(--bg-secondary); }
.section-kicker {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: 2px;
  color: var(--accent); margin-bottom: .75rem;
}
.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -.5px;
}
.section-subtitle {
  color: var(--text-secondary); font-size: 1.05rem; margin-top: .6rem; max-width: 620px;
}

/* =========================================================
   Sobre mi
   ========================================================= */
.about-text { color: var(--text-secondary); font-size: 1.08rem; margin-bottom: 1.25rem; }
.about-text strong { color: var(--text-primary); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.stat-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 1.6rem 1.4rem;
  transition: border-color .3s ease, transform .3s var(--ease);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-card--wide { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; }
.stat-card__num {
  font-family: var(--font-mono); font-size: 2.4rem; font-weight: 700; display: block;
}
.stat-plus { font-size: 2rem; font-weight: 700; }
.stat-card__icon { font-size: 1.7rem; color: var(--accent); display: block; margin-bottom: .6rem; }
.stat-card--wide .stat-card__icon { margin-bottom: 0; }
.stat-card__label { display: block; color: var(--text-secondary); font-size: .92rem; margin-top: .35rem; }
.stat-card--wide .stat-card__label { margin-top: 0; }

/* =========================================================
   Especializacion cards
   ========================================================= */
.spec-card {
  position: relative; height: 100%;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 2rem 1.75rem;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s ease, background .35s ease;
}
.spec-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: #1f1f1f;
}
.spec-card__accent {
  position: absolute; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent); transition: width .4s var(--ease);
}
.spec-card:hover .spec-card__accent { width: 100%; }
.spec-card__icon {
  font-size: 1.8rem; color: var(--accent); margin-bottom: 1.1rem; display: block;
}
.spec-card__title { font-size: 1.2rem; font-weight: 600; margin-bottom: .6rem; }
.spec-card__desc { color: var(--text-secondary); font-size: .95rem; }

/* =========================================================
   Tecnologias
   ========================================================= */
.tech-group { margin-bottom: 2.5rem; }
.tech-group__title {
  font-size: .95rem; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.tech-group__title i { color: var(--accent); }
.tech-tags { display: flex; flex-wrap: wrap; gap: .7rem; }
.tech-tag {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: .6rem 1.05rem; font-size: .88rem;
  color: var(--text-primary); font-family: var(--font-mono);
  transition: border-color .25s ease, transform .25s var(--ease), box-shadow .25s ease;
}
.tech-tag i { font-size: 1.05rem; color: var(--text-secondary); }
.tech-tag:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 8px 20px -8px var(--accent-glow);
}
.tech-tag:hover i { color: var(--accent); }

/* =========================================================
   Proyectos
   ========================================================= */
.project-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 14px; overflow: hidden; height: 100%;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), border-color .35s ease, box-shadow .35s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 30px 50px -30px rgba(0,0,0,.7);
}
.project-card__mock {
  background: linear-gradient(160deg, var(--bg-tertiary), #141414);
  border-bottom: 1px solid var(--border-subtle);
}
.mock__bar {
  display: flex; gap: 6px; padding: .8rem 1rem;
  border-bottom: 1px solid rgba(245,245,245,.05);
}
.mock__bar span { width: 8px; height: 8px; border-radius: 50%; background: rgba(245,245,245,.15); }
.mock__body {
  min-height: 170px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.1rem; padding: 1.5rem;
}
.mock__body > i { font-size: 2.6rem; color: var(--accent); opacity: .85; }
.mock__lines { display: flex; flex-direction: column; gap: 8px; width: 70%; }
.mock__lines span { height: 6px; border-radius: 3px; background: rgba(245,245,245,.08); }
.mock__lines span:nth-child(2) { width: 70%; }
.mock__lines span:nth-child(3) { width: 45%; }
.project-card:hover .mock__body > i { color: var(--accent); transform: scale(1.08); transition: transform .3s var(--ease); }

.project-card__body { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.project-card__title { font-size: 1.3rem; font-weight: 600; margin-bottom: .6rem; }
.project-card__desc { color: var(--text-secondary); font-size: .95rem; margin-bottom: 1.2rem; flex: 1; }
.project-card__stack { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.3rem; }
.project-card__stack span {
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-secondary);
  border: 1px solid var(--border-subtle); border-radius: 5px; padding: .25rem .6rem;
}
.project-card__link {
  color: var(--accent); font-weight: 600; font-size: .92rem;
  display: inline-flex; align-items: center; gap: .4rem; width: fit-content;
  transition: gap .25s ease;
}
.project-card__link:hover { gap: .7rem; }

/* =========================================================
   Filosofia
   ========================================================= */
.philosophy__flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-family: var(--font-mono); font-size: .95rem; color: var(--text-secondary);
  margin: 2rem 0 2.5rem; letter-spacing: 1px;
}
.philosophy__flow span {
  border: 1px solid var(--border-strong); border-radius: 30px;
  padding: .5rem 1.2rem; color: var(--text-primary);
}
.philosophy__flow i { color: var(--accent); }

.principle-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 2rem 1.6rem; height: 100%;
  transition: border-color .3s ease, transform .3s var(--ease);
}
.principle-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.principle-card__num {
  font-family: var(--font-mono); color: var(--accent); font-size: .9rem; font-weight: 700;
  display: block; margin-bottom: .9rem;
}
.principle-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; }
.principle-card p { color: var(--text-secondary); font-size: .93rem; margin: 0; }

/* =========================================================
   Experiencia — timeline
   ========================================================= */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: linear-gradient(var(--border-strong), var(--border-subtle));
}
.timeline__item { position: relative; margin-bottom: 2.25rem; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__dot {
  position: absolute; left: -2.5rem; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(255,106,0,.15);
}
.timeline__card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 1.75rem;
  transition: border-color .3s ease, transform .3s var(--ease);
}
.timeline__card:hover { border-color: var(--border-strong); transform: translateX(4px); }
.timeline__period {
  font-family: var(--font-mono); font-size: .78rem; color: var(--accent);
  letter-spacing: 1px;
}
.timeline__role { font-size: 1.15rem; font-weight: 600; margin: .5rem 0 .15rem; }
.timeline__company { color: var(--text-secondary); font-size: .9rem; margin-bottom: .8rem; }
.timeline__desc { color: var(--text-secondary); font-size: .93rem; margin-bottom: 1rem; }
.timeline__stack { display: flex; flex-wrap: wrap; gap: .5rem; }
.timeline__stack span {
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-secondary);
  border: 1px solid var(--border-subtle); border-radius: 5px; padding: .2rem .55rem;
}

/* =========================================================
   LAB
   ========================================================= */
.lab {
  background: var(--bg-secondary);
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}
.lab-card {
  background: rgba(13,13,13,.55);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 1.6rem 1rem; text-align: center; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  transition: border-color .3s ease, transform .3s var(--ease), background .3s ease;
}
.lab-card i { font-size: 1.6rem; color: var(--accent); }
.lab-card span { font-family: var(--font-mono); font-size: .82rem; color: var(--text-secondary); }
.lab-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  background: rgba(255,106,0,.05);
}
.lab__phrase {
  text-align: center; font-family: var(--font-mono); color: var(--text-secondary);
  font-size: 1rem; margin-top: 3rem; letter-spacing: .5px;
}

/* =========================================================
   Contacto
   ========================================================= */
.contact { position: relative; overflow: hidden; text-align: center; }
.contact__glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 65%);
  filter: blur(60px); opacity: .35; pointer-events: none;
}
.contact .section-kicker, .contact .section-title { text-align: center; }
.contact__text {
  color: var(--text-secondary); font-size: 1.1rem; max-width: 560px;
  margin: 1.25rem auto 2.5rem;
}
.contact__actions {
  display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.75rem;
}
.contact__meta {
  display: flex; justify-content: center; gap: 2.25rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .88rem; color: var(--text-secondary);
}
.contact__meta a { display: inline-flex; align-items: center; gap: .5rem; transition: color .25s ease; }
.contact__meta a:hover { color: var(--accent); }

/* =========================================================
   Footer
   ========================================================= */
.os-footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
}
.os-footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.5rem;
}
.os-footer__brand { display: flex; align-items: center; gap: 1rem; }
.os-footer__name { font-weight: 600; margin: 0; font-size: .95rem; }
.os-footer__role { color: var(--text-secondary); font-size: .82rem; margin: 0; }
.os-footer__credit { color: var(--text-muted); font-size: .82rem; margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991.98px) {
  .os-navbar__toggle { display: flex; }
  .os-navbar__menu {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 80vw);
    background: var(--bg-secondary); border-left: 1px solid var(--border-subtle);
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 2.5rem; padding: 2rem;
    transform: translateX(100%); transition: transform .4s var(--ease);
  }
  .os-navbar__menu.open { transform: translateX(0); }
  .os-navbar__links { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .os-footer__inner { flex-direction: column; text-align: center; justify-content: center; }
  .os-footer__brand { flex-direction: column; }
}

@media (max-width: 767.98px) {
  .section { padding: 80px 0; }
  .hero { padding: 120px 0 60px; }
  .stat-grid { grid-template-columns: 1fr; }
  .philosophy__flow { font-size: .8rem; gap: .6rem; }
  .philosophy__flow span { padding: .4rem .8rem; }
  .contact__meta { flex-direction: column; gap: 1rem; }
}

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}
