/* Crest public site. Tokens and layout follow prototype/CrestPublicSite.dc.html.
   theme.js overrides the colour variables for the chosen mode and accent. */
:root {
  --bg: #f9faef;
  --sf: #ffffff;
  --ink: #1a1c16;
  --ink2: #44483d;
  --mu: #5c6054;
  --ln: #e1e4d5;
  --ov: #c5c8ba;
  --tr: #e2e3d8;
  --sv: #eeefe3;
  --ac: #4c662b;
  --as: #cdeda3;
  --onas: #354e16;
  --on: #ffffff;
  --pos: #2e7d32;
  --ng: #ba1a1a;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(18px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12140e;
    --sf: #1e201a;
    --ink: #e2e3d8;
    --ink2: #c5c8ba;
    --mu: #8f9285;
    --ln: #2e3228;
    --ov: #5c6054;
    --tr: #33362e;
    --sv: #282b23;
    --ac: #b1d18a;
    --as: #354e16;
    --onas: #cdeda3;
    --on: #1f3701;
    --pos: #8fd18a;
    --ng: #ffb4ab;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ac);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main {
  flex: 1;
}

/* Header and footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--ln);
}

.site-header .wrap {
  height: 64px;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 500 22px/1 var(--serif);
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
}

.site-footer {
  border-top: 1px solid var(--ln);
  color: var(--mu);
  font-size: 13px;
}

.site-footer .wrap {
  padding-top: 22px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  color: var(--mu);
  text-decoration: none;
}

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

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  border: 0;
  border-radius: 26px;
  background: var(--ac);
  color: var(--on);
  font: 500 16px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  color: var(--on);
  background: color-mix(in oklab, var(--ac) 84%, var(--ink));
}

.button:disabled {
  background: var(--tr);
  color: var(--mu);
  cursor: not-allowed;
}

.button.outline {
  height: 48px;
  background: none;
  border: 1px solid var(--mu);
  color: var(--ink);
  font-size: 15px;
}

.button.outline:hover {
  background: var(--tr);
}

/* Home: hero */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
}

.hero {
  padding-top: clamp(32px, 6vw, 80px);
  padding-bottom: clamp(40px, 6vw, 88px);
  gap: clamp(28px, 4vw, 72px);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
}

.hero h1 {
  margin-top: 6px;
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero p {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.6;
  color: var(--ink2);
}

.hero .button {
  align-self: flex-start;
  margin-top: 8px;
}

.hint {
  font-size: 13px;
  color: var(--mu);
}

.sender {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--as);
  color: var(--onas);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 22px var(--serif);
}

.sender small {
  display: block;
  font: italic 400 17px/1.1 var(--serif);
  color: var(--mu);
}

.sender strong {
  font-size: 16px;
}

.theme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--ln);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 18px;
  background: var(--tr);
}

.segmented button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  background: none;
  color: var(--mu);
  font: 500 13px var(--sans);
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--sf);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatches button {
  width: 28px;
  height: 28px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.swatches button[aria-pressed="true"] {
  border-color: var(--ink);
}

.swatches button span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.swatches output {
  margin-left: 4px;
  font-size: 13px;
  color: var(--mu);
}

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 24px);
  min-width: 0;
}

.phone {
  width: min(44%, 240px);
  aspect-ratio: 376 / 756;
  padding: 8px;
  border-radius: 32px;
  background: #1a1c16;
  box-shadow: 0 30px 60px -30px rgba(26, 28, 22, 0.45);
}

.phone + .phone {
  margin-top: clamp(28px, 6vw, 64px);
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 25px;
  object-fit: cover;
  object-position: top;
  background: var(--bg);
}

/* Home: features */
.features {
  border-top: 1px solid var(--ln);
}

.features-intro {
  padding-top: clamp(48px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ac);
}

.features-intro h2 {
  max-width: 640px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.feature {
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(40px, 6vw, 80px);
}

.feature + .feature {
  border-top: 1px solid var(--ln);
}

.feature.flip > .copy {
  order: 2;
}

.copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
}

.copy .num {
  font: italic 400 18px var(--serif);
  color: var(--mu);
}

.copy h3 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.copy p {
  line-height: 1.6;
  color: var(--ink2);
}

.card {
  width: 100%;
  max-width: 420px;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--ln);
  border-radius: 28px;
  background: var(--sf);
  box-shadow: 0 24px 48px -32px rgba(26, 28, 22, 0.3);
  font-variant-numeric: tabular-nums;
}

.card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ln);
  font-size: 15px;
}

.card .row:last-child {
  border-bottom: 0;
}

.card .row small,
.card .sub {
  display: block;
  font-size: 12px;
  color: var(--mu);
}

.card .label {
  display: flex;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ln);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mu);
}

.hero-number {
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--as);
  color: var(--onas);
}

.hero-number .label {
  display: block;
  padding: 0;
  border: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: inherit;
}

.hero-number .amount {
  margin-top: 6px;
  font: 400 18px var(--serif);
}

.hero-number .amount b {
  margin-left: 5px;
  font: 400 38px/1.05 var(--serif);
  letter-spacing: -1px;
  color: var(--ink);
}

.hero-number .after {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklab, var(--onas) 20%, transparent);
  font-size: 12px;
}

.hero-number .after b {
  font-size: 14px;
  color: var(--ink);
}

.in {
  color: var(--pos);
  font-weight: 600;
}

.out {
  color: var(--ng);
  font-weight: 600;
}

.bars {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  border-bottom: 1px solid var(--ov);
}

.bars i {
  flex: 1;
  background: var(--ov);
}

.bars i.on {
  background: var(--ac);
}

.months {
  display: flex;
  margin-top: -4px;
  font-size: 12px;
  color: var(--mu);
}

.months span {
  flex: 1;
  text-align: center;
}

.big-line {
  font: 400 19px/1.3 var(--serif);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ln);
  border-radius: 16px;
  background: var(--sf);
  font-size: 13px;
}

.chip.on {
  border-color: var(--as);
  background: var(--as);
}

.chip i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.donut {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(
    #5f6356 0 52%,
    var(--ac) 0 86%,
    var(--ov) 0 95%,
    var(--ink2) 0 98%,
    #8f9285 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut div {
  width: 146px;
  height: 146px;
  border-radius: 50%;
  background: var(--sf);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: 400 20px var(--serif);
}

.donut small {
  font: 400 12px var(--sans);
  color: var(--mu);
}

.centered {
  align-items: center;
  text-align: center;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}

.bar-row > div:first-child {
  display: flex;
  justify-content: space-between;
}

.track {
  height: 3px;
  background: var(--tr);
}

.track i {
  display: block;
  height: 100%;
  background: var(--ac);
}

.over {
  color: var(--ng);
}

.track .over {
  background: var(--ng);
}

.toast-note {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  line-height: 1.4;
}

.stack {
  display: flex;
  height: 14px;
  gap: 2px;
}

.stack i:first-child {
  border-radius: 7px 0 0 7px;
}

.stack i:last-child {
  flex: 1;
  border-radius: 0 7px 7px 0;
  background: var(--tr);
}

.group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--ln);
  font-size: 14px;
}

.group:first-of-type {
  border-top: 0;
}

.group i {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.group span {
  flex: 1;
}

.group em {
  width: 44px;
  text-align: right;
  font-size: 12px;
  font-style: normal;
  color: var(--ink2);
}

.group b {
  width: 96px;
  text-align: right;
  font-weight: 400;
}

.member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member .avatar {
  width: 32px;
  height: 32px;
  background: var(--tr);
  color: var(--ink);
  font: 600 13px var(--sans);
}

.member > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.member > div > div {
  display: flex;
  justify-content: space-between;
}

.invite {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--ln);
  border-radius: 16px;
  background: var(--bg);
  font-size: 14px;
}

.invite .avatar {
  width: 36px;
  height: 36px;
  font: 600 14px var(--sans);
}

.invite div {
  flex: 1;
}

.invite small {
  display: block;
  font-size: 12px;
  color: var(--mu);
}

.cta-band {
  margin-top: clamp(24px, 4vw, 48px);
  margin-bottom: clamp(56px, 8vw, 112px);
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  border-radius: 32px;
  background: var(--as);
}

.cta-band h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cta-band p {
  margin-top: 8px;
  max-width: 520px;
  color: var(--onas);
}

/* Form and notice pages */
.page {
  padding-top: clamp(24px, 5vw, 64px);
  padding-bottom: 72px;
}

.page h1 {
  font-size: clamp(34px, 4.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.request {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.request .side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 500px;
}

.request .side p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink2);
}

.request .side .sender {
  margin-top: 6px;
}

.request .side .avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--ln);
  border-radius: 24px;
  background: var(--sf);
}

.panel.narrow {
  max-width: 480px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 18px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink2);
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  border: 1px solid var(--ov);
  border-radius: 12px;
  background: var(--sf);
  color: var(--ink);
  font: 15px var(--sans);
  outline: none;
}

.field input,
.field select {
  height: 46px;
  padding: 0 14px;
}

.field textarea {
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 1px var(--ac);
}

.field.invalid {
  color: var(--ng);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--ng);
}

.field .error {
  display: none;
  font-size: 12px;
  color: var(--ng);
}

.field.invalid .error {
  display: block;
}

.agree {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.agree input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ac);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ng);
  color: var(--bg);
  font-size: 14px;
}

.form-error:empty {
  display: none;
}

.center-note {
  font-size: 13px;
  color: var(--mu);
  text-align: center;
}

.done {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.done[hidden] {
  display: none;
}

.done .tick {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--as);
  color: var(--onas);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.done h2 {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.done p {
  line-height: 1.55;
  color: var(--ink2);
}

.next {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--ln);
}

.next h3 {
  font: 500 12px var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mu);
}

.next ol {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.next li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
}

.next li::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sv);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.centered-page {
  display: flex;
  justify-content: center;
}

.centered-page .panel {
  width: 100%;
}

.lead {
  margin-top: 12px;
  max-width: 560px;
  color: var(--ink2);
}

/* Install */
.guides {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 32px;
  max-width: 720px;
}

.guide {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--ln);
  border-radius: 24px;
  background: var(--sf);
}

.guide.is-yours {
  order: -1;
  border-color: var(--ac);
}

.guide h2 {
  font-size: 24px;
}

.guide .badge {
  display: none;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--as);
  color: var(--onas);
  font: 600 12px var(--sans);
  vertical-align: middle;
}

.guide.is-yours .badge {
  display: inline-block;
}

.guide ol {
  margin: 14px 0 0;
  padding-left: 22px;
  line-height: 1.7;
}

.guide p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--mu);
}

/* Privacy and terms */
.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(24px, 4vw, 56px);
}

.legal nav {
  position: sticky;
  top: 96px;
  flex: 1 1 220px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal .segmented {
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 20px;
  background: var(--sv);
}

.legal .segmented a {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.legal .segmented a[aria-current="page"] {
  background: var(--sf);
  color: var(--ink);
}

.legal .toc a {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  color: var(--ink2);
  font-size: 13px;
  text-decoration: none;
}

.legal .toc a:hover {
  color: var(--ac);
}

.legal .toc span {
  flex: none;
  width: 28px;
  color: var(--mu);
}

.legal article {
  flex: 999 1 480px;
  min-width: 0;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legal .summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--as);
  color: var(--onas);
}

.legal .summary h2 {
  font: 600 12px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal .summary p {
  color: var(--ink);
  font-size: 15px;
}

.legal section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--ln);
  scroll-margin-top: 90px;
}

.legal section h2 {
  display: flex;
  gap: 12px;
  font: 500 22px/1.2 var(--serif);
}

.legal section h2 span {
  flex: none;
  width: 30px;
  padding-top: 6px;
  font: 400 14px var(--sans);
  color: var(--mu);
}

.legal .body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 42px;
  font-size: 15px;
  line-height: 1.6;
}

.legal .body li {
  margin-left: 18px;
}

.legal .term {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 4px 20px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--ln);
  font-size: 14px;
  line-height: 1.5;
}

.legal .term b {
  font-weight: 600;
}

.legal .term span {
  color: var(--ink2);
}

.legal .questions {
  padding-top: 14px;
  border-top: 1px solid var(--ln);
  font-size: 14px;
  color: var(--ink2);
}

.card .inline {
  display: inline;
}
