/* Design tokens mirrored from the app theme (composeApp ui/theme/Color.kt). */
:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-elevated: #f5f5f5;
  --text: #090909;
  --text-muted: #6b6b6b;
  --text-faint: #8e8e8e;
  --blue: #007aff;
  --blue-deep: #0056cc;
  --blue-light: #5eb0ff;
  --indigo: #6366f1;
  --orange: #ff9500;
  --orange-warm: #ffb340;
  --green: #06c167;
  --blue-container: #e8f2ff;
  --orange-container: #fff4e6;
  --green-container: #e6f9f0;
  --border: #e5e5e5;
  --cta-bg: #090909;
  --cta-text: #ffffff;
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --max-width: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1a1a1a;
    --surface-elevated: #2a2a2a;
    --text: #ffffff;
    --text-muted: #b0b0b0;
    --text-faint: #8e8e8e;
    --blue: #5eb0ff;
    --blue-deep: #007aff;
    --orange: #ffb340;
    --blue-container: #0d1f33;
    --orange-container: #2a1a0d;
    --green-container: #0d3320;
    --border: #3d3d3d;
    --cta-bg: #ffffff;
    --cta-text: #090909;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--blue);
}

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo__mark {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.logo__text {
  line-height: 1.2;
}

.logo__link,
.logo__ai {
  color: var(--text);
}

.logo__up {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo__ai {
  position: relative;
  display: inline-block;
  font-weight: 600;
}

.logo__ai::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1em;
  height: 2px;
  border-radius: 1px;
  background: var(--orange);
  opacity: 0.75;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

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

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 1.5rem 0 3rem;
}

@media (min-width: 800px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 2.5rem 0 4rem;
  }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero__badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero__accent {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0 0 1.75rem;
  max-width: 30rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Phone mockup (mirrors the Groups tab) ---------- */

.phone {
  margin: 0 auto;
  width: min(20.5rem, 88vw);
  border: 1px solid var(--border);
  border-radius: 2.75rem;
  padding: 0.625rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.phone__screen {
  border-radius: 2.25rem;
  background: var(--bg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.phone__notch {
  width: 7rem;
  height: 1.5rem;
  margin: 0.5rem auto 0.25rem;
  border-radius: 999px;
  background: var(--surface-elevated);
}

.phone__body {
  padding: 0.75rem 1rem 1rem;
}

.phone__title {
  margin: 0.25rem 0 0.875rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.group-card__avatar {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #fff;
}

.group-card__avatar--blue {
  background: linear-gradient(135deg, #007aff, #6366f1);
}

.group-card__avatar--orange {
  background: linear-gradient(135deg, #ff9500, #ff6b35);
}

.group-card__avatar--green {
  background: linear-gradient(135deg, #06c167, #059a4f);
}

.group-card__info {
  min-width: 0;
  flex: 1;
}

.group-card__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card__meta {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 650;
  border-radius: 999px;
  white-space: nowrap;
}

.chip--orange {
  color: #a35e00;
  background: var(--orange-container);
}

.chip--green {
  color: #047a41;
  background: var(--green-container);
}

.chip--neutral {
  color: var(--text-muted);
  background: var(--surface-elevated);
}

@media (prefers-color-scheme: dark) {
  .chip--orange {
    color: var(--orange-warm);
  }
  .chip--green {
    color: #8ae8b4;
  }
}

.phone__tabbar {
  display: flex;
  justify-content: space-around;
  margin: 0.875rem 0.75rem 0.25rem;
  padding: 0.55rem 0;
  border-radius: 999px;
  background: var(--surface-elevated);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-faint);
}

.phone__tab--active {
  color: var(--text);
}

/* ---------- Buttons (PrimaryCta / SecondaryCta from the app) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  color: var(--cta-text);
  background: var(--cta-bg);
  border: 1.5px solid var(--cta-bg);
}

.btn--primary:hover {
  color: var(--cta-text);
  opacity: 0.85;
}

.btn--secondary {
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--border);
}

.btn--secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--surface);
}

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

.section-label {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 2rem;
  max-width: 38rem;
  color: var(--text-muted);
}

/* ---------- Features ---------- */

.features {
  display: grid;
  gap: 1rem;
  margin: 0 0 3.5rem;
  padding: 0;
  list-style: none;
}

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

@media (min-width: 900px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 1.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.feature-card__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.875rem;
  border-radius: 0.75rem;
  font-size: 1.125rem;
}

.feature-card__icon--blue {
  background: var(--blue-container);
}

.feature-card__icon--orange {
  background: var(--orange-container);
}

.feature-card__icon--green {
  background: var(--green-container);
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 1rem;
  margin: 0 0 3.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #6366f1);
  border-radius: 50%;
}

.step h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.step p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- CTA block ---------- */

.cta-block {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cta-block h2 {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.cta-block p {
  margin: 0 auto 1.5rem;
  max-width: 30rem;
  color: var(--text-muted);
}

.cta-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.cta-block__note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Legal / support pages ---------- */

.legal-page {
  max-width: 44rem;
}

.legal-page h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  font-weight: 750;
}

.legal-meta {
  margin: 0 0 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-page h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.legal-page h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.legal-page p,
.legal-page li {
  color: var(--text);
}

.legal-page ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.legal-page li + li {
  margin-top: 0.35rem;
}

.legal-page code {
  padding: 0.1rem 0.35rem;
  font-size: 0.875em;
  background: var(--surface-elevated);
  border-radius: 0.375rem;
}

.contact-card {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-card dt {
  font-weight: 600;
  margin-top: 1rem;
}

.contact-card dt:first-child {
  margin-top: 0;
}

.contact-card dd {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

/* ---------- Redirect (join / profile) pages ---------- */

.redirect-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.redirect-card {
  max-width: 24rem;
  width: 100%;
  padding: 2.25rem 1.75rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.redirect-card img {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.redirect-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.redirect-card p {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.redirect-card .btn {
  width: 100%;
}

.redirect-card__hint {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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