/* ═══════════════════════════════════════════════════════════════
   Portfolio — Antonio Vilarta Gil (Dark only)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0d13;
  --bg-alt: #12141d;
  --surface: #181a25;
  --text: #e4e4e7;
  --text-secondary: #9ca3af;
  --accent: #60a5fa;
  --accent-light: #1e3a5f;
  --accent-dark: #93c5fd;
  --border: #252836;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
  --shadow-hover: 0 8px 30px rgba(96,165,250,.12), 0 4px 16px rgba(0,0,0,.25);
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --max-width: 1100px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}
.nav--scrolled {
  background: rgba(11,13,19,.8);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 12px rgba(0,0,0,.2);
}
.nav__container {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.nav__logo { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -1px; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a { color: var(--text-secondary); font-size: .88rem; font-weight: 500; transition: color var(--transition); position: relative; }
.nav__links a:hover { color: var(--accent); }
.nav__links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--accent); transition: width var(--transition);
}
.nav__links a:hover::after { width: 100%; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.accent { color: var(--accent); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; transition: var(--transition);
  border: 2px solid transparent; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(96,165,250,.3); }
.btn--outline { border-color: var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--small { padding: 8px 16px; font-size: .82rem; background: rgba(255,255,255,.9); color: #111; border-radius: 6px; font-weight: 600; }
.btn--small:hover { background: var(--accent); color: #fff; }

/* ── HERO ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 100px 24px 60px;
  background: radial-gradient(ellipse at 20% 50%, var(--accent-light) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(139,92,246,.06) 0%, transparent 40%);
}
.hero__container {
  max-width: var(--max-width); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.hero__greeting {
  font-size: .85rem; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px;
}
.hero__name {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 900; line-height: 1.05; margin-bottom: 16px; letter-spacing: -2px;
}
.hero__roles { display: flex; align-items: center; gap: 2px; margin-bottom: 20px; min-height: 32px; }
.hero__role { font-size: 1.15rem; color: var(--accent); font-weight: 600; }
.hero__cursor { color: var(--accent); animation: blink 1s step-end infinite; font-weight: 300; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.hero__desc {
  font-size: 1rem; color: var(--text-secondary); max-width: 480px;
  margin-bottom: 32px; line-height: 1.75;
}
.hero__buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__right { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.hero__photo-wrapper { position: relative; }
.hero__photo-wrapper img {
  width: 320px; height: 320px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent); position: relative; z-index: 1;
}
.hero__photo-ring {
  position: absolute; inset: -12px; border-radius: 50%;
  border: 2px dashed var(--accent); opacity: .3;
  animation: spin 20s linear infinite;
}
.hero__photo-ring--2 {
  inset: -24px;
  border-style: dotted;
  opacity: .15;
  animation-duration: 30s;
  animation-direction: reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__quick-stats { display: flex; gap: 24px; }
.hero__stat { text-align: center; }
.hero__stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.hero__stat-label { font-size: .75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }

/* ── SECTIONS ── */
.section { padding: 90px 24px; }
.section--alt { background: var(--bg-alt); }
.container { max-width: var(--max-width); margin: 0 auto; }
.section__title {
  font-size: 2rem; font-weight: 800; margin-bottom: 48px;
  position: relative; letter-spacing: -.5px;
}
.section__title::after {
  content: ''; position: absolute; bottom: -10px; left: 0;
  width: 44px; height: 4px; background: var(--accent); border-radius: 2px;
}
.section__title--center {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section__title--center::after {
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
}

/* ── ABOUT ── */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about__text p { color: var(--text-secondary); margin-bottom: 16px; font-size: 1rem; line-height: 1.8; }
.about__cards { display: flex; flex-direction: column; gap: 16px; }
.about__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; display: flex; align-items: start; gap: 16px; transition: var(--transition);
}
.about__card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateX(4px); }
.about__card svg { flex-shrink: 0; margin-top: 2px; }
.about__card h3 { font-size: .95rem; margin-bottom: 4px; }
.about__card p { font-size: .85rem; color: var(--text-secondary); line-height: 1.5; }

/* ── STACK / GLOBE ── */
.stack__subtitle {
  color: var(--text-secondary); margin-top: -32px; margin-bottom: 10px;
  text-align: center; font-size: .88rem; letter-spacing: 2px; text-transform: uppercase;
}
.globe-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 24px 20px;
  position: relative;
}
#globeCanvas {
  width: 100%;
  max-width: 750px;
  height: 600px;
  cursor: grab;
}
#globeCanvas:active { cursor: grabbing; }
.globe-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
  z-index: 10;
  transform: translateX(-50%);
}

/* ── PROJECTS ── */
.projects__featured { display: flex; flex-direction: column; gap: 24px; margin-bottom: 24px; }
.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.pcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: var(--transition);
  display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.pcard--wide { flex-direction: row; }
.pcard--wide .pcard__visual { width: 280px; min-height: 260px; flex-shrink: 0; }
.pcard__visual { position: relative; overflow: hidden; }
.pcard__visual > img {
  width: 100%; height: 100%; min-height: 160px; object-fit: cover;
}
.pcard__gradient {
  width: 100%; height: 100%; min-height: 160px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex; align-items: center; justify-content: center;
}
.pcard__overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; transition: var(--transition);
}
.pcard:hover .pcard__overlay { opacity: 1; }
.pcard__fullscreen {
  position: absolute; bottom: 8px; right: 8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.15);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition); backdrop-filter: blur(4px);
}
.pcard__fullscreen:hover { background: var(--accent); border-color: var(--accent); }
.pcard__visual:hover .pcard__fullscreen { opacity: 1; }
@media (hover: none) {
  .pcard__overlay {
    opacity: 1; background: linear-gradient(transparent 40%, rgba(0,0,0,.7));
    align-items: flex-end; padding-bottom: 12px;
  }
  .pcard__fullscreen { opacity: 1; }
  .pcard:hover { transform: none; }
}
.pcard__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.pcard__badges { display: flex; gap: 6px; margin-bottom: 10px; }
.badge {
  padding: 3px 10px; border-radius: 20px; font-size: .7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.badge--live { background: #14532d; color: #86efac; }
.badge--ai { background: #3b0764; color: #c4b5fd; }
.badge--docker { background: #1e3a5f; color: #93c5fd; }
.badge--pwa { background: #451a03; color: #fcd34d; }
.pcard__body h3 { font-size: 1.1rem; margin-bottom: 2px; font-weight: 700; }
.pcard__sub { font-size: .82rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.pcard__body > p { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; flex: 1; }
.pcard__stack { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.pcard__stack span {
  padding: 3px 9px; background: var(--bg-alt); border-radius: 4px;
  font-size: .72rem; font-weight: 500; color: var(--text-secondary);
}

/* ── E-COMMERCE SECTION ── */
.ecommerce-section {
  margin-top: 48px; padding: 32px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.ecommerce__title {
  font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.ecommerce__desc { color: var(--text-secondary); font-size: .92rem; margin-bottom: 20px; }
.ecommerce__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.ecommerce__item {
  padding: 16px; background: var(--bg-alt); border-radius: var(--radius-sm);
}
.ecommerce__item strong { font-size: .85rem; display: block; margin-bottom: 4px; }
.ecommerce__item p { font-size: .8rem; color: var(--text-secondary); line-height: 1.5; }
.ecommerce__stores { display: flex; flex-wrap: wrap; gap: 8px; }
.ecommerce__stores span {
  padding: 5px 14px; background: var(--accent-light); color: var(--accent);
  border-radius: 20px; font-size: .78rem; font-weight: 600;
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 32px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -32px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-alt);
}
.timeline__content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: var(--transition);
}
.timeline__content:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.timeline__header { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 4px; }
.timeline__header h3 { font-size: 1.05rem; font-weight: 700; }
.timeline__period { font-size: .85rem; color: var(--accent); font-weight: 700; white-space: nowrap; }
.timeline__company { font-size: .88rem; color: var(--text-secondary); margin-bottom: 10px; }
.timeline__content ul { list-style: disc; padding-left: 18px; }
.timeline__content li { font-size: .88rem; color: var(--text-secondary); margin-bottom: 3px; line-height: 1.5; }

/* ── EDUCATION ── */
.education__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.education__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; transition: var(--transition);
}
.education__card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.education__year { font-size: .78rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.education__card h3 { font-size: 1.1rem; margin: 8px 0 4px; font-weight: 700; }
.education__card p { font-size: .88rem; color: var(--text-secondary); }
.education__school { font-style: italic; margin-top: 6px; }

/* ── CONTACT ── */
.contact__intro { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 32px; }
.contact__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
  transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.contact__card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.contact__label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); font-weight: 600; }
.contact__value { font-size: .88rem; color: var(--text); font-weight: 600; }

/* ── FOOTER ── */
.footer { padding: 20px 24px; text-align: center; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-secondary); }

/* ── ANIMATIONS ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal--visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .ecommerce__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero__container { grid-template-columns: 1fr; text-align: center; }
  .hero__right { order: -1; }
  .hero__photo-wrapper img { width: 240px; height: 240px; }
  .hero__desc { margin: 0 auto 32px; }
  .hero__buttons { justify-content: center; }
  .hero__quick-stats { justify-content: center; }
  .about__grid { grid-template-columns: 1fr; }
  .pcard--wide { flex-direction: column; }
  .pcard--wide .pcard__visual { width: 100%; min-height: 180px; }
  .contact__links { grid-template-columns: 1fr; }
  #globeCanvas { height: 480px; }
}
@media (max-width: 640px) {
  .nav__links {
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 24px; gap: 20px;
    transform: translateY(-120%); transition: transform var(--transition);
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .nav__links--open { transform: translateY(0); }
  .nav__toggle { display: flex; }
  .nav__toggle--open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav__toggle--open span:nth-child(2) { opacity: 0; }
  .nav__toggle--open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .projects__grid { grid-template-columns: 1fr; }
  .education__grid { grid-template-columns: 1fr; }
  .ecommerce__grid { grid-template-columns: 1fr; }
  .section { padding: 60px 16px; }
  .section__title { font-size: 1.5rem; }
  .hero { padding: 90px 16px 40px; }
  .hero__name { font-size: 2.2rem; }
  #globeCanvas { height: 380px; }
}
