:root {
  --u: calc(100vw / 1920);
  --paper: #F6F7F2;
  --paper-raw: #F7F5EF;
  --paper-white: #FAFAF6;
  --ivory: #EDEDE3;
  --ink: #111A15;
  --green: #2F6B4F;
  --green-deep: #0E4E37;
  --green-light: #DDE8DF;
  --muted: #65706A;
  --rule: #AAB0A9;
  --impact: cubic-bezier(.68, -.18, .24, 1.18);
  --feed: cubic-bezier(.22, .78, .18, 1);
  --impact-time: 220ms;
  --feed-time: 380ms;
  color-scheme: light;
  font-family: Manrope, sans-serif;
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 0; overflow-x: hidden; background: var(--paper); }
body { min-width: 0; margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.page-frame {
  width: auto;
  min-height: calc(100vh - (162 * var(--u)));
  margin: 0 calc(54 * var(--u)) 0 calc(57 * var(--u));
  padding: 0;
  background: transparent;
}

html body [data-chrome="nav"] {
  position: relative;
  z-index: 20;
  width: 100%;
  height: calc(76 * var(--u));
  min-height: 51px;
  padding: calc(8 * var(--u)) calc(32 * var(--u)) calc(7 * var(--u));
  grid-template-columns: calc(360 * var(--u)) 1fr auto;
  background: var(--paper);
}

html body [data-chrome="nav"] .brand {
  width: calc(300 * var(--u));
  height: calc(60 * var(--u));
  padding: 0;
  background: transparent;
}
html body [data-chrome="nav"] .brand img { width: calc(300 * var(--u)); height: calc(60 * var(--u)); object-fit: cover; object-position: center; }
html body [data-chrome="nav"] nav { gap: calc(34 * var(--u)); font-size: max(12px, calc(15 * var(--u))); }
html body [data-chrome="nav"] nav a { position: relative; border: 0; padding-bottom: calc(13 * var(--u)); }
html body [data-chrome="nav"] nav a::after {
  position: absolute;
  right: 0;
  bottom: calc(7 * var(--u));
  left: 0;
  height: 4px;
  background: var(--green);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms var(--feed), opacity 160ms linear;
}
html body [data-chrome="nav"] nav a:hover::after,
html body [data-chrome="nav"] nav a.is-active::after { opacity: 1; transform: scaleX(1); }
html body [data-chrome="nav"] nav a.is-active { border: 0; padding-bottom: calc(13 * var(--u)); }
html body [data-chrome="nav"] .social { gap: calc(22 * var(--u)); font-size: max(12px, calc(15 * var(--u))); }
html body [data-chrome="nav"] .social .icon { font-size: calc(25 * var(--u)); }
html body [data-chrome="nav"] .social-link { text-decoration: none; }
html body [data-chrome="nav"] .buy {
  padding: calc(13 * var(--u)) calc(21 * var(--u));
  border-radius: calc(4 * var(--u));
  background: var(--green);
  color: var(--paper-white);
  transition: transform var(--impact-time) var(--impact);
}
html body [data-chrome="nav"] .buy:hover { transform: translateX(calc(5 * var(--u))); }

.wallet-control { position: relative; }
.wallet-trigger { min-width: calc(154 * var(--u)); border: 0; white-space: nowrap; cursor: pointer; }
.wallet-account-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + (8 * var(--u)));
  right: 0;
  min-width: calc(154 * var(--u));
  padding: calc(7 * var(--u));
  border: 1px solid var(--ink);
  border-radius: calc(4 * var(--u));
  background: var(--paper-white);
}
.wallet-account-menu button { width: 100%; padding: calc(10 * var(--u)); border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.wallet-account-menu button:hover { background: var(--green-light); }
.wallet-modal[hidden], .wallet-account-menu[hidden], .site-toast[hidden] { display: none; }
.wallet-modal { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 24px; }
.wallet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(17,26,21,.58); cursor: pointer; }
.wallet-dialog {
  position: relative;
  z-index: 1;
  width: min(calc(560 * var(--u)), calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: calc(27 * var(--u));
  border: 1px solid var(--ink);
  border-radius: calc(6 * var(--u));
  background: var(--paper);
  box-shadow: calc(12 * var(--u)) calc(12 * var(--u)) 0 var(--green);
}
.wallet-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px dashed var(--rule); padding-bottom: calc(18 * var(--u)); }
.wallet-dialog-head p { margin: 0 0 calc(5 * var(--u)); font: 500 calc(13 * var(--u))/1 "Roboto Mono", monospace; }
.wallet-dialog h2 { margin: 0; font: 400 calc(42 * var(--u))/1 Anton, sans-serif; text-transform: uppercase; }
.wallet-close { width: calc(42 * var(--u)); height: calc(42 * var(--u)); border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font-size: calc(29 * var(--u)); line-height: 1; cursor: pointer; }
.wallet-note { margin: calc(18 * var(--u)) 0; color: var(--muted); font-size: calc(15 * var(--u)); }
.wallet-list { display: grid; gap: calc(8 * var(--u)); }
.wallet-option { min-height: calc(68 * var(--u)); display: grid; grid-template-columns: calc(42 * var(--u)) 1fr auto; align-items: center; gap: calc(14 * var(--u)); padding: calc(10 * var(--u)) calc(14 * var(--u)); border: 1px solid var(--rule); border-radius: calc(5 * var(--u)); background: var(--paper-white); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 160ms, transform 160ms; }
.wallet-option:hover { border-color: var(--green); transform: translateX(calc(4 * var(--u))); }
.wallet-option img { width: calc(38 * var(--u)); height: calc(38 * var(--u)); object-fit: contain; }
.wallet-option strong { display: block; font-size: calc(16 * var(--u)); }
.wallet-option small { color: var(--muted); font: 400 calc(12 * var(--u))/1.25 "Roboto Mono", monospace; }
.wallet-detected { padding: calc(5 * var(--u)) calc(8 * var(--u)); border-radius: calc(3 * var(--u)); background: var(--green-light); color: var(--green-deep); font-size: calc(11 * var(--u)); font-weight: 700; text-transform: uppercase; }
.site-toast { position: fixed; z-index: 260; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 14px 18px; border: 1px solid var(--ink); border-radius: 4px; background: var(--green); color: #fff; font-weight: 700; box-shadow: 6px 6px 0 rgba(17,26,21,.18); }

html body [data-chrome="footer"] {
  width: 100%;
  height: calc(86 * var(--u));
  min-height: 58px;
  padding: calc(15 * var(--u)) calc(44 * var(--u));
  background: var(--paper);
  font-size: max(12px, calc(15 * var(--u)));
  grid-template-columns: calc(250 * var(--u)) 1fr auto;
}
html body [data-chrome="footer"] .footer-brand { width: calc(220 * var(--u)); height: calc(50 * var(--u)); }
html body [data-chrome="footer"] .footer-brand img { width: calc(220 * var(--u)); height: calc(50 * var(--u)); object-fit: cover; object-position: center; }
html body [data-chrome="footer"] .source { font-family: "Roboto Mono", monospace; font-size: max(12px, calc(12 * var(--u))); }
html body [data-chrome="footer"] .links { gap: calc(22 * var(--u)); }
html body [data-chrome="footer"] .copy { padding: calc(11 * var(--u)) calc(16 * var(--u)); border-radius: calc(4 * var(--u)); }
html body [data-chrome="footer"] a { text-decoration: none; }
html body [data-chrome="footer"] .copy { background: transparent; color: var(--ink); cursor: pointer; }

/* Green actions always carry white copy, including their interactive states. */
.buy, .w-primary, .run-action-primary, .cl-reset, .cl-reset-large, .cl-present, .cl-stop-action, .fp-present, .fp-copy,
.cash-route .read-button, .cash-route .primary, .stop-route .btn.primary { color: #fff !important; }
.buy:hover, .buy:focus-visible, .w-primary:hover, .w-primary:focus-visible,
.run-action-primary:hover, .run-action-primary:focus-visible, .cl-reset:hover, .cl-reset:focus-visible, .cl-present:hover, .cl-present:focus-visible, .cl-stop-action:hover, .cl-stop-action:focus-visible,
.cl-reset-large:hover, .cl-reset-large:focus-visible, .fp-present:hover, .fp-present:focus-visible,
.fp-copy:hover, .fp-copy:focus-visible, .cash-route .read-button:hover, .cash-route .read-button:focus-visible,
.cash-route .primary:hover, .cash-route .primary:focus-visible,
.stop-route .btn.primary:hover, .stop-route .btn.primary:focus-visible { color: #fff !important; }

.menu-toggle,
.nav-drawer { display: none; }

body::after {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  background: var(--green);
  content: "";
  opacity: 1;
  transform: translateX(-102%);
}
body.is-route-changing::after { animation: register-pass 420ms var(--feed) both; }
@keyframes register-pass {
  0% { transform: translateX(-102%); }
  48% { transform: translateX(0); }
  100% { transform: translateX(102%); }
}

#app > * { transform-origin: left center; }
#app.is-route-entering > * { animation: cheque-feed var(--feed-time) var(--feed) both; }
@keyframes cheque-feed {
  from { opacity: 0; transform: translateX(calc(-28 * var(--u))); }
  to { opacity: 1; transform: translateX(0); }
}

[data-motion="feed"] { opacity: 0; transform: translateX(calc(-34 * var(--u))); }
[data-motion="feed"][data-motion-side="right"] { transform: translateX(calc(34 * var(--u))); }
[data-motion="feed"].is-in-view { opacity: 1; transform: translateX(0); transition: transform var(--feed-time) var(--feed), opacity 180ms linear; }
[data-motion="stamp"] { opacity: 0; transform: scale(1.35) rotate(-8deg); }
[data-motion="stamp"].is-stamped { opacity: 1; transform: scale(1) rotate(-3deg); transition: transform var(--impact-time) var(--impact), opacity 90ms linear; }
[data-motion="date-roll"] { overflow: hidden; }
[data-motion="date-roll"] > * { transform: translateY(-112%); }
[data-motion="date-roll"].is-rolled > * { transform: translateY(0); transition: transform 320ms var(--impact); }
[data-motion="grow"] { transform: scaleX(0); transform-origin: left; }
[data-motion="grow"].is-grown { transform: scaleX(1); transition: transform var(--feed-time) var(--feed); }
[data-motion="tear"] { transition: transform var(--impact-time) var(--impact); }
[data-motion="tear"]:hover { transform: translateX(calc(7 * var(--u))); }
[data-motion="tick"] { opacity: .42; transform: scaleY(.55); }
[data-motion="tick"].is-ticking { animation: ink-tick 440ms var(--impact); }
@keyframes ink-tick { 45% { opacity: 1; transform: scaleY(1); } }

@media (max-width: 1023px) {
  :root { --u: 1px; }
  .page-frame { min-height: calc(100vh - 154px); margin: 0 20px; }
  html body [data-chrome="nav"] {
    height: 68px;
    min-height: 68px;
    padding: 8px 18px;
    grid-template-columns: 1fr auto;
  }
  html body [data-chrome="nav"] .brand { width: 180px; height: 48px; padding: 0; }
  html body [data-chrome="nav"] .brand img { width: 180px; height: 48px; }
  html body [data-chrome="nav"] > nav,
  html body [data-chrome="nav"] > .social { display: none; }
  .menu-toggle {
    display: block;
    min-width: 48px;
    min-height: 44px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
  }
  .nav-drawer {
    position: fixed;
    z-index: 90;
    top: 68px;
    right: 0;
    left: 0;
    display: grid;
    gap: 0;
    padding: 14px 20px 20px;
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
    opacity: 0;
    transform: translateX(102%);
    transition: transform var(--feed-time) var(--feed), opacity 120ms linear;
  }
  .nav-drawer.is-open { opacity: 1; transform: translateX(0); }
  .nav-drawer nav { display: grid; gap: 0; font-size: 16px; }
  .nav-drawer nav a { min-height: 46px; padding: 13px 0 10px; border-bottom: 1px dashed var(--rule); text-decoration: none; }
  .nav-drawer nav a.is-active { border-bottom: 4px solid var(--green); padding-bottom: 8px; }
  .nav-drawer .social { display: grid; grid-template-columns:auto auto 1fr; align-items:center; gap: 12px; padding-top: 18px; font-size: 14px; }
  .nav-drawer .buy { padding: 10px 12px; border-radius: 4px; background: var(--green); color: var(--paper-white); text-decoration: none; }
  .nav-drawer .wallet-control { justify-self: end; }
  .nav-drawer .wallet-trigger { min-width: 140px; }
  .nav-drawer .wallet-account-menu { top: auto; right: 0; bottom: calc(100% + 6px); min-width: 140px; }
  .wallet-dialog { width: min(560px, calc(100vw - 32px)); padding: 22px; box-shadow: 8px 8px 0 var(--green); }
  .wallet-dialog-head p { font-size: 12px; }
  .wallet-dialog h2 { font-size: 36px; }
  .wallet-close { width: 40px; height: 40px; font-size: 26px; }
  .wallet-note { font-size: 14px; }
  .wallet-option { min-height: 64px; grid-template-columns: 40px 1fr auto; gap: 12px; padding: 10px 12px; }
  .wallet-option img { width: 36px; height: 36px; }
  .wallet-option strong { font-size: 15px; }
  .wallet-option small { font-size: 11px; }
  html body [data-chrome="footer"] {
    height: auto;
    min-height: 86px;
    padding: 14px 20px;
    grid-template-columns: 1fr;
    gap: 12px;
    font-size: 12px;
  }
  html body [data-chrome="footer"] .footer-brand { width: 180px; height: 42px; }
  html body [data-chrome="footer"] .footer-brand img { width: 180px; height: 42px; }
  html body [data-chrome="footer"] .source { margin-top: 4px; font-size: 12px; }
  html body [data-chrome="footer"] .links { justify-content: space-between; gap: 10px; }
  html body [data-chrome="footer"] .copy { padding: 9px 10px; }
}

@media (max-width: 420px) {
  .page-frame { margin-right: 14px; margin-left: 15px; }
  .nav-drawer .social { grid-template-columns: 1fr 1fr; }
  .nav-drawer .wallet-control { grid-column: 1 / -1; width: 100%; }
  .nav-drawer .wallet-trigger { width: 100%; }
  .wallet-dialog { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  body::after { opacity: 0 !important; transform: none !important; }
  #app > *,
  [data-motion] { opacity: 1 !important; transform: none !important; }
}
