/* Profile image scaling for sidebar */
.profile-container .profile-image {
  display: block;
  width: 125px;
  height: 125px;
  max-width: 125px;
  max-height: 125px;
  border-radius: 50%;
  object-fit: cover;
  margin: 3rem auto .5rem auto;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .profile-container .profile-image {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
  }
}

.sidebar .artist-details p {
  margin: 0;
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  font-weight: 500;
  opacity: 0.85;
  text-transform: none;
  text-align: left;
  position: relative;
  display: inline-block;
}


/* Sidebar artist name: match menu-level-1 tracking (desktop) */
.sidebar .artist-details h3 {
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  /* match menu level 1 */
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: none;
  text-align: left;
  white-space: nowrap;
  line-height: 1.05;
  position: relative;
  display: inline-block;
}


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

:root {
  --color-black: #111111;
  --color-white: var(--always-white);
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e5e5e5;
  --color-gray-300: #d4d4d4;
  --color-gray-400: #a3a3a3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #404040;
  --color-gray-800: #262626;
  --color-gray-900: #171717;

  --gradient-subtle: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
  --gradient-overlay: var(--always-dark-gradient);

  --always-dark-gradient: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
  --always-dark-overlay: rgba(43, 48, 54, .8);

  /* Universal Light Overlays */
  --always-light-overlay: rgba(255, 255, 255, 0.4);
  --always-white: #FFFFFF;

  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-duration-fast: 0.3s;
  --motion-duration-medium: 0.45s;
  --motion-duration-slow: 0.7s;
  --sidebar-width: 15vw;
  --profile-offset: 5vh;
  --header-expanded-height: 3.125rem;
  --header-scrolled-height: 2.5rem;
  --header-height: calc(var(--header-expanded-height) + env(safe-area-inset-top));
  --header-height-scrolled: calc(var(--header-scrolled-height) + env(safe-area-inset-top));
  --page-gutter: 1.5rem;
  --gallery-width: 70vw;
  --desktop-profile-offset: 0;
  --mobile-profile-offset: 190px;
}

body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: var(--ua-bg, var(--color-white));
  color: var(--ua-text, var(--color-black));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Profile page background */
body:has(.profile-container) {
  background: var(--ua-bg, var(--color-white));
}

/* Dark mode support - use background-color with alpha, never opacity */
html[data-theme="dark"] body:has(.profile-container),
body[data-theme="dark"]:has(.profile-container),
html.dark body:has(.profile-container),
body.dark:has(.profile-container) {
  background: rgb(12, 16, 20) !important;
}

/* Sidebar and Gallery matching background */
.sidebar,
.gallery-section {
  background: transparent !important;
}

@media (prefers-color-scheme: dark) {
  body:has(.profile-container) {
    background: rgb(12, 16, 20);
  }
}


.profile-container {
  display: flex;
  background: var(--ua-bg, var(--color-white));
}

@media (prefers-color-scheme: dark) {
  .profile-container {
    background: rgb(12, 16, 20) !important;
  }
}

.sidebar,
.gallery-section {
  background: transparent !important;
}

.profile-container {
  margin-top: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: visible;
  box-sizing: border-box;
}

.sidebar {
  position: fixed;
  top: 4rem;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: transparent !important;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  /* Sync desktop padding with header height */
  padding: var(--header-height) 0 var(--page-gutter);
  box-sizing: border-box;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.profile-header {
  padding: 0 clamp(1.5rem, 4vw, 2rem) 0;
  text-align: left;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-image {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  margin: 0 auto 2px;
  border: none;
}

.profile-nav {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.profile-nav li {
  margin: 0;
  display: inline-block;
}

.nav-link {
  position: relative;
  display: block;
  width: 100%;
  padding: 16px 32px;
  text-align: left;
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.85rem, 1vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: currentColor;
  opacity: 0.75;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
  border: none;
  appearance: none;
  outline: none;
  box-shadow: none;
  z-index: 2;
  transition: all var(--motion-duration-fast) var(--motion-ease-out);
  will-change: color;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--motion-duration-medium) var(--motion-ease-out), opacity var(--motion-duration-medium) var(--motion-ease-out);
}

.nav-link:hover,
.nav-link:focus {
  color: currentColor;
}

.nav-link:hover::after,
.nav-link:focus::after {
  opacity: 0.5;
  transform: scaleX(1);
}

.nav-link.active {
  color: currentColor;
  font-weight: 500;
}

.nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

@media (prefers-color-scheme: dark) {
  .nav-link {
    color: currentColor;
  }

  .nav-link::after {
    background: currentColor;
  }

  .nav-link:hover,
  .nav-link:focus {
    color: currentColor;
  }

  .nav-link:hover::after,
  .nav-link:focus::after {
    opacity: 0.7;
  }

  .nav-link.active {
    color: currentColor;
  }
}

html[data-theme="dark"] .nav-link,
body[data-theme="dark"] .nav-link,
html.dark .nav-link,
body.dark .nav-link {
  color: currentColor;
}

html[data-theme="dark"] .nav-link::after,
body[data-theme="dark"] .nav-link::after,
html.dark .nav-link::after,
body.dark .nav-link::after {
  background: currentColor;
}

html[data-theme="dark"] .nav-link:hover,
body[data-theme="dark"] .nav-link:hover,
html.dark .nav-link:hover,
body.dark .nav-link:hover,
html[data-theme="dark"] .nav-link:focus,
body[data-theme="dark"] .nav-link:focus,
html.dark .nav-link:focus,
body.dark .nav-link:focus {
  color: currentColor;
}

html[data-theme="dark"] .nav-link:hover::after,
body[data-theme="dark"] .nav-link:hover::after,
html.dark .nav-link:hover::after,
body.dark .nav-link:hover::after,
html[data-theme="dark"] .nav-link:focus::after,
body[data-theme="dark"] .nav-link:focus::after,
html.dark .nav-link:focus::after,
body.dark .nav-link:focus::after {
  opacity: 0.7;
}

html[data-theme="dark"] .nav-link.active,
body[data-theme="dark"] .nav-link.active,
html.dark .nav-link.active,
body.dark .nav-link.active {
  color: currentColor;
}

.instagram-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: clamp(0.5rem, 1vh, 0.75rem) clamp(1.5rem, 4vw, 2rem);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--ua-muted, var(--color-gray-600));
  text-decoration: none;
  margin: clamp(0.25rem, 0.5vh, 0.5rem) auto 0;
  transition: all 0.3s var(--transition-smooth);
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}

.instagram-link:hover {
  color: var(--ua-text, var(--color-black));
  background: var(--ua-accent, var(--color-gray-100));
}

.gallery-section {
  margin-top: 0;
  margin-left: var(--sidebar-width);
  width: var(--gallery-width);
  padding: var(--header-full-offset) 0.125rem 0.125rem;
  overflow: visible;
  position: relative;
  top: auto;
  left: auto;
  height: auto;
  min-height: 100vh;
  box-sizing: border-box;
  background: transparent !important;
  z-index: 90;
}

/* Ensure gallery section starts at top on load */
.gallery-section:not(:focus-within) {
  scroll-snap-type: none;
}

/* Fade-in animation for gallery switching */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery {
  display: none;
  opacity: 0;
}

.gallery.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s var(--transition-smooth) forwards;
}


.masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.0625rem;
  padding: 0;
  justify-items: stretch;
  box-sizing: border-box;
  background: transparent !important;
}

.masonry-grid>* {
  box-sizing: border-box;
}

.gallery-item {
  position: relative;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s var(--transition-smooth), transform 0.5s var(--transition-smooth);
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  border: none;
  border-radius: 0 !important;
  background: transparent;
  box-sizing: border-box;
}

.gallery-item .img-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
}

.gallery-item .img-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gallery-item .img-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-overlay);
  opacity: 0;
  transition: opacity 0.5s var(--transition-smooth);
  z-index: 1;
  pointer-events: none;
}

.gallery-item:hover .img-mask::before {
  opacity: 0.3;
}

/* Video thumbnails should not dim on hover */
.gallery-video-thumbnail.img-mask::before,
.gallery-item:hover .gallery-video-thumbnail.img-mask::before {
  opacity: 0;
  transition: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s var(--transition-smooth), filter 0.6s var(--transition-smooth);
  will-change: transform, filter;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

.gallery-video-thumbnail {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.gallery-video-thumbnail .gallery-video-poster {
  display: none !important;
}

.gallery-video-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  visibility: hidden;
}

.gallery-video-thumbnail.preview-ready::before {
  content: "";
}

.gallery-video-thumbnail.preview-ready video {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Responsive tweaks */

@media (max-width: 900px) {
  :root {
    --sidebar-width: 100%;
  }

  :root {
    --mobile-profile-offset: 190px;
  }

  /* One-Piece Strategy: Sidebar covers header area to solve striping */
  .global-header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    min-height: 60px;
    padding: 10.8rem 14px 0.5rem;
    /* Lowered initial point further to protect image */
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    z-index: 100;
    overflow: visible;
    border-bottom: 0.0625rem solid var(--color-gray-200);
  }

  /* Scrolled: Use negative transform to shift content UP */
  body.scrolled .sidebar {
    transform: translateY(-0.625rem);
    /* Pulls whole bar up to follow header */
    background: var(--header-scrolled-bg) !important;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 0.0625rem solid var(--color-gray-200);
  }

  @media (prefers-color-scheme: dark) {
    body.scrolled .sidebar {
      background: var(--header-scrolled-bg) !important;
      border-bottom: 0.0625rem solid var(--color-gray-700);
    }
  }

  /* Profile header: image left, name/title right */
  .profile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    margin-top: 0;
    text-align: left;
    transform: none;
    /* Remove transform that pushed it into header area */
  }

  .profile-image {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    margin: 0 auto 0;
    margin-top: 3.6rem;
    flex: 0 0 auto;
    position: relative;
    z-index: 1001;
  }

  .artist-details {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }

  .artist-details h3,
  .artist-details .artist-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .artist-details p,
  .artist-details .artist-title {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--ua-text, #666);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
  }

  /* Navigation: horizontal row */
  .profile-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0;
    margin: -0.3rem 0 0;
    justify-content: center;
  }

  .profile-nav ul {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .profile-nav ul::-webkit-scrollbar {
    display: none;
  }

  .profile-nav li {
    display: inline-block;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
  }

  .nav-link {
    display: block;
    color: var(--ua-text, #222);
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0 3px;
    border-radius: 3px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
  }

  .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ua-accent, #007aff);
  }

  .nav-link::after {
    display: none;
  }

  .instagram-link {
    display: none;
  }

  .profile-container {
    flex-direction: column;
    margin-top: 0;
    padding-top: calc(var(--header-height) + 120px);
  }

  body.scrolled .profile-container {
    padding-top: calc(var(--header-height-scrolled) + 120px);
  }

  .gallery-section {
    margin-left: 0;
    width: 100%;
    padding: var(--page-gutter);
    margin-top: 120px;
    height: auto;
    min-height: calc(100vh - var(--header-height) - 120px);
  }
}

/* Smallest breakpoint - nav links move down */
@media (max-width: 600px) {
  :root {
    --mobile-profile-offset: 220px;
  }

  .sidebar {
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--header-height) + 0.5rem) 12px 0.5rem;
    /* account for header */
    min-height: auto;
    gap: 8px;
    top: 0;
  }

  .profile-header {
    width: 100%;
    flex: 0 0 auto;
    gap: 8px;
  }

  .profile-image {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    margin-top: 0.6rem;
    position: relative;
    z-index: 1001;
  }

  .artist-details {
    gap: 1px;
  }

  .artist-details h3,
  .artist-details .artist-name {
    font-size: 0.75rem;
  }

  .artist-details p,
  .artist-details .artist-title {
    font-size: 0.65rem;
  }

  .profile-nav {
    width: 100%;
    flex: 0 0 auto;
    margin-top: -0.35rem;
    gap: 6px;
    justify-content: center;
  }

  .profile-nav ul {
    gap: 6px;
    justify-content: center;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0 2px;
  }

  .profile-container {
    padding-top: calc(var(--header-height) + var(--mobile-profile-offset));
  }
}


/* Mobile Landscape - Sidebar across top below header */
@media (max-width: 900px) and (orientation: landscape) {

  /* One-Piece Strategy: Landscape */
  .global-header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    padding: 8.8rem 1rem 0.5rem !important;
    /* Lowered landscape point further */
    border-right: none !important;
    border-bottom: 0.0625rem solid var(--color-gray-200) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 100 !important;
    box-shadow: none !important;
    overflow: visible !important;
    align-items: stretch !important;
    justify-content: center !important;
    margin-top: 0 !important;
  }

  /* Landscape Scrolled state: Pull UP on scroll */
  body.scrolled .sidebar {
    transform: translateY(-0.625rem) !important;
    background: var(--header-scrolled-bg) !important;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  }

  @media (prefers-color-scheme: dark) {
    body.scrolled .sidebar {
      background: var(--header-scrolled-bg) !important;
      border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.1);
    }
  }

  /* Top row: Profile image left, name/title right */
  .profile-header {
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    flex: 0 0 auto;
    border: none;
    order: 1;
  }

  .profile-image {
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    flex: 0 0 auto;
  }

  .artist-details {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .artist-details h3,
  .artist-details .artist-name {
    margin: 0;
    font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .artist-details p,
  .artist-details .artist-title {
    display: block !important;
    margin: 0;
    font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Second row: Full width nav links inline */
  .profile-nav {
    padding: 0 !important;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    width: 100% !important;
    order: 2 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    margin-top: 0 !important;
    align-items: center !important;
  }

  .profile-nav::-webkit-scrollbar {
    display: none !important;
  }

  .profile-nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-right: 0.5rem !important;
    padding-left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    list-style: none !important;
  }

  .profile-nav ul::-webkit-scrollbar {
    display: none !important;
  }

  .profile-nav li {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    min-height: 2rem;
    background: transparent;
    flex: 0 0 auto;
  }

  .nav-link.active {
    border-color: var(--color-black);
    background: var(--gradient-subtle);
  }

  .nav-link::after {
    display: none;
  }

  .gallery-section {
    margin-left: 0 !important;
    width: 100% !important;
    padding: var(--page-gutter) !important;
    top: calc(var(--header-height) + 4.5rem) !important;
    left: 0 !important;
    height: calc(100vh - var(--header-height) - 4.5rem) !important;
  }

  .instagram-link {
    display: none;
  }

  .sidebar .instagram-link {
    margin-left: 0;
    margin-right: 0;
  }

}