.profile-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  overflow: hidden;
}

.profile-hero--stand {
  grid-template-columns: minmax(220px, 340px) 1fr;
}

.profile-portrait {
  position: relative;
  min-height: 280px;
  background: var(--bg-elevated);
}

.profile-portrait--stand {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 16px 12px 0;
}

.profile-hero.gen1 .profile-portrait {
  background: radial-gradient(ellipse at 50% 30%, rgba(212, 180, 131, 0.22), transparent 60%), var(--bg-elevated);
}
.profile-hero.gen2 .profile-portrait {
  background: radial-gradient(ellipse at 50% 30%, rgba(126, 176, 216, 0.22), transparent 60%), var(--bg-elevated);
}
.profile-hero.gen3 .profile-portrait {
  background: radial-gradient(ellipse at 50% 30%, rgba(212, 146, 168, 0.22), transparent 60%), var(--bg-elevated);
}
.profile-hero.trainee .profile-portrait {
  background: radial-gradient(ellipse at 50% 30%, rgba(127, 196, 178, 0.2), transparent 60%), var(--bg-elevated);
}

.profile-portrait__stand {
  position: relative;
  max-height: min(62vh, 480px);
  width: auto;
  height: auto;
  max-width: min(100%, 78vw);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 36px rgba(0,0,0,0.35));
}

.profile-portrait__fallback {
  position: absolute;
  width: 56%;
  height: auto;
  aspect-ratio: 1;
  inset: auto;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.profile-info {
  padding: 36px 32px;
}

.gen-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.profile-hero.gen1 .gen-badge { color: var(--gen1); background: var(--gen1-soft); }
.profile-hero.gen2 .gen-badge { color: var(--gen2); background: var(--gen2-soft); }
.profile-hero.gen3 .gen-badge { color: var(--gen3); background: var(--gen3-soft); }
.profile-hero.trainee .gen-badge { color: var(--trainee); background: var(--trainee-soft); }

.profile-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin-bottom: 6px;
}

.profile-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-gen-sub {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.profile-desc {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 520px;
  white-space: pre-line;
}

.profile-desc.is-loading { color: var(--text-faint); font-size: 0.85rem; }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.profile-hero .subscriber-badge {
  font-size: 0.8rem;
}

.btn-yt {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  color: var(--bg);
  transition: filter 0.2s, transform 0.15s;
}

.profile-hero.gen1 .btn-yt { background: var(--gen1); }
.profile-hero.gen2 .btn-yt { background: var(--gen2); }
.profile-hero.gen3 .btn-yt { background: var(--gen3); }
.profile-hero.trainee .btn-yt { background: var(--trainee); }

.btn-yt:hover { filter: brightness(1.06); transform: translateY(-1px); }

.profile-links {
  margin-top: 28px;
  max-width: 520px;
}

.profile-links__title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.profile-links__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border);
}

.profile-links__list a {
  display: block;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: color 0.2s, padding-left 0.2s;
}

.profile-links__list a:hover {
  color: var(--text-muted);
  padding-left: 6px;
}

.profile-section { margin-bottom: 40px; }

.profile-section .section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.video-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.video-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.video-card-title {
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card:hover .video-card-title { color: var(--text); }

.profile-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.profile-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s;
}

.profile-nav a:hover { color: var(--text); }
.profile-nav .disabled { opacity: 0.35; pointer-events: none; }

.profile-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.not-found {
  text-align: center;
  padding: 120px 24px;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.not-found p { color: var(--text-muted); margin-bottom: 24px; }
.not-found a { color: var(--gen2); text-decoration: none; }

@media (max-width: 900px) {
  .profile-page {
    padding: 36px 20px 64px;
  }

  .profile-hero,
  .profile-hero--stand {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-portrait {
    min-height: 280px;
  }

  .profile-portrait--stand {
    min-height: 0;
    padding: 12px 16px 0;
  }

  .profile-portrait__stand {
    max-width: min(100%, 70vw);
    max-height: min(48vh, 380px);
  }

  .profile-info {
    padding: 28px 22px 32px;
  }

  .profile-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .profile-meta {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .profile-page {
    padding: 28px 14px 56px;
  }

  .profile-portrait--stand {
    min-height: 0;
    padding: 10px 18px 0;
  }

  .profile-portrait__stand {
    max-width: min(100%, 64vw);
    max-height: min(40vh, 280px);
  }

  .profile-name {
    font-size: 1.65rem;
  }

  .profile-info {
    padding: 24px 16px 28px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .profile-nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}
