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

:root {
  --bg: #0f0e15;
  --bg-dark: #09080f;
  --bg-card: rgba(23, 21, 30, 0.82);
  --bg-card-hover: rgba(30, 28, 40, 0.9);
  --brand: #c4847a;
  --brand-light: #d4a49c;
  /* 브랜드 톤 '텍스트' 전용. --brand-light는 그라디언트의 밝은 끝단이라
     라이트 테마에서 본문 색으로 쓰면 대비가 2.6:1까지 떨어진다 */
  --brand-text: #d4a49c;
  --brand-04: rgba(196,132,122,0.04);
  --brand-06: rgba(196,132,122,0.06);
  --brand-08: rgba(196,132,122,0.08);
  --brand-10: rgba(196,132,122,0.10);
  --brand-12: rgba(196,132,122,0.12);
  --brand-14: rgba(196,132,122,0.14);
  --brand-20: rgba(196,132,122,0.20);
  --brand-25: rgba(196,132,122,0.25);
  --brand-35: rgba(196,132,122,0.35);
  --brand-40: rgba(196,132,122,0.40);
  --brand-60: rgba(196,132,122,0.60);
  --text: #eee;
  --text-muted: #aaa;
  --text-dim: #808080;        /* #555는 배경 대비 2.6:1로 WCAG AA 미달이었다 */
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;          /* 프로필 모달 박스 */
  --font: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glow-velog: rgba(32, 201, 151, 0.18);
  --glow-brunch: rgba(100, 100, 100, 0.15);
  --glow-github: rgba(236, 236, 236, 0.18);
  --glow-melon: rgba(0, 205, 60, 0.18);
  --glow-soundcloud: rgba(255, 85, 0, 0.18);
  --glow-instagram: rgba(131, 58, 180, 0.18);
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --hero-name-size: 80px;
  --hero-name-size-mobile: 52px;
  --hero-entrance-offset: 28px;
  --hero-entrance-duration: 0.7s;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --platform-velog: #20c997;
  --platform-github: #58a6ff;

  /* Action pill (.profile__action) */
  --focus-pill-bg: rgba(255, 255, 255, 0.05);

  /* App Store (Released Apps) */
  --platform-app: #0a84ff;            /* App Store 블루 (다크 테마) */
  --platform-app-14: rgba(10, 132, 255, 0.14);
  --glow-app: rgba(10, 132, 255, 0.18);

  /* Linktree row tokens */
  --card-gap: 14px;          /* 카드 사이 세로 간격 */
  --card-pad-x: 24px;        /* 헤더/아이템 좌우 패딩 */
  --card-pad-y: 20px;        /* 헤더 상하 패딩 */
  --card-items-gap: 10px;    /* 프리뷰 썸네일 사이 간격 */
  --card-icon: 44px;         /* 아이콘 정사각 크기 */
  --card-icon-radius: 12px;  /* 아이콘 라운드 */
  --stack-gap: 40px;         /* 섹션 사이 세로 간격 */
  --embed-h: 300px;          /* 임베드 행(B 티어) 플레이어 높이 — SoundCloud visual 원문 값 */
  --glow-naver: rgba(3, 199, 90, 0.18);

  /* Quiet Glass */
  --radius-pill: 999px;
  --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.25);
  --shadow-item-hover: 0 6px 18px rgba(0, 0, 0, 0.28);
  --bg-item: #09080f;
  --theme-sun: #f0c040;
  --spot-size: 260px;        /* 카드 스포트라이트 반경 */
}

/* ---- Light Theme Override ---- */
html.light {
  --bg: #f5f4f8;
  --bg-dark: #e8e7ec;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --brand: #b07068;
  --brand-light: #c48a82;
  --brand-text: #8a574f;      /* 밝은 배경에서 AA(5.1:1)를 만족하는 브랜드 톤 */
  --brand-04: rgba(176,112,104,0.04);
  --brand-06: rgba(176,112,104,0.06);
  --brand-08: rgba(176,112,104,0.08);
  --brand-10: rgba(176,112,104,0.10);
  --brand-12: rgba(176,112,104,0.12);
  --brand-14: rgba(176,112,104,0.14);
  --brand-20: rgba(176,112,104,0.20);
  --brand-25: rgba(176,112,104,0.25);
  --brand-35: rgba(176,112,104,0.35);
  --brand-40: rgba(176,112,104,0.40);
  --brand-60: rgba(176,112,104,0.60);
  --text: #1a1a2e;
  --text-muted: #555;
  --text-dim: #6b6b6b;        /* #999는 배경 대비 2.6:1로 WCAG AA 미달이었다 */
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.16);
  --glow-velog: rgba(32, 201, 151, 0.15);
  --glow-brunch: rgba(100, 100, 100, 0.10);
  --glow-github: rgba(10, 10, 10, 0.12);
  --glow-melon: rgba(0, 205, 60, 0.15);
  --glow-soundcloud: rgba(255, 85, 0, 0.15);
  --glow-instagram: rgba(131, 58, 180, 0.15);
  --focus-pill-bg: rgba(0, 0, 0, 0.04);
  --glow-naver: rgba(3, 199, 90, 0.15);

  /* 플랫폼 배지 텍스트 — 다크용 원색은 밝은 배경에서 2.2:1까지 떨어진다.
     배지 배경이 같은 색의 14% 틴트라 그 위에서 AA를 넘도록 더 어둡게 잡았다 */
  --platform-velog: #095f46;
  --platform-github: #0a4da8;

  /* App Store (Released Apps) — 라이트 대응 */
  --platform-app: #0a47a4;    /* #0071e3은 14% 틴트 배지 위에서 3.4:1 */
  --platform-app-14: rgba(0, 113, 227, 0.14);
  --glow-app: rgba(0, 113, 227, 0.15);

  /* Quiet Glass — 라이트 대응 */
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-item-hover: 0 6px 16px rgba(0, 0, 0, 0.10);
  --bg-item: #f0eff4;
  --theme-sun: #a8650f;       /* #f0c040은 흰 배경 대비 1.6:1 */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Touch hardening for interactive chrome ---- */
button,
.profile__action,
.link-card__header {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  touch-action: manipulation;
}


/* ---- Theme Toggle Button ---- */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;

  &:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
  }

  & .theme-toggle__icon {
    position: absolute;
    font-size: 16px;
    transition: opacity 0.3s, transform 0.3s;
  }

  & .theme-toggle__icon--light {
    color: var(--theme-sun);
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
  }

  & .theme-toggle__icon--dark {
    color: var(--text-muted);
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

html.light .theme-toggle {
  & .theme-toggle__icon--light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }

  & .theme-toggle__icon--dark {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
  }
}

/* ---- Light Theme — component overrides ---- */
html.light .profile__name {
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 50%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  @supports not (-webkit-background-clip: text) {
    -webkit-text-fill-color: currentColor;
  }
}

html.light .profile__bio-quote strong {
  color: var(--brand-text);
}

html.light .icon--brunch {
  background: #f0f0f0;
  color: #333;
  border-color: rgba(0,0,0,0.1);
}

html.light .icon--github {
  background: #222;
  color: #fff;
}

html.light .modal-overlay {
  background: rgba(245, 244, 248, 0.75);
}

html.light .modal-box {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0,0,0,0.1);
}

html.light .modal-photo-wrap::after {
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, transparent 100%);
}

html.light .modal-name {
  background: linear-gradient(135deg, var(--text) 50%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.light .modal-close {
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);

  &:hover {
    background: rgba(0,0,0,0.12);
    color: var(--text);
  }
}

/* ---- Hero Background — 코럴 빛이 위에서 내려오는 정적 레이어 ---- */
.hero-bg {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 0%, var(--brand-14) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-dark) 0%, var(--bg) 100%);
}

.page-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ---- Profile Section ---- */
.profile {
  text-align: center;
  max-width: 720px;
  width: 100%;

  & .profile__avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 22px;

    &::before {
      content: '';
      position: absolute;
      inset: -4px;
      border-radius: 50%;
      background: conic-gradient(
        var(--brand) 0deg,
        transparent 60deg,
        var(--brand-25) 120deg,
        transparent 180deg,
        var(--brand) 240deg,
        transparent 300deg,
        var(--brand-25) 360deg
      );
      opacity: 0.35;
      transition: opacity var(--transition);
      animation: avatar-ring-rotate 12s linear infinite;
    }

    &:hover::before {
      opacity: 0.9;
    }
  }

  & .profile__avatar {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
    cursor: pointer;
    display: block;
    transition: box-shadow var(--transition);

    &:hover {
      box-shadow: 0 0 28px var(--brand-20);
    }
  }

  /* 최신 릴리즈 알약 — heroEntrance(fill both)가 transform을 붙잡으므로 hover transform 금지 */
  & .profile__eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--brand-text);
  }

  & .profile__dot {
    color: var(--brand-text);
    margin: 0 2px;
  }

  & .profile__name {
    font-family: var(--font-serif);
    font-size: var(--hero-name-size);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--brand-text);
    background:
      linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%),
      linear-gradient(135deg, #fff 50%, var(--brand-light) 100%);
    background-size: 200% 100%, 100% 100%;
    background-position: 100% 0, 0 0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background-position 0.4s ease;

    @supports not (-webkit-background-clip: text) {
      -webkit-text-fill-color: currentColor;
    }
  }

  & .profile__subtitle {
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
  }

  & .profile__statement {
    max-width: 560px;
    margin: 0 auto 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0;
  }

  & .profile__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto 12px;
  }

  & .profile__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--focus-pill-bg);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);

    &:hover {
      background: var(--bg-card-hover);
      border-color: var(--border-hover);
      color: var(--text);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px var(--brand-12);
    }

    & i {
      font-size: 13px;
      flex-shrink: 0;
    }
  }

  & .profile__action--primary {
    color: var(--brand-text);
    /* 틴트만 두면 어두운 히어로 배경이 비쳐 라이트에서 4.4:1 — 글래스 위에 겹친다 */
    background: linear-gradient(var(--brand-14), var(--brand-14)), var(--bg-card);
    border-color: var(--brand-40);
  }

  & .profile__action--ghost {
    appearance: none;
  }

  & .profile__motto {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 640px;
    margin: 0 auto 16px;
  }

  & .profile__motto-item {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 86px;
    padding: 10px 8px 8px;
    background: var(--bg-card);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    perspective: 600px;
    transition: border-color var(--transition), box-shadow var(--transition);

    &:hover {
      border-color: var(--brand-25);
      box-shadow: 0 0 14px var(--brand-12);

      & .profile__motto-front {
        transform: rotateY(180deg);
      }

      & .profile__motto-back {
        transform: rotateY(0deg);
      }
    }
  }

  & .profile__motto-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    gap: 4px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform 0.5s ease;
  }

  & .profile__motto-back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateY(-180deg);
    transition: transform 0.5s ease;
    background: var(--bg-card);
    border-radius: var(--radius);
  }

  & .profile__motto-back-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-text);
    letter-spacing: 0.3px;
    text-align: center;
    padding: 8px;
    line-height: 1.4;
  }

  & .profile__motto-letter {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  & .profile__motto-word {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  & .profile__motto-kr {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.2px;
    text-align: center;
    line-height: 1.4;
  }

  & .profile__bio {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--card-pad-y) var(--card-pad-x);
  }

  & .profile__bio-quote {
    font-size: 15px;
    font-style: italic;
    font-weight: 300;
    color: var(--text);
    line-height: 1.65;
    margin-bottom: 10px;
    letter-spacing: 0.1px;

    & strong {
      font-family: var(--font-serif);
      font-weight: 600;
      font-style: normal;
      color: var(--brand-text);
    }
  }

  & .profile__bio-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-35), transparent);
    margin: 0 auto 10px;
  }

  & .profile__bio-kr {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    font-weight: 400;
  }

  & .profile__bio-attr {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 2.5px;
    text-transform: uppercase;

    & .typing {
      color: var(--brand-text);
      display: inline-block;
      min-width: 1ch;
    }

    & .typing-cursor {
      color: var(--brand-text);
      font-weight: 300;
      animation: blink-caret 0.7s step-end infinite;
    }
  }

}

/* ---- Hero Section ---- */
/* z-index:1 컨텍스트 — reduced-motion에서 애니메이션이 빠져도 고정 배경(.hero-bg) 위에 그려진다 */
.hero {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(42px, 6vh, 84px) 24px clamp(40px, 6vh, 72px);
}

@keyframes heroEntrance {
  from { opacity: 0; transform: translateY(var(--hero-entrance-offset)); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero .profile__avatar-wrap {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0s both;
}

.hero .profile__eyebrow {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.08s both;
}

.hero .profile__name {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.14s both;
}

.hero .profile__subtitle {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.20s both;
}

.hero .profile__statement {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.26s both;
}

.hero .profile__actions {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.32s both;
}

/* 모토는 컨테이너가 아니라 항목 단위로 올라온다 — hover transform 금지 (fill both) */
.hero .profile__motto-item {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.38s both;

  &:nth-child(2) { animation-delay: 0.44s; }
  &:nth-child(3) { animation-delay: 0.50s; }
}

.hero .profile__bio {
  opacity: 0;
  animation: heroEntrance var(--hero-entrance-duration) var(--ease-out-expo) 0.58s both;
}

@keyframes avatar-ring-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Category Tabs ---- */
.category-nav {
  position: relative;
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 6px;
  margin: 0 auto 32px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);

  &::-webkit-scrollbar { display: none; }

  & .category-nav__indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    background: linear-gradient(135deg, var(--brand-25), var(--brand-14));
    border: 1px solid var(--brand-40);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 14px var(--brand-20), inset 0 0 0 1px var(--brand-12);
    transition: transform 0.45s var(--spring-bounce), width 0.45s var(--spring-bounce), height 0.45s var(--spring-bounce);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transform: translate(0, 0);
    will-change: transform, width, height;
  }

  &.is-ready .category-nav__indicator {
    opacity: 1;
  }

  & .category-nav__btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    flex: 0 0 auto;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s var(--spring-bounce);

    &:hover {
      color: var(--text);
      transform: translateY(-1px);

      & .category-nav__icon {
        filter: drop-shadow(0 0 6px var(--brand-25));
      }
    }

    &:focus-visible {
      outline: 2px solid var(--brand-40);
      outline-offset: 3px;
    }

    &.is-active {
      color: var(--brand-text);

      & .category-nav__icon {
        stroke-width: 2.2;
      }
    }
  }

  & .category-nav__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: filter 0.3s ease, stroke-width 0.3s ease;
  }

  & .category-nav__label {
    display: inline;
  }
}

@media (max-width: 520px) {
  .category-nav {
    width: 100%;
    scroll-snap-type: x mandatory;
    padding: 5px;

    & .category-nav__btn {
      padding: 14px 16px;
      scroll-snap-align: center;
    }
  }
}

/* 데스크톱에서는 탭 알약을 링크 컬럼 폭에 묶지 않는다. 탭이 늘어 컬럼보다 넓어지면
   컬럼 밖으로 확장해 1행을 유지하고, 뷰포트를 넘지 않도록 상한만 둔다.
   상한에 걸리는 좁은 폭에서는 기존 가로 스크롤 동작이 그대로 유지된다.
   가운데 정렬은 left 50% + translateX(-50%)가 맡는다. auto 마진을 남겨 두면 알약이
   컬럼보다 좁을 때 한 번 더 밀려 오른쪽으로 치우친다 (5개 탭에서 32px) */
@media (min-width: 521px) {
  .category-nav {
    max-width: calc(100vw - 32px);
    margin-left: 0;
    margin-right: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-nav__indicator { transition: none; }
  .category-nav__btn { transition: color 0.2s linear; }
  .category-nav__btn:hover { transform: none; }
}

/* ---- Category Section ---- */
.category-section {
  margin-bottom: var(--stack-gap);

  &.is-hidden {
    display: none;
  }
}

/* ---- Category Header ---- */
.category-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 22px;
  padding-left: 4px;
}

.category-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text);
  margin: 0;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);

  &.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  &::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0.75em;
    background: var(--brand);
    border-radius: 2px;
    opacity: 0.85;
  }
}

/* ---- Section Label ---- */
.section-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  line-height: 1.4;
  color: var(--text-dim);
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.5s ease-out;

  &.is-visible {
    opacity: 1;
  }
}

/* ---- Link Cards ---- */
.links {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.link-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  opacity: 0;
  transition:
    transform var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);

  /* 플랫폼별 글로우 — hover 그림자와 스포트라이트가 같은 변수를 쓴다 */
  --card-glow: var(--brand-14);
  &:has(.icon--velog)      { --card-glow: var(--glow-velog); }
  &:has(.icon--brunch)     { --card-glow: var(--glow-brunch); }
  &:has(.icon--github)     { --card-glow: var(--glow-github); }
  &:has(.icon--melon)      { --card-glow: var(--glow-melon); }
  &:has(.icon--soundcloud) { --card-glow: var(--glow-soundcloud); }
  &:has(.icon--app)        { --card-glow: var(--glow-app); }
  &:has(.icon--instagram)  { --card-glow: var(--glow-instagram); }
  &:has(.icon--naver)      { --card-glow: var(--glow-naver); }

  /* 등장은 keyframes로 — transition-delay가 hover 반응까지 늦추지 않도록.
     fill-mode는 backwards만: both/forwards는 끝난 뒤에도 transform을 붙잡아 hover lift를 막는다 */
  &.is-visible {
    opacity: 1;
    animation: card-rise 0.6s var(--ease-out-expo) backwards;
  }
  &.is-visible:nth-child(2) { animation-delay: 0.08s; }
  &.is-visible:nth-child(3) { animation-delay: 0.16s; }

  /* 포인터 스포트라이트 — 좌표는 initCardSpotlight()가 --spot-x/y로 넘긴다 */
  &::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: radial-gradient(var(--spot-size) circle at var(--spot-x, 50%) var(--spot-y, 0%),
                var(--card-glow), transparent 70%);
    transition: opacity var(--transition);
  }

  &:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    box-shadow: var(--shadow-card-hover), 0 6px 24px var(--card-glow);

    &::after { opacity: 1; }

    & .link-card__icon {
      transform: scale(1.04);
    }

    & .link-card__arrow {
      color: var(--brand);
      transform: translateX(3px);
    }

    & .link-card__divider {
      background: linear-gradient(90deg, transparent, var(--brand-35), transparent);
    }

  }

  & .link-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: var(--card-pad-y) var(--card-pad-x);
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
  }

  & .link-card__icon {
    width: var(--card-icon);
    height: var(--card-icon);
    border-radius: var(--card-icon-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: transform var(--transition);
  }

  & .link-card__info {
    flex: 1;
    min-width: 0;
  }

  & .link-card__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  & .link-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
  }

  & .link-card__arrow {
    color: var(--text-dim);
    font-size: 13px;
    transition: transform var(--transition), color var(--transition);
    flex-shrink: 0;
  }

  & .link-card__divider {
    height: 1px;
    background: var(--border);
    margin: 0 var(--card-pad-x);
    position: relative;
    z-index: 1;
    transition: background var(--transition);
  }

  & .link-card__items {
    padding: calc(var(--card-pad-y) - 4px) var(--card-pad-x) var(--card-pad-y);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--card-items-gap);
    position: relative;
    z-index: 1;
  }

  /* B 티어: 임베드 행 — 본문이 재생 위젯인 카드. 썸네일 그리드 대신 세로 스택 */
  &.link-card--embed {
    & .link-card__items {
      grid-template-columns: 1fr;
      gap: var(--card-pad-y);
    }

    /* 위젯 위에서 카드가 들썩이지 않게 리프트만 끈다 (글로우·스포트라이트·화살표는 유지) */
    &:hover { transform: none; }
  }

  /* 앱 행: 앱이 2개라 3열 그리드의 한 칸 폭은 그대로 두고 가운데로 모은다.
     앱이 다시 3개가 되면 이 규칙을 지우면 기본 3열로 돌아간다 */
  &.link-card--app {
    & .link-card__items {
      grid-template-columns: repeat(2, calc((100% - 2 * var(--card-items-gap)) / 3));
      justify-content: center;
    }
  }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(16px); }
}

/* ---- Featured Items ---- */
.featured-item {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-item);
  border: 1px solid var(--border);
  position: relative;
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);

  &:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-item-hover);

    & .featured-item__thumb {
      transform: scale(1.04);
    }
  }

  & .featured-item__thumb {
    width: 100%;
    /* height:auto가 없으면 <img>의 height 속성이 presentational hint로 살아남아
       aspect-ratio를 무력화한다 (352px 폭에 900px 높이 같은 사고) */
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg-dark);
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* iOS 앱 아이콘 — 비율 기반 라운드 사각 + 은은한 테두리/그림자 */
  & .featured-item__thumb--app {
    /* height="256" 속성이 aspect-ratio를 무력화해 좁은 화면에서 세로로 늘어나는 것 방지 */
    height: auto;
    border-radius: 22.37%;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  /* 곡 제목은 자르지 않는다 — feat./prod. 크레딧이 붙은 음악 카드는 좁은 폭에서
     5줄까지 가고, 3줄 클램프에 걸리면 아래가 잘려 나갔다. 그리드 행이 stretch라
     같은 행의 카드들은 가장 긴 제목 높이에 맞춰 그대로 정렬된다. */
  & .featured-item__label {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-muted);
    overflow-wrap: anywhere;
  }

  & .featured-item__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
  }

  & .featured-item__source {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--brand-08);
    color: var(--brand-text);
    line-height: 1;
  }

  & .featured-item__source--velog {
    background: color-mix(in srgb, var(--platform-velog) 14%, transparent);
    color: var(--platform-velog);
  }

  & .featured-item__source--github {
    background: color-mix(in srgb, var(--platform-github) 14%, transparent);
    color: var(--platform-github);
  }

  & .featured-item__source--app {
    background: var(--platform-app-14);
    color: var(--platform-app);
  }

  & .featured-item__detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  & .featured-item__fallback-bg {
    fill: var(--bg-dark);
  }

  & .featured-item__fallback-mark {
    fill: var(--text-dim);
  }

  & .featured-item__fallback-accent--velog {
    fill: var(--platform-velog);
  }

  & .featured-item__fallback-accent--github {
    fill: var(--platform-github);
  }

  /* Loading skeleton — 네이티브 중첩에는 SCSS식 문자열 연결이 없으므로 클래스를 전부 적는다 */
  &.featured-item--loading {
    pointer-events: none;
    position: relative;
    overflow: hidden;

    & .featured-item__thumb {
      position: relative;
      background: var(--bg-dark);

      &::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
          105deg,
          transparent 20%,
          var(--brand-04) 35%,
          rgba(255,255,255,0.06) 50%,
          var(--brand-04) 65%,
          transparent 80%
        );
        background-size: 250% 100%;
        animation: shimmer-sweep 2s ease-in-out infinite;
      }

      &::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 50% 50%, var(--brand-06) 0%, transparent 70%);
        animation: pulse-glow 2.2s ease-in-out infinite;
        z-index: 1;
      }
    }

    & .featured-item__label {
      color: transparent;
      padding: 10px;
      margin: 0;
      height: auto;
      width: auto;
      background: none;
      display: flex;
      flex-direction: column;
      gap: 6px;

      &::before,
      &::after {
        content: '';
        display: block;
        height: 8px;
        border-radius: 4px;
        background: var(--border);   /* 흰색 고정값은 라이트 테마에서 보이지 않았다 */
        position: relative;
        overflow: hidden;
      }

      &::before {
        width: 85%;
      }

      &::after {
        width: 55%;
      }
    }

    &:nth-child(1) .featured-item__thumb {
      &::after { animation-delay: 0s; }
      &::before { animation-delay: 0s; }
    }

    &:nth-child(2) .featured-item__thumb {
      &::after { animation-delay: 0.15s; }
      &::before { animation-delay: 0.4s; }
    }

    &:nth-child(3) .featured-item__thumb {
      &::after { animation-delay: 0.3s; }
      &::before { animation-delay: 0.8s; }
    }
  }
}

/* ---- Embed Items (B 티어 본문) ----
   iframe은 링크로 감쌀 수 없고 움직여서도 안 된다. 그래서 .featured-item과
   다른 블록으로 분리해 hover 변형·카운터 배지가 구조적으로 붙지 않게 했다. */
.embed-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;

  & .embed-item__frame {
    display: block;
    width: 100%;
    height: var(--embed-h);
    border: 0;
    border-radius: var(--radius-sm);
    /* 로딩 전·lazy 대기 중 빈 판: 카드 톤 위에 코럴 빛이 한쪽에서 스미는 정지 그라디언트 */
    background:
      linear-gradient(135deg, var(--brand-08), transparent 55%),
      var(--bg-item);
    box-shadow: 0 0 0 1px var(--border);
    transition: box-shadow var(--transition);
  }

  & .embed-item__caption {
    min-width: 0;
  }

  & .embed-item__link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
    transition: color var(--transition);
  }

  & .embed-item__index {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
    transition: color var(--transition);
  }

  & .embed-item__title {
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  & .embed-item__by {
    color: var(--text-dim);
    font-weight: 500;

    &::before {
      content: "·";
      margin-right: 8px;
    }
  }

  & .embed-item__arrow {
    margin-left: auto;
    font-size: 10.5px;
    color: var(--text-dim);
    transition: color var(--transition), transform var(--transition);
  }

  /* "지금 이 앨범" — 포인터가 판이나 캡션에 닿거나 포커스가 들어오면 링과 번호만 켜진다 */
  &:hover,
  &:focus-within {
    & .embed-item__frame { box-shadow: 0 0 0 1px var(--brand-35); }
    & .embed-item__index { color: var(--brand-text); }
  }

  & .embed-item__link:hover,
  & .embed-item__link:focus-visible {
    color: var(--brand-text);

    & .embed-item__arrow {
      color: var(--brand);
      transform: translate(2px, -2px);
    }
  }
}

@keyframes shimmer-sweep {
  0%   { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

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

.fetch-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ---- Platform Icon Colors ---- */
.icon--soundcloud { background: linear-gradient(135deg, #ff5500, #ff7700); color: #fff; }
.icon--instagram  { background: linear-gradient(135deg, #833AB4, #E1306C, #F77737); color: #fff; }
.icon--melon      { background: linear-gradient(135deg, #00cd3c, #00a832); color: #fff; }
.icon--brunch     { background: #111; color: #ddd; border: 1px solid rgba(255,255,255,0.1); }
.icon--velog      { background: linear-gradient(135deg, #20c997, #12b886); color: #fff; }
.icon--github     { background: #ececec; color: #0a0a0a; }
.icon--naver      { background: #03C75A; color: #fff; }
.icon--app        { background: var(--platform-app-14); color: var(--platform-app); }

/* ---- Footer ---- */
.footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);

  & .footer__social {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;

    /* 40px 원형 터치 타깃 */
    & a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: var(--radius-pill);
      border: 1px solid transparent;
      color: var(--text-dim);
      font-size: 16px;
      transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);

      &:hover {
        color: var(--brand-text);
        background: var(--focus-pill-bg);
        border-color: var(--border);
        transform: translateY(-2px);
      }
    }
  }

  & .footer__text {
    font-size: 12px;
    color: var(--text-dim);
  }
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
  /* 링크트리 리듬 토큰 재정의 — 카드 패딩/간격/아이콘을 한 곳에서 축소 */
  :root {
    --card-gap: 12px;
    --card-pad-x: 18px;
    --card-pad-y: 16px;
    --card-items-gap: 8px;
    --card-icon: 40px;
    --card-icon-radius: 10px;
    --stack-gap: 28px;
    --embed-h: 260px;
  }

  /* 토큰으로 표현되지 않는 모바일 전용 값 (축소된 아이콘 박스에 맞춘 글리프/간격) */
  .link-card {
    & .link-card__header { gap: 12px; }
    & .link-card__icon   { font-size: 18px; }
  }

  .page-wrapper { padding: 20px 16px 56px; }

  .category-title {
    font-size: 28px;
    &::before {
      left: -10px;
      width: 3px;
    }
  }
  .category-header {
    gap: 4px;
    margin-bottom: 16px;
    padding-left: 2px;
  }

  .hero { padding: 48px 16px 40px; }
  .hero .profile__subtitle { font-size: 12px; }

  .profile {
    & .profile__name           { font-size: var(--hero-name-size-mobile); }
    & .profile__avatar         { width: 96px; height: 96px; }
    & .profile__eyebrow        { font-size: 10px; letter-spacing: 1.6px; }
    & .profile__statement      { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
    & .profile__actions        { gap: 8px; margin-bottom: 12px; }
    & .profile__action         { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 10px; font-size: 12px; }
    & .profile__bio-quote      { font-size: 14px; }
    & .profile__bio-kr         { font-size: 12px; }
    & .profile__motto          { gap: 6px; }
    & .profile__motto-item     { padding: 10px 6px 8px; min-height: 82px; }
    & .profile__motto-letter   { font-size: 22px; }
    & .profile__motto-word     { font-size: 10px; letter-spacing: 0.8px; }
    & .profile__motto-kr       { font-size: 10px; }
    & .profile__motto-back-text { font-size: 11px; }
  }

  .featured-item {
    & .featured-item__label { padding: 6px 8px; font-size: 11px; }
    & .featured-item__meta  { padding: 0 8px 8px; font-size: 10px; }
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;

    & .theme-toggle__icon { font-size: 17px; }
  }

  .modal-backdrop {
    & .modal-box { max-width: 92vw; }

    & .modal-close {
      width: 44px;
      height: 44px;
      top: 12px;
      right: 12px;
      font-size: 18px;
    }
  }

}

@keyframes blink-caret {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Profile Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  /* 닫힌 모달은 보이지 않을 뿐 아니라 Tab 순서와 스크린리더에서도 빠져야 한다.
     visibility는 페이드아웃이 끝난 뒤(0.38s)에 꺼지고, 열릴 때는 즉시 켜진다 */
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0s linear 0.38s;

  &.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;

    & .modal-box {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }

  & .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 8, 15, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at center, var(--brand-20) 0%, transparent 70%);
      pointer-events: none;
    }
  }

  & .modal-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    background: rgba(20, 18, 28, 0.92);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: scale(0.92) translateY(24px);
    transition:
      transform 0.5s var(--spring-bounce),
      opacity 0.5s var(--spring-bounce);
    opacity: 0;
  }

  & .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);

    &:hover {
      background: rgba(255,255,255,0.15);
      color: var(--text);
    }
  }

  & .modal-photo-wrap {
    position: relative;

    &::after {
      content: '';
      position: absolute;
      bottom: 0; left: 0; right: 0;
      height: 60%;
      background: linear-gradient(to top, rgba(20,18,28,0.92) 0%, transparent 100%);
    }
  }

  & .modal-photo {
    width: 100%;
    height: auto;              /* height 속성 hint가 aspect-ratio를 덮지 않도록 */
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  & .modal-body {
    padding: 20px 28px 32px;
  }

  & .modal-name {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 50%, var(--brand-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  & .modal-eng {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 10px;
  }

  & .modal-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 20px;
  }

  & .modal-info {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;

    & li {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.5;
      opacity: 0;
      transform: translateY(8px);
      transition: opacity 0.4s ease-out, transform 0.4s ease-out;

      & .modal-info__icon {
        color: var(--brand);
        opacity: 0.7;
        font-size: 12px;
        margin-top: 2px;
        flex-shrink: 0;
        width: 14px;
      }

      /* 라벨과 보조 줄을 한 덩어리로 — li가 flex 행이라 감싸지 않으면 <br>이 무시되고 둘이 옆으로 나란히 선다 */
      & .modal-info__text {
        min-width: 0;
      }

      & .modal-info__sub {
        font-size: 11px;
        color: var(--text-dim);

        & a {
          color: inherit;
          text-decoration: underline;
        }
      }
    }
  }

  /* 모달 내부 콘텐츠 기본 숨김 상태 */
  & .modal-photo-wrap {
    opacity: 0;
    transition: opacity 0.4s ease-out;
  }

  & .modal-name {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }

  & .modal-eng {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }

  & .modal-divider {
    transform: scaleX(0);
    transition: transform 0.4s ease-out;
  }

  /* 모달 is-open 시 시차 진입 */
  &.is-open {
    & .modal-photo-wrap {
      opacity: 1;
      transition-delay: 0s;
    }

    & .modal-name {
      opacity: 1;
      transform: translateY(0);
      transition-delay: 0.08s;
    }

    & .modal-eng {
      opacity: 1;
      transform: translateY(0);
      transition-delay: 0.16s;
    }

    & .modal-divider {
      transform: scaleX(1);
      transition-delay: 0.24s;
    }

    & .modal-info li {
      opacity: 1;
      transform: translateY(0);

      &:nth-child(1) { transition-delay: 0.32s; }
      &:nth-child(2) { transition-delay: 0.38s; }
      &:nth-child(3) { transition-delay: 0.44s; }
      &:nth-child(4) { transition-delay: 0.50s; }
      &:nth-child(5) { transition-delay: 0.56s; }
    }
  }

  /* 모달 닫기 애니메이션 — 오버레이만이 아니라 backdrop 전체를 내린다.
     오버레이만 0으로 보내면 클래스가 빠지는 순간 오버레이가 1로 되돌아와
     어두운 막이 한 번 더 번쩍인 뒤에야 사라진다 */
  &.is-closing {
    opacity: 0;
    transition: opacity 0.25s ease-in;

    & .modal-box {
      transform: scale(0.95) translateY(12px);
      opacity: 0;
      transition-timing-function: ease-in;
      transition-duration: 0.25s;
    }
  }
}

/* ---- Accessibility: respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .link-card, .section-label, .category-title { opacity: 1; transform: none; }
  .link-card.is-visible { animation: none; }
  .link-card::after { display: none; }
  /* 베이스가 중첩 셀렉터(.profile / .footer 접두)라 같은 특이도로 맞춰야 이긴다 */
  .profile .profile__avatar-wrap::before { animation: none; }
  .link-card:hover,
  .profile .profile__action:hover,
  .link-card .featured-item:hover,
  .footer .footer__social a:hover { transform: none; }
  .embed-item .embed-item__link:hover .embed-item__arrow,
  .embed-item .embed-item__link:focus-visible .embed-item__arrow { transform: none; }

  .hero .profile__avatar-wrap,
  .hero .profile__eyebrow,
  .hero .profile__name,
  .hero .profile__subtitle,
  .hero .profile__statement,
  .hero .profile__actions,
  .hero .profile__motto-item,
  .hero .profile__bio { animation: none; opacity: 1; transform: none; }
}

/* ---- Scroll Progress Bar ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 50;
  pointer-events: none;
  transition: transform 0.05s linear;
}

/* ============================================================
   Desktop Layout (900px+)
   ============================================================ */
@media (min-width: 900px) {

  /* ---- Hero: 콘텐츠 높이 (고정 100vh 대신) — 큰 화면에선 탭이 첫 화면에 걸친다 ---- */
  .hero {
    padding-top: clamp(32px, 4vh, 64px);
    padding-bottom: clamp(48px, 7vh, 80px);
  }

  /* ---- 링크 컬럼: 히어로와 좌우 축을 맞춘 단일 컬럼 ---- */
  .page-wrapper {
    max-width: 760px;
    padding: 16px 32px 96px;
  }

  .profile {
    max-width: 760px;
  }
}

