/* ===================================
   PÍA SALAZAR – PORTFOLIO 2026
   =================================== */

/* ---------- VARIABLES (LIGHT MODE por defecto) ---------- */
:root {
  --c-primary: #009E90;
  --c-primary-light: #00B5A5;
  --c-secondary: #1E4FC2;
  --c-accent: #D93535;
  --c-accent-light: #F06060;
  --c-bg: #F5F3EF;
  --c-bg-alt: #EAE7E1;
  --c-surface: #FFFFFF;
  --c-text: #1A1A1A;
  --c-text-secondary: #4A4A4A;
  --c-text-muted: #767676;
  --c-border: #D8D4CD;
  --c-linkedin: #0a66c2;
  --c-error: #C0392B;

  --f-heading: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;

  --s-section: clamp(4rem, 8vw, 7rem);
  --s-gutter: clamp(1rem, 4vw, 1.5rem);
  --s-container: 71.25rem;

  --r-sm: 0.5rem;
  --r-md: 1rem;
  --r-lg: 1.5rem;
  --r-xl: 2rem;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);

  --t-fast: .2s ease;
  --t-base: .35s ease;
}

/* ---------- DARK MODE ---------- */
[data-theme="dark"] {
  --c-primary: #00C4B3;
  --c-primary-light: #00DDD0;
  --c-secondary: #3B6FD4;
  --c-accent: #E84040;
  --c-accent-light: #FF6B6B;
  --c-bg: #1C1F26;
  --c-bg-alt: #252830;
  --c-surface: #2D3039;
  --c-text: #F2F2F2;
  --c-text-secondary: #C8C8C8;
  --c-text-muted: #A8A8A8;
  --c-border: #3A3D47;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.45);
}

/* ---------- RESET & BASE ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-base), color var(--t-base);
}
h1, h2, h3, h4, h5, h6 { color: var(--c-text); }
img { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-accent); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.container {
  width: 100%;
  max-width: var(--s-container);
  margin: 0 auto;
  padding-inline: var(--s-gutter);
}

/* ---------- FOCUS VISIBLE ---------- */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ---------- HEADER ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(245,243,239,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
[data-theme="dark"] .header { background: rgba(28,31,38,.92); }
.header--scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem;
}
.nav__logo {
  font-family: var(--f-heading); font-weight: 700; font-size: 1.5rem;
  color: var(--c-text); letter-spacing: -.02em;
}
.accent-dot { color: var(--c-primary); }

.nav__menu { display: flex; gap: 1.75rem; }
.nav__link {
  font-size: .875rem; font-weight: 500; color: var(--c-text-secondary);
  position: relative; padding: .25rem 0;
}
.nav__link::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--c-primary); transition: width var(--t-fast);
}
.nav__link:hover { color: var(--c-text); }
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--c-bg-alt); color: var(--c-text);
  transition: background var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover { background: var(--c-border); transform: rotate(20deg); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Hamburger */
.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 2rem; height: 2rem; justify-content: center; align-items: center;
}
.nav__toggle span {
  display: block; width: 1.25rem; height: 2px; background: var(--c-text);
  border-radius: 2px; transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav__toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  padding: calc(4rem + var(--s-section)) 0 var(--s-section);
  min-height: 100vh; display: flex; align-items: center;
}
.hero__grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center;
}
.hero__greeting {
  font-size: 1.1rem; color: var(--c-primary); font-weight: 600; margin-bottom: .5rem;
  letter-spacing: .05em; text-transform: uppercase;
}
.hero__name {
  font-family: var(--f-heading); font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -.03em;
  color: var(--c-text); margin-bottom: .5rem;
}
.hero__title {
  font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--c-primary);
  margin-bottom: 1.25rem; line-height: 1.5;
}
.hero__desc {
  font-size: 1rem; color: var(--c-text-secondary); max-width: 36rem;
  margin-bottom: 2rem;
}
.hero__cta { display: flex; gap: 1rem; margin-bottom: 2.5rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 2rem; border-radius: var(--r-md); font-weight: 600;
  font-size: .95rem; transition: all var(--t-fast); white-space: nowrap;
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-light); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,158,144,.25); }
.btn--outline { border: 2px solid var(--c-primary); color: var(--c-primary); }
.btn--outline:hover { background: var(--c-primary); color: #fff; transform: translateY(-2px); }
.btn--full { width: 100%; justify-content: center; }
.btn--linkedin { background: var(--c-linkedin); color: #fff; margin-top: 1.5rem; }
.btn--linkedin:hover { opacity: .9; color: #fff; transform: translateY(-2px); }
[data-theme="dark"] .btn--primary { color: #111; }
[data-theme="dark"] .btn--primary:hover { color: #111; }
[data-theme="dark"] .btn--outline:hover { color: #111; }

/* Animated tags carousel */
.hero__tags {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.tags-track {
  display: flex; gap: 1rem; width: max-content;
  animation: scrollTags 25s linear infinite;
}
.tag {
  flex-shrink: 0; padding: .45rem 1.1rem; border-radius: 2rem;
  background: var(--c-bg-alt); color: var(--c-text-secondary);
  font-size: .85rem; font-weight: 500; border: 1px solid var(--c-border);
}
@keyframes scrollTags { to { transform: translateX(-50%); } }

/* Photo placeholder */
.hero__photo { display: flex; justify-content: center; }
.photo-placeholder {
  width: clamp(14rem, 22vw, 22rem); aspect-ratio: 1;
  border-radius: var(--r-xl); background: var(--c-bg-alt); border: 3px dashed var(--c-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); font-size: .95rem; text-align: center; line-height: 1.4;
  transition: border-color var(--t-fast);
}
.photo-placeholder:hover { border-color: var(--c-primary); }

/* ---------- SECTIONS ---------- */
.section { padding: var(--s-section) 0; }
.section--alt { background: var(--c-bg-alt); }
.section--contact { background: var(--c-bg-alt); }
.section__title {
  font-family: var(--f-heading); font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -.02em; margin-bottom: 1rem;
  position: relative; display: inline-block; color: var(--c-text);
}
.section__title::after {
  content: ''; position: absolute; bottom: -.25rem; left: 0;
  width: 2.5rem; height: 3px; background: var(--c-primary); border-radius: 2px;
}
.section__subtitle {
  color: var(--c-text-secondary); font-size: 1.05rem; margin-bottom: 2.5rem; max-width: 36rem;
}

/* ---------- ABOUT ---------- */
.about__grid {
  display: grid; grid-template-columns: 1.4fr .6fr; gap: 2.5rem; margin-top: 2rem;
}
.about__text p { margin-bottom: 1.25rem; color: var(--c-text-secondary); }
.about__text strong { color: var(--c-text); }

.card { background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-sm); border: 1px solid var(--c-border); }
.card--accent { border-left: 4px solid var(--c-primary); }
.card__title {
  font-family: var(--f-heading); font-size: 1.15rem; font-weight: 600;
  margin-bottom: 1rem; color: var(--c-text);
}
.card__list li {
  padding: .4rem 0 .4rem 1.25rem; position: relative; color: var(--c-text-secondary);
}
.card__list li::before {
  content: ''; position: absolute; left: 0; top: .85rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary);
}

/* ---------- EXPERIENCE ---------- */
.experience__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.exp-card {
  background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-sm); transition: transform var(--t-fast), box-shadow var(--t-fast);
  border: 1px solid var(--c-border);
}
.exp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.exp-card--placeholder { border-style: dashed; opacity: .7; }
.exp-card--placeholder:hover { opacity: 1; }
.exp-card__header { margin-bottom: 1.25rem; }
.exp-card__badge {
  display: inline-block; padding: .2rem .75rem; border-radius: 2rem;
  background: var(--c-accent); color: #fff; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .5rem;
}
.exp-card__badge--soon { background: var(--c-text-muted); }
.exp-card__date { font-size: .8rem; color: var(--c-text-muted); display: block; margin-bottom: .35rem; }
.exp-card__role { font-family: var(--f-heading); font-size: 1.25rem; font-weight: 600; color: var(--c-text); }
.exp-card__company { color: var(--c-primary); font-weight: 500; margin-top: .15rem; }
.exp-card__list li {
  padding: .35rem 0 .35rem 1.25rem; position: relative;
  font-size: .92rem; color: var(--c-text-secondary);
}
.exp-card__list li::before {
  content: ''; position: absolute; left: 0; top: .75rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary);
}
.exp-card__cta-text { color: var(--c-text-muted); font-style: italic; font-size: .92rem; }

/* ---------- PROJECTS (Bento Grid) ---------- */
.projects__bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; margin-top: 2rem;
}
.project-card {
  background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project-card--featured { grid-column: span 2; }
.project-card--placeholder { border-style: dashed; opacity: .65; }
.project-card--placeholder:hover { opacity: 1; }
.project-card__tag {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--c-primary); margin-bottom: .75rem;
}
.project-card__title {
  font-family: var(--f-heading); font-size: 1.2rem; font-weight: 600;
  margin-bottom: .6rem; line-height: 1.3; color: var(--c-text);
}
.project-card__desc { font-size: .92rem; color: var(--c-text-secondary); flex: 1; }
.project-card__status {
  display: inline-block; margin-top: 1rem; padding: .25rem .75rem;
  border-radius: 2rem; background: var(--c-bg-alt); font-size: .8rem;
  color: var(--c-text-muted); font-weight: 500; align-self: flex-start;
}

/* ---------- TIMELINE (Education) ---------- */
.timeline { margin-top: 2rem; position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 1rem; top: 0; bottom: 0;
  width: 2px; background: var(--c-border);
}
.timeline__item {
  position: relative; margin-bottom: 2.5rem;
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start;
}
.timeline__item:last-child { margin-bottom: 0; }
.timeline__icon {
  position: absolute; left: -2.5rem; top: 0;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--c-surface); border: 2px solid var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary); z-index: 1;
}
.timeline__icon svg { width: 1.1rem; height: 1.1rem; }
.timeline__content { padding-top: .15rem; }
.timeline__date {
  font-size: .8rem; font-weight: 600; color: var(--c-primary);
  text-transform: uppercase; letter-spacing: .04em;
}
.timeline__title {
  font-family: var(--f-heading); font-size: 1.2rem; font-weight: 600;
  margin: .25rem 0 .4rem; color: var(--c-text);
}
.timeline__content p { font-size: .92rem; color: var(--c-text-secondary); }
.timeline__content strong { color: var(--c-text); }

/* ---------- SKILLS ---------- */
.skills__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.skills__block {
  background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
}
.skills__subtitle {
  font-family: var(--f-heading); font-size: 1.1rem; font-weight: 600;
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem;
  color: var(--c-text);
}
.skills__subtitle svg { color: var(--c-primary); flex-shrink: 0; }
.skills__list li {
  padding: .4rem 0 .4rem 1.25rem; position: relative;
  font-size: .92rem; color: var(--c-text-secondary);
}
.skills__list li::before {
  content: ''; position: absolute; left: 0; top: .8rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary);
}

/* Languages */
.lang { display: flex; flex-direction: column; gap: 1.25rem; }
.lang__item { display: grid; grid-template-columns: 5rem 1fr auto; gap: .75rem; align-items: center; }
.lang__name { font-weight: 600; font-size: .9rem; color: var(--c-text); }
.lang__bar {
  height: .5rem; border-radius: 1rem; background: var(--c-bg-alt); overflow: hidden;
}
.lang__fill {
  height: 100%; width: var(--fill); border-radius: 1rem; background: var(--c-primary);
  transition: width .8s ease;
}
.lang__level { font-size: .8rem; color: var(--c-text-muted); white-space: nowrap; }

/* ---------- PUBLICATIONS ---------- */
.pubs__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.pub-card {
  background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.pub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pub-card__icon { color: var(--c-primary); margin-bottom: 1rem; }
.pub-card__title { font-family: var(--f-heading); font-size: 1.15rem; font-weight: 600; margin-bottom: .25rem; color: var(--c-text); }
.pub-card__meta { font-size: .8rem; color: var(--c-text-muted); margin-bottom: .75rem; }
.pub-card__desc { font-size: .92rem; color: var(--c-text-secondary); }

/* ---------- CONTACT ---------- */
.contact__grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 2.5rem; margin-top: 2rem;
}
.contact__form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--c-text); }
.form-group input,
.form-group textarea {
  padding: .85rem 1rem; border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-family: var(--f-body); font-size: .95rem; color: var(--c-text);
  background: var(--c-surface); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--c-primary); outline-offset: 1px;
  border-color: var(--c-primary);
}
.form-group textarea { resize: vertical; min-height: 7rem; }
.form-group input.error,
.form-group textarea.error { border-color: var(--c-error); }
.form-error { font-size: .78rem; color: var(--c-error); min-height: 1rem; }
.form-status { font-size: .9rem; margin-top: .5rem; text-align: center; }
.form-status.success { color: var(--c-primary); }
.form-status.error { color: var(--c-error); }

.contact__card {
  background: var(--c-surface); border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
}
.contact__card h3 {
  font-family: var(--f-heading); font-size: 1.15rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--c-text);
}
.contact__list li {
  display: flex; align-items: center; gap: .75rem; padding: .6rem 0;
  font-size: .92rem; color: var(--c-text-secondary);
}
.contact__list li svg { color: var(--c-primary); flex-shrink: 0; }
.contact__list li a { color: var(--c-text-secondary); }
.contact__list li a:hover { color: var(--c-primary); }

/* ---------- FOOTER ---------- */
.footer { background: var(--c-secondary); color: #fff; padding: 2.5rem 0; }
[data-theme="dark"] .footer { background: #13151C; color: var(--c-text); border-top: 1px solid var(--c-border); }
.footer__inner {
  display: flex; justify-content: space-between; align-items: start; gap: 2rem; flex-wrap: wrap;
}
.footer__name { font-family: var(--f-heading); font-size: 1.2rem; font-weight: 700; }
.footer__tagline { font-size: .85rem; opacity: .75; margin-top: .25rem; }
.footer__contact { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.footer__contact a { color: #fff; font-size: .85rem; opacity: .8; }
.footer__contact a:hover { opacity: 1; color: #fff; }
[data-theme="dark"] .footer__contact a { color: var(--c-text-secondary); }
[data-theme="dark"] .footer__contact a:hover { color: var(--c-primary); }
.footer__copy { font-size: .78rem; opacity: .55; }
.footer__address { font-size: .72rem; opacity: .35; margin-top: .15rem; }

/* ---------- ANIMATIONS ---------- */
.animate-on-scroll {
  opacity: 0; transform: translateY(1.5rem);
  transition: opacity .6s ease, transform .6s ease;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 64rem) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__photo { order: -1; }
  .hero__desc { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .about__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .projects__bento { grid-template-columns: repeat(2, 1fr); }
  .project-card--featured { grid-column: span 2; }
}

@media (max-width: 48rem) {
  .nav__menu {
    position: fixed; top: 4rem; left: 0; right: 0; bottom: 0;
    background: var(--c-bg); flex-direction: column; align-items: center;
    justify-content: center; gap: 2rem;
    transform: translateX(100%); transition: transform var(--t-base);
    z-index: 99;
  }
  .nav__menu.open { transform: translateX(0); }
  .nav__toggle { display: flex; }
  .nav__link { font-size: 1.2rem; }

  .projects__bento { grid-template-columns: 1fr; }
  .project-card--featured { grid-column: span 1; }

  .footer__inner { flex-direction: column; align-items: center; text-align: center; }
  .footer__contact { justify-content: center; }
}

@media (max-width: 30rem) {
  .hero__name { font-size: 2.5rem; }
  .experience__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
  .pubs__grid { grid-template-columns: 1fr; }
  .lang__item { grid-template-columns: 1fr; gap: .35rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .animate-on-scroll { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
