/* Chiply website. Same tokens as the app (docs/DESIGN.md, src/ui/theme.ts). No external fonts. */

:root {
  color-scheme: light dark;

  --bg: #f2f2f7;               /* systemGroupedBackground */
  --surface: #ffffff;          /* secondarySystemGroupedBackground */
  --surface-2: #f2f2f7;        /* tertiarySystemGroupedBackground */
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --accent: #4f4cd0;
  --accent-fill: #4f4cd0;
  --accent-tint: rgba(79, 76, 208, 0.12);
  --on-accent: #ffffff;
  --positive: #19713e;
  --danger: #b82e25;
  --bar: rgba(242, 242, 247, 0.8);

  --radius-group: 26px;
  --radius-md: 14px;
  --gutter: 16px;
  --measure: 680px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --accent: #a19fff;
    --accent-fill: #5e5ce6;
    --accent-tint: rgba(161, 159, 255, 0.14);
    --positive: #4cc27a;
    --danger: #ff8378;
    --bar: rgba(0, 0, 0, 0.72);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 10px;
}

/* ── Layout ─────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Top bar ────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--label);
  font-weight: 600;
  font-size: 17px;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.bar nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

.bar nav a {
  color: var(--label-2);
}

.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--label);
  text-decoration: none;
}

/* ── Type ───────────────────────────────────────────────── */

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}

h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--label-2);
}

.small {
  font-size: 15px;
  line-height: 20px;
}

ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

li + li {
  margin-top: 6px;
}

strong {
  font-weight: 600;
}

/* ── Page header (privacy, support) ─────────────────────── */

.page-head {
  padding: 40px 0 8px;
}

.page-head p {
  margin-top: 8px;
}

/* ── Inset grouped sections (like the app) ─────────────── */

.section {
  margin-top: 32px;
}

.section > h2 {
  margin: 0 0 10px;
  padding: 0 4px;
}

.section-title {
  margin: 0 0 8px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--label-2);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-group);
  padding: 20px;
}

.card + .card {
  margin-top: 12px;
}

.card h3 + p,
.card h3 + ul {
  margin-top: 6px;
}

.card > h3:not(:first-child) {
  margin-top: 20px;
}

.footnote {
  margin: 8px 16px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}

/* A grouped list: rows with hairline separators. */
.list {
  background: var(--surface);
  border-radius: var(--radius-group);
  overflow: hidden;
}

.row {
  padding: 14px 20px;
  position: relative;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 0;
  border-top: 0.5px solid var(--separator);
}

.row h3 + p {
  margin-top: 4px;
}

/* FAQ: native disclosure, no script. */
details {
  position: relative;
}

details + details::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 0;
  border-top: 0.5px solid var(--separator);
}

summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 48px 14px 20px;
  font-weight: 600;
  position: relative;
  min-height: 52px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--label-3);
  border-bottom: 2px solid var(--label-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

details .answer {
  padding: 0 20px 16px;
  color: var(--label);
}

details .answer p,
details .answer ul {
  color: var(--label-2);
}

details .answer strong {
  color: var(--label);
}

@media (prefers-reduced-motion: reduce) {
  summary::after {
    transition: none;
  }
}

/* ── Landing ────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 48px 0 8px;
}

.hero .chips {
  width: 330px;
  max-width: 100%;
  margin: 0 auto 28px;
}

.hero h1 {
  font-size: 40px;
  line-height: 46px;
}

.hero .lead {
  margin: 12px auto 0;
  text-wrap: balance;
  max-width: 30em;
  font-size: 20px;
  line-height: 28px;
  color: var(--label-2);
}

.cta {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.button.soon {
  background: var(--accent-tint);
  color: var(--accent);
  cursor: default;
}

.button.soon:hover {
  filter: none;
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.feature {
  background: var(--surface);
  border-radius: var(--radius-group);
  padding: 22px 20px;
}

.feature .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.feature h3 + p {
  margin-top: 6px;
  color: var(--label-2);
}

.price {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.price .card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.price ul {
  margin-top: 10px;
  color: var(--label-2);
}

/* ── 404 ────────────────────────────────────────────────── */

.notfound {
  text-align: center;
  padding: 80px 0 24px;
}

.notfound img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 24px;
}

.notfound p {
  margin-top: 10px;
}

/* ── Footer ─────────────────────────────────────────────── */

.foot {
  margin-top: 48px;
  padding: 24px 0 40px;
  border-top: 0.5px solid var(--separator);
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.foot a {
  color: var(--label-2);
}

.foot a:hover {
  color: var(--label);
}

/* ── Wider screens ──────────────────────────────────────── */

@media (min-width: 720px) {
  .page-head {
    padding-top: 64px;
  }

  h1 {
    font-size: 40px;
    line-height: 46px;
  }

  .hero {
    padding-top: 72px;
  }

  .hero h1 {
    font-size: 56px;
    line-height: 60px;
    letter-spacing: -0.025em;
  }

  .hero .chips {
    width: 440px;
  }

  .features {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .price .card + .card {
    margin-top: 0;
  }

  .section {
    margin-top: 48px;
  }
}

@media (min-width: 720px) {
  .wide {
    max-width: calc(960px + 2 * var(--gutter));
  }
}
