/* ChipIn public site. Brand tokens mirror src/lib/theme.ts. */

@font-face {
  font-family: "Outfit";
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/outfit-500.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/outfit-600.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/outfit-700.woff2") format("woff2");
}

:root {
  --pine-deep: #051C1A;
  --pine: #0A322E;
  --pine-lit: #11544C;
  --paper: #FAFAF8;
  --surface: #F1F1ED;
  --white: #FFFFFF;
  --navy: #0F2236;
  --navy-soft: #4A5866;
  --rule: #D7D7D2;

  /* The three people of the mark: bright on pine, deep on paper. */
  --coral: #F08B73;
  --brass: #F2BE58;
  --teal: #2CCDB6;
  --coral-deep: #C96555;
  --brass-deep: #B98A36;
  --teal-deep: #007F78;
  --owes: #B42318;

  --on-pine: #F3F7F5;
  --on-pine-soft: rgba(243, 247, 245, 0.72);
  --on-pine-rule: rgba(243, 247, 245, 0.16);

  --display: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: min(1180px, calc(100vw - 48px));
  --section-gap: clamp(88px, 11vw, 152px);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

[hidden] {
  display: none !important;
}

/* ---------- Dark band: masthead and hero ---------- */

.band-pine {
  color: var(--on-pine);
  background:
    radial-gradient(90% 70% at 72% 42%, var(--pine-lit) 0%, rgba(17, 84, 76, 0) 70%),
    linear-gradient(180deg, var(--pine) 0%, var(--pine-deep) 100%);
}

.masthead {
  display: flex;
  align-items: center;
  gap: 32px;
  width: var(--page);
  margin: 0 auto;
  padding: 22px 0;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.lockup-mark {
  width: auto;
  height: 1.3em;
  margin-right: -1px;
}

.person-top { fill: var(--coral); }
.person-left { fill: var(--brass); }
.person-bottom { fill: var(--teal); }

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 15px;
}

.site-nav a,
.lang-switch {
  color: var(--on-pine-soft);
  text-decoration: none;
  transition: color 160ms;
}

.site-nav a:hover,
.lang-switch:hover {
  color: var(--on-pine);
}

.lang-switch {
  font-size: 15px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms;
}

.button:active {
  transform: scale(0.97);
}

.button-teal {
  background: var(--teal);
  color: var(--pine-deep);
}

.button-teal:hover {
  background: #5BDCC9;
}

.button-small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.button-store {
  background: var(--on-pine);
  color: var(--pine-deep);
}

.button-store:hover {
  background: var(--white);
}

.button-store .icon {
  width: 22px;
  height: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  width: var(--page);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 84px) 0 clamp(72px, 9vw, 128px);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-intro {
  max-width: 30em;
  margin-top: 24px;
  color: var(--on-pine-soft);
  font-size: clamp(18px, 1.6vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 36px;
}

.store-pending {
  color: var(--on-pine-soft);
  font-size: 15px;
}

/* ---------- The split demo ---------- */

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
}

.receipt-wrap {
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.4));
}

.receipt {
  padding: 26px 24px 40px;
  background: var(--white);
  color: var(--navy);
  border-radius: 14px 14px 0 0;
  /* Torn bottom edge. */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
}

.receipt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--rule);
}

.receipt-title {
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.receipt-meta,
.receipt-hint {
  color: var(--navy-soft);
  font-size: 13px;
}

.receipt-hint {
  margin-top: 12px;
}

.receipt-items {
  margin-top: 6px;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #ECECE8;
  font-size: 15px;
}

.amount {
  font-family: var(--display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.receipt-sums {
  margin-top: 12px;
  color: var(--navy-soft);
  font-size: 14px;
}

.receipt-sums div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.receipt-sums .receipt-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--rule);
  color: var(--navy);
  font-size: 17px;
}

.receipt-total dt {
  font-family: var(--display);
  font-weight: 700;
}

.tally {
  padding: 24px 22px 20px;
  border: 1px solid var(--on-pine-rule);
  border-radius: 24px;
  background: rgba(5, 28, 26, 0.55);
}

.ring {
  position: relative;
  width: min(100%, 196px);
  margin: 0 auto 18px;
}

.ring svg {
  width: 100%;
  height: auto;
}

.ring-track,
.ring-arc {
  fill: none;
  stroke-width: 22;
  stroke-linecap: round;
}

.ring-track {
  stroke: rgba(243, 247, 245, 0.07);
}

.ring-arc {
  transition: stroke-dasharray 560ms var(--ease), stroke-dashoffset 560ms var(--ease), opacity 200ms;
}

.ring-arc[data-arc="maya"] { stroke: var(--coral); }
.ring-arc[data-arc="sam"] { stroke: var(--brass); }
.ring-arc[data-arc="you"] { stroke: var(--teal); }

.ring.is-resetting .ring-arc {
  transition: none;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-center .amount {
  font-size: 23px;
  font-weight: 700;
}

.ring-center span:last-child {
  color: var(--on-pine-soft);
  font-size: 12px;
}

.control {
  min-width: 0;
  margin: 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--on-pine-rule);
}

.control + .control {
  margin-top: 14px;
}

.control legend,
.control-label {
  padding: 0;
  color: var(--on-pine-soft);
  font-size: 13px;
}

.control legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
}

.segmented {
  clear: both;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border-radius: 999px;
  background: rgba(243, 247, 245, 0.08);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 7px 4px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  transition: background-color 200ms, color 200ms;
}

.segmented input:checked + span {
  background: var(--on-pine);
  color: var(--pine-deep);
}

.segmented input:focus-visible + span {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.chips {
  clear: both;
  display: grid;
  gap: 6px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--on-pine-rule);
  border-radius: 14px;
  background: rgba(243, 247, 245, 0.06);
  color: var(--on-pine);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms, opacity 200ms, transform 160ms var(--ease);
}

.chip:hover {
  background: rgba(243, 247, 245, 0.12);
}

.chip:active {
  transform: scale(0.98);
}

.chip-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--person);
  border-radius: 50%;
  background: var(--person);
  transition: background-color 200ms;
}

.chip[data-person="maya"] { --person: var(--coral); }
.chip[data-person="sam"] { --person: var(--brass); }
.chip[data-person="you"] { --person: var(--teal); }

.chip .amount {
  margin-left: auto;
  font-size: 17px;
}

.chip[aria-pressed="false"] {
  background: transparent;
  border-style: dashed;
  color: var(--on-pine-soft);
}

.chip[aria-pressed="false"] .chip-dot {
  background: transparent;
}

.chip[aria-pressed="false"] .amount {
  font-family: var(--body);
  font-weight: 400;
  font-size: 13px;
}

.pays {
  display: grid;
  gap: 2px;
  min-height: 3.2em;
  margin-top: 6px;
  font-size: 15px;
}

/* ---------- Light sections ---------- */

.section {
  width: var(--page);
  margin: var(--section-gap) auto 0;
}

.section-title {
  max-width: 17em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 3.8vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-lede {
  max-width: 34em;
  margin-top: 18px;
  color: var(--navy-soft);
  font-size: 19px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: 56px;
  counter-reset: step;
}

.step {
  padding-top: 26px;
  border-top: 3px solid var(--navy);
  counter-increment: step;
}

.step:nth-child(1) { border-color: var(--coral-deep); }
.step:nth-child(2) { border-color: var(--brass-deep); }
.step:nth-child(3) { border-color: var(--teal-deep); }

.step::before {
  content: counter(step);
  display: block;
  margin-bottom: 14px;
  color: var(--navy-soft);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.step h3,
.feature h3,
.promise h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.step p,
.feature p,
.promise p {
  margin-top: 8px;
  color: var(--navy-soft);
  font-size: 16px;
}

.balances {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(40px, 7vw, 104px);
}

.features {
  display: grid;
  gap: 28px;
  margin-top: 44px;
}

.feature {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
}

.feature .icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: #D8F1EF;
  color: var(--teal-deep);
}

.group-card {
  padding: 28px 26px 22px;
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 40px 70px -48px rgba(15, 34, 54, 0.45);
}

.group-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.group-card-sub {
  color: var(--navy-soft);
  font-size: 14px;
}

.group-owed {
  margin: 20px 0 18px;
}

.group-owed span {
  display: block;
  color: var(--navy-soft);
  font-size: 14px;
}

.group-owed .amount {
  color: var(--teal-deep);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.member {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  font-size: 16px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.avatar-coral { background: #B4513F; }
.avatar-brass { background: #8A6420; }
.avatar-teal { background: var(--teal-deep); }
.avatar-navy { background: #0B2B4A; }

.member-balance {
  margin-left: auto;
  text-align: right;
  line-height: 1.25;
}

.member-balance small {
  display: block;
  color: var(--navy-soft);
  font-size: 12px;
}

.is-owed .amount { color: var(--teal-deep); }
.owes .amount { color: var(--owes); }

.promises {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 52px;
}

.promise .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  color: var(--teal-deep);
}

/* ---------- Closing band and footer ---------- */

.closing {
  margin-top: var(--section-gap);
}

.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) 0;
}

.closing h2 {
  max-width: 14em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.closing .hero-actions {
  margin-top: 30px;
}

.closing-mark {
  width: clamp(140px, 18vw, 240px);
  height: auto;
}

.site-footer {
  background: var(--pine-deep);
  color: var(--on-pine-soft);
  font-size: 14px;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  width: var(--page);
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid var(--on-pine-rule);
}

.site-footer a {
  text-decoration: none;
}

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

.site-footer-publisher {
  margin-right: auto;
}

/* ---------- Support page ---------- */

.support-hero {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) 0 clamp(64px, 8vw, 104px);
}

.support-hero h1 {
  max-width: 13em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin-top: 40px;
}

.topic {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}

.topic h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.015em;
}

.topic p {
  margin-top: 8px;
  color: var(--navy-soft);
  font-size: 16px;
}

.checklist {
  display: grid;
  gap: 12px;
  max-width: 40em;
  margin-top: 32px;
}

.checklist li {
  display: flex;
  gap: 14px;
}

.checklist .icon {
  margin-top: 2px;
  color: var(--teal-deep);
}

.text-link {
  color: var(--teal-deep);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ---------- Privacy policy ---------- */

.policy {
  width: var(--page);
  margin: 0 auto var(--section-gap);
}

.policy-hero {
  max-width: 44em;
  padding: clamp(48px, 6vw, 88px) 0 40px;
}

.policy .eyebrow,
.policy .section-kicker {
  color: var(--teal-deep);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.policy h1 {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.policy-intro {
  margin-top: 20px;
  color: var(--navy-soft);
  font-size: 19px;
}

.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin-top: 20px;
  color: var(--navy-soft);
  font-size: 14px;
}

.policy-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 32px 0;
  border-top: 3px solid var(--navy);
  border-bottom: 1px solid var(--rule);
}

.policy-summary h2,
.policy-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.policy-summary p,
.policy-card p {
  margin-top: 8px;
  color: var(--navy-soft);
  font-size: 16px;
}

.policy-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 88px);
  margin-top: 56px;
}

.policy-toc {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.policy-toc a {
  color: var(--navy-soft);
  text-decoration: none;
}

.policy-toc a:hover {
  color: var(--teal-deep);
}

.policy-content {
  max-width: 46em;
}

.policy-section + .policy-section {
  margin-top: 64px;
}

.policy-section {
  scroll-margin-top: 24px;
}

.policy-section h2 {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.policy-section > p:not(.section-kicker) {
  margin-top: 16px;
}

.policy-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin-top: 24px;
}

.policy-card {
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}

.policy-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-left: 1.2em;
  list-style: disc;
}

.policy-list li::marker {
  color: var(--teal-deep);
}

.inline-link {
  color: var(--teal-deep);
  font-weight: 600;
  text-underline-offset: 3px;
}

.section-last {
  margin-bottom: var(--section-gap);
}

/* ---------- Responsive ---------- */

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

  .hero-copy {
    max-width: 640px;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 32px;
  }

  .balances {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-card {
    max-width: 480px;
  }
}

@media (max-width: 720px) {
  :root {
    --page: calc(100vw - 40px);
  }

  body {
    font-size: 16px;
  }

  .masthead {
    gap: 16px;
    padding: 16px 0;
  }

  .site-nav {
    display: none;
  }

  .lang-switch {
    margin-left: auto;
  }

  .demo {
    grid-template-columns: minmax(0, 1fr);
  }

  .ring {
    width: 168px;
  }

  .promises,
  .topics,
  .policy-summary,
  .policy-layout,
  .policy-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .policy-summary {
    gap: 28px;
  }

  .policy-toc {
    position: static;
  }

  .promises {
    gap: 32px;
  }

  .closing-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing-mark {
    display: none;
  }
}

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

  .receipt {
    padding: 22px 16px 36px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
