/* Trip Split — tripsplit.ventureapp.world
   Venture's dark, gold-led brand. One motif: the settle-up is a folio with a
   perforated stub, because the thing people keep (and screenshot) is the
   answer, not the form. */

:root {
  --ink: #0A0805;
  --surface: #0E0A06;
  --surface-2: #130F0A;
  --field: #0D0A06;
  --gold: #D4A574;
  --gold-bright: #F5D4A8;
  --gold-dark: #B8956A;
  --champ: #E8DDD0;
  --text: #F2ECE3;
  --text-2: color-mix(in oklab, var(--champ) 74%, var(--ink));
  --text-3: color-mix(in oklab, var(--champ) 63%, var(--ink));
  --rule: color-mix(in oklab, var(--gold) 16%, transparent);
  --rule-strong: color-mix(in oklab, var(--gold) 32%, transparent);
  --rule-active: color-mix(in oklab, var(--gold) 56%, transparent);
  --gold-wash: color-mix(in oklab, var(--gold) 14%, transparent);
  --track-caps: 0.16em;
  --card: linear-gradient(160deg, #221B13, #0C0A07);
  --warn: #E7A58F;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.953rem;
  --t-3xl: 2.441rem;

  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --r-field: 12px;
  --r-panel: 18px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: radial-gradient(900px 480px at 78% -140px, rgba(212, 165, 116, 0.12), transparent 72%) no-repeat, var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: var(--gold-bright); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ── masthead ─────────────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm); min-height: 64px;
}
.brand { display: flex; align-items: center; gap: var(--space-xs); text-decoration: none; color: inherit; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand-name {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: var(--t-lg); color: var(--champ); letter-spacing: 0.01em;
}
.brand-product {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--gold); padding-left: var(--space-xs); border-left: 1px solid var(--rule-strong);
  line-height: 1.2;
}
.masthead-link { font-size: var(--t-sm); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.masthead-link:hover { color: var(--gold-bright); }

/* ── type ─────────────────────────────────────────────────── */
.eyebrow {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--gold); margin: 0;
}
.display {
  font-family: var(--font-display); font-weight: 500; line-height: 1.04; letter-spacing: -0.012em;
  color: var(--text); margin: 0; text-wrap: balance;
  font-variant-numeric: lining-nums;
}
.display em { font-style: italic; color: var(--gold-bright); }
.lead { font-size: var(--t-lg); line-height: 1.55; color: var(--text-2); margin: 0; max-width: 34ch; text-wrap: pretty; }
.fine { font-size: var(--t-sm); color: var(--text-3); margin: 0; line-height: 1.55; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ── controls ─────────────────────────────────────────────── */
.field { display: grid; gap: var(--space-2xs); }
.field-label { font-size: var(--t-sm); font-weight: 500; color: var(--text-2); }
.input, .select {
  width: 100%; min-height: 48px;
  background: var(--field);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-field);
  padding: var(--space-xs) var(--space-sm);
  color: var(--text);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.input::placeholder { color: color-mix(in oklab, var(--champ) 54%, var(--ink)); }
.input:hover, .select:hover { border-color: var(--rule-active); }
.input:focus, .select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold) 22%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--warn); }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23D4A574' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.select option { background: var(--surface-2); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: 48px; padding: 0 var(--space-md);
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: var(--t-base); letter-spacing: 0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary:active { background: var(--gold-dark); }
.btn-ghost:active { background: var(--gold-wash); }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-bright); }
.btn-primary[disabled] { background: color-mix(in oklab, var(--gold) 45%, var(--ink)); cursor: progress; }
.btn-ghost { border-color: var(--rule-strong); color: var(--gold-bright); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); }
.btn-text {
  background: none; border: 0; padding: var(--space-2xs) 0; min-height: 44px;
  color: var(--text-2); cursor: pointer; font-size: var(--t-sm);
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px;
}
.btn-text:hover { color: var(--gold-bright); text-decoration-color: currentColor; }

/* Chips are real radios/checkboxes wearing pills. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: 0; padding: 0; border: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-sm);
  border-radius: var(--r-pill); border: 1px solid var(--rule-strong);
  color: var(--text-2); font-size: var(--t-sm); font-weight: 500;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out);
  user-select: none;
}
.chip input:hover + span { border-color: var(--rule-active); }
.chip input[type="radio"]:checked + span { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.chip input[type="checkbox"]:checked + span {
  border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold-bright);
  padding-left: 12px;
}
.chip input[type="checkbox"]:checked + span::before {
  content: ''; width: 9px; height: 5px; margin-right: 7px; margin-top: -3px;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg);
}
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip input:active + span { transform: scale(0.97); }
.chip span { transition-property: background-color, border-color, color, transform; }

/* Name tags in an entry field (landing "who's in", people strip). */
.tagfield {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs);
  min-height: 48px; padding: 6px 8px 6px 8px;
  background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--r-field);
  cursor: text;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.tagfield:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold) 22%, transparent); }
.tagfield input {
  flex: 1 1 8ch; min-width: 8ch; border: 0; background: transparent; outline: none;
  min-height: 34px; padding: 0 var(--space-2xs); color: var(--text);
}
.tagfield input::placeholder { color: color-mix(in oklab, var(--champ) 54%, var(--ink)); }
.tag {
  display: inline-flex; align-items: center; gap: 2px; min-height: 34px;
  padding: 0 4px 0 var(--space-xs); border-radius: var(--r-pill);
  background: var(--gold-wash);
  border: 1px solid var(--rule-active);
  color: var(--gold-bright); font-size: var(--t-sm); font-weight: 500;
}
.tag button {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: none; color: var(--gold); cursor: pointer; font-size: 16px; line-height: 1;
}
.tag button:hover { background: color-mix(in oklab, var(--gold) 22%, transparent); color: var(--gold-bright); }

.form-error { color: var(--warn); font-size: var(--t-sm); margin: 0; min-height: 1.4em; }

/* ── the folio (settle-up) ────────────────────────────────── */
.folio {
  position: relative;
  background: var(--card);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--gold-bright) 8%, transparent),
    0 30px 60px -34px color-mix(in oklab, var(--gold) 24%, transparent);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-panel);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  isolation: isolate;
}
.folio::before {
  content: ''; position: absolute; inset: 6px; z-index: -1;
  border: 1px solid var(--rule); border-radius: 11px;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle 17px at -6px var(--perf-y, -99px), #0000 16.5px, #000 17px),
    radial-gradient(circle 17px at calc(100% + 6px) var(--perf-y, -99px), #0000 16.5px, #000 17px);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle 17px at -6px var(--perf-y, -99px), #0000 16.5px, #000 17px),
    radial-gradient(circle 17px at calc(100% + 6px) var(--perf-y, -99px), #0000 16.5px, #000 17px);
  mask-composite: intersect;
}
.folio-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.folio-count { font-size: var(--t-xs); color: var(--text-3); }
.folio-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--t-lg); color: var(--champ); margin: var(--space-2xs) 0 var(--space-md);
  line-height: 1.25; overflow-wrap: anywhere;
}
.folio-cur {
  display: flex; align-items: center; gap: var(--space-xs);
  font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--track-caps); color: var(--gold-dark);
  margin: var(--space-sm) 0 var(--space-3xs);
}
.folio-cur::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.transfers { list-style: none; margin: 0; padding: 0; }
.transfer {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
  gap: var(--space-sm); padding: var(--space-xs) 0;
}
.transfer + .transfer { border-top: 1px solid var(--rule); }
.transfer-who {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2xs);
  color: var(--text); font-weight: 500; min-width: 0;
}
.transfer-who .name { overflow-wrap: anywhere; }
.transfer-who .pays { color: var(--text-3); font-weight: 400; font-size: var(--t-sm); }
.transfer-amt { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.amount {
  font-family: var(--font-display); font-weight: 600; color: var(--gold-bright);
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.01em;
}
.transfer .amount { font-size: var(--t-xl); line-height: 1.1; }
.cur-code { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.08em; color: var(--gold-dark); }
.square {
  font-family: var(--font-display); font-style: italic; font-size: var(--t-2xl);
  color: var(--champ); margin: 0; line-height: 1.15;
}
.square-sub { margin: var(--space-2xs) 0 0; color: var(--text-3); font-size: var(--t-sm); }

.perf {
  position: relative; height: 2px; margin: var(--space-md) calc(-1 * var(--space-md));
  padding-inline: 20px; background-origin: content-box; background-clip: content-box;
  background: radial-gradient(circle at 3px 1px, var(--rule-active) 0.9px, transparent 1.25px) content-box 0 0 / 6px 2px space no-repeat;
}
.perf::before, .perf::after {
  content: ''; position: absolute; top: -10px; width: 11px; height: 22px;
  background: var(--ink); border: 1px solid var(--rule-strong); z-index: 1;
}
/* Half-circles drawn inside the card's own box, so nothing overhangs the page. */
.perf::before { left: -1px; border-left: 0; border-radius: 0 11px 11px 0; }
.perf::after { right: -1px; border-right: 0; border-radius: 11px 0 0 11px; }

.stub { display: grid; gap: var(--space-xs); }
.stub-meta { margin: 0; font-size: var(--t-sm); color: var(--text-2); }
.stub-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.stub-label { font-size: var(--t-sm); color: var(--text-3); }
.stub-total { display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: var(--space-sm); }
.stub-total .amount { font-size: var(--t-lg); color: var(--champ); font-weight: 500; }
.stub-mark {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3xs) var(--space-sm);
  font-size: 0.8125rem; color: var(--text-2); align-items: baseline;
  padding-top: var(--space-2xs);
}
.stub-mark span { white-space: nowrap; }
.stub-mark span:last-child { letter-spacing: 0.02em; }
.stub-mark b { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: var(--t-base); letter-spacing: 0.01em; color: var(--champ); }

/* ── motion ───────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* ── footer ───────────────────────────────────────────────── */
.colophon { border-top: 1px solid var(--rule); margin-top: var(--space-3xl); }
.colophon .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--space-sm) var(--space-lg); padding-block: var(--space-lg);
}
.colophon p { margin: 0; color: var(--text-3); font-size: var(--t-sm); max-width: 52ch; }
.colophon p em { font-family: var(--font-display); color: var(--champ); font-size: var(--t-base); }
.colophon nav { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); font-size: var(--t-sm); }
.colophon nav a { color: var(--text-2); text-decoration: none; }
.colophon nav a:hover { color: var(--gold-bright); }

.toast {
  position: fixed; left: 50%; bottom: max(var(--space-md), env(safe-area-inset-bottom));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--champ); color: var(--ink); font-weight: 600; font-size: var(--t-sm);
  padding: var(--space-xs) var(--space-md); border-radius: var(--r-pill);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
