/* HobinRood main stylesheet. Hand written, no framework. */

:root {
  --ink: #181410;
  --canvas: #f0e7d2;
  --canvas-deep: #e6dabf;
  --night: #14110c;
  --night-ink: #ece2c9;
  --accent: #4f7031;
  --accent-ink: #3a5624;
  --accent-deep: #2d431c;
  --night-soft: #262017;
  --gold: #c9922e;
  --line: rgba(24, 20, 16, .22);
  --line-night: rgba(236, 226, 201, .22);
  --radius: 12px;
  --display: "IM Fell English", Georgia, serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --control-h: 48px;
  --control-h-sm: 40px;
  --maxw: 1120px;
  --gutter: 24px;
  --pad-block: clamp(56px, 6.5vw, 88px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 40;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus-visible { top: 12px; }

/* icons */
.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex: none;
}
.icon-lg { width: 40px; height: 40px; }
.icon-sm { width: 18px; height: 18px; }

/* type */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0 0 .5em;
}
h2 { font-size: clamp(30px, 3.8vw, 44px); }
h3 { font-size: clamp(20px, 2.2vw, 24px); }

p { margin: 0 0 1em; max-width: 68ch; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* sections */
.section {
  position: relative;
  padding: var(--pad-block) var(--gutter);
  overflow: hidden;
}
.section.canvas { background: var(--canvas); color: var(--ink); }
.section.night { background: var(--night); color: var(--night-ink); }

/* paper grain: inline svg filter on a background fleck layer, over content at very low opacity */
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--ink);
  opacity: .05;
  filter: url(#grain);
}
.section.night::after { background: var(--night-ink); opacity: .06; }

.wrap {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* pretty (not balance) keeps whole clauses together and kills orphans:
   balance split sentences mid-clause on the two-line subs */
.section-sub {
  font-size: 17px;
  max-width: 68ch;
  margin-bottom: clamp(28px, 4vw, 48px);
  text-wrap: pretty;
}

/* buttons: all solid, no borders, explicit opaque colors in every state */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 26px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn-small {
  height: var(--control-h-sm);
  padding: 0 18px;
  font-size: 14px;
}

.btn-solid {
  background: var(--accent);
  color: var(--canvas);
}
.btn-solid:hover {
  background: var(--accent-ink);
  color: var(--canvas);
}
.btn-solid:active {
  background: var(--accent-deep);
  color: var(--canvas);
}
.btn-solid:focus-visible {
  background: var(--accent);
  color: var(--canvas);
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

/* quiet solids: paper chip on the light panels, soft night on the dark */
.btn-soft {
  background: var(--canvas);
  color: var(--ink);
}
.btn-soft:hover {
  background: var(--accent);
  color: var(--canvas);
}
.btn-soft:active {
  background: var(--accent-ink);
  color: var(--canvas);
}
.btn-soft:focus-visible {
  background: var(--canvas);
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-soft-night {
  background: var(--night-soft);
  color: var(--night-ink);
}
.btn-soft-night:hover {
  background: var(--accent);
  color: var(--canvas);
}
.btn-soft-night:active {
  background: var(--accent-ink);
  color: var(--canvas);
}
.btn-soft-night:focus-visible {
  background: var(--night-soft);
  color: var(--night-ink);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn[disabled] {
  cursor: not-allowed;
  background: var(--canvas-deep);
  color: var(--ink);
}
.section.night .btn[disabled] {
  background: var(--night-soft);
  color: var(--night-ink);
}

/* nav: masthead, wordmark centred, links split either side, double rule below */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--night);
  color: var(--night-ink);
  border-bottom: 1px solid var(--line-night);
}
.site-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 1px;
  background: var(--line-night);
  pointer-events: none;
}
.nav-inner {
  position: relative;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  height: 72px;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav-side {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.nav-side-left { justify-content: flex-end; }
.nav-side-right { justify-content: flex-start; padding-right: 96px; }
.nav-side a {
  display: inline-flex;
  align-items: center;
  height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--night-ink);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.nav-side a:hover { background: var(--night-ink); color: var(--night); }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 26px;
  font-family: var(--display);
  font-size: 27px;
  color: var(--night-ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-cta {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  height: var(--control-h-sm);
}

.nav-menu-btn {
  display: none;
  align-items: center;
  gap: 10px;
  height: var(--control-h-sm);
  padding: 0 14px;
  justify-self: start;
  background: var(--night-soft);
  color: var(--night-ink);
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nav-menu-btn:hover { background: var(--accent); color: var(--canvas); }
.nav-menu-btn:active { background: var(--accent-ink); color: var(--canvas); }
.nav-menu-btn:focus-visible { background: var(--night-soft); color: var(--night-ink); }
.nav-menu-lines {
  position: relative;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav-menu-lines::before,
.nav-menu-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav-menu-lines::before { top: -6px; }
.nav-menu-lines::after { top: 6px; }

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--night);
  border-bottom: 1px solid var(--line-night);
  padding: 8px 16px 16px;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  display: flex;
  align-items: center;
  height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--night-ink);
  text-decoration: none;
  font-size: 16px;
}
.nav-mobile a:hover { background: var(--night-ink); color: var(--night); }

/* hero: one full bleed plate, text centred in the open paper */
.hero {
  min-height: min(78svh, 760px);
  display: grid;
  place-items: center;
  padding: clamp(72px, 10vh, 120px) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
}
.hero-content h1 {
  font-size: clamp(38px, 4.8vw, 62px);
  margin-bottom: 14px;
}
.hero-sub {
  font-size: 17px;
  margin: 0 auto 22px;
}
.hero-tithes {
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}
.hero-tithes li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
}
.hero-tithes .icon { color: var(--accent-ink); }
.icon-xs { width: 15px; height: 15px; }
.hero-cta-row { margin: 0; }

/* plates: the woodcut prints */
.plate { margin: 0 auto clamp(28px, 4vw, 48px); }
.plate img { width: 100%; height: auto; border-radius: var(--radius); }
.plate-wide { max-width: 880px; }
.plate-tall { max-width: 400px; }

/* tale: eight verses on a two by four grid */
.verse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.verse {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.verse-no {
  font-family: var(--display);
  font-size: 17px;
  color: var(--accent-ink);
  margin: 0 0 8px;
}
.verse h3 { margin-bottom: 8px; }
.verse p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

/* tithe */
.tithe-diagram { position: relative; }
.tithe-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tithe-card {
  background: var(--night);
  border: 1px solid var(--line-night);
  border-radius: var(--radius);
  padding: 26px;
}
.tithe-card .icon { color: var(--accent); margin-bottom: 14px; }
.tithe-card h3 { margin-bottom: 4px; }
/* now carries a full split sentence, not a two-word figure: size down and
   keep it on as few lines as possible */
.tithe-figure {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.3;
  text-wrap: pretty;
  color: var(--night-ink);
  margin-bottom: 10px;
}
.tithe-card p:last-child { margin-bottom: 0; font-size: 16px; }
.tithe-chest { border-color: var(--accent); }

/* panels, empty states */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas-deep);
  padding: clamp(24px, 3.5vw, 40px);
}
.section.night .panel {
  border-color: var(--line-night);
  background: var(--night);
}
.panel-label {
  font-weight: 600;
  margin-bottom: 16px;
}
.empty-state {
  text-align: center;
  padding: 24px 16px;
}
.empty-state .icon {
  margin: 0 auto 14px;
  color: var(--accent);
}
.empty-state p {
  margin: 0 auto;
  max-width: 46ch;
}
.panel-error { margin: 16px 0 0; }

/* exchange */
.exchange-grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
.swap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas-deep);
  padding: clamp(24px, 3.5vw, 40px);
}
.exchange-notes { min-width: 0; }
.note-tithes {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.note-tithes li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.note-explainer {
  font-size: 15px;
  opacity: .85;
  margin-bottom: 16px;
}
.note-network {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.exchange-notes .network-details div { border-bottom-color: var(--line); }
.exchange-notes .network-details a { color: var(--accent-ink); font-weight: 600; }
.swap-empty { text-align: center; padding: 40px 24px; }
.swap-empty .icon { margin: 0 auto 14px; color: var(--accent); }
.swap-empty p { margin: 0 auto; max-width: 44ch; }
.swap-steps {
  margin: 24px auto 0;
  padding: 0 0 0 22px;
  max-width: 40ch;
  text-align: left;
}
.swap-steps li { padding: 6px 0; }

.swap-gate { text-align: center; }
.swap-note { margin: 0 auto 20px; max-width: 44ch; }
.swap-gate .btn + .btn { margin-left: 12px; }

.swap-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}
.swap-tab {
  height: var(--control-h);
  border-radius: var(--radius);
  border: none;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.swap-tab:hover {
  background: var(--accent);
  color: var(--canvas);
}
.swap-tab.is-active {
  background: var(--accent);
  color: var(--canvas);
}
.swap-tab.is-active:hover {
  background: var(--accent-ink);
  color: var(--canvas);
}
.swap-tab:active {
  background: var(--accent-ink);
  color: var(--canvas);
}
.swap-tab:focus-visible {
  background: var(--canvas);
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.swap-tab.is-active:focus-visible {
  background: var(--accent);
  color: var(--canvas);
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.swap-panel h3 { margin-bottom: 20px; }

.field { margin-bottom: 20px; }
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-weight: 600;
}
.field-unit { font-weight: 700; }
.amount-row { display: flex; gap: 10px; }
.amount-row input {
  flex: 1;
  min-width: 0;
  height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}
.amount-row input:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field-note {
  font-size: 14px;
  margin: 8px 0 0;
  opacity: .85;
}
.amount-out {
  margin: 0;
  height: var(--control-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--canvas);
  font-size: 18px;
  overflow: hidden;
}

.tithe-line {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.35;
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 4px 0 20px;
  text-wrap: balance;
}
.tithe-line:empty { display: none; }

.quote-rows {
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
}
.quote-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.quote-row dt { font-weight: 600; }
.quote-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.slippage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 20px;
}
.slippage legend { font-weight: 600; padding: 0 8px; }
.slippage-row { display: flex; gap: 8px; flex-wrap: wrap; }
.slippage-btn {
  flex: 1 1 96px;
  background: var(--canvas);
  color: var(--ink);
}
.slippage-btn:hover {
  background: var(--accent);
  color: var(--canvas);
}
.slippage-btn.is-active {
  background: var(--accent);
  color: var(--canvas);
}
.slippage-btn:active {
  background: var(--accent-ink);
  color: var(--canvas);
}
.slippage-btn:focus-visible {
  background: var(--canvas);
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.slippage .field-note { margin-top: 12px; }

.btn-submit { width: 100%; }
.tx-status {
  margin: 16px 0 0;
  min-height: 1.4em;
  overflow-wrap: anywhere;
}
.tx-status a { color: var(--accent-ink); font-weight: 600; }

/* ledger */
.ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-night);
}
.ledger-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-night);
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.ledger-list .ledger-icon { color: var(--accent); flex: none; align-self: center; }
.ledger-list p { margin: 0; }
.ledger-list a { color: var(--night-ink); overflow-wrap: anywhere; }

/* alms */
.alms-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.alms-form input {
  flex: 1;
  min-width: 0;
  height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}
.alms-form input:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.alms-result p { margin: 0; overflow-wrap: anywhere; }

/* merry men */
.table-scroll { overflow-x: auto; }
.holders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.holders-table th,
.holders-table td {
  text-align: left;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line-night);
  white-space: nowrap;
}
.holders-table th { font-weight: 600; }
.holders-table thead tr { border-bottom: 1px solid var(--line-night); }
.holders-table td:last-child,
.holders-table th:last-child { padding-right: 0; }
.no-shaming {
  margin: 24px 0 0;
  font-size: 15px;
  opacity: .85;
}

/* faq: two columns of questions */
#faq h2 { margin-bottom: clamp(28px, 4vw, 48px); }
.faq-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  align-items: start;
  border-bottom: 1px solid var(--line-night);
}
.faq-list details { border-top: 1px solid var(--line-night); }
.faq-list summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  padding: 10px 0;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.3;
  text-wrap: balance;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: none;
  width: 24px;
  margin-left: auto;
  text-align: center;
  font-family: var(--body);
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
  transition: transform .15s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p {
  margin: 0;
  padding: 0 48px 22px 0;
}

/* footer */
.site-footer {
  background: var(--night);
  color: var(--night-ink);
  border-top: 1px solid var(--line-night);
  padding: var(--pad-block) var(--gutter);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 0;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line-night);
}
.footer-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 26px;
  margin-bottom: 16px;
}
.footer-contract { overflow-wrap: anywhere; }
.footer-socials {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-socials a { color: var(--night-ink); }
.social-soon { opacity: .75; }
.footer-heading {
  font-weight: 600;
  margin-bottom: 14px;
}
.network-details { margin: 0 0 20px; }
.network-details div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-night);
}
.network-details dt { font-weight: 600; }
.network-details dd { margin: 0; overflow-wrap: anywhere; }
.network-details a { color: var(--night-ink); }
.disclaimer {
  font-size: 14px;
  opacity: .8;
  margin: 0;
  max-width: 90ch;
  padding-top: 32px;
}

/* responsive */
@media (min-width: 861px) {
  .nav-mobile.open { display: none; }
}

@media (max-width: 1120px) {
  .nav-side a { padding: 0 9px; font-size: 14px; }
  .wordmark { margin: 0 14px; font-size: 24px; }
  .nav-side-right { padding-right: 88px; }
}

@media (max-width: 900px) {
  .exchange-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-side { display: none; }
  .nav-menu-btn { display: inline-flex; }
  .wordmark { margin: 0; }

  .hero { min-height: min(72svh, 640px); }

  .verse-grid { grid-template-columns: 1fr; gap: 16px; }
  .tithe-grid { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; }

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

@media (max-width: 560px) {
  :root { --gutter: 18px; }
  .nav-menu-label { display: none; }
  .nav-menu-btn { padding: 0 14px; }
  .wordmark { font-size: 22px; }
  .nav-cta { padding: 0 16px; }
  .alms-form { flex-direction: column; }
  .alms-form .btn { width: 100%; }
  .swap-gate .btn { width: 100%; }
  .swap-gate .btn + .btn { margin: 12px 0 0; }
  .quote-row { flex-direction: column; gap: 2px; }
  .quote-row dd { text-align: left; }
}

/* hidden must win over button display rules, placed last on purpose */
[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq-list summary::after { transition: none; }
  .skip-link { transition: none; }
  .btn, .nav-links a, .swap-tab, .slippage-btn, .nav-menu-btn { transition: none; }
}
