/*
 * URWU public web face — landing, error, and legal pages.
 * Dark lavender theme, ported from urwu-flutter/lib/constants/app_colors.dart.
 * Plain CSS, no build step (mobile-first, then desktop breakpoints).
 *
 * Type: Fraunces (self-hosted variable woff2, GDPR-safe) for display,
 * system stack for body. Signature element: the "circle" — a phone mockup
 * of the app surrounded by an orbiting ring of member dots, echoing the
 * product's group-therapy-first positioning.
 */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 450 650;
  font-display: swap;
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 450 650;
  font-display: swap;
  src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0f0d13;
  --surface: #1b1821;
  --elevated: #272430;
  --text: #eae2f3;
  --text-muted: #afa8b8;
  --text-tertiary: #938f99;
  --purple-900: #5d3a7a;
  --purple-500: #7c3aed;
  --purple-300: #8b6bae;
  --purple-200: #a855f7;
  --purple-100: #d2bcfb;
  --pink-soft: #fce7f3;
  --green-soft: #dcfce7;
  --border: #4a4653;
  --success: #22c55e;
  --error: #ef4444;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* Ambient atmosphere behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 45% at 18% -8%, rgba(93, 58, 122, 0.38), transparent 65%),
    radial-gradient(ellipse 45% 38% at 88% 12%, rgba(168, 85, 247, 0.14), transparent 70%),
    radial-gradient(ellipse 55% 40% at 50% 108%, rgba(124, 58, 237, 0.12), transparent 70%);
  pointer-events: none;
}

a {
  color: var(--purple-100);
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--purple-200);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
.error-code {
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.015em;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 34px;
  width: auto;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    padding-top: 56px;
    padding-bottom: 96px;
    gap: 32px;
  }
}

.hero-copy {
  text-align: center;
}

@media (min-width: 900px) {
  .hero-copy {
    text-align: left;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(210, 188, 251, 0.28);
  background: rgba(124, 58, 237, 0.12);
  color: var(--purple-100);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--purple-200);
  box-shadow: 0 0 10px 2px rgba(168, 85, 247, 0.65);
}

.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(38px, 7.2vw, 62px);
  line-height: 1.07;
}

.hero h1 em {
  font-style: italic;
  font-weight: 520;
  background: linear-gradient(115deg, var(--purple-100) 10%, var(--purple-200) 55%, var(--purple-100) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--purple-100);
}

.hero p.subheading {
  margin: 22px auto 0;
  max-width: 540px;
  color: var(--text-muted);
  font-size: 16.5px;
}

@media (min-width: 900px) {
  .hero p.subheading {
    margin-left: 0;
  }
}

.store-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

@media (min-width: 480px) {
  .store-badges {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 900px) {
  .store-badges {
    justify-content: flex-start;
  }
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--elevated), var(--surface));
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

a.store-badge:hover {
  border-color: var(--purple-200);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(124, 58, 237, 0.45);
}

.store-badge[aria-disabled='true'] {
  color: var(--text-tertiary);
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Signature: the circle — phone mockup + orbiting member dots         */
/* ------------------------------------------------------------------ */

.circle-stage {
  position: relative;
  width: min(400px, 88vw);
  aspect-ratio: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-stage::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28) 0%, rgba(93, 58, 122, 0.12) 45%, transparent 70%);
  filter: blur(6px);
}

.member-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(210, 188, 251, 0.22);
  animation: ring-drift 90s linear infinite;
}

@keyframes ring-drift {
  to {
    transform: rotate(360deg);
  }
}

.member-dot {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px;
  border-radius: 50%;
  border: 2px solid rgba(15, 13, 19, 0.9);
  box-shadow: 0 4px 18px -2px rgba(124, 58, 237, 0.5);
  opacity: 0;
  animation: member-join 0.7s ease forwards;
}

.member-dot:nth-child(1) { top: 4%; left: 50%; background: linear-gradient(135deg, #a855f7, #7c3aed); animation-delay: 0.15s; }
.member-dot:nth-child(2) { top: 19%; left: 84%; background: linear-gradient(135deg, #fce7f3, #d2bcfb); animation-delay: 0.3s; }
.member-dot:nth-child(3) { top: 52%; left: 97%; background: linear-gradient(135deg, #8b6bae, #5d3a7a); animation-delay: 0.45s; }
.member-dot:nth-child(4) { top: 83%; left: 81%; background: linear-gradient(135deg, #dcfce7, #86efac); animation-delay: 0.6s; }
.member-dot:nth-child(5) { top: 96%; left: 50%; background: linear-gradient(135deg, #d2bcfb, #a855f7); animation-delay: 0.75s; }
.member-dot:nth-child(6) { top: 83%; left: 19%; background: linear-gradient(135deg, #7c3aed, #5d3a7a); animation-delay: 0.9s; }
.member-dot:nth-child(7) { top: 52%; left: 3%; background: linear-gradient(135deg, #fce7f3, #f9a8d4); animation-delay: 1.05s; }
.member-dot:nth-child(8) { top: 19%; left: 16%; background: linear-gradient(135deg, #a855f7, #d2bcfb); animation-delay: 1.2s; }

@keyframes member-join {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Phone mockup — abstract, textless rendition of the app UI */

.phone {
  position: relative;
  width: 218px;
  height: 452px;
  border-radius: 42px;
  border: 1px solid rgba(210, 188, 251, 0.35);
  background: linear-gradient(165deg, #201c29 0%, #16131c 60%, #131019 100%);
  box-shadow:
    0 0 0 6px rgba(39, 36, 48, 0.85),
    0 30px 80px -20px rgba(93, 58, 122, 0.55),
    inset 0 1px 0 rgba(234, 226, 243, 0.08);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.phone::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: rgba(74, 70, 83, 0.9);
}

.ui-greeting {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ui-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-200), var(--purple-500));
  flex: none;
}

.ui-greeting-lines {
  flex: 1;
}

.ui-line {
  height: 8px;
  border-radius: 999px;
  background: rgba(234, 226, 243, 0.22);
}

.ui-line.short {
  width: 55%;
  margin-bottom: 6px;
  background: rgba(234, 226, 243, 0.35);
}

.ui-line.faint {
  width: 80%;
  background: rgba(175, 168, 184, 0.18);
}

.ui-card {
  border-radius: 18px;
  border: 1px solid rgba(74, 70, 83, 0.6);
  background: rgba(39, 36, 48, 0.65);
  padding: 12px;
}

.ui-moods {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.ui-mood {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(74, 70, 83, 0.55);
}

.ui-mood.active {
  background: linear-gradient(135deg, var(--purple-200), var(--purple-500));
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
}

.ui-session {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ui-cluster {
  display: flex;
  flex: none;
}

.ui-cluster span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #1b1821;
}

.ui-cluster span + span {
  margin-left: -8px;
}

.ui-cluster span:nth-child(1) { background: linear-gradient(135deg, #fce7f3, #d2bcfb); }
.ui-cluster span:nth-child(2) { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.ui-cluster span:nth-child(3) { background: linear-gradient(135deg, #dcfce7, #86efac); }

.ui-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-left: auto;
  flex: none;
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.ui-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 44px;
  margin-top: 8px;
}

.ui-bars span {
  flex: 1;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.75), rgba(124, 58, 237, 0.35));
}

.ui-bars span:nth-child(1) { height: 45%; }
.ui-bars span:nth-child(2) { height: 70%; }
.ui-bars span:nth-child(3) { height: 55%; }
.ui-bars span:nth-child(4) { height: 90%; opacity: 1; }
.ui-bars span:nth-child(5) { height: 62%; }
.ui-bars span:nth-child(6) { height: 78%; }
.ui-bars span:nth-child(7) { height: 50%; }

/* The app's signature floating pill nav */
.ui-pillnav {
  margin-top: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(210, 188, 251, 0.25);
  background: rgba(39, 36, 48, 0.92);
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.6);
}

.ui-pillnav i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(175, 168, 184, 0.45);
}

.ui-pillnav i.active {
  width: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-200), var(--purple-500));
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

section.landing-section {
  padding: 72px 24px;
  position: relative;
}

section.landing-section + section.landing-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 70vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(210, 188, 251, 0.35), transparent);
}

.eyebrow {
  display: block;
  color: var(--purple-200);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}

.section-heading {
  margin: 10px auto 48px;
  max-width: 640px;
  text-align: center;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
}

/* Bento feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .feature-card {
    grid-column: span 3;
  }

  .feature-card.featured {
    grid-column: span 6;
  }
}

@media (min-width: 1024px) {
  .feature-card {
    grid-column: span 2;
  }

  .feature-card.featured {
    grid-column: span 4;
  }

  .feature-card.tall {
    grid-column: span 2;
  }
}

.feature-card {
  position: relative;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid rgba(74, 70, 83, 0.8);
  background: linear-gradient(170deg, rgba(39, 36, 48, 0.55), rgba(27, 24, 33, 0.9));
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-3px);
}

.feature-card.featured {
  background:
    radial-gradient(ellipse 70% 90% at 85% 10%, rgba(124, 58, 237, 0.22), transparent 60%),
    linear-gradient(170deg, rgba(39, 36, 48, 0.6), rgba(27, 24, 33, 0.92));
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  font-weight: 650;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 46ch;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  margin-bottom: 16px;
}

.chip svg {
  width: 21px;
  height: 21px;
}

.chip.lilac { background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(124, 58, 237, 0.18)); color: var(--purple-100); }
.chip.pink { background: var(--pink-soft); color: #9d2463; }
.chip.green { background: var(--green-soft); color: #166534; }
.chip.violet { background: linear-gradient(135deg, var(--purple-500), var(--purple-200)); color: #f5f0fb; }

/* Group vignette inside the featured card */
.group-vignette {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(74, 70, 83, 0.7);
  background: rgba(15, 13, 19, 0.45);
}

.group-vignette .ui-cluster span {
  width: 28px;
  height: 28px;
  border-color: #131019;
}

.group-vignette .v-lines {
  flex: 1;
}

.group-vignette .ui-line {
  max-width: 150px;
}

/* Journey (how it works) */

.step-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  max-width: 1120px;
  margin: 0 auto;
}

@media (min-width: 760px) {
  .step-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .step-grid::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.55), rgba(124, 58, 237, 0.1));
  }
}

.step {
  position: relative;
  text-align: center;
  padding: 0 8px;
}

.step-number {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-200));
  color: #f5f0fb;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 16px;
  box-shadow: 0 0 0 6px var(--bg), 0 6px 22px -4px rgba(124, 58, 237, 0.6);
}

.step h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 650;
}

.step p {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 34ch;
}

/* Trust */

.trust {
  text-align: center;
}

.trust-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(210, 188, 251, 0.3);
  background: rgba(124, 58, 237, 0.14);
  color: var(--purple-100);
  margin-bottom: 20px;
}

.trust-lock svg {
  width: 24px;
  height: 24px;
}

.trust h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  margin: 0 0 14px;
}

.trust p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 15.5px;
}

/* Scroll reveal — hidden state only applies when JS has tagged <html class="js">,
   so users without JS (and crawlers) always see the full content. */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(74, 70, 83, 0.6);
  padding: 44px 24px;
  background: rgba(27, 24, 33, 0.4);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-right: 16px;
  transition: color 0.2s ease;
}

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

.footer-links a:last-child {
  margin-right: 0;
}

.footer-meta {
  color: var(--text-tertiary);
  font-size: 12px;
}

.locale-switcher {
  display: flex;
  gap: 6px;
}

.locale-switcher a {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.locale-switcher a:hover {
  border-color: var(--purple-300);
  color: var(--text);
}

.locale-switcher a.active {
  border-color: var(--purple-200);
  color: var(--text);
  background: var(--elevated);
}

/* Legal / simple pages */

.simple-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
}

.simple-page h1 {
  font-size: clamp(30px, 4vw, 38px);
  margin-bottom: 16px;
}

.simple-page p {
  color: var(--text-muted);
}

/* Error pages */

.error-page {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 16px;
}

.error-code {
  font-size: clamp(80px, 14vw, 120px);
  color: transparent;
  background: linear-gradient(160deg, var(--purple-100) 15%, var(--purple-500) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0;
  line-height: 1;
}

.error-message {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.home-link {
  display: inline-block;
  margin-top: 8px;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid var(--purple-200);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.home-link:hover {
  background: rgba(124, 58, 237, 0.18);
  box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.55);
}

/* Reduced motion: settle everything instantly */

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

  .member-ring,
  .ui-live {
    animation: none;
  }

  .member-dot {
    animation: none;
    opacity: 1;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .feature-card,
  .store-badge,
  .home-link {
    transition: none;
  }
}
