:root {
  --milk: #f5f6f2;
  --milk-2: #e7e9e2;
  --card: #ffffff;
  --ink: #171817;
  --ink-soft: #4d534c;
  --faint: #8b938a;
  --rule: #cdd2c8;
  --leaf: #22c150;
  --leaf-d: #0f6b2a;
  --hill: #33ad26;
  --apple: #e8564d;
  --apple-d: #b0302a;
  --red: #cf3226;
  --bark: #6e4220;
  --maxw: 1120px;
  --font-display: "Jersey 25", system-ui, sans-serif;
  --font-data: "Jersey 10", monospace;
  --font-label: "Silkscreen", monospace;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--milk);
  background-image:
    linear-gradient(rgba(23,24,23,.045) 1px, transparent 0),
    linear-gradient(90deg, rgba(23,24,23,.045) 1px, transparent 0);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { image-rendering: pixelated; }
code { font-family: var(--font-data); font-size: 1.15em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--leaf-d);
}
.field .eyebrow { color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-label); font-size: 9px; letter-spacing: .03em; text-transform: uppercase;
  background: var(--card); border: 3px solid var(--ink); padding: 9px 12px;
}
.dot { width: 9px; height: 9px; background: var(--leaf); border: 2px solid var(--ink); animation: blink 1.2s steps(1) infinite; }
.dot.idle { background: var(--faint); animation: none; }
@keyframes blink { 50% { opacity: .2; } }
.up { color: var(--leaf-d); }
.down { color: var(--red); }

.rail {
  height: 15px;
  background-color: var(--milk-2);
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 34px);
  border-top: 3px solid var(--ink);
}
.nav, .rail { border-bottom: 3px solid var(--ink); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--milk); }
.nav-inner { justify-content: space-between; height: 68px; gap: 18px; }
.brand, .nav-inner { display: flex; align-items: center; }
.brand { gap: 10px; font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: .01em; }
.brand img { width: 36px; height: 36px; border: 2px solid var(--ink); background: var(--leaf); }
.brand .tld { color: var(--leaf-d); }
.nav-links { display: flex; align-items: center; gap: 18px; font-family: var(--font-display); font-size: 22px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--leaf-d); }
.nav-cta {
  font-family: var(--font-label) !important; font-size: 9px !important;
  text-transform: uppercase; letter-spacing: .03em; color: var(--ink) !important;
  background: var(--leaf); border: 3px solid var(--ink); padding: 10px 13px; box-shadow: 3px 3px 0 var(--ink);
}
.nav-cta:hover { background: var(--apple); }
.nav-x {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 3px solid var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .12s ease;
}
.nav-x svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-x:hover { background: var(--apple); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.nav-x:active { transform: translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
@media (max-width: 820px) {
  .nav-links a:not(.nav-cta):not(.nav-x) { display: none; }
  .brand { font-size: 24px; }
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-label); font-size: 10px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.5;
  padding: 15px 19px; border: 3px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .12s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--leaf); }
.btn-primary:hover { background: #2fd862; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 74px 0 0; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(54px, 9vw, 104px); line-height: .9; letter-spacing: .005em;
  margin: 14px 0 0; max-width: 15ch;
}
.hero h1 .accent { color: var(--leaf-d); }
.hero-sub { margin: 24px 0 0; max-width: 52ch; font-size: 17.5px; color: var(--ink-soft); }
.hero-actions { margin: 32px 0 44px; display: flex; gap: 15px; flex-wrap: wrap; align-items: center; }

.orchard-band {
  height: clamp(150px, 22vw, 250px);
  background-image: url(assets/orchard.jpg);
  background-size: cover; background-position: center 62%;
  image-rendering: pixelated;
}
.orchard-band, .tape { border-top: 3px solid var(--ink); }

/* ---------- tape ---------- */
.tape { background: var(--leaf); border-bottom: 3px solid var(--ink); overflow: hidden; position: relative; }
.tape-label {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; padding: 0 14px;
  font-family: var(--font-label); font-size: 9px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--milk); background: var(--ink);
}
.tape-track { display: flex; white-space: nowrap; animation: scroll 46s linear infinite; padding: 10px 0 10px 110px; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes scroll { 0% { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item {
  font-family: var(--font-data); font-size: 25px; line-height: 1; padding: 0 18px; color: #06381a;
  border-right: 2px solid rgba(23,24,23,.22); display: inline-flex; align-items: center; gap: 9px;
}
.tape-item .sym { color: var(--ink); }
.tape-item .in { color: #033d16; }
.tape-item .out { color: #6b2b26; }
.tape-empty { font-family: var(--font-data); font-size: 25px; color: #10502a; padding: 12px 0 12px 110px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0 0; }
.stat { background: var(--card); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 16px 18px 18px; }
.stat-k { font-family: var(--font-label); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--leaf-d); }
.stat-v { font-family: var(--font-data); font-size: 46px; line-height: .95; margin-top: 10px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sections ---------- */
.section { padding: 78px 0; scroll-margin-top: 86px; }
.section.alt { background: var(--milk-2); }
.section.field {
  background-color: var(--leaf);
  background-image:
    linear-gradient(rgba(23,24,23,.055) 1px, transparent 0),
    linear-gradient(90deg, rgba(23,24,23,.055) 1px, transparent 0);
  background-size: 28px 28px;
}
.section-head h2 { font-family: var(--font-display); font-size: clamp(36px, 5.5vw, 60px); line-height: .95; margin: 12px 0 0; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin-top: 14px; max-width: 60ch; }
.field .section-head p { color: #06421f; }

/* ---------- harvest ---------- */
.harvest-grid { margin-top: 44px; display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 900px) { .harvest-grid { grid-template-columns: 1fr; } }

.shaker {
  background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 22px 20px 0; display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.harvest-clock {
  font-family: var(--font-data); font-size: 52px; line-height: .95; letter-spacing: .01em;
  font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
}
.harvest-clock.due { color: var(--apple-d); }
.harvest-when {
  font-family: var(--font-label); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint); margin-top: 5px; text-align: center;
}
.harvest-stage {
  flex: 1 1; min-height: 210px; margin: 18px -20px 0; width: calc(100% + 40px); position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--leaf); border-top: 3px solid var(--ink); overflow: hidden;
}
.harvest-stage img {
  width: 196px; max-width: 76%; display: block; position: relative; bottom: 18px; z-index: 1;
  transform-origin: 50% 100%;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .9s cubic-bezier(.34, 1.2, .64, 1);
}
.harvest-stage.tipped img { animation: shake .5s ease-in-out infinite; }
@keyframes shake {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
/* apples that drop from the tree at harvest time */
.apple {
  position: absolute; z-index: 1; width: 14px; height: 14px; background: var(--apple);
  border: 3px solid var(--ink); box-shadow: inset 3px 3px 0 #ffb3ab;
  opacity: 0; transform: translateY(0);
}
.apple.a1 { left: calc(50% - 44px); bottom: 150px; }
.apple.a2 { left: calc(50% + 28px); bottom: 166px; }
.apple.a3 { left: calc(50% + 56px); bottom: 118px; }
.apple.a4 { left: calc(50% - 66px); bottom: 104px; }
.harvest-stage.tipped .apple { opacity: 1; animation: drop 1.4s cubic-bezier(.3, .6, .6, 1) infinite; }
.harvest-stage.tipped .apple.a2 { animation-delay: .35s; }
.harvest-stage.tipped .apple.a3 { animation-delay: .7s; }
.harvest-stage.tipped .apple.a4 { animation-delay: 1.05s; }
@keyframes drop {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(140px); opacity: 1; }
  100% { transform: translateY(140px); opacity: 0; }
}
.harvest-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 2;
  background-color: #0aa845;
  background-image: repeating-linear-gradient(90deg, #0f6b2a 0 3px, transparent 3px 13px);
  border-top: 3px solid var(--ink);
}

.harvest-panel { background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; }
.harvest-figures { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 3px solid var(--ink); }
.harvest-fig { padding: 20px 22px 22px; }
.harvest-fig + .harvest-fig { border-left: 3px solid var(--ink); }
.harvest-fig .k { font-family: var(--font-label); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--leaf-d); }
.harvest-fig .v { font-family: var(--font-data); font-size: 50px; line-height: .95; margin-top: 8px; }
.harvest-fig .v.pool { color: var(--apple-d); }
.harvest-fig .note { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
@media (max-width: 520px) {
  .harvest-figures { grid-template-columns: 1fr; }
  .harvest-fig + .harvest-fig { border-left: none; border-top: 3px solid var(--ink); }
}

.split { padding: 20px 22px 24px; border-bottom: 3px solid var(--ink); }
.split-bar { display: flex; height: 34px; border: 3px solid var(--ink); margin-top: 11px; }
.split-bar > span {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-label); font-size: 8.5px; letter-spacing: .03em; text-transform: uppercase;
  overflow: hidden; white-space: nowrap;
}
.split-bar .orchard { background: var(--apple); }
.split-bar .bankroll { background: var(--leaf); border-left: 3px solid var(--ink); }
.split-legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 13px; font-size: 13.5px; color: var(--ink-soft); }
.split-legend b { font-weight: 600; color: var(--ink); }

.estimator { padding: 20px 22px 24px; }
.est-row { display: flex; gap: 10px; margin-top: 13px; flex-wrap: wrap; }
.est-row input {
  flex: 1 1; min-width: 220px; font-family: var(--font-data); font-size: 22px; padding: 9px 12px;
  border: 3px solid var(--ink); background: var(--milk); color: var(--ink);
}
.est-row input::placeholder { color: var(--faint); }
.est-out {
  margin-top: 15px; border-top: 2px solid var(--rule); padding-top: 15px; display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--font-data); font-size: 27px;
}
.est-out .k {
  display: block; font-family: var(--font-label); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--leaf-d); margin-bottom: 4px;
}
.est-err { margin-top: 13px; font-size: 13.5px; color: var(--apple-d); }
.harvest-history { margin-top: 22px; }

/* ---------- loop ---------- */
.loop { margin-top: 46px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.beat { background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 22px 22px 24px; position: relative; }
.beat-tag {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-label); font-size: 8.5px;
  letter-spacing: .04em; text-transform: uppercase; background: var(--leaf); border: 2px solid var(--ink); padding: 6px 9px;
}
.beat:last-child .beat-tag { background: var(--apple); }
.beat h3 { font-family: var(--font-display); font-size: 34px; line-height: 1; margin: 15px 0 8px; }
.beat p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.beat:after { content: "\2192"; position: absolute; top: 50%; right: -18px; transform: translateY(-50%); font-size: 22px; z-index: 1; }
.beat:last-child:after { content: "\21ba"; right: 18px; top: 20px; transform: none; color: var(--faint); }
@media (max-width: 880px) {
  .loop { grid-template-columns: 1fr; }
  .beat:after { content: "\2193"; right: 50%; top: auto; bottom: -20px; transform: translateX(50%); }
  .beat:last-child:after { content: "\21ba"; right: 18px; top: 20px; bottom: auto; transform: none; }
}

/* ---------- fuel ---------- */
.fuel { margin-top: 42px; background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 24px 26px; gap: 22px; }
.fuel, .fuel .lines { display: flex; align-items: center; flex-wrap: wrap; }
.fuel .lines { gap: 11px; }
.fuel-tag {
  font-family: var(--font-data); font-size: 25px; padding: 6px 13px; border: 3px solid var(--ink); background: var(--milk-2);
  display: inline-flex; align-items: center; gap: 9px;
}
.fuel-tag .glyph { color: var(--leaf-d); font-size: 11px; }
.fuel-plus, .fuel-tag .glyph { font-family: var(--font-label); }
.fuel-plus { font-size: 12px; color: var(--faint); }
.fuel p { flex: 1 1; min-width: 270px; margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- wallet dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-data); font-size: 24px;
  background: var(--card); border: 3px solid var(--ink); padding: 6px 7px 6px 13px; color: var(--ink-soft);
}
.wallet-chip a, .wallet-chip button {
  font-family: var(--font-label); font-size: 8px; letter-spacing: .03em; text-transform: uppercase;
  border: 2px solid var(--ink); background: var(--milk-2); color: var(--ink); padding: 7px 9px; cursor: pointer;
}
.wallet-chip a:hover, .wallet-chip button:hover { background: var(--leaf); }
.refresh-note { font-family: var(--font-data); font-size: 22px; color: var(--faint); }
.dash-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1.35fr; gap: 20px; align-items: start; }
@media (max-width: 940px) { .dash-grid { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.panel-head {
  padding: 12px 18px; border-bottom: 3px solid var(--ink); background: var(--milk-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--font-label); font-size: 9px; letter-spacing: .04em; text-transform: uppercase;
}
.pnl-big { padding: 24px 18px 6px; }
.pnl-big .v { font-size: 62px; line-height: .9; }
.pnl-big .sub, .pnl-big .v { font-family: var(--font-data); }
.pnl-big .sub { margin-top: 6px; font-size: 24px; color: var(--ink-soft); }
.bal-rows { padding: 6px 18px 18px; }
.bal-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0;
  border-top: 2px solid var(--rule); font-family: var(--font-data); font-size: 25px;
}
.bal-row .k { color: var(--ink-soft); }

.tbl { width: 100%; border-collapse: collapse; font-family: var(--font-data); font-size: 24px; }
.tbl th {
  text-align: left; padding: 10px 18px; color: var(--leaf-d); font-family: var(--font-label); font-weight: 400;
  font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 3px solid var(--ink); background: var(--milk-2);
}
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td { padding: 9px 18px; border-bottom: 2px solid var(--rule); }
.tbl tr:last-child td { border-bottom: none; }
.tbl .name { color: var(--faint); font-family: var(--font-body); font-size: 12px; line-height: 1.3; }
.tbl a { color: var(--leaf-d); }
.tbl a:hover { text-decoration: underline; }
.tbl-scroll { overflow-x: auto; }

.badge {
  font-family: var(--font-label); font-size: 7.5px; letter-spacing: .03em; text-transform: uppercase;
  padding: 4px 7px; border: 2px solid var(--ink); color: var(--ink-soft); background: var(--milk-2);
}
.badge.in { color: #06421f; background: #c9f2d6; }
.badge.out { color: var(--apple-d); background: #f8dedb; }

.empty-state { padding: 38px 20px; text-align: center; color: var(--faint); font-family: var(--font-data); font-size: 24px; line-height: 1.4; }
.empty-state .sm { display: block; font-family: var(--font-body); font-size: 13px; margin-top: 10px; }

.notice {
  margin-top: 20px; border: 3px solid var(--ink); padding: 15px 18px; font-size: 13.5px; color: var(--ink-soft);
  background: var(--card); display: flex; gap: 13px; align-items: flex-start; box-shadow: 4px 4px 0 var(--ink);
}
.notice .k {
  color: var(--leaf-d); font-family: var(--font-label); font-size: 8px; letter-spacing: .03em; text-transform: uppercase;
  flex-shrink: 0; padding-top: 3px;
}

/* ---------- footer ---------- */
.footer { border-top: 3px solid var(--ink); background: var(--ink); padding: 44px 0 58px; }
.footer, .footer .brand { color: var(--milk); }
.footer .brand .tld { color: var(--leaf); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: center; }
.footer .brand img { width: 40px; height: 40px; border-color: var(--milk); }
.foot-right { display: flex; flex-direction: column; align-items: flex-end; gap: 13px; }
.foot-social {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-label); font-size: 9px; letter-spacing: .03em;
  color: var(--ink); background: var(--leaf); border: 3px solid var(--milk); padding: 10px 13px; transition: background .12s ease;
}
.foot-social svg { width: 14px; height: 14px; }
.foot-social:hover { background: var(--apple); }
.foot-meta { font-family: var(--font-data); font-size: 22px; color: #9aa398; line-height: 1.4; text-align: right; }
.disclaimer { margin-top: 28px; font-size: 12.5px; color: #8b938a; max-width: 76ch; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  *, :after, :before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
