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

:root {
  --bg-primary: #fafafa;
  --bg-card: #ffffff;
  --bg-dark: #1a1a1a;
  --accent: #d32f2f;
  --accent-light: #ff6659;
  --text-primary: #1a1a1a;
  --text-secondary: #616161;
  --text-muted: #9e9e9e;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.08);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 0.75rem 1rem 0.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

/* Back Link */
.back-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.header h1 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  border-radius: 2px;
}

.lang-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Main layout */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Swiper - square images */
.artist-swiper {
  width: 100%;
  height: 38vh;
  min-height: 200px;
  max-height: 320px;
  padding: 0.5rem 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-primary) 100%);
  overflow: visible;
  position: relative;
  z-index: 5;
}

.swiper-wrapper {
  align-items: center;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
  z-index: 1;
}

.swiper-slide-prev,
.swiper-slide-next {
  z-index: 2;
}

.swiper-slide-active {
  z-index: 3;
}

/* Square image container */
.swiper-slide img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 4px 16px var(--shadow), 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: center center;
}

/* Active slide */
.swiper-slide-active img {
  transform: scale(1) perspective(800px) rotateY(0deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 1;
  filter: brightness(1);
  z-index: 10;
}

/* Previous slide */
.swiper-slide-prev img {
  transform: scale(0.78) perspective(800px) rotateY(12deg) translateX(20%);
  opacity: 0.75;
  filter: brightness(0.92);
}

/* Next slide */
.swiper-slide-next img {
  transform: scale(0.78) perspective(800px) rotateY(-12deg) translateX(-20%);
  opacity: 0.75;
  filter: brightness(0.92);
}

/* Far left slides */
.swiper-slide.slide-far-left img {
  transform: scale(0.55) perspective(800px) rotateY(20deg) translateX(30%);
  opacity: 0.35;
  filter: brightness(0.75);
}

/* Far right slides */
.swiper-slide.slide-far-right img {
  transform: scale(0.55) perspective(800px) rotateY(-20deg) translateX(-30%);
  opacity: 0.35;
  filter: brightness(0.75);
}

/* Progress Bar Pagination */
.swiper-pagination {
  position: relative;
  padding: 0.75rem 1.5rem 1rem;
  background: var(--bg-primary);
  z-index: 15;
}

.progress-pagination {
  width: 66%;
  max-width: 200px;
  margin: 0 auto;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  touch-action: none;
}

.progress-track.is-dragging {
  cursor: grabbing;
}

.progress-handle {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
  transition: left 0.15s ease-out, transform 0.15s ease;
  cursor: grab;
}

.progress-track.is-dragging .progress-handle {
  transform: translate(-50%, -50%) scale(1.2);
  cursor: grabbing;
}

.progress-track:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Info Panel */
.info-panel {
  flex: 1;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-top: -20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -4px 30px var(--shadow);
  position: relative;
  z-index: 10;
}

.info-content {
  max-width: 100%;
}

.info-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--text-primary);
}

.info-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.artist-name-group {
  flex: 1;
  min-width: 0;
}

.artist-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.furigana {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

/* Instagram Link */
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}

.instagram-link:hover {
  color: #E4405F;
}

.instagram-icon {
  width: 20px;
  height: 20px;
}

.instagram-text {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Sections */
.section {
  margin-bottom: 1rem;
}

.section h3 {
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.375rem;
  font-weight: 700;
}

.section p {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Bio section */
.section.bio h3 {
  font-size: 0.7rem;
}

.section.bio p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-primary);
}

/* Work description with portrait */
.section.work-description h3 {
  font-size: 0.7rem;
}

.work-content {
  position: relative;
}

.work-content p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-primary);
}

/* Portrait - Mobile: centered below text */
.portrait-wrapper {
  margin-top: 1rem;
  text-align: center;
}

.portrait-wrapper img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 12px var(--shadow);
}

/* Hidden class */
.hidden {
  display: none;
}

/* Tablet+ */
@media (min-width: 768px) {
  .header {
    padding: 1rem 2rem 0.75rem;
  }

  .back-link {
    left: 2rem;
  }

  .header h1 {
    font-size: 1rem;
  }

  .lang-btn {
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
  }

  .artist-swiper {
    height: 45vh;
    max-height: 450px;
  }

  .swiper-slide img {
    width: 220px;
    height: 220px;
  }

  .info-panel {
    padding: 1.5rem 2.5rem;
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
  }

  .artist-name {
    font-size: 1.375rem;
  }

  .section.bio p,
  .work-content p {
    font-size: 1rem;
    line-height: 1.8;
  }

  /* Portrait - Tablet: right aligned */
  .work-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .work-content p {
    flex: 1;
  }

  .portrait-wrapper {
    margin-top: 0;
    flex-shrink: 0;
  }

  .portrait-wrapper img {
    width: 120px;
    height: 120px;
  }

  .progress-pagination {
    max-width: 400px;
  }

  .progress-track {
    height: 8px;
  }

  .progress-handle {
    width: 22px;
    height: 22px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .artist-swiper {
    height: 48vh;
    max-height: 480px;
  }

  .swiper-slide img {
    width: 260px;
    height: 260px;
  }

  .info-panel {
    max-width: 900px;
    padding: 1.5rem 3rem;
  }

  .artist-name {
    font-size: 1.5rem;
  }

  .section.bio p,
  .work-content p {
    font-size: 1.0625rem;
  }

  .portrait-wrapper img {
    width: 140px;
    height: 140px;
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  .info-panel {
    max-width: 1000px;
  }

  .swiper-slide img {
    width: 280px;
    height: 280px;
  }

  .section.bio p,
  .work-content p {
    font-size: 1.125rem;
  }
}
