:root {
  color-scheme: light;
  --page: #f7f6ee;
  --paper: #fffef8;
  --ink: #192822;
  --muted: #506058;
  --line: #d7ddd0;
  --green: #284e3b;
  --dark: #1a392d;
  --lime: #e4edb0;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; color: var(--ink); background: var(--page); font: 1rem/1.55 var(--sans); }
a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #52762c; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.06; }
h2 { font-size: clamp(2.25rem, 5vw, 3.25rem); letter-spacing: -0.045em; }
h3 { line-height: 1.3; }
.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.skip-link { position: absolute; z-index: 1; left: 1rem; top: 1rem; padding: 0.6rem 1rem; background: var(--paper); }
.skip-link:not(:focus) { clip-path: inset(50%); }
.site-header { border-bottom: 1px solid var(--line); }
.masthead, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: 1.05rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 750; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; background: var(--dark); color: var(--lime); border-radius: 50%; }
.masthead nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.75rem; }
.masthead nav a { color: var(--ink); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { text-decoration: underline; }

.overview { display: grid; grid-template-areas: "intro data" "start data"; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); grid-template-rows: auto 1fr; align-items: start; gap: 1.5rem clamp(1.75rem, 5vw, 4.25rem); padding-block: 2.75rem; }
.hero-copy { grid-area: intro; }
.hero-copy h1 { font-size: clamp(2.85rem, 4.9vw, 4.25rem); line-height: 1.02; letter-spacing: -0.055em; }
.hero-copy > p { max-width: 25rem; margin: 0.95rem 0 1.1rem; color: var(--muted); font-size: 1.04rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; align-self: start; min-height: 2.85rem; padding: 0.65rem 1rem; color: white; background: var(--dark); border: 1px solid var(--dark); border-radius: 0.35rem; font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.button:hover { background: var(--green); }
.start-links { grid-area: start; max-width: 25rem; }
.start-links h2 { margin-bottom: 0.48rem; font: 700 0.9rem/1.4 var(--sans); letter-spacing: normal; }
.start-links ul { margin: 0; padding: 0; list-style: none; }
.start-links li { border-top: 1px solid var(--line); }
.start-links a { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; min-height: 2.08rem; text-decoration: none; font-size: 0.87rem; }
.start-links a:hover { text-decoration: underline; }

.section { padding: clamp(2.15rem, 5vw, 3.75rem) 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 0.65rem 1.5rem; margin-bottom: 1.45rem; }
.section-heading p { margin-top: 0.5rem; color: var(--muted); }
.feed-status { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; font-size: 0.88rem; }
.feed-status p { margin: 0; }
.feed-status button { padding: 0.3rem 0.8rem; border: 1px solid var(--green); background: var(--paper); color: var(--green); border-radius: 0.35rem; }
#economy { grid-area: data; }
#economy .section-heading { margin-bottom: 0.95rem; }
#economy .section-heading h2 { font-size: clamp(2rem, 4vw, 2.65rem); }
.economic-grid { background: var(--paper); border: 1px solid var(--line); border-radius: 0.65rem; }
.economic-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.3rem 1rem; padding: 0.76rem clamp(0.85rem, 2.3vw, 1.35rem); }
.economic-card + .economic-card { border-top: 1px solid var(--line); }
.economic-card h3 { font-size: 1rem; }
.reading { text-align: right; color: var(--dark); font-family: var(--serif); font-size: clamp(1.85rem, 4vw, 2.6rem); letter-spacing: -0.055em; line-height: 1.08; }
.observation { margin-top: 0.18rem; color: var(--muted); font-size: 0.79rem; }
.economic-card details { grid-column: 1 / -1; font-size: 0.82rem; }
.economic-card summary, .methodology summary { width: fit-content; color: var(--green); font-weight: 650; cursor: pointer; }
.definition { max-width: 42rem; margin-block: 0.45rem 0.35rem; }
.economic-card a { font-weight: 650; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lesson { display: flex; flex-direction: column; align-items: start; border-top: 3px solid #92a68b; padding: 1.3rem 1rem 1.3rem 0.35rem; }
.lesson h3 { margin-bottom: 0.65rem; font-family: var(--serif); font-size: 1.55rem; font-weight: normal; }
.lesson p { margin-bottom: 0.85rem; }
.lesson a { margin-top: auto; font-size: 0.83rem; font-weight: 650; }
.methodology { margin-top: 1.05rem; color: var(--muted); font-size: 0.88rem; }
.methodology p { padding-top: 0.55rem; max-width: 52rem; }

.calculator-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1rem; }
#fee-form, .result { padding: clamp(1.1rem, 3vw, 2rem); border-radius: 0.65rem; }
#fee-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 1rem; border: 1px solid var(--line); background: var(--paper); }
#fee-form .button { width: fit-content; grid-column: 1 / -1; }
.field { display: grid; align-content: end; gap: 0.3rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.86rem; font-weight: 650; }
.field input, .field select { width: 100%; min-height: 2.6rem; border: 1px solid #859785; border-radius: 0.32rem; padding: 0.45rem 0.65rem; color: var(--ink); background: var(--paper); }
.result { display: grid; align-content: center; gap: 1.05rem; background: #e9edde; }
.result h3 { font-family: var(--serif); font-size: 1.65rem; font-weight: normal; }
.balance-text { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.15rem 0.75rem; }
.balance-text strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.track { height: 0.48rem; margin-top: 0.4rem; background: #d3dac9; border-radius: 1rem; overflow: hidden; }
.track span { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; }
#bar-b { background: #667849; }
#fee-result { font-size: 0.9rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.84rem; }
.footer-row { flex-wrap: wrap; }

.watchlist { grid-template-areas: "intro data"; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.5fr); grid-template-rows: auto; }
.watchlist .hero-copy h1 { font-size: clamp(2.6rem, 4.4vw, 3.7rem); }
.watchlist-form { display: grid; gap: 0.75rem; max-width: 24rem; }
.watchlist-form .button { justify-self: start; }
.watchlist-chart { grid-area: data; min-width: 0; padding-top: 0.75rem; background: #fff; border: 1px solid var(--line); border-radius: 0.65rem; overflow: hidden; }
.watchlist-chart h2 { padding-inline: 1rem; font-size: 1.35rem; letter-spacing: -0.025em; }
.watchlist-chart noscript p { margin: 0.6rem 1rem; font-size: 0.9rem; }
.chart-frame { height: clamp(23rem, 61vh, 33rem); }
.tradingview-widget-container { width: 100%; height: 100%; }
.tradingview-widget-container__widget { width: 100%; height: calc(100% - 2rem); }
.tradingview-widget-copyright { padding-inline: 0.75rem; font-size: 0.8rem; }

@media (max-width: 54rem) {
  .lesson { padding-inline: 0.9rem; }
}
@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .masthead { align-items: start; flex-direction: column; gap: 0.7rem; }
  .masthead nav { gap: 0.55rem 1rem; }
  .overview { grid-template-areas: "intro" "data" "start"; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; padding-block: 1.75rem 2rem; }
  .watchlist { grid-template-areas: "intro" "data"; }
  .lesson-grid, .calculator-grid { grid-template-columns: minmax(0, 1fr); }
  .lesson { padding-inline: 0; }
}
