/* TraitMatch marketing site — brand: night + teal + pink, with light theme */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16141a;
  --bg-elev: #221f28;
  --text: #f2ebe3;
  --muted: rgba(242, 235, 227, 0.72);
  --teal: #2aa8a0;
  --teal-bright: #12c4b0;
  --pink: #ff6b9d;
  --line: rgba(242, 235, 227, 0.12);
  --header-bg: rgba(22, 20, 26, 0.82);
  --store-bg: #0a0a0c;
  --store-border: rgba(242, 235, 227, 0.22);
  --phone-frame: #0c0b0f;
  --phone-bezel: #2a2730;
  --phone-screen: #16141a;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  --glow-1: rgba(42, 168, 160, 0.28);
  --glow-2: rgba(255, 107, 157, 0.16);
  --max: 72rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0ea;
  --bg-elev: #ffffff;
  --text: #1a171f;
  --muted: rgba(26, 23, 31, 0.68);
  --teal: #1f8f88;
  --teal-bright: #0e9e90;
  --pink: #e05588;
  --line: rgba(26, 23, 31, 0.1);
  --header-bg: rgba(244, 240, 234, 0.88);
  --store-bg: #1a171f;
  --store-border: transparent;
  --phone-frame: #1a171f;
  --phone-bezel: #2e2a35;
  --phone-screen: #16141a;
  --shadow: 0 24px 50px rgba(40, 30, 50, 0.18);
  --glow-1: rgba(42, 168, 160, 0.18);
  --glow-2: rgba(255, 107, 157, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -10%, var(--glow-1), transparent 55%),
    radial-gradient(700px 480px at 92% 8%, var(--glow-2), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(18, 196, 176, 0.06), transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--pink);
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  transition: font-size 0.25s ease, color 0.25s ease;
}

.logo-mark {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.55rem;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: #2aa8a0;
  box-shadow: 0 0 0 1px var(--line);
  transition: width 0.25s ease, height 0.25s ease;
}

.logo:hover {
  color: var(--teal-bright);
}

.mascot-hero {
  width: min(11rem, 46vw);
  height: auto;
  margin: 0 0 1rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
  animation: rise 0.85s ease both;
}

.mascot-footer {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem 1.15rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.92rem;
  transition: font-size 0.25s ease, gap 0.25s ease;
}

.nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a.is-active {
  color: var(--text);
  font-weight: 650;
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 2px;
  border-radius: 999px;
  background: var(--teal-bright);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  line-height: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.theme-toggle svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  overflow: visible;
}

/* Crescent glyph sits high-left in its path — nudge for optical center */
.theme-toggle .icon-moon {
  transform: translate(0.5px, 1px);
}

html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* —— Hero —— */
.hero {
  min-height: calc(100vh - 3.6rem);
  display: grid;
  align-items: center;
  gap: 2.5rem 3rem;
  padding: 3rem 0 3.5rem;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

.hero-inner {
  max-width: 34rem;
  animation: rise 0.9s ease both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  background: linear-gradient(120deg, var(--text) 35%, var(--teal-bright) 72%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-line {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.hero-sub {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 28rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: var(--store-bg);
  border: 1px solid var(--store-border);
  color: #f2ebe3;
  text-decoration: none;
  min-width: 10.5rem;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}

.store-btn:hover {
  border-color: var(--teal);
  color: #f2ebe3;
  transform: translateY(-2px);
}

.store-btn.is-soon {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

.store-btn .label-sm {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1.2;
}

.store-btn .label-lg {
  display: block;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.2;
}

.store-btn svg {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
}

.beta-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.beta-link a {
  color: var(--teal-bright);
}

.trust-line {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.75rem;
  z-index: 50;
  padding: 0.55rem 0.9rem;
  background: var(--teal);
  color: #061614;
  font-weight: 650;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  left: 0.75rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1rem;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* —— Phone stack —— */
.hero-phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 28rem;
  animation: rise 1s ease 0.15s both;
}

.phone {
  width: min(17.5rem, 72vw);
  border-radius: 2rem;
  background: var(--phone-frame);
  padding: 0.55rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--phone-bezel);
  position: relative;
  z-index: 2;
}

.phone::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4.2rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #000;
  z-index: 3;
}

.phone-screen {
  border-radius: 1.55rem;
  overflow: hidden;
  background: var(--phone-screen);
  aspect-ratio: 9 / 19.2;
  position: relative;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.phone.phone-back {
  position: absolute;
  width: min(15.5rem, 64vw);
  z-index: 1;
  opacity: 0.92;
  transform: translate(-38%, -6%) rotate(-8deg);
}

.phone.phone-front-side {
  position: absolute;
  width: min(15.2rem, 62vw);
  z-index: 1;
  opacity: 0.95;
  transform: translate(40%, -4%) rotate(7deg);
}

.phone.phone-hero-main {
  animation: phone-float 5.5s ease-in-out infinite;
}

@keyframes phone-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 959px) {
  .phone.phone-back,
  .phone.phone-front-side {
    display: none;
  }
}

/* —— How it works —— */
.how-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .how-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

.how-item {
  padding: 1.35rem 1.25rem 1.45rem;
  border-top: 2px solid var(--teal);
}

.how-num {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--pink);
  margin-bottom: 0.45rem;
}

.how-item h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.how-item p {
  margin: 0;
  color: var(--muted);
}

/* —— Safety —— */
.safety-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .safety-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.safety-card {
  display: block;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.safety-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  color: inherit;
}

.safety-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.safety-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— FAQ —— */
.faq-list {
  display: grid;
  gap: 0.65rem;
  max-width: 40rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 0.15rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  padding: 0.95rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--teal-bright);
  font-weight: 650;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* —— Feature deep-dives —— */
.feature-row {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.feature-row:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}

@media (min-width: 860px) {
  .feature-row {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
  }
  .feature-row-reverse .feature-copy {
    order: 2;
  }
  .feature-row-reverse .feature-media {
    order: 1;
  }
}

.feature-tag {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.feature-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 650;
  margin: 0 0 0.55rem;
  letter-spacing: -0.015em;
}

.feature-copy p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}

.feature-media {
  display: flex;
  justify-content: center;
}

.feature-media .phone {
  width: min(15.5rem, 70vw);
}

/* —— App gallery —— */
.shots {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .shots {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .shots.shots-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 800px) and (max-width: 1100px) {
  .shots.shots-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.shot .phone {
  width: 100%;
  max-width: 16.5rem;
}

.shot figcaption {
  text-align: center;
  max-width: 16rem;
}

.shot figcaption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.shot figcaption span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— Sections —— */
.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--line);
}

.section-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.5rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 650;
  margin: 0 0 0.65rem;
  letter-spacing: -0.015em;
}

.section-lead {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 36rem;
}

.why-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 720px) {
  .why-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.75rem 2rem;
  }
}

.why-item {
  animation: rise 0.7s ease both;
}

.why-item:nth-child(2) { animation-delay: 0.08s; }
.why-item:nth-child(3) { animation-delay: 0.14s; }
.why-item:nth-child(4) { animation-delay: 0.2s; }

.why-num {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--pink);
  margin-bottom: 0.4rem;
}

.why-item h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.why-item p {
  margin: 0;
  color: var(--muted);
}

.download-band {
  text-align: center;
  padding: 4rem 0 4.5rem;
  border-top: 1px solid var(--line);
}

.download-band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0 0 0.5rem;
}

.download-band p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.download-band .cta-row {
  justify-content: center;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--teal-bright);
}

/* —— Legal / inner pages —— */
.page {
  padding: 2.5rem 0 4rem;
}

.page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.4rem;
}

.meta {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.doc {
  white-space: pre-wrap;
  font-family: var(--font-body);
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 1.75rem;
  font-size: 0.92rem;
}

.legal-nav a {
  color: var(--muted);
  text-decoration: none;
}

.legal-nav a:hover {
  color: var(--teal-bright);
}

.box {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  margin: 1rem 0;
}

.box h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.65rem;
}

.box p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.box p:last-child {
  margin-bottom: 0;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.contact-list li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
}

.contact-list strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.contact-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .site-header .wrap {
    position: relative;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
  }

  .nav a.is-active::after {
    display: none;
  }

  .nav a.is-active {
    background: rgba(42, 168, 160, 0.12);
  }
}

@media (max-width: 720px) {
  .nav a:nth-child(n + 3) {
    display: block;
  }
}

.mobile-cta {
  display: none;
}

@media (max-width: 720px) {
  .mobile-cta {
    display: flex;
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--header-bg);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    justify-content: center;
  }

  .mobile-cta[hidden] {
    display: none !important;
  }

  .mobile-cta .store-btn {
    width: min(100%, 22rem);
    justify-content: center;
  }

  body {
    padding-bottom: 5.5rem;
  }
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.footer-links-secondary {
  opacity: 0.85;
  font-size: 0.92rem;
}
