body {
  margin: 0;
  background: var(--pf-bg, #f7fbff);
  color: var(--pf-text, #20212b);
}

.profile-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid #dbeafe;
  border-radius: 28px;
  padding: 34px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 58%, #ffffff 100%);
  box-shadow: var(--pf-shadow-sm);
}

.profile-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0));
  pointer-events: none;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  margin: 0 0 8px;
  color: #2451a6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #163766;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.18;
}

h2 {
  margin-bottom: 12px;
  color: #163766;
  font-size: 20px;
}

h3 {
  margin: 16px 0 8px;
  color: #174ea6;
  font-size: 15px;
}

p,
li {
  color: #596175;
  line-height: 1.68;
}

.profile-hero p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: #5e6678;
  font-size: 16px;
}

.state-box,
.summary-card,
.panel,
.cta-band {
  border: 1px solid var(--pf-border, #dde3ef);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--pf-shadow-sm);
  padding: 24px;
}

.state-box.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.profile-box {
  display: grid;
  gap: 18px;
}

.hero-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
}

.hero-card #profileSummary {
  color: #2f3a4f;
  font-size: 17px;
  line-height: 1.8;
}

.sub-summary {
  margin-bottom: 0;
  color: #5e6678;
}

.dashboard-grid,
.preference-grid,
.growth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  min-height: 240px;
}

.section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-description {
  margin-bottom: 16px;
  color: #64748b;
}

.tag-list,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.soft-tags {
  margin-top: 10px;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 11px;
  background: #eaf4ff;
  color: #2451a6;
  font-size: 13px;
  font-weight: 800;
}

.soft-tags .profile-tag,
.tag-cloud .profile-tag {
  background: #f0f7ff;
  color: #174ea6;
}

.cloud-tag.size-1 {
  font-size: 13px;
}

.cloud-tag.size-2 {
  font-size: 14px;
  padding-inline: 13px;
}

.cloud-tag.size-3 {
  font-size: 15px;
  padding-inline: 15px;
  background: #dbeafe;
}

.insight-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 19px;
}

.insight-list li {
  margin: 0;
}

.learning-style {
  margin: 14px 0 0;
  border-left: 3px solid #60a5fa;
  padding-left: 12px;
  color: #4d5870;
}

.weight-list {
  display: grid;
  gap: 12px;
}

.weight-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr 56px;
  align-items: center;
  gap: 12px;
}

.weight-label {
  color: #334155;
  font-weight: 900;
}

.weight-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e5edf8;
}

.weight-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2451a6);
}

.weight-value {
  color: #163766;
  font-size: 13px;
  text-align: right;
}

.preference-card {
  border-color: #bfdbfe;
}

.confidence-chip {
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 54px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  color: #174ea6;
  font-size: 20px;
  font-weight: 900;
}

.preference-panel {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 16px;
  background: #f8fbff;
}

.preference-panel.wide {
  grid-column: span 1;
}

.mini-weight-list {
  display: grid;
  gap: 8px;
}

.mini-weight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  padding: 9px 10px;
  background: #ffffff;
}

.mini-weight-row span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.mini-weight-row strong {
  color: #2451a6;
  font-size: 13px;
}

.muted-list .mini-weight-row strong {
  color: #64748b;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 12px;
  background: #2451a6;
  color: #ffffff;
  font-weight: 900;
}

.updated-at {
  margin: 0;
  color: #64748b;
}

.growth-card article {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 16px;
  background: #f8fbff;
}

.ready-profile {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.ready-profile div {
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

dt {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

dd {
  margin: 0;
  color: #163766;
  font-weight: 900;
  line-height: 1.5;
}

.ready-keywords {
  display: grid;
  gap: 8px;
}

.empty-note {
  margin: 0;
  color: #64748b;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-band h2 {
  margin-bottom: 8px;
}

.cta-band p {
  margin-bottom: 0;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #2451a6;
  border-radius: 14px;
  padding: 0 16px;
  background: #2451a6;
  color: white;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
  
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.cta-button.secondary {
  border-color: #cfd7e6;
  background: #ffffff;
  color: #174ea6;
  box-shadow: none;
}

.cta-button:hover {
  transform: translateY(-1px);
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .preference-grid,
  .growth-grid,
  .ready-profile {
    grid-template-columns: 1fr;
  }

  .weight-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .weight-value {
    text-align: left;
  }

  .cta-band,
  .section-header-row {
    align-items: stretch;
    flex-direction: column;
  }

  .cta-actions {
    justify-content: stretch;
  }

  .cta-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container{padding-top: 32px}

  .profile-hero {
    padding: 26px;
  }

  h1 {
    font-size: 28px;
  }
}


/* Feedback change visualization */
.feedback-change-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
}

.feedback-empty {
  border: 1px dashed #bfdbfe;
  border-radius: 18px;
  padding: 18px;
  background: #f8fbff;
  color: #5e6678;
  line-height: 1.65;
}

.feedback-change-content {
  display: grid;
  gap: 16px;
}

.feedback-visual-grid,
.feedback-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feedback-panel {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 16px;
  background: rgba(248, 251, 255, 0.95);
}

.feedback-panel h3 {
  margin-top: 0;
}

.change-bar-list {
  display: grid;
  gap: 10px;
}

.change-bar-row {
  display: grid;
  gap: 7px;
}

.change-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.change-bar-top span {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.change-bar-top strong {
  color: #2451a6;
  font-size: 13px;
}

.change-bar-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e5edf8;
}

.change-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dd3fc, #2451a6);
}

.compact-bars .change-bar-track {
  height: 7px;
}

.feedback-tag {
  background: #eef6ff;
  color: #2451a6;
}

.muted-tags .feedback-tag {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #dbeafe;
}

.difficulty-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.difficulty-step {
  display: grid;
  justify-items: center;
  gap: 8px;
  position: relative;
  min-width: 0;
}

.difficulty-dot {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #bfdbfe;
  border-radius: 50%;
  background: #ffffff;
}

.difficulty-step strong {
  color: #64748b;
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
}

.difficulty-step.passed .difficulty-dot {
  border-color: #60a5fa;
  background: #dbeafe;
}

.difficulty-step.active .difficulty-dot {
  border-color: #2451a6;
  background: #2451a6;
  box-shadow: 0 0 0 5px rgba(36, 81, 166, 0.12);
}

.difficulty-step.active strong {
  color: #174ea6;
  font-weight: 900;
}

.confidence-bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e5edf8;
}

.confidence-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #0f766e);
  transition: width 0.2s ease;
}

.confidence-text {
  margin: 12px 0 0;
  color: #5e6678;
  font-size: 14px;
}

@media (max-width: 900px) {
  .feedback-visual-grid,
  .feedback-status-grid {
    grid-template-columns: 1fr;
  }

  .difficulty-stepper {
    grid-template-columns: 1fr;
  }

  .difficulty-step {
    grid-template-columns: 22px 1fr;
    justify-items: start;
    align-items: center;
  }

  .difficulty-step strong {
    text-align: left;
  }
}


/* ------------------------------------------------------------ 로드맵 목표 */

.goal-section {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: linear-gradient(135deg, var(--pf-surface), var(--pf-primary-pale));
}

.goal-section .section-heading h2 {
  margin: 6px 0 8px;
  font-size: 20px;
}

.goal-section .section-heading p {
  margin: 0;
  max-width: 60ch;
  color: var(--pf-muted);
  font-size: 14px;
  line-height: 1.65;
}

.goal-targets {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.goal-targets li {
  padding: 14px 16px;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  background: var(--pf-surface);
}

.goal-target-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.goal-target-head strong {
  font-size: 15px;
}

.goal-target-head span {
  color: var(--pf-primary-dark);
  font-size: 14px;
  font-weight: 900;
}

.goal-targets p {
  margin: 0;
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.6;
}

.goal-section .cta-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
}


/* ------------------------------------------------------------ 스크롤 연출 */

/*
 * 카드는 기본적으로 가라앉아 있다가, 화면 중앙 밴드에 들어오면 떠오릅니다.
 * 지나가면 다시 가라앉아 지금 읽는 카드에 시선이 모입니다.
 * 관찰과 클래스 토글은 profile.js의 setupScrollReveal이 담당합니다.
 */
.reveal-item {
  opacity: 0.18;
  transform: translateY(26px) scale(0.985);
  filter: blur(1px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s ease;
  will-change: opacity, transform;
}

.reveal-item.reveal-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* JS가 동작하지 않는 환경에서는 흐리게 남지 않도록 모두 보여줍니다. */
@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}


/* ---------------------------------------------------------- 수치 애니메이션 */

/*
 * 막대는 폭 0에서 시작해 목표까지 늘어납니다.
 * 시작 시점은 profile.js가 카드별로 어긋나게 잡아줍니다.
 */
.weight-bar,
.change-bar-fill,
.confidence-bar-fill {
  transition: width 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 숫자는 자릿수가 바뀔 때 좌우로 흔들리지 않게 고정폭 숫자를 씁니다. */
.weight-value,
.mini-weight-row strong,
.change-bar-top strong,
.confidence-chip {
  font-variant-numeric: tabular-nums;
}

/* 카드가 들어올 때 태그가 순서대로 톡톡 나타납니다. */
.reveal-item.reveal-in .profile-tag,
.reveal-item.reveal-in .cloud-tag {
  animation: tag-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-item.reveal-in .profile-tag:nth-child(1) { animation-delay: 0.04s; }
.reveal-item.reveal-in .profile-tag:nth-child(2) { animation-delay: 0.09s; }
.reveal-item.reveal-in .profile-tag:nth-child(3) { animation-delay: 0.14s; }
.reveal-item.reveal-in .profile-tag:nth-child(4) { animation-delay: 0.19s; }
.reveal-item.reveal-in .profile-tag:nth-child(5) { animation-delay: 0.24s; }
.reveal-item.reveal-in .profile-tag:nth-child(n + 6) { animation-delay: 0.28s; }

@keyframes tag-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* 난이도 단계는 현재 위치만 살짝 맥동해 눈이 가게 합니다. */
.difficulty-step.active .difficulty-dot {
  animation: dot-pulse 2.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  .weight-bar,
  .change-bar-fill,
  .confidence-bar-fill {
    transition: none;
  }

  .reveal-item.reveal-in .profile-tag,
  .reveal-item.reveal-in .cloud-tag,
  .difficulty-step.active .difficulty-dot {
    animation: none;
  }
}
