:root {
  color-scheme: light;
  --ink: #192e24;
  --muted: #4e6055;
  --green: #1a3e30;
  --deep: #102c24;
  --cream: #f4f0e6;
  --paper: #fffcf4;
  --gold: #e8c78d;
  --ochre: #78531e;
  --line: #dbd4c2;
  --heading: Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 1rem/1.65 var(--body); }
p { margin: 0 0 1rem; }
a { color: inherit; text-underline-offset: .22em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid #8f5b16; outline-offset: 4px; }
.masthead :focus-visible, .hero :focus-visible, .footer :focus-visible { outline-color: var(--gold); }
.wrap { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.skip { position: absolute; top: 0; left: 1rem; padding: .7rem 1rem; z-index: 10; background: var(--paper); transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }

.masthead { background: var(--deep); color: var(--paper); border-bottom: 1px solid #c8ae7445; }
.mast-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; }
.mast-inner { min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .045em; font: bold 1.44rem/1 var(--heading); letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand img { margin-right: .55rem; }
.brand span { color: var(--gold); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.65rem; }
nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .88rem; text-decoration: none; }
nav a:hover { color: var(--gold); }
nav a[aria-current] { color: var(--gold); text-decoration: underline; text-underline-offset: .5em; }

h1, h2, h3 { font-family: var(--heading); font-weight: 500; line-height: 1.12; margin: 0 0 .58em; }
h1 { font-size: clamp(2.7rem, 6vw, 5.25rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.72rem, 3vw, 2.65rem); letter-spacing: -.033em; }
h3 { font-size: 1.42rem; letter-spacing: -.018em; }
.eyebrow { margin: 0 0 .68rem; color: var(--ochre); font-size: .68rem; font-weight: 760; letter-spacing: .18em; }
.lead { font-size: clamp(1rem, 1.45vw, 1.13rem); max-width: 38rem; }

.hero {
  color: var(--paper);
  background: radial-gradient(ellipse at 72% 26%, #254639 0, transparent 65%), var(--deep);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  padding-block: clamp(3rem, 6vw, 5.25rem) 5.85rem;
  position: relative;
  isolation: isolate;
}
.hero-heading, .hero-detail { grid-column: 1; }
.hero-heading { grid-row: 1; }
.hero-detail { grid-row: 2; }
.hero .eyebrow { color: var(--gold); display: flex; align-items: center; gap: .75rem; }
.hero .eyebrow::before { content: ""; display: inline-block; width: 1.7rem; height: 1px; background: currentColor; }
.hero h1 { margin: .15em 0 .18em; line-height: .99; }
.hero h1 em { display: block; color: var(--gold); font-weight: inherit; }
.hero .lead { max-width: 25rem; color: #e1e6da; margin-bottom: .85rem; }
.hero-action { display: inline-flex; gap: .8em; align-items: center; min-height: 44px; color: var(--gold); font-size: .9rem; font-weight: 680; }
.hero-action:hover { color: var(--paper); }
.hero-art {
  grid-area: 1 / 2 / 3 / 3;
  align-self: center;
  min-width: 0;
  margin-block: -2rem -1.75rem;
}
.hero-art img { display: block; width: 100%; height: auto; max-height: 365px; object-fit: contain; }
.hero-art-preview img { max-height: 390px; }

.convert-section { margin-top: -58px; position: relative; scroll-margin-top: 18px; }
.converter {
  min-width: 0;
  padding: clamp(1.1rem, 3.3vw, 2.3rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 9px 26px #2935220c;
}
.year-panel { display: grid; grid-template-columns: minmax(11.5rem, .72fr) minmax(0, 1.7fr); gap: clamp(1.25rem, 4.2vw, 4.5rem); border-top: 3px solid #b88a47; }
.converter h2 { margin-bottom: .25em; }
.converter > p, .converter-head p { color: var(--muted); }
.converter-head { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.converter-head p { margin: 0; }
.today { display: flex; flex-direction: column; gap: .05rem; padding: .24rem 0 .24rem .75rem; border-left: 2px solid #b88a47; }
.today-label { font-size: .73rem; font-weight: 680; }
.today strong { display: block; color: var(--green); font-size: .94rem; font-variant-numeric: tabular-nums; }
.dot { color: var(--ochre); }

.year-fields, .field-grid { display: grid; gap: .85rem 1.05rem; }
.year-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: .75rem; }
.field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-row { align-items: end; margin-top: 1rem; }
label { display: block; min-width: 0; font-size: .9rem; font-weight: 700; }
label span { display: inline-block; color: var(--muted); font-size: .77rem; font-weight: 520; margin-left: .23rem; }
input, select { display: block; width: 100%; margin-top: .33rem; min-height: 48px; padding: .57rem .72rem; color: var(--ink); background: #fffefa; border: 1px solid #9ba795; border-radius: 5px; font-size: 1rem; }
input:hover, select:hover { border-color: var(--green); }
input[aria-invalid] { border-color: #a32824; box-shadow: 0 0 0 1px #a32824; }
.year-fields input { min-height: 58px; font: clamp(1.55rem, 3.4vw, 2.05rem)/1.05 var(--heading); font-variant-numeric: lining-nums tabular-nums; padding: .55rem .74rem; }
.exchange { display: grid; place-items: center; width: 38px; height: 58px; color: var(--ochre); }
.exchange svg, .tile-icon svg { display: block; width: 23px; height: 23px; }
button { min-height: 44px; padding: .55rem 1rem; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #fff; font-size: .88rem; font-weight: 700; }
button:not(:disabled):hover { background: #28533f; }
.result { display: flex; justify-content: space-between; align-items: center; gap: .5rem .85rem; margin-top: .9rem; min-height: 88px; padding: .65rem .8rem; border: 1px solid #d0d8c7; border-radius: 5px; background: #edf0e5; }
.result-main { min-width: 0; }
.result .eyebrow { display: block; margin-bottom: .12rem; font-size: .62rem; }
output { display: block; color: var(--green); font-weight: 740; overflow-wrap: anywhere; }
.result p { margin: .13rem 0 0; color: var(--muted); font-size: .83rem; }
.result output:empty + p:not(:empty) { color: #852822; }
.copy-box { flex: none; }
.copy-box button { background: transparent; color: var(--green); border-color: #879582; }
.copy-box button:not(:disabled):hover { background: #dce5d3; }
.copy-box small { display: block; }

.section { margin-block: clamp(2.5rem, 6.5vw, 5rem); }
.tool-links, .guide-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem 1.05rem; }
.tool-links-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .86rem; align-items: center; padding: 1.05rem; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
.tool-link:hover { border-color: #92703c; background: #fffaf0; }
.tool-index { display: block; color: var(--ochre); font-size: .62rem; font-weight: 750; letter-spacing: .13em; }
.tool-link strong { display: block; margin-top: .12rem; font: 1.22rem/1.18 var(--heading); }
.tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #ded2b6; border-radius: 50%; background: #f4ecda; color: var(--ochre); }
.tool-link small { display: block; color: var(--muted); line-height: 1.42; margin-top: .24rem; }
.arrow { color: var(--ochre); font-weight: 700; }

.split { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: clamp(1.3rem, 6.5vw, 5rem); padding-top: clamp(1.6rem, 4.2vw, 3.2rem); border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { padding: .8rem .12rem; cursor: pointer; font-weight: 660; }
summary::marker { color: var(--ochre); }
details p { color: var(--muted); }
.reference { min-width: 0; }
.reference label { max-width: 15rem; }
.reference [data-filter-status] { font-size: .89rem; margin: .5rem 0; }
.table-scroll { overflow: auto; max-height: 15rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .5rem .62rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #e7e9dd; }
.table-scroll th { position: sticky; top: 0; }

.guide-link { padding: 1rem .2rem 1.1rem 0; border-top: 1px solid #b28b4f; }
.guide-link .eyebrow { display: block; }
.guide-link a { text-decoration: none; }
.guide-link a:hover { text-decoration: underline; }
.guide-link p { color: var(--muted); font-size: .92rem; margin-bottom: 0; }
.text-link { color: var(--green); font-weight: 720; }
.section > .guide-links + p { margin-top: .6rem; }

.page-intro { padding-block: clamp(2rem, 5.2vw, 4.6rem); background: #ebe9dc; border-bottom: 1px solid var(--line); }
.page-intro h1 { max-width: 24ch; margin-bottom: .23em; font-size: clamp(2.3rem, 5vw, 4.1rem); }
.page-intro .lead { color: var(--muted); margin-bottom: 0; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr); align-items: start; gap: clamp(1.4rem, 5vw, 4.6rem); margin-block: 2rem 4rem; }
.reading { overflow-wrap: break-word; }
.reading h2 { margin: 1.6em 0 .45em; font-size: clamp(1.43rem, 2.8vw, 2rem); }
.reading h2:first-child { margin-top: 0; }
.reading table { margin-block: 1.2rem; max-width: 34rem; }
.article { max-width: 710px; margin-block: 2.2rem 4.5rem; }

.footer { background: var(--deep); color: var(--paper); padding: 2rem 0; border-top: 1px solid #b69257; }
.footer p { margin: .4rem 0 0; color: #c9d7ca; font-size: .85rem; }

@media (max-width: 870px) {
  .wrap { width: calc(100% - 48px); }
  .hero-grid { padding-bottom: 5.15rem; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-links, .guide-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { flex-wrap: wrap; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .mast-inner { flex-direction: column; align-items: stretch; gap: .2rem; padding-top: .8rem; }
  .mast-inner nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .35rem; }
  .mast-inner nav a { font-size: clamp(.69rem, 2.55vw, .82rem); line-height: 1.2; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); column-gap: .22rem; padding-block: 1.7rem 2.9rem; }
  .hero .eyebrow { font-size: .58rem; gap: .4rem; letter-spacing: .115em; }
  .hero .eyebrow::before { width: .78rem; }
  .hero h1 { font-size: clamp(2.15rem, 8.8vw, 3.6rem); }
  .hero-detail { grid-column: 1 / -1; padding-top: .42rem; }
  .hero .lead { max-width: 29rem; font-size: .94rem; margin-bottom: 0; }
  .hero-action { font-size: .83rem; }
  .hero-art { grid-row: 1; margin: -.3rem 0 -.15rem; }
  .hero-art-preview img { aspect-ratio: 1; height: auto; object-fit: cover; }
  .convert-section { margin-top: -26px; }
  .year-panel { grid-template-columns: 1fr; gap: .8rem; }
  .converter-head { gap: .56rem; }
  .converter-head p:not(.today) { font-size: .88rem; }
  .today { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .02rem .5rem; }
  .today strong { font-size: .87rem; }
  .year-fields { column-gap: .38rem; }
  .year-fields label span { display: block; margin-left: 0; }
  .exchange { width: 25px; }
  .exchange svg { width: 20px; }
  .field-grid, .split, .guide-links, .tool-links { grid-template-columns: 1fr; }
  .tool-layout { margin-block: 1.3rem 3rem; }
  .result { flex-wrap: wrap; }
  .footer-inner { display: grid; gap: .75rem; }
  .footer nav { gap: .25rem .9rem; }
}
