*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 12px rgba(60, 60, 60, 0.07);
  --shadow-card-hover: 0 6px 20px rgba(60, 60, 60, 0.12);
  --brand: #1aaa6e;
  --brand-dark: #0e8f5b;
  --brand-light: rgba(26, 170, 110, 0.12);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: #e8e8e8;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 100px;
}

/* ─── Navbar ────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 500px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 24px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(0, 0, 0, 0.07);
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8) 20%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.8) 80%,
    transparent
  );
  border-radius: var(--radius-pill);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(0, 0, 0, 0.09);
}

.logo-wrap {
  flex-shrink: 0;
}

.logo-img {
  margin-left: 20px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--brand);
  box-shadow: 0 1px 4px rgba(60, 60, 60, 0.08);
}

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 1;
}

.nav-item {
  font-size: 13px;
  color: #777;
  cursor: pointer;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-item:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  font-weight: 500;
  color: var(--brand-dark);
  background: var(--brand-light);
}

.nav-item:active {
  transform: scale(0.95);
}

.online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-dark);
  background: rgba(26, 170, 110, 0.1);
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 8px;
  white-space: nowrap;
  margin-left: auto;
  cursor: pointer;
  transition: background 0.15s ease;
}

.online-badge:hover {
  background: rgba(26, 170, 110, 0.18);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.dot.online {
  background: var(--brand);
  box-shadow: 0 0 6px rgba(26, 170, 110, 0.5);
}

.dot.offline {
  background: #e74c3c;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
  animation: pulse-offline 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.9); }
}

@keyframes pulse-offline {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.85); }
}

/* ─── Profile card ──────────────────────────────────────── */

.profile-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.profile-photo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--brand);
  margin-top: -50px;
  background: #f4f4f4;
  box-shadow: 0 2px 8px rgba(60, 60, 60, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #111;
}

.profile-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #444;
}

.profile-sub .sep {
  color: #999;
}

.divider {
  width: 100%;
  border: none;
  border-top: 1px solid #e0e0e0;
}

.profile-bio {
  font-size: 14px;
  color: #444;
  text-align: center;
  line-height: 1.65;
  font-style: italic;
  padding: 0 8px;
}

/* ─── Activity card ─────────────────────────────────────── */

.activity-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 90px;
  box-shadow: var(--shadow-card);
}

.activity-node {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.4;
  flex-shrink: 0;
}

.node-orange  { background: #fff0e0; border: 1.5px solid #f0a060; color: #a05010; }
.node-green   { background: #d8f5e8; border: 1.5px solid #3dbb7a; color: #0a6030; font-weight: 600; }
.node-blue    { background: #ddeeff; border: 1.5px solid #60a0f0; color: #1050a0; }
.node-yellow  { background: #fffbe0; border: 1.5px solid #ffe066; color: #a08a10; }
.node-red     { background: #ffe0e0; border: 1.5px solid #f06060; color: #a01010; }
.node-purple  { background: #f3e0ff; border: 1.5px solid #b060f0; color: #5a108a; }
.node-cyan    { background: #e0faff; border: 1.5px solid #60e0f0; color: #107a8a; }
.node-pink    { background: #ffe0f3; border: 1.5px solid #f060b0; color: #a0105a; }
.node-gray    { background: #f4f4f4; border: 1.5px solid #ccc;    color: #555; }

/* ─── Roadmap ────────────────────────────────────────────── */

.roadmap-wrapper {
  width: 100%;
  overflow: hidden;
  padding: 4px 0;
}

.roadmap-container {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.roadmap-container::-webkit-scrollbar {
  display: none;
}

.roadmap-node {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 12px;
  line-height: 1.4;
  flex-shrink: 0;
  white-space: pre-line;
  text-decoration: none;
  background: var(--node-bg, rgba(255, 240, 224, 0.6));
  border: 1.5px solid var(--node-border, #f0a060);
  color: var(--node-text, #a05010);
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.roadmap-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.roadmap-arrow {
  font-size: 20px;
  color: #888;
  flex-shrink: 0;
  margin: 0 4px;
}

/* ─── Project card (destacado) ──────────────────────────── */

.project-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  min-height: 140px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.project-img {
  width: 110px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
  border-right: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
  position: relative;
  overflow: hidden;
}

.project-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg,  transparent 45%, rgba(255, 255, 255, 0.4) 50%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, rgba(255, 255, 255, 0.4) 50%, transparent 55%);
  background-size: 20px 20px;
}

.project-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.project-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.project-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.6;
  flex: 1;
}

.discover-btn {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.discover-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

/* ─── Projects list ─────────────────────────────────────── */

.projects-list {
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  overflow: hidden auto;
  box-shadow: var(--shadow-card);
}

.projects-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.projects-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.projects-container {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s ease, padding-left 0.15s ease;
}

.project-item:last-child {
  border-bottom: none;
}

.project-item:hover {
  background: #f8f8f8;
  padding-left: 20px;
}

.project-item:active {
  background: #f0f0f0;
}

.project-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.project-item-arrow {
  font-size: 20px;
  color: #ccc;
  transition: color 0.15s ease, transform 0.15s ease;
}

.project-item:hover .project-item-arrow {
  color: var(--brand);
  transform: translateX(3px);
}

.projects-error {
  padding: 16px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* ─── Modal fullscreen ──────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: #eee;
  color: #111;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  justify-content: center;
}

/* El markdown se limita en desktop, fluido en móvil */
.markdown-body {
  width: 100%;
  max-width: 680px;
}

/* ─── Footer ─────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: 20px 10px;
  font-size: 12px;
  color: #888;
}

.footer a {
  color: var(--brand);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 400px) {
  .nav-links span     { font-size: 11px; }
  .online-badge       { font-size: 11px; }
  .profile-name       { font-size: 20px; }
  .activity-node      { font-size: 11px; padding: 7px 10px; }
  .profile-photo-wrap { width: 80px; height: 80px; margin-top: -30px; }
  .project-card       { flex-direction: column; }
  .project-img        { width: 100%; height: 100px; border-right: none; border-bottom: 1px solid #e0e0e0; }
  .roadmap-node       { font-size: 11px; padding: 8px 12px; }
}