:root {
  --paper: #F4EEDF;
  --paper-raised: #FBF7EC;
  --ink: #2B2620;
  --ink-soft: #73685A;
  --rule: #DCD2BC;
  --wheat: #C98A1B;
  --wheat-ink: #8A5A0A;
  --wheat-wash: #EFD9A4;
  /* the landscape */
  --sky-high: #FBF7EC;
  --sky-low: #F0DDAF;
  --hill-far: #D9CBA8;
  --hill-near: #BFAE86;
  --soil: #EAE0C8;
  --silhouette: #2B2620;
  --on-wheat: #2B2620;
  --serif: "Vollkorn", Georgia, serif;
  --sans: "Cabin", "Trebuchet MS", sans-serif;
  --hand: "Caveat", cursive;
  --wide: 1120px;
}

/* Dark follows the system unless the reader picks a side with the switch in the nav. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1C1915;
    --paper-raised: #26221C;
    --ink: #ECE3D0;
    --ink-soft: #A99C88;
    --rule: #3A332A;
    --wheat: #E0A63A;
    --wheat-ink: #E9BC62;
    --wheat-wash: #5A4519;
    --sky-high: #211D18;
    --sky-low: #3B301C;
    --hill-far: #332C22;
    --hill-near: #2A241C;
    --soil: #24201A;
    --silhouette: #14110E;
  }
}
:root[data-theme="dark"] {
  --paper: #1C1915;
  --paper-raised: #26221C;
  --ink: #ECE3D0;
  --ink-soft: #A99C88;
  --rule: #3A332A;
  --wheat: #E0A63A;
  --wheat-ink: #E9BC62;
  --wheat-wash: #5A4519;
  --sky-high: #211D18;
  --sky-low: #3B301C;
  --hill-far: #332C22;
  --hill-near: #2A241C;
  --soil: #24201A;
  --silhouette: #14110E;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wheat-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* Floating navigation */
.masthead {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 9px 12px 9px 22px;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 999px;
  box-shadow: 0 6px 20px -12px rgba(43, 38, 32, 0.45);
}
.wordmark { font: 700 22px/1 var(--serif); color: var(--ink); text-decoration: none; }
.links { display: flex; gap: 2px; font-size: 15px; }
.links a { color: var(--ink-soft); text-decoration: none; padding: 7px 13px; border-radius: 999px; }
.links a:hover { color: var(--ink); background: var(--paper); }

.theme {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex: none;
}
/* The icon shows where the switch takes you: a moon while the page is light, a sun while it is dark. */
.theme svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.2s ease;
}
.theme .moon { opacity: 1; transform: none; fill: var(--wheat); }
.theme .sun  { opacity: 0; transform: rotate(-70deg) scale(0.5); }
.theme .sun circle { fill: var(--wheat); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .moon { opacity: 0; transform: rotate(70deg) scale(0.5); }
  :root:not([data-theme="light"]) .theme .sun  { opacity: 1; transform: none; }
}
:root[data-theme="dark"] .theme .moon { opacity: 0; transform: rotate(70deg) scale(0.5); }
:root[data-theme="dark"] .theme .sun  { opacity: 1; transform: none; }
.theme:hover { border-color: var(--ink-soft); }

main, footer { max-width: var(--wide); margin: 0 auto; padding-left: 28px; padding-right: 28px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 56px;
  align-items: center;
  padding: 56px 0 40px;
}

h1, h2, h3 { font-family: var(--serif); margin: 0; }
h1 {
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 74px);
  line-height: 1.04;
  letter-spacing: -0.022em;
}
h2 { font-weight: 500; font-size: clamp(29px, 3.2vw, 38px); line-height: 1.14; letter-spacing: -0.012em; }
h3 { font-weight: 500; font-size: 23px; line-height: 1.3; margin: 44px 0 12px; }

p { margin: 0 0 16px; max-width: 62ch; }
.lead { font-size: 20px; line-height: 1.55; margin-top: 26px; color: var(--ink); max-width: 31em; }
.aside { font-size: 16px; color: var(--ink-soft); max-width: 34em; }
.small { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.dateline { color: var(--ink-soft); font-size: 15px; margin-top: 10px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 32px 0 20px; }
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  padding: 14px 24px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 0 0 var(--wheat);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 0 var(--wheat); }
.button:active { transform: translateY(1px); box-shadow: 0 1px 0 0 var(--wheat); }
.quiet { color: var(--ink); font-weight: 500; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.chips li { position: relative; padding-left: 20px; }
.chips li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.42em;
  width: 9px; height: 5px;
  border-left: 2px solid var(--wheat-ink);
  border-bottom: 2px solid var(--wheat-ink);
  transform: rotate(-45deg);
}

.hero-art { margin: 0; }
.painting {
  position: relative;
  border-radius: 10px 14px 12px 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(43, 38, 32, 0.6);
}
.painting img { display: block; width: 100%; height: auto; }
.painting .night { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .painting .day { display: none; }
  :root:not([data-theme="light"]) .painting .night { display: block; }
}
:root[data-theme="dark"] .painting .day { display: none; }
:root[data-theme="dark"] .painting .night { display: block; }

/* The weekly note is written into the painting's sky. */
.note {
  position: absolute;
  top: 6%; left: 7%; right: 14%;
  margin: 0;
  font: 600 clamp(20px, 2.1vw, 27px)/1.25 var(--hand);
  color: #4A3210;
  transform: rotate(-1.2deg);
  transform-origin: left top;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note { color: #F3DFAE; } }
:root[data-theme="dark"] .note { color: #F3DFAE; }

/* The specification for judges */
.spec { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px 20px; margin: 0 0 26px; }
.spec dt { color: var(--ink-soft); font-size: 15px; padding-top: 2px; }
.spec dd { margin: 0; max-width: 58ch; }
#scorecard td:first-child { font-weight: 500; }

/* Sections: heading on the left, matter on the right */
section.split {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 56px;
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--rule);
}
section.split:last-of-type { border-bottom: 0; }
.side { align-self: start; position: sticky; top: 96px; }
.side p { margin-top: 14px; color: var(--ink-soft); font-size: 16px; }
.body { min-width: 0; }

/* The five fields */
.fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.field { min-width: 0; }
.plot {
  position: relative;
  height: 156px;
  border: 1.5px solid var(--ink);
  border-radius: 3px 5px 4px 6px;
  background: repeating-linear-gradient(135deg, transparent 0 7px, var(--rule) 7px 8px);
  overflow: hidden;
}
.crop-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(43, 38, 32, 0.16) 9px 10px),
    var(--wheat);
  border-top: 1.5px solid var(--ink);
  transition: height 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.field h4 { font: 500 17px/1.3 var(--serif); margin: 10px 0 0; }
.field h4 small { display: block; font: 400 12.5px/1.4 var(--sans); color: var(--ink-soft); letter-spacing: 0.02em; }
.field .weight { font: 700 21px/1.2 var(--sans); font-variant-numeric: tabular-nums; margin: 2px 0; }
.field .state { font-size: 14px; line-height: 1.35; color: var(--ink-soft); margin: 0; }

.farm { margin: 40px 0 8px; }
figure { margin: 24px 0; }
figcaption { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 8px; }

.allocation {
  display: flex;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 4px 3px 5px 3px;
  overflow: hidden;
}
.allocation span { display: block; height: 100%; border-right: 1.5px solid var(--ink); }
.allocation span:last-child { border-right: 0; }
.allocation .planted {
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(43, 38, 32, 0.16) 9px 10px),
    var(--wheat);
}
.allocation .resting { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--rule) 7px 8px); }

.key { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14.5px; }
.key b { font-variant-numeric: tabular-nums; }

/* Your Monday list */
.yours { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 28px; align-items: end; margin-bottom: 20px; }
.field-input { display: grid; gap: 8px; font-size: 15px; color: var(--ink-soft); }
.field-input b { color: var(--ink); font-variant-numeric: tabular-nums; }
#account {
  font: 500 24px var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-radius: 4px 6px 5px 3px;
  padding: 10px 14px;
  width: 100%;
}
#account:focus-visible, #dial:focus-visible, .button:focus-visible, .theme:focus-visible { outline: 2px solid var(--wheat-ink); outline-offset: 3px; }
#dial { width: 100%; accent-color: var(--wheat); height: 28px; }
.dial .ends { display: flex; justify-content: space-between; font-size: 13.5px; }
.dial .ends i { font-style: normal; }
#list td:first-child small { display: block; color: var(--ink-soft); font-size: 13.5px; }
#list tr.rest td { color: var(--ink-soft); }
.actions.tight { margin: 18px 0 14px; }
button.button { border: 0; font: 500 16px var(--sans); cursor: pointer; }

.holdings { margin: 0 0 18px; }
.holdings summary { cursor: pointer; color: var(--wheat-ink); font-weight: 500; }
.holding-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 10px; }
.holding-grid label { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-soft); }
.holding-grid input {
  font: 500 16px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--paper-raised); border: 1px solid var(--ink-soft); border-radius: 4px; padding: 7px 9px; width: 100%;
}
#list td.buy { color: var(--ink); }
#list td.sell { color: var(--wheat-ink); }
#list td.thin { color: var(--wheat-ink); font-weight: 500; }
.quiet-button {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 16px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wheat); margin-right: 7px; vertical-align: 1px; }

/* The planting calendar */
.chart.calendar { aspect-ratio: 760 / 214; cursor: crosshair; touch-action: pan-y; }
.chart.calendar .cell { fill: var(--wheat); }
.chart.calendar .rest { fill: var(--ink-soft); }
.chart.calendar .cursor { stroke: var(--ink); stroke-width: 1.2; }
.chart.calendar .rowname { font-size: 12.5px; fill: var(--ink); }
#calendar-detail { min-height: 3.2em; }

/* Numbered steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.steps .n { font: italic 400 30px/1 var(--serif); color: var(--wheat-ink); }
.steps h3 { margin: 12px 0 8px; font-size: 21px; }
.steps p { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* Charts */
.chart { display: block; width: 100%; height: auto; aspect-ratio: 720 / 300; overflow: visible; }
.chart.short { aspect-ratio: 720 / 150; }
.chart text { font: 400 12px var(--sans); fill: var(--ink-soft); }
.chart .label { font-weight: 700; font-size: 13px; }
.chart .axis { stroke: var(--rule); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.fallow { stroke: var(--wheat); stroke-width: 2.5; }
.chart .line.btc { stroke: var(--ink); stroke-width: 1.4; }
.chart .area.fallow { fill: var(--wheat); opacity: 0.32; }
.chart .area.btc { fill: url(#hatch); }
.chart .tick { stroke: var(--ink-soft); stroke-width: 1; opacity: 0.45; }
.chart .tick.ours { stroke: var(--wheat-ink); stroke-width: 3; opacity: 1; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px 16px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 16px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 14px; font-weight: 500; color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); }
tbody tr.ours td { font-weight: 700; }
tbody tr.group td { font: 500 17px var(--serif); padding-top: 22px; border-bottom: 0; }

/* Bars for the rToken comparison */
.bars { margin: 24px 0 8px; display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: minmax(120px, 13em) 1fr 3.2em; align-items: center; gap: 12px; }
.bar .track { height: 26px; border-left: 1.5px solid var(--ink); }
.bar .fill {
  height: 100%;
  border: 1.5px solid var(--ink);
  border-left: 0;
  border-radius: 0 4px 3px 0;
  background: repeating-linear-gradient(135deg, transparent 0 7px, var(--rule) 7px 8px);
}
.bar.ours .fill {
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(43, 38, 32, 0.16) 9px 10px),
    var(--wheat);
}
.bar .value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.losses { padding-left: 1.3em; margin: 0 0 32px; }
.losses li { margin-bottom: 18px; padding-left: 6px; max-width: 60ch; }
.losses li::marker { font: 500 21px var(--serif); color: var(--wheat-ink); }
.losses b { font-weight: 700; }

ul.plain { padding-left: 1.2em; margin: 0 0 32px; }
ul.plain li { margin-bottom: 8px; max-width: 60ch; }

pre {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font: 400 14px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin: 20px 0 8px;
}

footer { padding-top: 40px; padding-bottom: 64px; color: var(--ink-soft); font-size: 14.5px; border-top: 1px solid var(--rule); }
footer p { max-width: 62ch; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .hero-art { max-width: 520px; }
  section.split { grid-template-columns: 1fr; gap: 24px; padding-top: 56px; }
  .side { position: static; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .yours { grid-template-columns: 1fr; gap: 18px; }
  .holding-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  main, footer { padding-left: 18px; padding-right: 18px; }
  .spec { grid-template-columns: 1fr; gap: 2px 0; }
  .spec dd { margin-bottom: 10px; }
  .pill { gap: 6px; padding: 8px 8px 8px 16px; }
  .links { font-size: 13.5px; }
  .links a { padding: 6px 8px; }
  .links a:nth-child(4) { display: none; }
  .fields { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .plot { height: 110px; }
  .bar { grid-template-columns: 1fr 3.2em; }
  .bar .name { grid-column: 1 / -1; margin-bottom: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .crop-fill, .button, .theme svg { transition: none; }
}
