.ff-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: center;
}

/* Prevent the page-hero and first content section from stacking large paddings. */
.ff-page-hero { padding-bottom: 20px; }
.ff-page-hero + .ff-section { padding-top: 26px; }

.ff-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.ff-text-link {
  color: var(--ink);
  font-weight: 900;
}

.ff-quick {
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 24px;
}

.ff-quick strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.ff-quick a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.ff-formula-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ff-formula-list a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 2px 14px;
  background: #fff;
  border: 2px solid var(--ink);
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}

.ff-formula-list span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.ff-formula-list strong { font-size: 1.05rem; }
.ff-formula-list code { color: var(--muted); white-space: normal; }

.ff-formula-box {
  margin: 26px 0;
  padding: 24px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 var(--gold);
}

.ff-formula-box span {
  display: block;
  color: #d6e0ea;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ff-formula-box code {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  white-space: normal;
}

.ff-definition-grid,
.ff-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ff-definition-grid > div,
.ff-related-grid > a {
  padding: 18px;
  background: #fff;
  border: 2px solid var(--ink);
}

.ff-definition-grid dt { font-weight: 950; }
.ff-definition-grid dd { margin: 6px 0 0; color: var(--muted); }
.ff-related-grid > a { color: var(--ink); font-weight: 900; text-decoration: none; }

.ff-layout--single { grid-template-columns: minmax(0, 1fr); }

.ff-toc {
  margin: 24px 0 34px;
  padding: 22px;
  background: var(--blue);
  border: 2px solid var(--ink);
}

.ff-toc strong {
  display: block;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.ff-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.ff-toc a {
  color: var(--ink);
  font-weight: 850;
  text-underline-offset: 3px;
}

.ff-related-grid { gap: 22px; margin-top: 20px; }
.ff-related-grid > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 20px 22px;
  box-shadow: 4px 4px 0 var(--ink);
}
.ff-related-grid > a::after {
  content: "→";
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.ff-steps {
  counter-reset: ff-step;
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.ff-steps li {
  counter-increment: ff-step;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  background: #fff;
  border: 2px solid var(--ink);
}

.ff-steps li::before {
  content: counter(ff-step);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--gold);
  border: 2px solid var(--ink);
  font-weight: 950;
}

.ff-faq { display: grid; gap: 18px; margin-top: 20px; }
.ff-faq details { background: #fff; border: 2px solid var(--ink); overflow: hidden; }
.ff-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  cursor: pointer;
  font-weight: 950;
  list-style: none;
}
.ff-faq summary::-webkit-details-marker { display: none; }
.ff-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--gold);
  border: 2px solid var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}
.ff-faq details[open] summary::after { content: "−"; }
.ff-faq details p {
  max-width: none;
  margin: 0;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
}

.ff-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 22px 0 34px;
}

.ff-comparison article {
  padding: 24px;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--gold);
}

.ff-comparison h3 { margin-top: 0; }

@media (max-width: 680px) {
  .ff-definition-grid,
  .ff-related-grid,
  .ff-comparison { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .ff-links > a { display: none; }
  .ff-hero-grid, .ff-formula-list { grid-template-columns: 1fr; }
}
