/* ============================================================================
   PROFILE HEADER (TWITTER-LIKE)
   ============================================================================ */

#header {
  background: var(--surface);
  inline-size: 100%;
  position: relative;
}

.profile-banner {
  inline-size: 100%;
  aspect-ratio: 5 / 1;
  background: var(--gradient-banner);
  position: relative;
}

.theme-toggle {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-end: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: light-dark(0 0.125rem 0.5rem rgba(0,0,0,0.08), 0 0.125rem 0.5rem rgba(0,0,0,0.2));
}

.theme-toggle:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Draggable Theme Switch */
#theme-switch {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-end: 1.5rem;
}

#theme-switch::before {
  content: '';
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  inline-size: 0.5ch;
  block-size: 75%;
  background: var(--border);
  border-radius: 0.125rem;
  z-index: 0;
}

.theme-switch-track {
  position: relative;
  inline-size: 5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 2rem;
  cursor: grab;
  user-select: none;
  z-index: 1;
  display: flex;
  align-items: center;
  transition: border-color 0.2s;
  box-shadow: inset 0 0.375rem 0.75rem rgba(0, 0, 0, 0.1);
  touch-action: pan-y;
}

.theme-switch-track:hover {
  border-color: var(--accent);
}

.theme-switch-track:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-switch-knob {
  position: absolute;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 2;
  transform: translateX(0);
  top: 50%;
  transform: translate(0, -50%);
  padding: 0.5rem;
}

.theme-icon {
  position: absolute;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  transition: opacity 0.2s, transform 0.2s, filter 0.2s;
  display: block;
  color: var(--accent);
}

.theme-icon svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.theme-icon-moon {
  inset-inline-start: 0.25rem;
  opacity: 1;
  transform: scale(1);
}

.theme-icon-sun {
  inset-inline-end: 0.25rem;
  opacity: 0;
  transform: scale(0.5);
}

/* Light mode: sun visible, moon hidden */
.theme-switch-knob[data-mode="light"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.5);
}

.theme-switch-knob[data-mode="light"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1);
}

/* Auto mode: both icons hidden */
.theme-switch-knob.auto-mode {
  background: transparent;
  border: none;
  box-shadow: none;
}

.theme-switch-knob.auto-mode .theme-icon-moon,
.theme-switch-knob.auto-mode .theme-icon-sun {
  opacity: 0;
}

/* Auto mode: show the effective icon in black */
.theme-switch-knob.auto-mode[data-auto="true"][data-mode="light"] .theme-icon-sun {
  opacity: 0.6;
  transform: scale(0.9);
  color: #000;
}

.theme-switch-knob.auto-mode[data-auto="true"][data-mode="dark"] .theme-icon-moon {
  opacity: 0.6;
  transform: scale(0.9);
  color: #000;
}

/* Explicit modes: show icon in accent color */
.theme-switch-knob[data-mode="light"] .theme-icon-sun {
  color: var(--accent);
  opacity: 1;
  transform: scale(1);
}

.theme-switch-knob[data-mode="dark"] .theme-icon-moon {
  color: var(--accent);
  opacity: 1;
  transform: scale(1);
}

.banner-links {
  display: flex;
  gap: 0.75rem;
  position: absolute;
  inset-block-end: 1rem;
  inset-inline-end: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.banner-link-item {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  border-radius: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
  box-shadow: light-dark(0 0.125rem 0.5rem rgba(0,0,0,0.08), 0 0.125rem 0.5rem rgba(0,0,0,0.2));
  white-space: nowrap;
}

.banner-link-item:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-info {
  display: flex;
  gap: 1.5rem;
  padding-inline: 1.5rem;
  position: relative;
  max-width: 62.5rem;
  margin-inline: auto;
  align-items: flex-end;
  min-height: 8rem;
}

.profile-photo {
  flex-shrink: 0;
  margin-block-start: -6.875rem;
  margin-block-end: 0;
  inline-size: 13.75rem;
  block-size: 13.75rem;
  border-radius: 50%;
  border: 4px solid var(--surface);
  object-fit: cover;
  display: block;
}

.profile-info:not(:has(.profile-photo)) {
  align-items: flex-end;
  min-height: 8rem;
  padding-left: 0;
}

.profile-details {
  padding-block: 1rem;
  flex: 1;
  min-inline-size: 0;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-block-end: 0.25rem;
}

.profile-title {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  margin-block-end: 0.5rem;
}
