:root {
  --paper: #f3efe6;
  --paper-deep: #e8e0d0;
  --ink: #122334;
  --ink-soft: #42505a;
  --teal: #2f6f73;
  --teal-dark: #1f5559;
  --rust: #b85c38;
  --gold: #c6a15b;
  --rule: rgba(18, 35, 52, 0.22);
  --white: #fffdfa;
  --max-width: 1240px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(198, 161, 91, 0.09), transparent 26rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--rule);
  background: rgba(243, 239, 230, 0.94);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.1vw, 2rem);
  font-size: 0.83rem;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--teal-dark);
}

.github-link {
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}

main,
footer {
  width: min(calc(100% - 8vw), var(--max-width));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.72fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  min-height: min(800px, calc(100vh - 76px));
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.eyebrow,
.section-number,
.scorecard-label {
  margin: 0 0 1rem;
  color: var(--rust);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 850px;
  margin-bottom: 1.7rem;
  font-size: clamp(3.6rem, 7.6vw, 7.5rem);
}

h2 {
  margin-bottom: 1.35rem;
  font-size: clamp(2.5rem, 4.8vw, 4.6rem);
}

h3 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.lede {
  max-width: 720px;
  margin-bottom: 2.2rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--white);
  background: var(--ink);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--teal-dark);
}

.button-secondary {
  background: transparent;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  color: var(--white);
  background: var(--ink);
}

.scorecard {
  position: relative;
  min-height: 410px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 1px solid var(--ink);
  background: rgba(255, 253, 250, 0.52);
}

.scorecard::before,
.scorecard::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.scorecard::before {
  inset: 8px;
  border: 1px solid rgba(18, 35, 52, 0.13);
}

.scorecard::after {
  top: 0;
  left: 35%;
  width: 1px;
  height: 100%;
  background: rgba(18, 35, 52, 0.12);
}

.scorecard-label {
  position: relative;
  z-index: 1;
  color: var(--teal-dark);
}

.scorecard-grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.45rem;
}

.scorecard-grid > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
}

.scorecard-grid strong {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  font-weight: 500;
  line-height: 1;
}

.scorecard-grid span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mini-chart {
  position: relative;
  z-index: 2;
  height: 90px;
  margin-top: 1.75rem;
  border-bottom: 1px solid var(--ink);
}

.mini-chart::after {
  position: absolute;
  right: 2%;
  bottom: 14%;
  width: 90%;
  height: 1px;
  background: var(--teal);
  content: "";
  transform: rotate(-27deg);
  transform-origin: right center;
}

.mini-chart i {
  position: absolute;
  z-index: 2;
  left: var(--x);
  bottom: var(--y);
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--rust);
}

.section-rule {
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr);
  gap: clamp(2rem, 8vw, 8rem);
  padding: clamp(5rem, 9vw, 8rem) 0;
  border-top: 1px solid var(--rule);
}

.opening > div {
  max-width: 900px;
}

.opening p:not(.section-number) {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  line-height: 1.65;
}

.opening strong {
  color: var(--ink);
}

.workflow-section,
.figures-section {
  padding: clamp(5rem, 9vw, 8rem) 0;
}

.workflow-section {
  border-top: 1px solid var(--rule);
}

.section-heading {
  max-width: 820px;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-heading > p:not(.eyebrow) {
  max-width: 700px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.section-heading.compact {
  margin-bottom: 2.25rem;
}

.framework-principles {
  max-width: 900px;
  margin: 0;
  padding-left: 1.4rem;
}

.framework-principles li {
  padding: 0 0 1.5rem 0.45rem;
}

.framework-principles li::marker {
  color: var(--rust);
  font-size: 1.2em;
}

.framework-principles h3 {
  margin-bottom: 0.45rem;
  font-size: 1.25rem;
}

.framework-principles p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.workflow li {
  min-height: 280px;
  padding: 1.5rem;
  border-right: 1px solid var(--rule);
}

.workflow li:last-child {
  border-right: 0;
}

.workflow li > span {
  display: block;
  margin-bottom: 3.5rem;
  color: var(--rust);
  font-family: var(--serif);
  font-size: 1.3rem;
}

.workflow h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.workflow p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.measure-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.measure-card {
  display: grid;
  grid-template-columns: 0.52fr 1fr;
  gap: 1.5rem;
  align-items: start;
  min-height: 310px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--ink);
}

.score-card {
  background: var(--ink);
  color: var(--white);
}

.n-card {
  background: var(--paper-deep);
}

.measure-symbol {
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 0.95;
}

.n-card .measure-symbol {
  color: var(--rust);
}

.measure-card h3 {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.measure-card p {
  margin: 0;
  color: inherit;
  opacity: 0.82;
}

.figures-section {
  border-top: 1px solid var(--rule);
}

.figure-stack {
  display: grid;
  gap: clamp(4rem, 8vw, 7rem);
}

figure {
  margin: 0;
}

figure > a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--white);
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 300ms ease;
}

figure > a:hover img,
figure > a:focus-visible img {
  transform: scale(1.008);
}

figcaption {
  display: grid;
  grid-template-columns: 100px minmax(0, 780px);
  gap: clamp(1rem, 4vw, 4rem);
  padding-top: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

figcaption > span {
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

figcaption strong {
  color: var(--ink);
}

.closing {
  max-width: 940px;
  margin: clamp(5rem, 10vw, 10rem) auto;
  padding: clamp(2.25rem, 6vw, 5rem);
  color: var(--white);
  background: var(--teal-dark);
  text-align: center;
}

.closing .eyebrow {
  color: #e8c783;
}

.closing h2 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.closing p:not(.eyebrow) {
  max-width: 700px;
  margin: 0 auto 2rem;
  color: rgba(255, 255, 255, 0.78);
}

.closing .button {
  color: var(--ink);
  border-color: var(--white);
  background: var(--white);
}

.closing .button:hover,
.closing .button:focus-visible {
  color: var(--white);
  background: transparent;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

footer a {
  font-weight: 700;
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  color: var(--teal-dark);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .site-header {
    position: static;
    align-items: flex-start;
    gap: 1rem;
    padding-block: 1rem;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  nav a:not(.github-link) {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .scorecard {
    min-height: auto;
  }

  .measure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  main,
  footer {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .site-header {
    padding-inline: 1rem;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .github-link {
    padding-left: 0;
    border-left: 0;
  }

  .hero {
    gap: 2.5rem;
    padding: 4.5rem 0;
  }

  h1 {
    font-size: clamp(3.1rem, 15vw, 5rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-rule {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .section-number {
    margin-bottom: 0;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .workflow li,
  .workflow li:nth-child(2) {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .workflow li:last-child {
    border-bottom: 0;
  }

  .workflow li > span {
    margin-bottom: 1.5rem;
  }

  .measure-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  figcaption {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
