@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --canvas: #F3F4F5;
  --surface: #FFFFFF;
  --sunken: #E9EBED;
  --line: #DDE0E3;
  --line-strong: #7C858C;
  --text: #101314;
  --text-2: #4A5257;
  --muted: #646D73;
  --accent: #0A6B58;
  --on-accent: #FFFFFF;
  --soft: #DCEEEA;
  --caution: #8A5A00;
  --deep: #07332B;
  --deep-line: #1F5146;
  --deep-text: #F2F4F5;
  --deep-muted: #A9C6BE;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0E1112;
    --surface: #171B1C;
    --sunken: #0A0C0D;
    --line: #2A2F31;
    --line-strong: #6E787D;
    --text: #F2F4F5;
    --text-2: #AAB3B8;
    --muted: #8F999E;
    --accent: #4CCFB2;
    --on-accent: #06231D;
    --soft: #12302A;
    --caution: #F0B95A;
    --deep: #0F2C26;
  }
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 16px/24px "Schibsted Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.root { overflow-x: clip; }

h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg path, svg circle { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* tnum also widens this font's comma and full stop, so only digits get it. */
[data-sen] { font-variant-numeric: tabular-nums; }
.pn { font-variant-numeric: normal; }
.sen { color: var(--muted); font-size: .72em; font-weight: 500; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: var(--canvas);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand img { width: 40px; }
.top-end { display: flex; align-items: center; gap: 20px; }
.tag { font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.hide {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 180ms ease-out;
}
.hide:hover { color: var(--text); }
.login-link {
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 100ms ease-out;
}
.login-link:active { transform: scale(.96); }
.hide .slash { opacity: 0; transition: opacity 180ms ease-out; }
.hide[aria-pressed="true"] .slash { opacity: 1; }
.hide[aria-pressed="true"] { color: var(--accent); }
@media (max-width: 559px) {
  .hide-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hide { min-width: 44px; justify-content: center; }
  .top-end { gap: 8px; }
  .tag { display: none; }
}

/* Hero */
.hero { padding: clamp(24px, 4vh, 56px) var(--gutter) 0; }
h1 {
  font-size: clamp(44px, 8.6vw, 128px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.04em;
}
.h-line { display: block; }
.figure { color: var(--accent); }
.figure .sen { color: inherit; opacity: .62; }

.rule {
  --p: 82.3%;
  position: relative;
  height: 3px;
  margin-top: clamp(100px, 9vw, 136px);
  background: var(--line);
  border-radius: 3px;
}
.rule-fill {
  width: var(--p);
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 400ms var(--ease);
}
.rule-pace {
  position: absolute;
  left: 46%;
  top: -5px;
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}
.rule-pace::after {
  content: attr(data-label);
  position: absolute;
  top: 18px;
  left: 0;
  transform: translateX(-50%);
  font-size: 12px;
  font-style: normal;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
}
.mascot {
  --w: clamp(84px, 9vw, 124px);
  position: absolute;
  bottom: 100%;
  left: clamp(calc(var(--w) / 2), var(--p), calc(100% - var(--w) / 2));
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  margin-bottom: -2px;
  transition: left 400ms var(--ease);
  transform-origin: 50% 100%;
}
.mascot img { width: 100%; }

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding: 56px 0 72px;
}
@media (min-width: 900px) {
  .hero-foot { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; }
}

.add label { display: block; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--muted); }
.add-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 180ms ease-out;
}
.add-row:focus-within { border-color: var(--accent); }
.add input {
  flex: 1;
  min-width: 0;
  height: 60px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 500;
  letter-spacing: -.02em;
}
.add input::placeholder { color: var(--muted); opacity: 1; }
.add button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  transition: transform 100ms ease-out;
}
.add button:active { transform: scale(.94); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.chip .sen { font-size: 1em; color: inherit; }
.chip.unsure { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.chip.warn { background: none; box-shadow: inset 0 0 0 1px var(--caution); color: var(--caution); }

.rows li, .bill-rows li {
  display: grid;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  border-top: 1px solid var(--line);
}
.rows li { grid-template-columns: minmax(0, 1fr) auto minmax(96px, auto); }
.rows li:last-child, .bill-rows li:last-child { border-bottom: 1px solid var(--line); }
.r-name, .b-name { font-weight: 500; overflow-wrap: anywhere; }
.r-meta { font-size: 14px; color: var(--muted); }
.r-amt { text-align: right; font-weight: 600; white-space: nowrap; }
.r-amt .sen { font-size: 13px; }

/* Bands */
.band { position: relative; padding: 0 var(--gutter); }
.line {
  display: block;
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
}
.js .line { transform: scaleX(0); transition: transform 900ms var(--ease); }
.js .line.in { transform: none; }

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding: 72px 0;
}
@media (min-width: 900px) {
  .band-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; padding: 112px 0; }
  .band-grid > h2 { position: sticky; top: 104px; align-self: start; }
}
h2 {
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -.035em;
  text-wrap: balance;
}

/* Split */
.split-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(72px, auto);
  align-items: center;
  gap: 12px;
  min-height: 60px;
  border-top: 1px solid var(--line);
}
.split-item .who { display: flex; }
.split-name { font-weight: 500; }
.av {
  position: relative;
  width: 40px;
  height: 44px;
  display: grid;
  place-items: center;
}
.av span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}
.av:hover span { box-shadow: inset 0 0 0 1px var(--line-strong); }
.av[aria-pressed="true"] span { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.split-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}
.person b { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); }
.person strong { display: block; font-size: clamp(20px, 2.4vw, 32px); line-height: 1.25; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.person small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.track { height: 3px; margin: 10px 0; background: var(--line); border-radius: 3px; overflow: hidden; }
.track i { display: block; height: 100%; width: var(--w, 0); background: var(--accent); transition: width 260ms var(--ease); }

/* Bills */
.month { position: relative; height: 3px; margin: 12px 0 12px; background: var(--line); border-radius: 3px; }
.month-fill { width: 30%; height: 100%; background: var(--accent); border-radius: 3px; transform-origin: 0 50%; }
.js .month-fill { transform: scaleX(0); transition: transform 900ms 200ms var(--ease); }
.js .month.in .month-fill { transform: none; }
.due {
  position: absolute;
  top: -5px;
  left: var(--at);
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: var(--canvas);
  box-shadow: inset 0 0 0 3px var(--text);
}
.due:first-of-type { box-shadow: inset 0 0 0 3px var(--caution); }
.month-ends { position: relative; display: flex; justify-content: space-between; height: 16px; font-size: 12px; line-height: 16px; color: var(--muted); }
.month-ends span:nth-child(2) { position: absolute; left: 30%; transform: translateX(-50%); color: var(--text); font-weight: 500; white-space: nowrap; }
.bill-rows { margin-top: 32px; }
.bill-rows li { grid-template-columns: 64px minmax(0, 1fr) auto; min-height: 60px; }
.b-date { font-size: 14px; color: var(--muted); }
.b-name em { display: block; font-size: 12px; line-height: 16px; font-style: normal; font-weight: 500; color: var(--caution); }

/* Net worth */
.worth-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.worth-fig { font-size: clamp(32px, 4.4vw, 64px); line-height: 1.06; font-weight: 600; letter-spacing: -.035em; }
.worth-month { font-size: 14px; color: var(--muted); }
.chart { position: relative; height: clamp(200px, 26vw, 320px); margin-top: 24px; touch-action: pan-y; cursor: crosshair; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .c-area { fill: var(--soft); stroke: none; }
.chart .c-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .c-base { stroke: var(--line); stroke-width: 1; }
.chart .c-cross { stroke: var(--line-strong); stroke-width: 1; }
.chart .c-dot { fill: var(--accent); stroke: var(--canvas); stroke-width: 2; }
.chart text { fill: var(--muted); font-size: 12px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat p { max-width: min(460px, 90%); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.4; }
.ask {
  align-self: flex-end;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--sunken);
  font-weight: 500;
}
.say { padding: 4px 0 20px; color: var(--text-2); }
.say span { color: var(--text); font-weight: 600; }

/* The rest */
.more { padding-bottom: 112px; }
.words {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .42em;
  padding-top: 56px;
  font-size: clamp(32px, 5.6vw, 84px);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -.035em;
  color: var(--text);
}
.words li:nth-child(even) { color: var(--muted); }

/* Privacy */
.private {
  padding: clamp(72px, 10vw, 136px) var(--gutter);
  background: var(--deep);
  color: var(--deep-text);
  --muted: var(--deep-muted);
}
.private h2 { max-width: 12em; font-size: clamp(40px, 7vw, 104px); line-height: 1.02; letter-spacing: -.04em; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: clamp(56px, 7vw, 96px);
}
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 40px; } }
.facts li { padding: 16px 0 32px; border-top: 1px solid var(--deep-line); }
.facts b { display: block; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.facts span { display: block; margin-top: 4px; color: var(--muted); }

/* Closing */
.last { padding: clamp(72px, 10vw, 136px) var(--gutter) 0; }
.last h2 { max-width: 10em; font-size: clamp(44px, 8.6vw, 128px); line-height: 1; letter-spacing: -.04em; }
.last-rule { position: relative; height: 3px; margin-top: clamp(160px, 18vw, 240px); background: var(--accent); border-radius: 3px; }
.last-rule .mascot { --p: 76%; --w: clamp(150px, 19vw, 280px); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 20px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.foot a { text-underline-offset: 3px; }

/* Login */
.login { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100svh; }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.login-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 16px var(--gutter) 40px;
  padding-top: calc(16px + env(safe-area-inset-top));
  background: var(--deep);
  color: var(--deep-text);
}
.login-side .brand { align-self: flex-start; min-height: 44px; }
.login-line {
  font-size: clamp(36px, 6.2vw, 96px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.04em;
}
.login-line .figure { color: #4CCFB2; }
.login-side .rule { margin-top: clamp(96px, 9vw, 128px); background: var(--deep-line); }
.login-side .rule-fill { background: #4CCFB2; }
.login-main { display: grid; place-items: center; padding: 56px var(--gutter); }
.login-box { width: min(100%, 380px); }
.login-box h1 { font-size: clamp(36px, 3.6vw, 52px); line-height: 1.06; letter-spacing: -.035em; }
.passkey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  margin-top: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 600;
  transition: transform 100ms ease-out;
}
.passkey:active { transform: scale(.98); }
.passkey:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.login-note { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--muted); }
.login-status { min-height: 20px; margin-top: 16px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--caution); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
