:root {
  --bg: #070707;
  --paper: #101010;
  --ink: #f4f4f1;
  --mute: #8f8f8c;
  --line: rgba(255, 255, 255, 0.14);
  --white: #f7f7f4;
  --black: #070707;
  --soft: #ecece8;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button, .file-btn { font: inherit; cursor: pointer; }

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
}

.nav::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: rgba(7, 7, 7, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.brand strong {
  display: block;
  font-weight: 560;
  letter-spacing: -0.03em;
  font-size: 15px;
}

.brand span {
  display: block;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 8px 12px;
  color: #d7d7d3;
  font-size: 14px;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--white);
}

.nav-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--black);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn.ghost,
.ghost {
  background: transparent;
  color: var(--white);
}

.btn:hover,
.nav-cta:hover,
.ghost:hover,
.icon-btn:hover,
.file-btn:hover,
.entry-form button:hover {
  background: var(--white);
  color: var(--black);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: end;
  padding: 42px 0 64px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.035em; }

h1 {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.88;
}

h1 em { font-style: italic; }

.lede {
  max-width: 460px;
  margin: 22px 0 0;
  color: #cfcfca;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.frame {
  position: relative;
  border: 1px solid var(--line);
  min-height: 320px;
  overflow: hidden;
}

.frame img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12);
}

.frame figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  margin: 0;
  padding: 6px 8px;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.band article {
  padding: 22px 0;
  border-right: 1px solid var(--line);
}

.band article:last-child { border-right: 0; padding-left: 28px; }
.band article:nth-child(2) { padding-left: 28px; }

.band p {
  margin: 6px 0 0;
  color: var(--mute);
  font-size: 14px;
}

.band strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 500;
}

.sheet {
  background: var(--white);
  color: var(--black);
}

.sheet .wrap { padding: 72px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2,
.dark-block h2,
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.92;
}

.section-head p,
.page-head p { margin: 0; max-width: 340px; color: #4d4d4a; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #d8d8d3;
}

.service {
  padding: 28px 24px 8px 0;
  border-right: 1px solid #d8d8d3;
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.service:last-child { border-right: 0; padding-right: 0; padding-left: 24px; }
.service:nth-child(2) { padding-left: 24px; }

.service .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #6d6d69;
}

.service h3 {
  font-family: var(--serif);
  font-size: 36px;
  margin: 18px 0 12px;
}

.service p { margin: 0; color: #2c2c2a; }

.service ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: #3a3a37;
}

.service li {
  padding: 8px 0;
  border-top: 1px solid #e4e4df;
  font-size: 14px;
}

.service .btn {
  margin-top: auto;
  align-self: flex-start;
  margin-bottom: 8px;
}

.dark-block { padding: 72px 0; border-bottom: 1px solid var(--line); }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 32px;
}

.steps article {
  border-top: 1px solid var(--white);
  padding-top: 16px;
}

.steps span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.steps h3 { font-size: 22px; margin: 10px 0; letter-spacing: -0.03em; }

.steps p { margin: 0; color: #c8c8c3; font-size: 15px; }

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modules a, .modules article {
  display: block;
  border: 1px solid var(--line);
  padding: 16px 16px 14px;
  background: var(--paper);
}

.modules a:hover { background: var(--white); color: var(--black); }

.modules strong { display: block; font-size: 16px; margin-bottom: 4px; }

.modules span, .modules p { color: var(--mute); font-size: 14px; margin: 0; }

.modules a:hover span { color: #3d3d3a; }

.page-head {
  padding: 28px 0 36px;
  border-bottom: 1px solid var(--line);
}

.page-head p { color: #c8c8c3; margin-top: 14px; max-width: 560px; }

.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 28px 0 48px;
  border-top: 1px solid var(--line);
}

.feature-list article {
  padding: 22px 22px 22px 0;
  border-bottom: 1px solid var(--line);
}

.feature-list article:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }

.feature-list h3 { font-size: 20px; margin-bottom: 8px; }

.feature-list p { margin: 0 0 10px; color: #c8c8c3; }

.feature-list code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 40px;
  color: var(--mute);
  font-size: 13px;
}

footer a { border-bottom: 1px solid var(--line); }

.ledger { padding-bottom: 48px; }

.month-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0 18px;
}

.month-nav { display: flex; gap: 8px; align-items: center; }

.month-title h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
}

.month-title p { margin: 4px 0 0; color: var(--mute); }

.icon-btn, .ghost, .file-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--white);
  padding: 8px 14px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 18px 20px;
}

.stat p {
  margin: 0;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
}

.stat.remaining strong.negative { color: #8a8a8a; }

.year-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 18px 0 6px;
}

.year-strip button {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 10px;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 12px;
}

.year-strip button.active { background: var(--white); color: var(--black); }

.year-strip button.has-data:not(.active) {
  border-color: var(--line);
  color: var(--white);
}

.year-strip small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  opacity: 0.7;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px;
  min-height: 420px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 16px;
}

.panel-head h3 { font-family: var(--serif); font-size: 32px; }

.count { color: var(--mute); font-size: 13px; }

.entry-form {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 8px;
  margin-bottom: 16px;
}

.entry-form input[name="note"],
.entry-form button { grid-column: 1 / -1; }

input {
  font: inherit;
  border: 1px solid var(--line);
  background: #0a0a0a;
  color: var(--ink);
  padding: 12px 14px;
}

input:focus {
  outline: 1px solid var(--white);
  border-color: var(--white);
}

.entry-form button {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
  padding: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
}

.entry-form button.spend {
  background: transparent;
  color: var(--white);
}

.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.entry {
  border: 1px solid var(--line);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 12px;
}

.entry h4 { margin: 0; font-size: 16px; }

.entry .amount { font-family: var(--mono); }

.entry .note, .entry .meta { grid-column: 1 / 3; margin: 0; color: var(--mute); font-size: 13px; }

.entry .meta { font-family: var(--mono); font-size: 11px; color: #6d6d6d; }

.entry .delete {
  grid-row: 1 / 3;
  grid-column: 3;
  width: 32px;
  height: 32px;
  align-self: center;
  background: transparent;
  color: var(--mute);
  border: 0;
}

.entry .delete:hover { background: var(--white); color: var(--black); }

.empty { color: var(--mute); text-align: center; padding: 24px 4px; }

.top-actions { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; }

  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: #0d0d0d;
    border: 1px solid var(--line);
  }

  .nav-links.open { display: flex; }

  .hero, .band, .grid-3, .steps, .split, .modules, .feature-list, .columns, .stats, .entry-form {
    grid-template-columns: 1fr;
  }

  .band article, .band article:nth-child(2), .band article:last-child,
  .service, .service:nth-child(2), .service:last-child,
  .feature-list article:nth-child(even) {
    border-right: 0;
    border-left: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .band article { border-bottom: 1px solid var(--line); }

  .service { min-height: 0; border-bottom: 1px solid #d8d8d3; padding-bottom: 24px; }

  .section-head, .month-hero, footer, .hero-actions { flex-direction: column; align-items: flex-start; }

  footer { align-items: flex-start; }
}
