/* Profile sheet + auth overlay — liquid glass v3 */

@property --lg-profile-rim-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes lg-profile-rim-spin {
  to { --lg-profile-rim-angle: 360deg; }
}

@keyframes lg-profile-shimmer {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.62; }
}

@keyframes gc-profile-rise-in {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.gc-profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
  opacity: 0;
  transition:
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

#gc-profile-root.is-open .gc-profile-backdrop {
  opacity: 1;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

#gc-profile-root.is-closing .gc-profile-backdrop {
  opacity: 0;
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
}

.gc-profile-sheet {
  position: fixed;
  z-index: 1090;
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(94dvh, 760px);
  padding: 0;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  transform: translate3d(0, 100%, 0) scale(0.98);
  opacity: 0;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  --glass-blur: var(--glass-blur-lg);
  box-shadow:
    0 -12px 64px rgba(0, 0, 0, 0.52),
    0 0 48px rgba(100, 210, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  will-change: transform, opacity;
}

#gc-profile-sheet.glass::before {
  --lg-profile-rim-angle: 0deg;
  background: conic-gradient(
    from var(--lg-profile-rim-angle),
    rgba(100, 210, 255, 0.72) 0%,
    rgba(175, 95, 255, 0.58) 22%,
    rgba(255, 90, 175, 0.52) 44%,
    rgba(0, 220, 255, 0.62) 66%,
    rgba(100, 210, 255, 0.72) 100%
  );
  opacity: 0.5;
  animation: lg-profile-rim-spin 18s linear infinite;
}

#gc-profile-sheet.glass::after {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.05) 14%,
    transparent 38%,
    transparent 100%
  );
}

#gc-profile-root.is-open .gc-profile-sheet {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

#gc-profile-root.is-closing .gc-profile-sheet {
  transform: translate3d(0, 100%, 0) scale(0.98);
  opacity: 0;
}

#gc-profile-root.is-open .gc-profile-topbar {
  animation: gc-profile-rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

#gc-profile-root.is-open .gc-profile-glass-card--hero {
  animation: gc-profile-rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

#gc-profile-root.is-open .gc-profile-account-mount {
  animation: gc-profile-rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

#gc-profile-root.is-open .gc-profile-glass-card--danger {
  animation: gc-profile-rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.gc-profile-open {
  overflow: hidden;
}

.gc-profile-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: linear-gradient(
    168deg,
    color-mix(in srgb, var(--color-bg-elevated) 72%, transparent) 0%,
    color-mix(in srgb, var(--color-bg) 84%, transparent) 100%
  );
}

.gc-profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.45rem;
  flex-shrink: 0;
}

.gc-profile-topbar__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
}

.gc-profile-close {
  width: 2.125rem;
  height: 2.125rem;
}

.gc-profile-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  flex-shrink: 0;
}

.gc-profile-hero__copy {
  flex: 1;
  min-width: 0;
}

.gc-profile-hero__avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, rgb(100, 210, 255), rgb(170, 100, 255));
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(100, 210, 255, 0.22);
  overflow: hidden;
  flex-shrink: 0;
}

.gc-profile-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-profile-hero__avatar--guest {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.gc-profile-hero__name {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-profile-hero__email {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-profile-hero__badge {
  margin-top: 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gc-profile-hero__badge--member {
  color: rgb(100, 210, 255);
  background: rgba(100, 210, 255, 0.12);
  border-color: rgba(100, 210, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.gc-profile-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.85rem 1.35rem;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gc-profile-section {
  flex-shrink: 0;
}

.gc-profile-section__label {
  margin: 0 0 0.38rem;
  padding: 0 0.2rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.gc-profile-glass-card {
  border-radius: 16px;
  overflow: hidden;
}

.gc-profile-glass-card.glass {
  --glass-blur: var(--glass-blur-sm);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 28px rgba(0, 0, 0, 0.22);
}

.gc-profile-glass-card.glass::before {
  --lg-profile-rim-angle: 0deg;
  background: conic-gradient(
    from var(--lg-profile-rim-angle),
    rgba(100, 210, 255, 0.65) 0%,
    rgba(175, 95, 255, 0.5) 25%,
    rgba(255, 90, 175, 0.45) 50%,
    rgba(0, 220, 255, 0.55) 75%,
    rgba(100, 210, 255, 0.65) 100%
  );
  opacity: 0.44;
  animation: lg-profile-rim-spin 16s linear infinite;
}

.gc-profile-glass-card.glass::after {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 28%,
    transparent 55%
  );
}

.gc-profile-glass-card--danger.glass::before {
  background: conic-gradient(
    from var(--lg-profile-rim-angle),
    rgba(255, 90, 140, 0.7) 0%,
    rgba(255, 120, 100, 0.55) 33%,
    rgba(255, 90, 175, 0.5) 66%,
    rgba(255, 90, 140, 0.7) 100%
  );
}

.gc-profile-glass-card > .gc-profile-row + .gc-profile-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gc-profile-account-mount {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.gc-profile-accordion {
  border-radius: 16px;
  overflow: hidden;
  --glass-blur: var(--glass-blur-sm);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 28px rgba(0, 0, 0, 0.22);
}

.gc-profile-accordion.glass::before {
  --lg-profile-rim-angle: 0deg;
  background: conic-gradient(
    from var(--lg-profile-rim-angle),
    rgba(100, 210, 255, 0.65) 0%,
    rgba(175, 95, 255, 0.5) 25%,
    rgba(255, 90, 175, 0.45) 50%,
    rgba(0, 220, 255, 0.55) 75%,
    rgba(100, 210, 255, 0.65) 100%
  );
  opacity: 0.44;
  animation: lg-profile-rim-spin 16s linear infinite;
}

.gc-profile-accordion--page {
  margin-bottom: var(--space-md);
}

.gc-profile-acc {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gc-profile-acc:last-of-type {
  border-bottom: none;
}

html[data-theme="light"] .gc-profile-acc {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.gc-profile-acc__summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease;
  box-sizing: border-box;
}

.gc-profile-acc__summary::-webkit-details-marker {
  display: none;
}

.gc-profile-acc__summary:hover,
.gc-profile-acc__summary:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.gc-profile-acc[open] > .gc-profile-acc__summary {
  background: rgba(255, 255, 255, 0.05);
}

.gc-profile-acc__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  flex-shrink: 0;
  color: rgb(100, 210, 255);
  background: rgba(100, 210, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.gc-profile-acc__icon--admin {
  color: rgb(255, 180, 100);
  background: rgba(255, 180, 100, 0.12);
}

.gc-profile-acc--upgrade .gc-profile-acc__icon {
  color: rgb(180, 140, 255);
  background: rgba(180, 140, 255, 0.12);
}

.gc-profile-acc__label {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.gc-profile-acc__badge {
  flex-shrink: 0;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
  color: rgb(100, 210, 255);
  background: rgba(100, 210, 255, 0.14);
  border: 1px solid rgba(100, 210, 255, 0.22);
}

.gc-profile-acc__badge[hidden] {
  display: none;
}

.gc-profile-acc__chev {
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.gc-profile-acc[open] > .gc-profile-acc__summary .gc-profile-acc__chev {
  transform: rotate(180deg);
  opacity: 0.65;
}

.gc-profile-acc__body {
  padding: 0 0.9rem 0.85rem;
  animation: gc-profile-acc-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gc-profile-acc-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gc-profile-acc-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s ease;
}

.gc-profile-acc-link:hover {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .gc-profile-acc-link {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.gc-profile-form--acc {
  padding: 0.15rem 0 0;
  gap: 0.65rem;
}

.gc-profile-follows-wrap {
  padding: 0.15rem 0 0;
}

.gc-profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}

.gc-profile-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.gc-profile-field input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.gc-profile-field input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

html[data-theme="light"] .gc-profile-field input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

.gc-profile-muted {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-subtle);
}

.gc-profile-submit {
  width: 100%;
  justify-content: center;
}

.gc-profile-divider {
  margin: 0.25rem 0;
}

.gc-profile-follows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gc-profile-follows .account-follows__item {
  padding: 0.55rem 0;
}

.gc-profile-follows .cal-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.gc-profile-follows .cal-follow--on {
  color: #ff9ab0;
  border-color: rgba(255, 100, 130, 0.35);
  background: rgba(255, 100, 130, 0.12);
}

html[data-theme="light"] .gc-profile-glass-card > .gc-profile-row + .gc-profile-row {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.gc-profile-inset > .gc-profile-row + .gc-profile-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gc-profile-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease;
  box-sizing: border-box;
}

.gc-profile-inset > .gc-profile-row + .gc-profile-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .gc-profile-inset > .gc-profile-row + .gc-profile-row {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.gc-profile-row:hover,
.gc-profile-row:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.gc-profile-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  flex-shrink: 0;
  color: rgb(100, 210, 255);
  background: rgba(100, 210, 255, 0.1);
}

.gc-profile-row__icon--admin {
  color: rgb(255, 180, 100);
  background: rgba(255, 180, 100, 0.12);
}

.gc-profile-row__icon--upgrade {
  color: rgb(180, 140, 255);
  background: rgba(180, 140, 255, 0.12);
}

.gc-profile-row__icon--danger {
  color: #ff6b8a;
  background: rgba(255, 90, 140, 0.12);
}

.gc-profile-row__text {
  flex: 1;
  min-width: 0;
}

.gc-profile-row__chevron {
  flex-shrink: 0;
  opacity: 0.35;
}

.gc-profile-row--danger .gc-profile-row__text {
  color: #ff6b8a;
}

.gc-profile-row--cta {
  justify-content: center;
  font-weight: 650;
  color: rgb(100, 210, 255);
  background: rgba(100, 210, 255, 0.08);
}

.gc-profile-row--cta:hover {
  background: rgba(100, 210, 255, 0.14);
}

.gc-profile-signout-wrap {
  margin-top: 0.75rem;
}

/* Header trigger — avatar only */
.site-header__auth .user-menu__trigger {
  position: relative;
}

.site-header__auth .user-menu__trigger.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 2px rgba(100, 210, 255, 0.35);
}

@media (min-width: 901px) {
  .gc-profile-sheet {
    top: calc(max(0.45rem, env(safe-area-inset-top, 0px)) + var(--header-height, 52px) + 0.35rem);
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: auto;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(88dvh, 680px);
    border-radius: 22px;
    transform: translate3d(0, 10px, 0) scale(0.96);
    opacity: 0;
    transition:
      transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  #gc-profile-root.is-open .gc-profile-sheet {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  #gc-profile-root.is-closing .gc-profile-sheet {
    transform: translate3d(0, 10px, 0) scale(0.96);
    opacity: 0;
  }
}

/* Auth overlay — liquid glass refresh */
.auth-overlay__backdrop {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-overlay__dialog {
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(92dvh, 640px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}

.auth-overlay [data-auth-panel].auth-panel {
  padding: 1.15rem 1.15rem 1.35rem;
  background: linear-gradient(
    168deg,
    color-mix(in srgb, var(--color-bg-elevated) 94%, #0a0c14) 0%,
    color-mix(in srgb, var(--color-bg) 98%, #050508) 100%
  );
}

.auth-panel__brand {
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-panel__logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-panel__logo-wrap .brand-logo {
  --brand-logo-h: 28px;
}

.auth-panel__title {
  font-size: 1.125rem;
}

.auth-panel__subtitle:empty {
  display: none;
}

.auth-panel__subtitle {
  font-size: 0.8125rem;
  max-width: none;
  color: var(--color-text-muted);
}

.auth-panel__btn-google {
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.auth-segment {
  border-radius: 999px;
  padding: 0.18rem;
  background: rgba(0, 0, 0, 0.22);
}

.auth-segment__btn {
  border-radius: 999px;
}

.auth-field label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.auth-input-wrap input {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-panel__submit {
  border-radius: 12px;
  margin-top: 0.25rem;
}

.auth-hint {
  display: none;
}

.auth-legal {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--color-text-subtle);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .gc-profile-sheet,
  .gc-profile-backdrop {
    transition: none;
  }

  #gc-profile-root.is-open .gc-profile-topbar,
  #gc-profile-root.is-open .gc-profile-glass-card--hero,
  #gc-profile-root.is-open .gc-profile-account-mount,
  #gc-profile-root.is-open .gc-profile-glass-card--danger {
    animation: none;
  }

  .gc-profile-acc__body {
    animation: none;
  }

  #gc-profile-sheet.glass::before,
  .gc-profile-glass-card.glass::before,
  .gc-profile-accordion.glass::before {
    animation: none;
  }
}
