* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 3rem 0;
}

/* --- Mesh gradient background (soft pastel, light) --- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(160, 130, 230, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(130, 180, 240, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 60% 80%, rgba(240, 170, 200, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 10% 70%, rgba(150, 210, 220, 0.16) 0%, transparent 70%);
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Layout --- */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Glass card base (white frosted) --- */
.card {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border-radius: 16px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* --- Card shared --- */
.card-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.4);
  padding: 0.85rem 1.1rem 0.4rem;
}

.card-body {
  padding: 0.4rem 1.1rem 1rem;
}

.card-body p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 0.6rem;
}

.card-body p:last-child {
  margin-bottom: 0;
}

/* --- Profile card --- */
.profile-card {
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  margin: 0 auto 1rem;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* --- Instagram-style story ring around avatar --- */
.avatar-story-ring {
  appearance: none;
  border: none;
  background: conic-gradient(
    from 0deg,
    #feda75 0%,
    #fa7e1e 20%,
    #d62976 45%,
    #962fbf 70%,
    #4f5bd5 90%,
    #feda75 100%
  );
  padding: 3px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  cursor: pointer;
  transition: transform 0.18s ease;
  position: relative;
}

.avatar-story-ring:active {
  transform: scale(0.96);
}

.avatar-story-ring[data-seen="true"] {
  background: linear-gradient(135deg, rgba(0,0,0,0.18), rgba(0,0,0,0.1));
}

.avatar-story-inner {
  background: #fff;
  padding: 3px;
  border-radius: 50%;
  display: flex;
}

.avatar-story-ring .avatar {
  margin: 0;
  border: none;
  box-shadow: none;
  width: 96px;
  height: 96px;
}

/* subtle shimmer to hint "new content" */
.avatar-story-ring:not([data-seen="true"])::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(220, 41, 118, 0.45);
  animation: storyRingPulse 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes storyRingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 41, 118, 0.40); }
  70%  { box-shadow: 0 0 0 12px rgba(220, 41, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 41, 118, 0); }
}

/* --- Story viewer --- */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.story-viewer.is-open {
  opacity: 1;
}

/* The "phone-like" frame that matches main column width */
.story-viewer-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100dvh;
  background: #000;
  overflow: hidden;
}

@media (min-width: 481px) {
  .story-viewer-frame {
    height: calc(100dvh - 3rem);
    max-height: 820px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  }
}

.story-progress-bars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  z-index: 3;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
}

.story-progress-bar {
  flex: 1;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 2px;
}

.story-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 14px 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 22px);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
}

.story-viewer-header > * {
  pointer-events: auto;
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.story-viewer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.story-viewer-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.story-viewer-name {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.1;
}

.story-viewer-time {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  line-height: 1.2;
  margin-top: 2px;
}

.story-viewer-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}

.story-viewer-close:active {
  background: rgba(255, 255, 255, 0.12);
}

.story-viewer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.story-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-slide[hidden] {
  display: none;
}

.story-slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  padding: 0 1.6rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.story-slide-text {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #fff;
  text-align: center;
}

.story-slide-text span {
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  white-space: pre-line;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
  max-width: 360px;
}

.story-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.story-nav-prev { left: 0; }
.story-nav-next { right: 0; width: 67%; }

@media (prefers-reduced-motion: reduce) {
  .avatar-story-ring:not([data-seen="true"])::after {
    animation: none;
  }
  .story-viewer {
    transition: none;
  }
}

h1 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  color: #1d1d1f;
}

.role {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.55);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.role a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

.role a:hover {
  color: #0055aa;
}

.location {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.location svg {
  opacity: 0.55;
}

/* --- Status card --- */
.status-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  color: rgba(0, 0, 0, 0.72);
}

.status-card strong {
  color: #0066cc;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30b84a;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(48, 184, 74, 0.45);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Live presence variants --- */
.presence-card[data-state="offline"] .presence-dot {
  background: #b0b0b5;
  box-shadow: none;
  animation: none;
}
.presence-card[data-state="offline"] {
  color: rgba(0, 0, 0, 0.45);
}

.activity-dot {
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.45);
  animation: none;
}
.music-dot {
  background: #e11d48;
  box-shadow: 0 0 6px rgba(225, 29, 72, 0.45);
  animation: none;
}

/* --- Live status card: current activity + now playing --- */
.live-status {
  display: flex;
  flex-direction: column;
}

.live-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
}

.row-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.row-icon svg { display: block; }

/* State-specific accents for status row */
.live-status[data-state="online"] .row-activity .row-icon {
  background: rgba(0, 122, 255, 0.14);
  color: #0064d8;
  box-shadow:
    inset 0 0 0 0.5px rgba(0, 122, 255, 0.28),
    0 4px 12px rgba(0, 122, 255, 0.18);
}

/* Radiating pulse for "online" idle state */
.live-status[data-state="online"] .row-activity .row-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 11px;
  border: 1.5px solid rgba(0, 122, 255, 0.48);
  animation: livePulse 2.2s ease-out infinite;
}
@keyframes livePulse {
  0%   { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 0; }
}

.live-status[data-state="offline"] .row-activity .row-icon {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

/* Music icon */
.row-music .row-icon {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.18), rgba(225, 29, 72, 0.08));
  color: #b81e3d;
  box-shadow:
    inset 0 0 0 0.5px rgba(225, 29, 72, 0.22),
    0 4px 12px rgba(225, 29, 72, 0.12);
}

/* Shared text column */
.row-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  flex: 1;
}

.row-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  line-height: 1.2;
  margin-bottom: 0.12rem;
}

.row-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #1d1d1f;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  font-size: 0.74rem;
  color: rgba(0, 0, 0, 0.48);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-status[data-state="offline"] .row-title {
  color: rgba(0, 0, 0, 0.55);
  font-weight: 500;
}

/* Divider between rows */
.live-divider {
  height: 0.5px;
  background: rgba(0, 0, 0, 0.07);
  margin: 0 1.1rem;
}

/* Online — beacon estilo "LIVE stream" del lado derecho */
.online-beacon {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007aff;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
  animation: onlineBeacon 1.8s ease-out infinite;
}

@keyframes onlineBeacon {
  0%   { box-shadow: 0 0 0 0   rgba(0, 122, 255, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(0, 122, 255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(0, 122, 255, 0); }
}

/* Equalizer — 4 barras bailando (solo en music row) */
.music-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.music-eq span {
  display: block;
  width: 2.5px;
  background: #e11d48;
  border-radius: 1.5px;
  transform-origin: bottom;
  animation: musicEq 1.15s ease-in-out infinite;
}

.music-eq span:nth-child(1) { height: 60%; animation-delay: 0s; }
.music-eq span:nth-child(2) { height: 100%; animation-delay: 0.18s; }
.music-eq span:nth-child(3) { height: 45%; animation-delay: 0.36s; }
.music-eq span:nth-child(4) { height: 80%; animation-delay: 0.54s; }

@keyframes musicEq {
  0%, 100% { transform: scaleY(0.25); }
  50%      { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .live-status[data-state="online"] .row-activity .row-icon::before,
  .online-beacon,
  .music-eq span {
    animation: none;
  }
}


/* --- Skills chips --- */
.skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem 1rem;
}

.chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chip:active {
  transform: scale(0.96);
}

.chip-ai    { background: rgba(160, 70, 220, 0.1);  color: #8a3dbd; border-color: rgba(160, 70, 220, 0.2); }
.chip-dev   { background: rgba(0, 102, 204, 0.1);   color: #0055aa; border-color: rgba(0, 102, 204, 0.2); }
.chip-data  { background: rgba(35, 165, 70, 0.12);  color: #1f8a3c; border-color: rgba(35, 165, 70, 0.22); }
.chip-cloud { background: rgba(230, 130, 20, 0.12); color: #b5660e; border-color: rgba(230, 130, 20, 0.22); }
.chip-lead  { background: rgba(220, 40, 50, 0.1);   color: #b31f2a; border-color: rgba(220, 40, 50, 0.2); }

/* --- Tech Stack grid --- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5px;
  background: rgba(0, 0, 0, 0.06);
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: #fff;
  transition: background 0.15s;
}

.stack-item span {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
}

.stack-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.stack-icon.gcloud   { background: linear-gradient(135deg, #4285F4, #34A853); }
.stack-icon.aws      { background: linear-gradient(135deg, #FF9900, #EC7211); }
.stack-icon.node     { background: linear-gradient(135deg, #539E43, #3C7A30); }
.stack-icon.python   { background: linear-gradient(135deg, #3776AB, #FFD43B); }
.stack-icon.firebase { background: linear-gradient(135deg, #FFCA28, #F57C00); }
.stack-icon.ai       { background: linear-gradient(135deg, #D97757, #C45A3C); }

/* --- Project card --- */
.project-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
  transition: background 0.15s;
  cursor: pointer;
}

.project-row:active {
  background: rgba(0, 0, 0, 0.05);
}

@media (hover: hover) {
  .project-row:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

.project-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4aadff, #0A66C2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.project-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.project-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1d1d1f;
}

.project-desc {
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.35;
}

/* --- Timeline --- */
.timeline {
  padding: 0.4rem 1.1rem 1rem;
}

.timeline-item {
  display: flex;
  gap: 0.85rem;
  padding-bottom: 1rem;
  position: relative;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.timeline-marker {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  margin-top: 3px;
}

.timeline-marker.current {
  background: #30b84a;
  border-color: #30b84a;
  box-shadow: 0 0 6px rgba(48, 184, 74, 0.35);
}

.timeline-marker.education {
  background: #5e5ce6;
  border-color: #5e5ce6;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 0.1rem;
}

.timeline-company {
  font-size: 0.82rem;
  color: #0066cc;
  margin-bottom: 0.15rem;
}

.timeline-date {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 0.3rem;
}

.timeline-desc {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.4;
}

/* --- Social icon bar --- */
.social-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}

.social-icon:active {
  transform: scale(0.9);
  opacity: 0.7;
}

@media (hover: hover) {
  .social-icon:hover {
    transform: scale(1.1);
  }
}

.social-icon.github    { background: #1d1d1f; }
.social-icon.linkedin  { background: #0A66C2; }
.social-icon.instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-icon.tiktok    { background: #111; }
.social-icon.mail      { background: #0066cc; }

.link-chevron {
  font-size: 1.3rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.4);
  line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  body {
    padding: 1.5rem 0;
  }

  main {
    max-width: 100%;
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.45rem;
  }

  .avatar {
    width: 88px;
    height: 88px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .bg-mesh { animation: none; }
  .status-dot { animation: none; }
}
