/* Mansa public site. Tokens mirror the app's dark theme (ui/src/styles.css). */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("fonts/spline-sans-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #000000;
  --panel: #0d0d0d;
  --raised: #171717;
  --line: #262626;
  --line-soft: #1b1b1b;
  --ivory: #f0ede6;
  --muted: #98938a;
  --faint: #635f57;
  --gold: #e0a43c;
  --gold-strong: #f0bc5e;
  --gold-soft: rgba(224, 164, 60, 0.12);
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(20px, 4vw, 40px);
  --wide: 1200px;
  --radius: 14px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

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

/* --- Shared type roles ------------------------------------------------------------ */

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2rem, 1.25rem + 2.4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.caption {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--faint);
}

/* --- Header and footer ------------------------------------------------------------ */

.masthead {
  padding-block: 22px;
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__mark {
  width: 11px;
  height: 16px;
  color: var(--gold);
}
.brand__name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-size: 1.375rem;
  letter-spacing: 0.005em;
  color: var(--ivory);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__links {
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav__link:hover {
  color: var(--ivory);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button--gold {
  background: var(--gold);
  color: var(--ink);
}
.button--gold:hover {
  background: var(--gold-strong);
}
.button--small {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.textlink {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.textlink:hover {
  color: var(--ivory);
}
.textlink--gold {
  color: var(--gold);
}
.textlink--gold:hover {
  color: var(--gold-strong);
}

.footer {
  margin-top: 40px;
  padding-block: 36px 48px;
  border-top: 1px solid var(--line-soft);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.footer__legal {
  margin: 0;
  font-size: 0.875rem;
  color: var(--faint);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 760px) {
  .nav__links {
    display: none;
  }
}

/* --- Hero: headline and the night ledger ----------------------------------------------- */

.hero {
  padding-block: clamp(36px, 7vw, 96px) clamp(48px, 6vw, 80px);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}
.hero__headline {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.875rem, 1.4rem + 5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.028em;
}
.hero__headline em {
  display: block;
  font-style: italic;
  font-weight: 350;
  color: var(--gold);
}
.hero__lede {
  margin-top: 28px;
  max-width: 34rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 34px;
}
.hero__note {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

@media (max-width: 920px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ledger {
  margin: 0;
  padding: 22px 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ledger__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.ledger__agent {
  color: var(--ivory);
}
.ledger__list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The rail joining each entry's dot. */
.ledger__list::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 28px;
  left: calc(3.5rem + 12px + 7px);
  width: 1px;
  background: var(--line);
}
.ledger__entry {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem 15px minmax(0, 1fr);
  column-gap: 12px;
  padding-block: 9px;
  animation: ledger-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* Staggered here, not inline, so the CSP can keep style-src 'self'. */
.ledger__entry:nth-child(2) { animation-delay: 0.35s; }
.ledger__entry:nth-child(3) { animation-delay: 0.7s; }
.ledger__entry:nth-child(4) { animation-delay: 1.05s; }
.ledger__entry:nth-child(5) { animation-delay: 1.5s; }
.ledger__entry:nth-child(6) { animation-delay: 1.85s; }
.ledger__entry:nth-child(7) { animation-delay: 2.4s; }
.ledger__time {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.ledger__dot {
  align-self: start;
  justify-self: center;
  width: 7px;
  height: 7px;
  margin-top: calc((1.55rem - 7px) / 2);
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--faint);
  position: relative;
  z-index: 1;
}
.ledger__entry--last .ledger__dot {
  background: var(--gold);
  border-color: var(--gold);
}
.ledger__what {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55rem;
  color: var(--ivory);
}
.ledger__detail {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.ledger__sms {
  margin: 10px 0 2px;
  max-width: 21rem;
  padding: 11px 14px;
  background: var(--raised);
  border-radius: 18px 18px 18px 5px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ivory);
}

@keyframes ledger-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Product frames --------------------------------------------------------------- */

.frame {
  margin: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.frame--flush {
  border-radius: 10px;
}

.showcase {
  padding-bottom: clamp(72px, 10vw, 136px);
}
.showcase__inner {
  max-width: calc(1320px + 2 * var(--gutter));
}

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

.section {
  padding-block: clamp(72px, 10vw, 128px);
  border-top: 1px solid var(--line-soft);
}
.section__intro {
  max-width: 44rem;
}
.section__intro .title {
  margin-top: 18px;
}
.section__intro .lede {
  margin-top: 20px;
}

/* The loop: run → keep → split → schedule. */
.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(44px, 6vw, 72px) 0 0;
  padding: 0;
  list-style: none;
}
.loop__step {
  position: relative;
  padding: 26px 28px 0 0;
  border-top: 1px solid var(--line);
}
.loop__step + .loop__step {
  padding-left: 28px;
}
.loop__name {
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.loop__text {
  margin: 12px 0 0;
  font-size: 0.9688rem;
  line-height: 1.6;
  color: var(--muted);
}
/* The verb that takes you from the previous step to this one, sitting on the rule. */
.loop__verb {
  position: absolute;
  top: -0.7rem;
  left: -2.9rem;
  padding: 0 8px;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4rem;
  color: var(--gold);
}
.loop__verb::after {
  content: " →";
}

@media (max-width: 900px) {
  .loop {
    grid-template-columns: minmax(0, 1fr);
  }
  .loop__step,
  .loop__step + .loop__step {
    padding: 22px 0 28px 0;
  }
  .loop__verb {
    left: 0;
    padding-left: 0;
  }
  .loop__verb::after {
    content: " ↓";
  }
}

/* Feature rows: text beside a screenshot, sides alternating. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
}
.feature + .feature {
  margin-top: clamp(72px, 9vw, 120px);
}
.feature--flip {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}
.feature--flip .feature__copy {
  order: 2;
}
.feature__copy .title {
  margin-top: 16px;
}
.feature__copy .lede {
  margin-top: 18px;
}
.feature__points {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.feature__point {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9688rem;
  color: var(--muted);
}
.feature__point strong {
  font-weight: 600;
  color: var(--ivory);
}
.feature__media--narrow {
  max-width: 560px;
  justify-self: center;
}

@media (max-width: 900px) {
  .feature,
  .feature--flip {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature--flip .feature__copy {
    order: 0;
  }
}

/* Reach: phone, website, models. */
.reach {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(44px, 6vw, 64px);
}
.card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.card__title {
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card__text {
  margin: 10px 0 0;
  font-size: 0.9688rem;
  color: var(--muted);
}
.card__media {
  margin-top: 26px;
}
.card--text {
  grid-column: span 7;
}
.card--site {
  grid-column: span 5;
  grid-row: span 2;
}
.card--site .card__text {
  margin-bottom: 26px;
}
.card--site .card__media {
  margin-top: auto;
}
.card--site .frame {
  max-width: 340px;
  margin-inline: auto;
}
.card--models {
  grid-column: span 7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 28px;
}
.card--models .card__media {
  margin-top: 0;
}

.sms {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}
.sms__bubble {
  max-width: 80%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.sms__bubble--you {
  align-self: flex-end;
  background: var(--gold);
  color: var(--ink);
  border-bottom-right-radius: 5px;
}
.sms__bubble--agent {
  align-self: flex-start;
  background: var(--raised);
  color: var(--ivory);
  border-bottom-left-radius: 5px;
}

@media (max-width: 980px) {
  .card--text,
  .card--site,
  .card--models {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}
@media (max-width: 560px) {
  .card {
    padding: 22px;
  }
  .card--models {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Trust list: title beside description, hairlines between. */
.specs {
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line-soft);
}
.specs__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 12px 48px;
  padding-block: 26px;
  border-top: 1px solid var(--line-soft);
}
.specs__name {
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.3;
}
.specs__text {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .specs__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Closing call to action. */
.closing {
  padding-block: clamp(80px, 12vw, 160px);
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.closing__title {
  margin: 0 auto;
  max-width: 16ch;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.5rem, 1.4rem + 4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.closing__title em {
  font-style: italic;
  font-weight: 350;
  color: var(--gold);
}
.closing__text {
  margin: 24px auto 0;
  max-width: 32rem;
  color: var(--muted);
}
.closing__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 24px;
  margin-top: 34px;
}

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

.doc {
  padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px);
}
.doc__grid {
  display: grid;
  grid-template-columns: 15rem minmax(0, 44rem);
  justify-content: center;
  gap: 36px clamp(40px, 6vw, 88px);
}
.doc__head {
  grid-column: 2;
  grid-row: 1;
}
.doc__body {
  grid-column: 2;
  grid-row: 2;
}
.doc__title {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem);
  line-height: 1;
  letter-spacing: -0.025em;
}
.doc__meta {
  margin: 20px 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--faint);
}
.doc__summary {
  margin: 0;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--gold);
  border-radius: 10px;
}
.doc__summary p {
  margin: 0;
  color: var(--ivory);
}
.doc__summary ul {
  margin: 12px 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.doc__summary li + li {
  margin-top: 6px;
}

.toc {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 28px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding-top: 8px;
}
.toc__label {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.toc__item {
  counter-increment: toc;
}
.toc__link {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  padding: 5px 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
}
.toc__link::before {
  content: counter(toc);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--faint);
}
.toc__link:hover {
  color: var(--ivory);
}

.prose {
  counter-reset: clause;
}
.prose h2 {
  counter-increment: clause;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  margin: 56px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 48;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}
.prose h2::before {
  content: counter(clause);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 2.2rem;
  color: var(--gold);
}
.prose h3 {
  margin: 30px 0 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: 24px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 14px 0 0;
  color: #cfcac1;
}
.prose ul,
.prose ol {
  padding-left: 1.2rem;
}
.prose li + li {
  margin-top: 8px;
}
.prose strong {
  font-weight: 600;
  color: var(--ivory);
}
.prose a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover {
  color: var(--gold-strong);
}
.prose code {
  padding: 1px 6px;
  background: var(--raised);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ivory);
}
.prose blockquote {
  margin: 18px 0 0;
  padding: 16px 20px;
  background: var(--panel);
  border-left: 2px solid var(--gold);
  border-radius: 0 8px 8px 0;
}
.prose blockquote p {
  margin: 0;
  color: var(--ivory);
}
.prose .caps {
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
.table {
  overflow-x: auto;
  margin-top: 16px;
}
.prose table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.prose th,
.prose td {
  padding: 11px 14px 11px 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  color: #cfcac1;
}
.prose th {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border-top: 0;
}
.prose td:first-child {
  color: var(--ivory);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .doc__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .doc__head,
  .doc__body,
  .toc {
    grid-column: 1;
    grid-row: auto;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 20px 22px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
  }
}

/* --- 404 -------------------------------------------------------------------------- */

.missing {
  padding-block: clamp(80px, 16vw, 200px);
}
.missing .title {
  margin-top: 16px;
}
.missing .lede {
  margin-top: 20px;
}
.missing__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 32px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
