/* ============================================================
   JAVIER GÓMEZ M. — BLUEPRINT MERIDIAN v2
   3D Metallic · Particles · Interactive Cards
   ============================================================ */

:root {
  --bg: #060A13;
  --surface: #0C1120;
  --surface2: #141D2E;
  --border: rgba(255, 255, 255, 0.07);
  --borderAcc: rgba(59, 123, 248, 0.35);

  --blue: #3B7BF8;
  --cyan: #22D3EE;
  --gold: #C8963E;
  --green: #22C55E;

  --text: #F1F5F9;
  --dim: #94A3B8;
  --muted: #475569;

  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  --radius-lg: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Background ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 15% -5%, rgba(59, 123, 248, .15) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 88% 105%, rgba(34, 211, 238, .08) 0%, transparent 60%),
    var(--bg);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 123, 248, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 123, 248, .04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, black 20%, transparent 75%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 60px);
  height: 60px;
  background: rgba(6, 10, 19, .9);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  /* Metallic top shine */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: default;
}

.nav__monogram {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #4d8aff, #2563eb);
  color: white;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 0 16px rgba(59, 123, 248, .4);
}

.nav__brand:hover .nav__monogram {
  transform: rotate(30deg);
}

.nav__title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}

.nav__links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .22s ease;
  border: 1px solid transparent;
}

.btn--solid {
  background: linear-gradient(135deg, #4d8aff, #2563eb);
  color: white;
  border-color: #3B7BF8;
  box-shadow: 0 2px 12px rgba(59, 123, 248, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}

.btn--solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 123, 248, .45), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn--ghost {
  background: transparent;
  color: var(--dim);
  border-color: var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .04);
}

.btn--small {
  padding: 6px 14px;
  font-size: 12px;
}

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 60px);
  position: relative;
  z-index: 1;
}

/* ── Hero ── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 64px 0 48px;
  overflow: hidden;
}

.hero__watermark {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(150px, 20vw, 260px);
  line-height: 1;
  color: rgba(59, 123, 248, .05);
  letter-spacing: -0.05em;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.hero__left {
  position: relative;
  z-index: 1;
}

.hero__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.dot--pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-ring 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  }

  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.hero__label .mono {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.hero__left h1 {
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 0;
}

.glitch {
  display: block;
  position: relative;
  padding-bottom: 20px;
  margin-bottom: 22px;
}

.glitch::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 2px;
}

.kicker {
  display: none;
}

.subtitle {
  font-size: 17px;
  color: var(--dim);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 32px;
}

.subtitle strong {
  color: var(--text);
  font-weight: 600;
}

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ── Profile Card — Metallic macOS style ── */
.hero__right {
  position: relative;
  z-index: 1;
}

.card--profile {
  background: linear-gradient(145deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .02) 40%, rgba(59, 123, 248, .04) 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  /* Metallic depth shadow */
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .5),
    0 1px 0 rgba(255, 255, 255, .08) inset,
    0 -1px 0 rgba(0, 0, 0, .3) inset;
  transition: transform .3s ease, box-shadow .3s ease;
}

.card--profile:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .6),
    0 1px 0 rgba(255, 255, 255, .1) inset,
    0 0 0 1px rgba(59, 123, 248, .15);
}

/* Blueprint corner */
.card--profile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background:
    linear-gradient(to left, rgba(59, 123, 248, .12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 123, 248, .12) 1px, transparent 1px);
  background-size: 12px 12px;
  border-radius: 0 var(--radius-lg) 0 0;
}

.card__top {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .025);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot:nth-child(1) {
  background: #EF4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, .4);
}

.dot:nth-child(2) {
  background: #F59E0B;
  box-shadow: 0 0 6px rgba(245, 158, 11, .3);
}

.dot:nth-child(3) {
  background: #22C55E;
  box-shadow: 0 0 6px rgba(34, 197, 94, .3);
}

.card__body {
  padding: 22px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.dim {
  color: var(--dim);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list li {
  font-size: 13px;
  color: var(--dim);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.list li::before {
  content: '▸';
  color: var(--blue);
  font-size: 10px;
  margin-top: 2px;
  flex-shrink: 0;
}

.card__body a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 12px;
  transition: color .2s;
}

.card__body a:hover {
  color: var(--text);
}

/* ── Sections ── */
.section {
  padding: 72px 0;
}

.section--last {
  padding-bottom: 100px;
}

.section__head {
  margin-bottom: 40px;
}

.section__head h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}

.section__head h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

.section__head .dim {
  font-size: 15px;
  margin-top: 14px;
  display: block;
}

/* ── Projects Grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 16px;
}

/* 3D Tilt Base */
.card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .01) 50%, transparent 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: box-shadow .3s ease;
  transform-style: preserve-3d;
  /* Metallic: top highlight + depth shadow */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  will-change: transform;
}

/* Featured card spans full width */
.card--featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(59, 123, 248, .08) 0%, rgba(34, 211, 238, .04) 50%, rgba(255, 255, 255, .02) 100%);
  border-color: rgba(59, 123, 248, .2);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, .4),
    0 0 0 1px rgba(59, 123, 248, .12),
    inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* Shine sweep — appears on hover via JS */
.card__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .06) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform .65s ease;
  border-radius: var(--radius-lg);
}

.card:hover .card__shine {
  transform: translateX(100%);
}

/* Top accent line on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), transparent);
  opacity: 0;
  transition: opacity .3s;
  z-index: 3;
}

.card:hover::before {
  opacity: 1;
}

.card--featured::before {
  opacity: .6;
}

.card__body {
  padding: 26px 26px 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Card meta row: label + badge */
.card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.case-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--gold);
  opacity: .5;
  flex-shrink: 0;
}

/* Normal cards: case-label takes full width */
.card:not(.card--featured) .case-label {
  margin-bottom: 14px;
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.badge--featured {
  background: rgba(59, 123, 248, .15);
  color: var(--cyan);
  border: 1px solid rgba(59, 123, 248, .3);
}

.card__body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card--featured .card__body h3 {
  font-size: 20px;
}

.card__body>.dim {
  font-size: 14px;
  line-height: 1.7;
  color: var(--dim);
  flex: 1;
  margin-bottom: 18px;
}

/* Tech tags */
.tech-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tech {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  background: rgba(34, 211, 238, .07);
  border: 1px solid rgba(34, 211, 238, .18);
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Contact card */
.contact-card {
  max-width: 440px;
  cursor: default;
}

.contact-card:hover::before {
  opacity: 0;
}

/* ── Stack ── */
.pillbox {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: 4px;
  transition: all .2s;
  cursor: default;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.pill:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .14);
  color: var(--text);
  transform: translateY(-1px);
}

.pill--accent {
  color: var(--blue);
  border-color: rgba(59, 123, 248, .25);
  background: rgba(59, 123, 248, .07);
}

.pill--accent:hover {
  background: rgba(59, 123, 248, .12);
  border-color: rgba(59, 123, 248, .4);
}

/* ── Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 32px;
  margin-left: 8px;
}

.tl__item {
  display: flex;
  gap: 20px;
  padding-bottom: 36px;
  position: relative;
}

.tl__item:last-child {
  padding-bottom: 0;
}

.tl__item::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  transition: border-color .25s, background .25s;
}

.tl__item:hover::before {
  border-color: var(--blue);
  background: rgba(59, 123, 248, .15);
}

.tl__item--done::before {
  background: rgba(34, 197, 94, .15);
  border-color: var(--green);
}

.tl__badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59, 123, 248, .08);
  border: 1px solid rgba(59, 123, 248, .18);
  padding: 4px 10px;
  border-radius: 4px;
  height: fit-content;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.tl__item--done .tl__badge {
  color: var(--green);
  background: rgba(34, 197, 94, .08);
  border-color: rgba(34, 197, 94, .2);
}

.tl__content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.tl__content .dim {
  font-size: 14px;
}

.tl__content a {
  color: var(--cyan);
  text-decoration: none;
}

.tl__content a:hover {
  color: var(--text);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

::selection {
  background: rgba(59, 123, 248, .25);
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 48px 0 36px;
    gap: 36px;
  }

  .hero__watermark {
    display: none;
  }

  .hero__left h1 {
    font-size: clamp(36px, 10vw, 52px);
  }

  .nav__title {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .card--featured {
    grid-column: 1;
  }

  .section {
    padding: 56px 0;
  }
}

@media (max-width: 480px) {
  .nav__links a:not(.btn) {
    display: none;
  }

  .cta {
    flex-direction: column;
  }
}