* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f7f4f7;
  --surface: #ffffff;
  --text: #211c24;
  --muted: #827984;
  --accent: #ff6476;
  --border: #e9e2e9;
  --shadow: 0 18px 50px #2014282b;
}

body.dark-mode {
  color-scheme: dark;
  --bg: #17151a;
  --surface: #242128;
  --text: #fff9ff;
  --muted: #b4aab9;
  --border: #3b3540;
  --shadow: 0 18px 55px #0006;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 84px;
}

.topbar {
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 850;
}

.brand span {
  color: var(--accent);
}

#theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 21px;
}

.discovery {
  width: min(calc(100% - 40px), 480px);
  margin: 24px auto 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 5vw, 34px);
  letter-spacing: -1.3px;
}

h1 span {
  color: var(--accent);
}

.demo-badge {
  padding: 7px 10px;
  border-radius: 20px;
  color: #e34c63;
  background: #ff647622;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.card-stage {
  position: relative;
  width: 100%;
  height: min(65vh, 680px);
  height: min(65dvh, 680px);
  min-height: 430px;
  perspective: 1400px;
  isolation: isolate;
}

.profile-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 25px;
  background: #302a35;
  box-shadow: var(--shadow);
  transform-origin: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.current-card {
  z-index: 2;
  touch-action: pan-y;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.next-card {
  z-index: 1;
  inset: 9px 7px -7px;
  transform: scale(.965) translateY(7px);
  opacity: .85;
  filter: brightness(.8);
  pointer-events: none;
}

.profile-photo-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #39313e;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #0002 0%,
    transparent 27%,
    #0002 42%,
    #000e 100%
  );
}

.profile-details {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 22px;
  left: 20px;
  color: white;
  pointer-events: none;
}

.profile-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: #f0e9f1;
  font-size: 12px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #69edb0;
}

.profile-details h2 {
  margin: 0;
  font-size: clamp(28px, 6vw, 37px);
  font-weight: 800;
  letter-spacing: -1px;
}

.profile-location {
  margin: 5px 0 10px;
  color: #f2eaf4;
  font-size: 13px;
}

.profile-bio {
  max-width: 420px;
  margin: 0 0 12px;
  color: #f6f1f7;
  font-size: 14px;
  line-height: 1.5;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-tags span {
  padding: 7px 11px;
  border: 1px solid #ffffff40;
  border-radius: 20px;
  background: #ffffff24;
  color: white;
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.swipe-stamp {
  position: absolute;
  z-index: 12;
  top: 13%;
  padding: 9px 14px;
  border: 4px solid currentColor;
  border-radius: 10px;
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 950;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 12px #0003;
}

.like-stamp {
  left: 7%;
  color: #63f5b0;
  transform: rotate(-14deg);
}

.nope-stamp {
  right: 7%;
  color: #ff626e;
  transform: rotate(14deg);
}

.swipe-hint {
  margin: 18px 0 15px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.action-button {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 20px #0001;
  transition: transform .18s;
}

.action-button:active {
  transform: scale(.91);
}

.pass-button {
  color: #f06c81;
  font-size: 42px;
  font-weight: 300;
}

.like-button {
  width: 76px;
  height: 76px;
  border: 0;
  background: linear-gradient(135deg, #ff7b79, #ff536c);
  color: white;
  font-size: 35px;
  box-shadow: 0 8px 25px #ff536c52;
}

.action-caption {
  margin: 9px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 3px;
}

.action-caption span {
  margin: 0 8px;
  color: var(--accent);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-around;
  padding: 10px 8px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.nav-item {
  display: flex;
  flex: 1;
  align-items: center;
  flex-direction: column;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.nav-item > span {
  font-size: 24px;
  line-height: 1.1;
}

.nav-item small {
  font-size: 10px;
  font-weight: 650;
}

.nav-item b {
  color: var(--accent);
}

.nav-item.active {
  color: var(--accent);
}

.secondary-page {
  width: min(calc(100% - 40px), 700px);
  margin: 30px auto;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 22px;
}

.mini-profile {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.mini-profile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.mini-profile div {
  padding: 12px;
  font-weight: 750;
}

.mini-profile p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.empty-state {
  margin-top: 30px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 105px;
  left: 18px;
  width: fit-content;
  max-width: calc(100% - 36px);
  margin: auto;
  padding: 13px 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

#discovery-card.swiping {
  pointer-events: none;
}

#discovery-card.swipe-left {
  transform: translate3d(-135%, 5%, 0) rotate(-20deg) !important;
  opacity: 0;
}

#discovery-card.swipe-right {
  transform: translate3d(135%, 5%, 0) rotate(20deg) !important;
  opacity: 0;
}

/* Decorative 3D folding panels */
.fold-panels {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  perspective: 1000px;
  transform-style: preserve-3d;
  opacity: 0;
}

.fold-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.3334%;
  background-repeat: no-repeat;
  background-size: 300% 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, filter;
}

.panel-one {
  left: 0;
  background-position: left center;
  transform-origin: right center;
}

.panel-two {
  left: 33.3333%;
  background-position: center center;
  transform-origin: right center;
}

.panel-three {
  left: 66.6666%;
  background-position: right center;
  transform-origin: left center;
}

.fold-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0003, transparent 24%, #0002);
  pointer-events: none;
}

#discovery-card.is-dragging .fold-panels {
  opacity: 1;
}

.end-state {
  pointer-events: auto;
  top: 35%;
  bottom: auto;
}

.restart-button {
  margin-top: 15px;
  padding: 12px 18px;
  border: 0;
  border-radius: 24px;
  background: var(--accent);
  color: white;
}

@media (max-width: 700px) {
  .app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .topbar {
    display: none;
  }

  .discovery {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .section-heading,
  .swipe-hint,
  .action-caption {
    display: none;
  }

  .card-stage {
    flex: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    perspective: 1200px;
  }

  .profile-card {
    border-radius: 0;
  }

  .profile-details {
    right: 19px;
    bottom: 112px;
    left: 19px;
  }

  .profile-details h2 {
    font-size: 34px;
  }

  .profile-bio {
    font-size: 13px;
  }

  .action-buttons {
    position: absolute;
    z-index: 15;
    right: 0;
    bottom: calc(25px + env(safe-area-inset-bottom));
    left: 0;
    gap: 28px;
    pointer-events: none;
  }

  .action-button {
    pointer-events: auto;
    width: 55px;
    height: 55px;
    box-shadow: 0 5px 24px #0004;
  }

  .pass-button {
    font-size: 36px;
  }

  .like-button {
    width: 64px;
    height: 64px;
    font-size: 29px;
  }

  .bottom-nav {
    display: none;
  }

  .secondary-page {
    width: calc(100% - 32px);
    margin: 24px auto;
  }

  .profile-list {
    gap: 10px;
  }

  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 701px) {
  .discovery {
    margin-top: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ===== Heyfingle Profile Completion Dashboard ===== */

.profile-dashboard-intro {
  color: var(--muted, #aaa3af);
  line-height: 1.6;
  margin: 10px 0 22px;
  max-width: 520px;
}

.completion-card {
  background: linear-gradient(135deg, #29212d, #201c24);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  padding: 22px;
  margin: 22px 0 28px;
}

.completion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.completion-top .eyebrow {
  margin-bottom: 8px;
}

.completion-top h2 {
  font-size: 42px;
  line-height: 1;
  margin: 0;
  letter-spacing: -1.5px;
}

.completion-heart {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #ff75ad;
  background: rgba(255, 117, 173, 0.12);
  font-size: 27px;
}

.completion-track {
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
}

.completion-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff75ad, #ff4f91);
  transition: width 350ms ease;
}

#completion-message {
  color: #c9c0cd;
  font-size: 13px;
  line-height: 1.5;
  margin: 13px 0 0;
}

.completion-checklist {
  margin-top: 28px;
}

.completion-checklist > h2 {
  font-size: 20px;
  margin: 0 0 12px;
}

.completion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.completion-status {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ff75ad;
  background: rgba(255, 117, 173, 0.12);
  font-size: 18px;
}

.completion-status.is-complete {
  color: #fff;
  background: #e95796;
}

.completion-item-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.completion-item-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.completion-item-copy small {
  color: var(--muted, #aaa3af);
  font-size: 12px;
  line-height: 1.5;
}

.completion-action {
  border: 1px solid rgba(255, 117, 173, 0.45);
  border-radius: 20px;
  padding: 8px 14px;
  color: #ff8fba;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.completion-action:hover {
  background: rgba(255, 117, 173, 0.12);
}

.completion-footnote {
  color: var(--muted, #aaa3af);
  font-size: 12px;
  line-height: 1.6;
  margin: 22px 0;
}

@media (max-width: 480px) {
  .completion-card {
    padding: 18px;
    border-radius: 19px;
  }

  .completion-item {
    gap: 9px;
  }

  .completion-action {
    padding: 8px 11px;
  }
}
