/* 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;
  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 {
  width: 1.15rem;
  height: 1.15rem;
}

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);
}

/* —— 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);
}

@media (max-width: 959px) {
  .phone.phone-back,
  .phone.phone-front-side {
    display: none;
  }
}

/* —— 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: 720px) {
  .nav a:nth-child(n + 3) {
    display: none;
  }
}

.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;
}

.cookie-banner {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
  background: var(--header-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner p {
  margin: 0;
  flex: 1 1 16rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.cookie-btn-primary {
  background: var(--teal);
  border-color: transparent;
  color: #061614;
  font-weight: 650;
}

.cookie-btn-ghost:hover {
  border-color: var(--teal-bright);
}
