/* Xting — brand noir. One stylesheet for the landing + legal pages.
   Palette mirrors the app's design system (ios DesignSystem/Theme.swift):
   hot pink #FF006E + purple #8338EC on purple-black, lilac-tinted neutrals. */

:root {
  --bg: #08070B;
  --bg-deep: #040407;
  --bg-ember: #0C090D;
  --ink: #F4F4F6;
  --ink-dim: rgba(255, 255, 255, 0.66);
  --ink-faint: rgba(255, 255, 255, 0.5);
  --accent: #FF006E;
  --accent-2: #8338EC;
  --yours: #FF5C9E;
  --theirs: #A96BFF;
  --brand: linear-gradient(100deg, #FF006E 0%, #8338EC 100%);
  --line: rgba(221, 204, 234, 0.10);
  --line-soft: rgba(221, 204, 234, 0.06);
  --card: linear-gradient(165deg, rgba(232, 220, 240, 0.05), rgba(232, 220, 240, 0.014) 58%);
  --radius: 22px;
  --maxw: 1080px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- atmosphere ---------- */

/* Same recipe as the app's PageBackground: deep-to-ember vertical wash
   plus slow pink/purple ambient fog. */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(48rem 34rem at 16% -6%, rgba(255, 0, 110, 0.10), transparent 62%),
    radial-gradient(46rem 34rem at 86% 2%, rgba(131, 56, 236, 0.13), transparent 60%),
    radial-gradient(58rem 42rem at 50% 112%, rgba(255, 0, 110, 0.06), transparent 64%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 45%, var(--bg-ember) 100%);
  animation: breathe 16s ease-in-out infinite alternate;
}

@keyframes breathe {
  from { transform: scale(1) translateY(0); opacity: 0.88; }
  to   { transform: scale(1.05) translateY(-1.2%); opacity: 1; }
}

/* film grain — the app has GrainOverlay; the site keeps it too */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* cursor-follow glow (JS moves it; hidden on touch) */
.glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 46rem;
  height: 46rem;
  margin: -23rem 0 0 -23rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 0, 110, 0.08), rgba(131, 56, 236, 0.05) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: transform;
}

body.glow-on .glow { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .glow { display: none; }
}

a { color: inherit; }

::selection { background: rgba(255, 0, 110, 0.35); color: var(--ink); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(8, 7, 11, 0.55);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav.scrolled {
  background: rgba(8, 7, 11, 0.82);
  border-bottom-color: var(--line-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark span {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
}

.nav-links a {
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav-links a:hover { color: var(--ink); }

.chip {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border: 1px solid rgba(255, 0, 110, 0.4);
  border-radius: 999px;
  color: var(--yours);
  background: rgba(255, 0, 110, 0.07);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 104px 0 84px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--theirs);
  margin: 0 0 26px;
  padding: 8px 16px;
  border: 1px solid rgba(169, 107, 255, 0.24);
  border-radius: 999px;
  background: rgba(131, 56, 236, 0.07);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(255, 0, 110, 0.9);
  animation: emberPulse 2.4s ease-in-out infinite;
}

@keyframes emberPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.6; }
}

.hero-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 380;
  font-size: clamp(46px, 7.8vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 0 0 28px;
}

.hero-title .line { display: block; }

.hero-title .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.9em) rotate(1.5deg);
  filter: blur(8px);
  animation: wordIn 1s var(--ease-out) forwards;
  animation-delay: calc(0.12s + var(--i) * 0.07s);
}

@keyframes wordIn {
  to { opacity: 1; transform: none; filter: blur(0); }
}

.hero-title em {
  font-style: italic;
  font-weight: 420;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* generic staged entrance for hero blocks */
.hero-in {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(5px);
  animation: heroIn 1.1s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes heroIn {
  to { opacity: 1; transform: none; filter: blur(0); }
}

.lede {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 0 0 38px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

/* Primary CTA follows the app's PrimaryAction chrome: dark glassy body,
   low-saturation brand wash, gradient hairline border, light text. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.btn-primary {
  color: #FFF4F9;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%) padding-box,
    linear-gradient(90deg, rgba(255, 0, 110, 0.30), rgba(131, 56, 236, 0.30)) padding-box,
    linear-gradient(rgba(22, 16, 24, 0.94), rgba(22, 16, 24, 0.94)) padding-box,
    linear-gradient(90deg, rgba(255, 0, 110, 0.75), rgba(131, 56, 236, 0.75)) border-box;
  box-shadow: 0 8px 30px rgba(255, 0, 110, 0.14);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 244, 249, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 42px rgba(255, 0, 110, 0.24), 0 4px 20px rgba(131, 56, 236, 0.18);
}

.btn-primary:hover::after { transform: translateX(120%); }

.btn-apple {
  width: 15px;
  height: 19px;
  margin-top: -2px;
  flex: none;
}

/* Secondary CTA mirrors the app's SecondaryAction: lilac surface + hairline. */
.btn-ghost {
  color: var(--ink);
  background: rgba(232, 220, 240, 0.045);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(221, 204, 234, 0.24);
  background: rgba(232, 220, 240, 0.07);
}

/* ---------- live demo ---------- */

.demo { margin-top: 74px; }

.demo-inner {
  display: grid;
  grid-template-columns: 1fr 84px 1fr;
  align-items: stretch;
}

.demo-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(6px);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.demo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 220, 240, 0.22), transparent);
}

.demo-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 18px;
}

.opt {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  color: var(--ink-dim);
  margin-bottom: 10px;
  transition: border-color 0.45s ease, background 0.45s ease, color 0.45s ease,
              transform 0.45s var(--ease-out), box-shadow 0.45s ease, opacity 0.45s ease;
}

.opt:last-child { margin-bottom: 0; }

.opt-free { color: var(--ink-faint); font-style: italic; }

.opt.picked {
  border-color: rgba(255, 92, 158, 0.6);
  background: rgba(255, 0, 110, 0.09);
  color: var(--ink);
  transform: scale(1.025);
  box-shadow: 0 6px 26px rgba(255, 0, 110, 0.16);
}

.demo.settled .opt:not(.picked) { opacity: 0.38; }

/* the beam between the two cards */
.demo-beam {
  position: relative;
  align-self: center;
  height: 2px;
  margin: 0 6px;
}

.beam-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 0, 110, 0.55), rgba(131, 56, 236, 0.55));
  opacity: 0.22;
  border-radius: 2px;
  transition: opacity 0.4s ease;
}

.demo.sending .beam-line { opacity: 0.9; }

.beam-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 14px rgba(169, 107, 255, 0.95);
  opacity: 0;
}

.demo.sending .beam-dot { animation: beamTravel 0.7s ease-in-out infinite; }

@keyframes beamTravel {
  0%   { opacity: 0; transform: translateX(0) scale(0.6); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(calc(84px - 6px)) scale(0.6); }
}

.demo.writing .demo-scene,
.demo.done .demo-scene {
  border-color: rgba(169, 107, 255, 0.32);
  box-shadow: 0 10px 44px rgba(131, 56, 236, 0.12);
}

.scene-text {
  font-family: var(--serif);
  font-size: 21.5px;
  font-weight: 380;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  min-height: 5.8em;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--theirs);
  opacity: 0;
}

.demo.writing .caret { opacity: 1; animation: caretBlink 0.85s step-end infinite; }

@keyframes caretBlink { 50% { opacity: 0; } }

.scene-meta {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--ink-faint);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}

.demo.done .scene-meta { opacity: 1; transform: none; }

.demo.fading .demo-inner { opacity: 0.25; transition: opacity 0.5s ease; }
.demo-inner { transition: opacity 0.5s ease; }

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.marquee-seg {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee-seg i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.01em;
  color: var(--ink-faint);
  padding: 0 26px;
  white-space: nowrap;
  transition: color 0.4s ease;
}

.marquee-seg i:hover { color: var(--theirs); }

.marquee-seg b {
  font-size: 13px;
  color: rgba(255, 0, 110, 0.55);
}

/* ---------- sections ---------- */

section { padding: 104px 0; }

.section-top { margin-bottom: 56px; }

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--yours);
  margin-bottom: 18px;
}

.section-head {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 380;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 16px;
  max-width: 22ch;
}

.section-head em {
  font-style: italic;
  font-weight: 420;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-sub {
  color: var(--ink-dim);
  max-width: 52ch;
  margin: 0;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition: opacity 1s var(--ease-out) var(--d, 0s),
              transform 1s var(--ease-out) var(--d, 0s),
              filter 1s var(--ease-out) var(--d, 0s);
}

.reveal.in { opacity: 1; transform: none; filter: blur(0); }

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.step {
  padding: 34px 28px 10px 0;
  border-right: 1px solid var(--line-soft);
}

.step + .step { padding-left: 28px; }
.step:last-child { border-right: 0; }

.step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 52px;
  font-weight: 380;
  line-height: 1;
  margin: 0 0 18px;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.9;
}

.step h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.step p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0;
}

/* ---------- bento ---------- */

.bento {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 16px;
}

.bcard {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  overflow: hidden;
  transition: border-color 0.5s ease, transform 0.5s var(--ease-out), box-shadow 0.5s ease;
}

.bcard:hover {
  border-color: rgba(169, 107, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4), 0 6px 30px rgba(131, 56, 236, 0.1);
}

.bcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(169, 107, 255, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bcard:hover::before { opacity: 1; }

.b-wide { grid-row: span 2; }

.b-glyph {
  width: 34px;
  height: 34px;
  color: var(--theirs);
  opacity: 0.85;
  margin-bottom: 20px;
}

.bcard h3 {
  font-family: var(--serif);
  font-weight: 420;
  font-size: 25px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.bcard p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0;
}

.pov-strip {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pov {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16.5px;
  line-height: 1.45;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

/* "You watched…" = their move (purple family); "You crossed…" = yours (pink). */
.pov-a { color: var(--ink-dim); background: rgba(131, 56, 236, 0.07); align-self: flex-start; }
.pov-b { color: var(--ink-dim); background: rgba(255, 0, 110, 0.06); align-self: flex-end; }

.pov-x {
  align-self: center;
  font-size: 12px;
  color: var(--yours);
  opacity: 0.7;
}

/* ---------- rating note ---------- */

.note {
  position: relative;
  border: 1px solid rgba(255, 0, 110, 0.22);
  border-radius: var(--radius);
  padding: 38px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
  background:
    radial-gradient(40rem 16rem at 8% 0%, rgba(255, 0, 110, 0.07), transparent 60%),
    rgba(232, 220, 240, 0.015);
  overflow: hidden;
}

.note-badge {
  font-family: var(--serif);
  font-style: italic;
  font-size: 44px;
  font-weight: 420;
  line-height: 1;
  flex: none;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.note h3 {
  font-family: var(--serif);
  font-weight: 420;
  font-size: 27px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.note p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0;
  max-width: 64ch;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line-soft);
  padding: 38px 0 60px;
  font-size: 14px;
  color: var(--ink-faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.footer-links { display: flex; gap: 22px; }

.footer-links a {
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-links a:hover { color: var(--ink); }

/* ---------- legal pages ---------- */

.legal {
  padding-top: 72px;
  padding-bottom: 96px;
  max-width: 760px;
}

.legal h1 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(36px, 5.6vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.legal .updated {
  color: var(--ink-faint);
  font-size: 14px;
  margin: 0 0 48px;
}

.legal h2 {
  font-family: var(--serif);
  font-weight: 420;
  font-size: 28px;
  letter-spacing: -0.012em;
  margin: 50px 0 14px;
}

.legal h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.legal p,
.legal li {
  color: var(--ink-dim);
  font-size: 16px;
}

.legal ul { padding-left: 20px; }

.legal li { margin-bottom: 7px; }

.legal a {
  color: var(--ink);
  text-decoration-color: rgba(255, 0, 110, 0.5);
  text-underline-offset: 3px;
}

.legal a:hover { text-decoration-color: var(--accent); }

.legal strong { color: var(--ink); font-weight: 600; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .b-wide { grid-row: auto; grid-column: span 2; }
}

@media (max-width: 860px) {
  .hero { padding: 72px 0 60px; }
  section { padding: 72px 0; }

  .demo { margin-top: 54px; }

  .demo-inner { grid-template-columns: 1fr; }

  .demo-beam {
    height: 44px;
    width: 2px;
    margin: 0 auto;
    align-self: auto;
    justify-self: center;
  }

  .beam-line { background: linear-gradient(180deg, rgba(255, 0, 110, 0.55), rgba(131, 56, 236, 0.55)); }

  .beam-dot { left: 50%; top: 0; margin: 0 0 0 -4.5px; }

  @keyframes beamTravel {
    0%   { opacity: 0; transform: translateY(0) scale(0.6); }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(38px) scale(0.6); }
  }

  .scene-text { min-height: 7.2em; }

  .steps { grid-template-columns: 1fr; }

  .step {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 28px 0 28px;
  }

  .step + .step { padding-left: 0; }
  .step:last-child { border-bottom: 0; }

  .bento { grid-template-columns: 1fr; }
  .b-wide { grid-column: auto; }

  .note { flex-direction: column; gap: 18px; padding: 28px; }

  .nav-links .hide-sm { display: none; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body::before,
  .marquee-track,
  .eyebrow-dot,
  .beam-dot,
  .caret { animation: none !important; }

  .hero-title .w,
  .hero-in {
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  * { transition-duration: 0.01ms !important; }
}
