:root {
  --ink: #20272b;
  --muted: #5e6a6f;
  --line: #d9dfda;
  --paper: #f7f8f5;
  --green: #477d63;
  --gold: #d9c27b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.trade-site-header {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1120px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
}

.trade-site-header img {
  display: block;
  width: 210px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #17212b;
}

.trade-site-header nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.trade-site-header nav a {
  color: #536066;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid #27383f;
  border-radius: 6px;
  background: #27383f;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border-color: #afbbb4;
  background: #fff;
  color: #27383f;
}

.trade-main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.trade-hero {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 520px;
  overflow: hidden;
  padding: 54px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 39, 43, .9), rgba(31, 39, 43, .55) 58%, rgba(31, 39, 43, .12)),
    image-set(url("assets/frontpage-hero.webp") type("image/webp"), url("assets/frontpage-hero.png") type("image/png")) center / cover;
  color: #fff;
}

.trade-hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 9px;
  color: #ead68e;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.trade-hero h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.08;
}

.trade-hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 0 0 24px;
  color: #e8eeeb;
  font-size: 19px;
}

.trade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trade-actions .button:first-child {
  border-color: var(--gold);
  background: var(--gold);
  color: #20272b;
}

.trade-actions .secondary {
  border-color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.trade-intro,
.trade-workflow,
.trade-links {
  padding: 58px 0;
}

.trade-intro h2,
.trade-workflow h2,
.trade-links h2,
.trade-cta h2 {
  max-width: 760px;
  margin: 0 0 13px;
  font-size: clamp(27px, 3.5vw, 40px);
  line-height: 1.18;
}

.section-copy {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.benefit-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.benefit-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.benefit-grid p {
  margin: 0;
  color: var(--muted);
}

.trade-workflow {
  border-block: 1px solid var(--line);
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: workflow;
}

.workflow-list li {
  position: relative;
  padding-top: 46px;
  counter-increment: workflow;
}

.workflow-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #27383f;
  color: var(--gold);
  content: counter(workflow);
  font-size: 13px;
  font-weight: 850;
}

.workflow-list strong {
  display: block;
  margin-bottom: 5px;
}

.workflow-list span {
  color: var(--muted);
  font-size: 14px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.related-links a {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #3e4b50;
  font-weight: 700;
  text-decoration: none;
}

.trade-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  margin-bottom: 48px;
  padding: 34px;
  border-radius: 8px;
  background: #20272b;
  color: #fff;
}

.trade-cta p {
  max-width: 680px;
  margin: 0;
  color: #d4ddda;
}

.trade-site-footer {
  padding: 26px 16px 38px;
  border-top: 1px solid var(--line);
  color: #6a7579;
  font-size: 13px;
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #4a565b;
  border-radius: 50%;
  background: #20272b;
  color: #f0dda0;
  box-shadow: 0 10px 26px rgba(31, 41, 55, .2);
  font: inherit;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}

.back-to-top:hover {
  background: #344046;
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(217, 194, 123, .55);
  outline-offset: 3px;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top span {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 800px) {
  .trade-site-header {
    min-height: 64px;
  }

  .trade-site-header img {
    width: 180px;
  }

  .trade-site-header nav a:not(.button) {
    display: none;
  }

  .trade-hero {
    min-height: 470px;
    padding: 30px 22px;
  }

  .trade-hero h1 {
    font-size: 39px;
  }

  .trade-hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .benefit-grid,
  .workflow-list,
  .trade-cta {
    grid-template-columns: 1fr;
  }

  .trade-intro,
  .trade-workflow,
  .trade-links {
    padding: 42px 0;
  }

  .trade-cta {
    gap: 22px;
    padding: 26px 22px;
  }

  .trade-cta .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .trade-site-header {
    width: calc(100% - 20px);
  }

  .trade-site-header img {
    width: 150px;
  }

  .trade-site-header .button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .trade-main {
    width: calc(100% - 20px);
  }

  .trade-hero h1 {
    font-size: 34px;
  }
}
