/* Haversack. Mobile first, base styles target a 360px phone. */

:root {
  --cream: #f7f3ea;
  --cream-deep: #efe8d9;
  --forest: #0f3d2e;
  --forest-deep: #0a2c21;
  --forest-muted: #b9cdc3;
  --coral: #ff6b4a;
  --ink: #14211c;
  --muted: #4a5a52;
  --line: rgba(20, 33, 28, 0.14);
  --line-light: rgba(247, 243, 234, 0.18);
  --white: #ffffff;
  --radius: 24px;
  --radius-sm: 14px;
  --font-sans: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: 16px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */

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

.section {
  padding: 56px 0;
}

.section-tint {
  background: var(--cream-deep);
}

.section-forest {
  background: var(--forest);
  color: var(--cream);
}

.prose {
  max-width: 62ch;
}

.prose p + p {
  margin-top: 1em;
}

.prose-light {
  color: var(--cream);
}

/* Type */

h1 {
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 12px 0 20px;
  max-width: 16ch;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 10px 0 20px;
  max-width: 24ch;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 600;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest);
}

.eyebrow-light {
  color: var(--forest-muted);
}

figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 14px;
  max-width: 48ch;
}

.section-forest figcaption {
  color: var(--forest-muted);
}

/* Buttons and links */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  text-align: center;
}

.btn-primary {
  background: var(--coral);
  color: var(--ink);
  border-color: var(--coral);
}

.btn-primary:hover {
  background: #ff815f;
  border-color: #ff815f;
}

.btn-outline {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}

.btn-outline:hover {
  background: rgba(15, 61, 46, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}

.btn-ghost:hover {
  background: rgba(247, 243, 234, 0.12);
}

.btn-small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.section-link {
  margin-top: 28px;
}

.section-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--coral);
}

.section-link-light a {
  color: var(--cream);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.1rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

/* Hero */

.hero {
  padding: 44px 0 56px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 40px;
}

.hero-art figcaption {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Phone mock: the phone rises out of a forest block and is cut by its bottom edge */

.phone-stage {
  width: min(100%, 340px);
  margin: 0 auto;
  padding: 36px 20px 0;
  background: var(--forest);
  border-radius: var(--radius);
  overflow: hidden;
}

.phone {
  position: relative;
  width: min(100%, 290px);
  margin: 0 auto -28px;
  padding: 12px;
  background: var(--ink);
  border-radius: 40px;
  box-shadow: 0 30px 60px rgba(20, 33, 28, 0.35);
}

.phone-notch {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 92px;
  height: 22px;
  transform: translateX(-50%);
  background: var(--ink);
  border-radius: 999px;
  z-index: 2;
}

.screen {
  background: var(--white);
  border-radius: 30px;
  overflow: hidden;
}

.screen-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 52px 20px 22px;
  background: var(--forest);
  color: var(--cream);
}

.screen-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest-muted);
}

.screen-balance {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
}

.screen-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--forest-muted);
}

.txns {
  padding-bottom: 36px;
}

.txns li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name amt"
    "note amt";
  column-gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.txns li:last-child {
  border-bottom: 0;
}

.txn-name {
  grid-area: name;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.3;
}

.txn-note {
  grid-area: note;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 3px;
}

.txn-amt {
  grid-area: amt;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.txn-in {
  color: var(--forest);
}

/* Metal card */

.card-figure {
  margin-top: 36px;
}

.card-row {
  display: grid;
  gap: 24px;
}

.metal-card {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1.586 / 1;
  border-radius: 20px;
  color: var(--cream);
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.10) 46%, rgba(255, 255, 255, 0) 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    linear-gradient(135deg, #1c4e3d 0%, #0f3d2e 38%, #16463a 55%, #0a2c21 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 24px 48px rgba(20, 33, 28, 0.28);
  overflow: hidden;
}

.metal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.chip {
  position: absolute;
  left: 7.5%;
  top: 30%;
  width: 13.5%;
  aspect-ratio: 1.25 / 1;
  border-radius: 6px;
  background: linear-gradient(135deg, #e9cd84 0%, #c9a24f 55%, #a9823a 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.chip::before,
.chip::after {
  content: "";
  position: absolute;
  background: rgba(60, 40, 10, 0.5);
}

.chip::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
}

.chip::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
}

.tap {
  position: absolute;
  right: 8%;
  top: 28%;
  width: 9%;
  height: auto;
  color: rgba(247, 243, 234, 0.8);
}

.card-issuer {
  position: absolute;
  left: 7.5%;
  top: 58%;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest-muted);
}

.card-weight {
  position: absolute;
  right: 8%;
  bottom: 10%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--coral);
}

.card-wordmark {
  position: absolute;
  left: 7.5%;
  bottom: 9%;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.spec {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
}

.spec th,
.spec td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.spec th {
  width: 46%;
  font-weight: 400;
  color: var(--muted);
  padding-right: 12px;
}

.spec td {
  font-weight: 500;
}

.spec tr:last-child td {
  color: var(--forest);
}

/* Split layout: prose beside a figure */

.split {
  display: grid;
  gap: 36px;
}

.split > *,
.card-row > * {
  min-width: 0;
}

/* Round-ups ledger */

.ledger {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 22px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  box-shadow: 0 18px 40px rgba(20, 33, 28, 0.08);
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.ledger-row span:last-child {
  font-weight: 500;
}

.ledger-total {
  border-bottom: 0;
  border-top: 2px solid var(--forest);
  margin-top: 8px;
  padding-top: 18px;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--forest);
}

/* Fee table: stacked rows on phones, a table from 640px */

.fees-figure {
  margin-top: 36px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.fees {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.5;
}

.fees thead {
  display: none;
}

.fees tbody,
.fees tr,
.fees th,
.fees td {
  display: block;
}

.fees tr {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 18px 8px;
  margin-bottom: 14px;
}

.fees th[scope="row"] {
  font-weight: 600;
  text-align: left;
  font-size: 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.fees td {
  padding: 8px 0 10px;
}

.fees td::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Money flow diagram */

.flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.flow-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 20px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--forest);
  background: var(--white);
}

.flow-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.flow-holds {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.flow-app {
  background: var(--coral);
  border-color: var(--coral);
}

.flow-app .flow-holds {
  color: var(--ink);
}

.flow-bank {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

.flow-bank .flow-holds {
  color: var(--forest-muted);
}

.flow-arrow {
  display: flex;
  justify-content: center;
  color: var(--forest);
}

.flow-arrow svg {
  width: 36px;
  height: 18px;
  transform: rotate(90deg);
}

/* Disclosures */

.disclosures-figure {
  margin-top: 32px;
}

.disclosures {
  display: grid;
  gap: 14px;
  counter-reset: none;
}

.disclosures li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 20px 20px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-light);
  background: var(--forest-deep);
}

.disc-num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--coral);
}

.disclosures p {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  max-width: 62ch;
}

/* Questions */

.questions {
  display: grid;
  gap: 14px;
}

.qa {
  padding: 22px 20px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--line);
}

.qa p {
  margin-top: 10px;
  max-width: 62ch;
}

/* Final section */

.section-final h2 {
  font-size: 1.9rem;
}

.section-final .actions {
  margin-top: 32px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  background: var(--cream);
}

.footer-grid {
  display: grid;
  gap: 32px;
}

.footer-brand p {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 40ch;
}

.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--forest);
  margin: 0 0 6px;
}

.footer-col li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
}

.footer-col li a:hover {
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer-legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--coral);
}

/* Larger phones and small tablets */

@media (min-width: 480px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Tablets */

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }

  body {
    font-size: 1.0625rem;
  }

  .section {
    padding: 72px 0;
  }

  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 2rem;
  }

  .section-final h2 {
    font-size: 2.4rem;
  }

  .hero {
    padding: 64px 0 72px;
  }

  .card-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 36px;
  }

  .fees thead {
    display: table-header-group;
  }

  .fees tbody {
    display: table-row-group;
  }

  .fees tr {
    display: table-row;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
  }

  .fees th,
  .fees td {
    display: table-cell;
    padding: 14px 14px 14px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
  }

  .fees th[scope="col"] {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--muted);
    padding-bottom: 10px;
  }

  .fees th[scope="row"] {
    font-size: 0.95rem;
    width: 22%;
    margin: 0;
  }

  .fees td::before {
    display: none;
  }

  .fees td:nth-child(2) {
    font-weight: 600;
    color: var(--forest);
  }

  .questions {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablets only: the flow diagram runs left to right while it has the full width.
   From 960px it sits beside the copy and stacks again. */

@media (min-width: 640px) and (max-width: 959px) {
  .flow {
    flex-direction: row;
    align-items: stretch;
  }

  .flow-box {
    flex: 1 1 0;
  }

  .flow-arrow {
    align-items: center;
    flex: 0 0 36px;
  }

  .flow-arrow svg {
    transform: none;
  }
}

/* Desktops */

@media (min-width: 960px) {
  :root {
    --gutter: 32px;
  }

  .section {
    padding: 96px 0;
  }

  .hero {
    padding: 80px 0 96px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 56px;
  }

  .phone-stage {
    width: min(100%, 390px);
    padding-top: 48px;
  }

  .phone {
    width: min(100%, 310px);
  }

  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }

  .card-row {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: 56px;
  }

  .footer-grid {
    grid-template-columns: 1.5fr repeat(4, 1fr);
    gap: 40px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-legal {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

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