:root {
  --page: #f6f7f9;
  --ink: #17181c;
  --muted: #737782;
  --line: rgba(22, 24, 28, 0.08);
  --glass: rgba(255, 255, 255, 0.62);
  --card-w: min(72vw, 318px);
  --card-h: min(134vw, 520px);
  --radius-card: 34px;
  --spring: cubic-bezier(.21, 1.28, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, rgba(120, 160, 255, 0.22), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(252, 210, 168, 0.26), transparent 30%),
    linear-gradient(180deg, #fbfcfd 0%, var(--page) 44%, #edf0f4 100%);
  overflow-x: hidden;
}

body.detail-open {
  overflow: hidden;
}

button {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid rgba(80, 120, 255, .72);
  outline-offset: 3px;
}

img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.app-shell {
  min-height: 100svh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(560px, 1fr) auto auto;
  gap: 14px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 0;
}

.eyebrow,
.label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 8vw, 42px);
  line-height: .95;
  letter-spacing: 0;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 34px rgba(54, 61, 78, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.refresh-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #22252d;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 520ms var(--spring);
}

.icon-button:active .refresh-icon {
  transform: rotate(160deg) scale(.94);
}

.stage {
  min-height: 550px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(32px);
  opacity: .68;
  pointer-events: none;
}

.ambient-a {
  width: 230px;
  height: 230px;
  left: -72px;
  top: 74px;
  background: rgba(105, 152, 255, .22);
}

.ambient-b {
  width: 210px;
  height: 210px;
  right: -86px;
  bottom: 58px;
  background: rgba(238, 190, 132, .28);
}

.carousel {
  width: 100%;
  height: calc(var(--card-h) + 86px);
  max-height: 610px;
  position: relative;
  perspective: 1320px;
  perspective-origin: 50% 46%;
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
}

.cards,
.back-plate,
.bridge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
}

.back-plate {
  width: min(96vw, 492px);
  height: calc(var(--card-h) * .82);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(229, 235, 243, .52) 44%, rgba(255, 255, 255, .33)),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .92), transparent 38%);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow:
    0 42px 96px rgba(49, 58, 72, .20),
    0 12px 32px rgba(111, 128, 154, .12),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -28px 70px rgba(122, 137, 162, .10);
  transform: translate3d(-50%, -50%, -250px) rotateX(0deg);
  backdrop-filter: blur(26px) saturate(1.12);
}

.bridge {
  width: min(47vw, 214px);
  height: calc(var(--card-h) * .78);
  border-radius: 34px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.58), rgba(224,230,239,.36) 55%, rgba(255,255,255,.18)),
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(184,196,214,.18));
  border: 1px solid rgba(255,255,255,.54);
  box-shadow: 0 30px 70px rgba(60, 68, 82, .14), inset 0 1px 0 rgba(255,255,255,.75);
  opacity: .82;
  backdrop-filter: blur(20px);
  pointer-events: none;
}

.bridge-left {
  transform: translate3d(calc(-50% - 116px), -50%, -190px) rotateY(-18deg);
}

.bridge-right {
  transform: translate3d(calc(-50% + 116px), -50%, -190px) rotateY(18deg);
}

.cards {
  width: 0;
  height: 0;
  transform: translate3d(-50%, -50%, 0);
}

.member-card {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  left: calc(var(--card-w) / -2);
  top: calc(var(--card-h) / -2);
  border-radius: var(--radius-card);
  padding: 16px;
  background: rgba(255, 255, 255, .88);
  box-shadow:
    0 34px 76px rgba(34, 39, 48, .24),
    0 8px 18px rgba(34, 39, 48, .08),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .74);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
  contain: layout paint style;
  overflow: hidden;
  transition: box-shadow 520ms var(--spring);
}

.member-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,.34), transparent 28%),
    radial-gradient(circle at 50% -12%, rgba(255,255,255,.55), transparent 32%);
  mix-blend-mode: screen;
  opacity: .74;
}

.carousel-empty {
  position: absolute;
  width: min(74vw, 300px);
  left: min(-37vw, -150px);
  top: -42px;
  border-radius: 22px;
  padding: 18px;
  color: #676d78;
  text-align: center;
  font-size: 14px;
  font-weight: 720;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.76);
  box-shadow: 0 22px 54px rgba(42,50,66,.12), inset 0 1px 0 rgba(255,255,255,.86);
}

.profile-empty {
  border-radius: 22px;
  padding: 28px 18px;
  color: #676d78;
  text-align: center;
  font-size: 14px;
  font-weight: 720;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 18px 44px rgba(42,50,66,.10), inset 0 1px 0 rgba(255,255,255,.86);
}

.photo-shell {
  height: calc(var(--card-h) * .62);
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, #d9e2ee, #f4efe8),
    #d9e2ee;
  transform: translateZ(16px);
}

.photo-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.018);
  backface-visibility: hidden;
}

.photo-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 18, 34, .46) 0%, rgba(10, 18, 34, .06) 34%, transparent 62%),
    linear-gradient(0deg, rgba(10, 18, 34, .36), transparent 34%);
}

.default-photo-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,.92);
  background: rgba(20, 24, 32, .38);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 760;
}

.card-title {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  text-align: left;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}

.card-title h3 {
  margin: 0;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0;
}

.card-title p {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 560;
  opacity: .9;
}

.profile-panel {
  padding: 13px 2px 0;
  transform: translateZ(22px);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-width: 0;
  height: 40px;
  border-radius: 15px;
  padding: 6px 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(244,247,251,.78)),
    rgba(247, 249, 252, .86);
  border: 1px solid rgba(31, 35, 44, .055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.metric span {
  display: block;
  color: #858b96;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0;
}

.metric strong {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: #191b20;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 740;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-copy {
  text-align: center;
  min-height: 86px;
  padding: 0 12px;
}

.member-copy h2 {
  font-size: 28px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.member-copy p:last-child {
  margin: 8px auto 0;
  max-width: 28em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.carousel-controls {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.control-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: #1b1d22;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 12px 26px rgba(39, 46, 60, .12), inset 0 1px 0 rgba(255,255,255,.84);
}

.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(34, 36, 42, .18);
  transition: width 420ms var(--spring), background 420ms var(--spring);
}

.dot.is-active {
  width: 22px;
  background: #1b1d22;
}

.detail-page {
  min-height: 100svh;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(26px, env(safe-area-inset-bottom));
}

.profile-detail {
  display: grid;
  gap: 16px;
}

.profile-hero {
  position: relative;
  width: 100%;
  height: clamp(340px, 112vw, 430px);
  max-height: 430px;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #dfe5ef;
  box-shadow: 0 28px 70px rgba(32, 40, 54, .18), inset 0 1px 0 rgba(255,255,255,.72);
}

.profile-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.profile-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14,18,28,.16), transparent 42%),
    linear-gradient(0deg, rgba(14,18,28,.62), transparent 58%);
}

.hero-default-badge {
  top: 10px;
  right: 10px;
}

.profile-hero-copy {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  color: white;
  text-shadow: 0 2px 18px rgba(0,0,0,.28);
}

.profile-hero-copy h1 {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-size: 24px;
  line-height: 1.1;
}

.profile-hero-copy span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 580;
}

.gender-fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 22px;
  line-height: 1;
  font-weight: 760;
  flex: 0 0 auto;
  transform: translateY(2px);
}

.gender-fa.female {
  color: #f43f5e;
}

.gender-fa.male {
  color: #3b82f6;
}

.profile-hero-copy .gender-fa {
  width: 22px;
  height: 22px;
  font-size: 22px;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.22));
  text-shadow: none;
  transform: translateY(2px);
}

.detail-field .gender-fa {
  margin-right: 6px;
}

.detail-section {
  border-radius: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(255, 255, 255, .76);
  box-shadow: 0 16px 42px rgba(48, 58, 78, .09), inset 0 1px 0 rgba(255,255,255,.78);
}

.detail-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 820;
}

.detail-basic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-field {
  min-width: 0;
  min-height: 52px;
  border-radius: 16px;
  padding: 9px 10px;
  background: rgba(247, 249, 252, .88);
  border: 1px solid rgba(26, 30, 38, .06);
}

.detail-field span {
  display: block;
  color: #858b97;
  font-size: 10px;
  font-weight: 740;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-field strong {
  display: block;
  min-width: 0;
  margin-top: 5px;
  color: #1a1d24;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-field:nth-last-child(1) {
  grid-column: auto;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tags span {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(235,239,245,.92);
  color: #454b57;
  font-size: 12px;
  font-weight: 720;
}

.detail-note {
  border-radius: 18px;
  padding: 13px;
  background: rgba(247,249,252,.88);
  border: 1px solid rgba(26,30,38,.06);
}

.detail-note strong {
  display: block;
  color: #1a1d24;
  font-size: 14px;
  line-height: 1.35;
}

.detail-note p {
  margin-top: 8px;
  color: #656b78;
  font-size: 13px;
  line-height: 1.6;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.photo-gallery.is-empty {
  display: block;
}

.gallery-empty {
  min-height: 132px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #8a909b;
  font-size: 13px;
  font-weight: 720;
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(244,247,251,.78)),
    rgba(247,249,252,.86);
  border: 1px dashed rgba(26,30,38,.13);
}

.gallery-photo {
  height: 132px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #dfe5ef;
  box-shadow: 0 14px 32px rgba(28,36,50,.12);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-photo:active,
.gallery-photo:focus {
  background: #dfe5ef;
  box-shadow: 0 14px 32px rgba(28,36,50,.12);
}

.gallery-photo.is-main {
  grid-column: 1 / -1;
  height: 230px;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-preview[hidden] {
  display: none;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 10, 14, .84);
  backdrop-filter: blur(18px);
}

.preview-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: white;
  font-size: 28px;
  line-height: 36px;
}

.preview-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  height: 82svh;
  overflow: hidden;
  border-radius: 22px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.preview-track {
  height: 100%;
  display: flex;
  transition: transform 420ms var(--spring);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.preview-slide {
  min-width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.preview-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.preview-nav {
  position: fixed;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: white;
  font-size: 34px;
  line-height: 38px;
}

.preview-prev {
  left: 16px;
}

.preview-next {
  right: 16px;
}

.preview-count {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 390px) {
  :root {
    --card-w: min(75vw, 292px);
    --card-h: min(136vw, 500px);
  }

  .app-shell {
    grid-template-rows: auto minmax(530px, 1fr) auto auto;
    padding-left: 14px;
    padding-right: 14px;
  }

  .stage {
    min-height: 520px;
  }

  .detail-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .detail-field {
    min-height: 48px;
    padding: 8px;
  }

  .detail-field strong {
    font-size: 12px;
  }

  .profile-hero {
    height: clamp(320px, 108vw, 410px);
    max-height: 410px;
  }

  .photo-gallery {
    gap: 8px;
  }

  .gallery-photo {
    height: 112px;
    border-radius: 16px;
  }

  .gallery-photo.is-main {
    height: 202px;
  }

  .preview-frame {
    height: 78svh;
  }

  .preview-nav {
    width: 38px;
    height: 38px;
    font-size: 30px;
  }
}

@media (min-width: 700px) {
  .app-shell {
    width: min(100%, 760px);
  }

  :root {
    --card-w: 330px;
    --card-h: 530px;
  }
}

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