:root {
  --paper: #fcf9f3;
  --surface: #fffdf8;
  --ink: #252725;
  --navy: #263743;
  --muted: #55554f;
  --rust: #8d3c2b;
  --rust-dark: #6f2b20;
  --rule: #d9d1c4;
  --border: #81786c;
  --focus: #5d338c;
  --serif: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  font: 100%/1.55 system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--rust); text-underline-offset: .2em; }
a:hover { color: var(--rust-dark); text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; }
h1, h2, h3 { margin: 0; color: var(--navy); font: normal 2rem/1.12 var(--serif); }
h1 { font-size: clamp(2.65rem, 6vw, 5.4rem); letter-spacing: -.06em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.85rem, 3.6vw, 3.2rem); letter-spacing: -.045em; }
h3 { font-size: clamp(1.26rem, 2.2vw, 1.65rem); letter-spacing: -.028em; }
p { margin: .7em 0 0; }
li + li { margin-top: .5em; }
.wrap { width: min(1200px, calc(100% - 4rem)); margin-inline: auto; }
.skip { position: absolute; top: -7rem; left: 1rem; z-index: 2; padding: .75rem 1rem; background: var(--surface); }
.skip:focus { top: .75rem; }

.site-header { border-top: .24rem solid var(--rust); border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead { min-height: 5.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; color: var(--navy); font: 1.8rem/1 var(--serif); text-decoration: none; }
.wordmark img { width: min(188px, 40vw); height: auto; }
.wordmark img.mark { width: clamp(1.65rem, 5vw, 2.3rem); flex: none; }
.languages { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; font-size: .83rem; }
.languages a, .languages span { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .5rem; }
.languages [aria-current] { color: var(--navy); background: #eee8de; font-weight: 650; border-radius: .3rem; }
.topics { border-top: 1px solid var(--rule); }
.topics ul { display: flex; flex-wrap: wrap; column-gap: clamp(.5rem, 2vw, 1.7rem); margin: 0; padding: .15rem 0; list-style: none; }
.topics li { margin: 0; }
.topics a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .3rem;
  color: var(--ink);
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
}
.topics a:hover, .topics [aria-current] { color: var(--rust); text-decoration: underline; }
.preview-note { color: var(--muted); font-size: .8rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  min-height: min(500px, 55vw);
  margin-block: clamp(1.2rem, 4vw, 3.5rem);
  overflow: hidden;
  border-radius: .85rem;
  background: #f2e4d5;
}
.hero-copy { align-self: center; padding: clamp(1.6rem, 4.5vw, 4.5rem); }
.hero h1 { max-width: 13ch; text-wrap: balance; }
.hero-art { position: relative; display: grid; place-items: stretch; min-width: 0; margin: 0; background: #e5c3aa; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.eyebrow {
  margin: 0 0 .8rem;
  color: var(--rust);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dek { max-width: 43ch; font-size: clamp(1.03rem, 1.7vw, 1.22rem); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: .6rem;
  margin-top: 1.5rem;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .3rem;
  color: #fffdf8;
  background: var(--rust);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: #fffdf8; background: var(--rust-dark); text-decoration: underline; }

.block { margin-block: 2rem 3.5rem; }
.section-head { margin-bottom: 1.25rem; }
.section-head .eyebrow { margin-bottom: .3rem; }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-grid li { min-width: 0; margin: 0; background: #f0e6d9; border-radius: .55rem; }
.topic-grid li:nth-child(3n + 2) { background: #e8ede5; }
.topic-grid li:nth-child(3n + 3) { background: #f3e3dc; }
.tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: start;
  height: 100%;
  min-height: 7.6rem;
  padding: clamp(.85rem, 1.5vw, 1.25rem);
  border: 1px solid transparent;
  border-radius: inherit;
  color: var(--ink);
  text-decoration: none;
}
.tile:hover { border-color: var(--border); color: var(--ink); }
.tile:hover h3 { text-decoration: underline; text-underline-offset: .18em; }
.tile h3 { overflow-wrap: anywhere; }
.tile p { margin-top: .36rem; color: var(--muted); font-size: .87rem; }
.topic-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: var(--rust); background: var(--surface); }
.topic-icon svg { width: 1.25rem; height: 1.25rem; }
.arrow { color: var(--rust); line-height: 1.25; font-weight: 700; }

.page-head { padding-block: clamp(2.3rem, 6vw, 5rem) 1.5rem; }
.page-head h1 { max-width: 18ch; font-size: clamp(2.55rem, 5.2vw, 4.7rem); }
.article-preview .page-head h1 { margin-top: .6rem; }
.article-layout { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr); align-items: start; gap: 2rem; margin-bottom: 3.5rem; }
.article-contents { padding: 1rem; border: 1px solid var(--rule); border-radius: .55rem; background: var(--surface); }
.article-contents ul { margin: 0; padding-inline-start: 1.2rem; }
.article-body { max-width: 67ch; }
.article-body section { margin-top: 2rem; scroll-margin-top: 1rem; }
.article-body h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
.guide-photo { margin: 0 0 1.5rem; }
.article-body section + .guide-photo { margin-top: 2rem; }
.guide-photo img { width: 100%; height: auto; border-radius: .55rem; }
.guide-photo figcaption { margin-top: .5rem; color: var(--muted); font-size: .84rem; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; padding: 0; list-style: none; }
.guide-cards li { margin: 0; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .55rem; }
.guide-cards img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: .75rem; border-radius: .35rem; }
.guide-cards li > a { font: 1.45rem/1.2 var(--serif); color: var(--navy); }
.guide-card-credit { font-size: .78rem; color: var(--muted); }
.article-photo-slot { display: grid; place-items: center; min-height: clamp(9rem, 24vw, 16rem); margin: 0; padding: 1rem; border: 1px dashed var(--border); border-radius: .55rem; color: var(--muted); background: #efe7db; text-align: center; }
.narrow { max-width: 66ch; }
.site-footer { border-top: 1px solid var(--rule); background: #efe7db; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.1rem 2rem; padding-block: 1.8rem; }
.footer-inner p { color: var(--muted); font-size: .85rem; }
.footer-inner img { width: min(150px, 100%); height: auto; }
.gateway { padding-block: clamp(2.5rem, 10vw, 7rem); }
.gateway img { width: min(280px, 100%); height: auto; }
.editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 2rem; }
.editions section { padding: clamp(1rem, 4vw, 2.5rem); border-top: 3px solid var(--rust); border-radius: .3rem; background: #f2e4d5; }
.editions section + section { background: #e8ede5; }

.tool-panel { margin-block: 1.5rem 2.5rem; padding: clamp(1rem, 4vw, 2.5rem); border: 1px solid var(--rule); border-radius: .65rem; background: #e8ede5; }
.tool-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; margin-top: 1rem; }
.tool-form[hidden] { display: none; }
.tool-form .unit-field, .tool-form .result { grid-column: 1 / -1; }
.tool-form .unit-field { max-width: 15rem; }
.tool-form label { display: block; font-weight: 650; }
.tool-form input, .tool-form select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: .28rem;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: .3rem;
  color: var(--ink);
  background: var(--surface);
}
.tool-form .button { justify-self: start; margin-top: 0; }
.result { padding-block: .7rem; color: var(--navy); font-weight: 700; }

@media (max-width: 860px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  .article-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .wrap { width: calc(100% - 2rem); }
  .masthead { min-height: 4.4rem; }
  .topics ul { column-gap: .45rem; }
  .topics a { padding-inline: .22rem; font-size: .81rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { aspect-ratio: 2 / 1; }
  .hero h1 { max-width: 15ch; }
}

@media (max-width: 490px) {
  .topic-grid, .editions, .tool-form { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
}

@media (forced-colors: active) {
  .button, .tile, .topic-icon { border: 1px solid ButtonText; }
  .topics a, .tile, .wordmark { text-decoration: underline; }
}
