/* Homepage. Built on tokens.css; aligned with the site shell (same 1240px frame as the header).
   One idea per section: who you are, what you can do, what is new, where to start. */

.home {
  --home-wrap: min(1240px, calc(100% - 2 * clamp(16px, 4vw, 48px)));
  --home-line: rgba(23, 26, 24, 0.14);
  --home-line-strong: rgba(23, 26, 24, 0.3);
  --home-wash: rgba(135, 48, 31, 0.06);
  color: var(--ink);
}
.home-wrap { width: var(--home-wrap); margin-inline: auto; }

/* Hero: what the site is, the two main actions, and the audience routes side by side. */
.home-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(44px, 5vw, 72px); }
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.home-intro h1 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(40px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.home-lede {
  max-width: 34em;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.5;
}
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
}
.home-button:hover { color: var(--paper-light); background: var(--ink); }
.home-button.is-primary { color: var(--paper-light); background: var(--terra-interactive); border-color: var(--terra-interactive); }
.home-button.is-primary:hover { background: var(--ink); border-color: var(--ink); }
.home-byline { max-width: 36em; margin: 26px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.home-byline a { color: var(--ink); text-underline-offset: 3px; }

.home-audiences {
  border: 1px solid var(--home-line-strong);
  background: var(--paper-light);
}
.home-audiences h2 {
  margin: 0;
  padding: 20px 22px 14px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.home-audiences ul { margin: 0; padding: 0; list-style: none; }
.home-audiences li { border-top: 1px solid var(--home-line); }
.home-audiences a {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 13px 52px 13px 22px;
  color: var(--ink);
  text-decoration: none;
}
.home-audiences a::after {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.55;
}
.home-audiences a:hover { background: var(--home-wash); }
.home-audiences a:hover strong,
.home-audiences a:hover::after { color: var(--terra-interactive); opacity: 1; }
.home-audiences strong { font-size: 16px; font-weight: 600; line-height: 1.3; }
.home-audiences span { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Sections */
.home-section { padding: clamp(44px, 5vw, 72px) 0; border-top: 1px solid var(--home-line); }
.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(22px, 2.6vw, 32px);
}
.home-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.home-section-head a { color: var(--terra-interactive); font-size: 15px; font-weight: 600; text-underline-offset: 4px; }

/* Tools: the title is the link; the whole card is its target. */
.home-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px 22px 18px;
  border: 1px solid var(--home-line-strong);
  background: var(--paper-light);
}
.home-tool h3 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.home-tool h3 a { color: var(--ink); text-decoration: none; }
.home-tool h3 a::after { position: absolute; inset: 0; content: ""; }
.home-tool:hover { border-color: var(--terra-interactive); }
.home-tool:hover h3 a { color: var(--terra-interactive); }
.home-tool:focus-within { outline: 3px solid var(--terra-interactive); outline-offset: 3px; }
.home-tool h3 a:focus-visible { outline: none; }
.home-tool p { margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.home-tool .home-tool-facts { margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 13px; }

/* Latest reading */
.home-latest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-latest-item { padding-top: 18px; border-top: 2px solid var(--ink); }
.home-latest-date { margin: 0; color: var(--muted); font-size: 13.5px; }
.home-latest-item h3 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.015em;
}
.home-latest-item h3 a { color: var(--ink); text-decoration: none; }
.home-latest-item h3 a:hover { color: var(--terra-interactive); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.home-latest-item p:last-child { margin: 12px 0 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }

/* Where to start: a real sequence, so it is numbered. */
.home-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: home-step;
}
.home-path li { counter-increment: home-step; }
.home-path a {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--home-line-strong);
  color: var(--ink);
  text-decoration: none;
}
.home-path a::before {
  color: var(--terra-interactive);
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  content: counter(home-step);
}
.home-path a:hover { background: var(--home-wash); }
.home-path a:hover strong { color: var(--terra-interactive); }
.home-path strong { font-size: 17px; font-weight: 600; line-height: 1.3; }
.home-path span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

@media (max-width: 1120px) {
  .home-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .home-intro h1 { max-width: 15ch; }
  .home-tools,
  .home-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-latest { grid-template-columns: minmax(0, 1fr); }
  .home-latest-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 24px; }
  .home-latest-date { grid-row: 1 / span 2; padding-top: 4px; }
  .home-latest-item h3 { margin-top: 0; }
}

@media (max-width: 640px) {
  .home-hero { padding-top: 32px; }
  .home-actions { flex-direction: column; }
  .home-button { width: 100%; }
  .home-audiences h2 { padding: 16px 16px 12px; font-size: 22px; }
  .home-audiences a { padding: 12px 44px 12px 16px; }
  .home-audiences a::after { right: 18px; }
  .home-tools,
  .home-path { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .home-tool { padding: 18px 16px 16px; }
  .home-latest-item { display: block; }
  .home-latest-item h3 { margin-top: 8px; font-size: 21px; }
  .home-path a { grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; padding: 14px 4px 16px; }
  .home-path a::before { grid-row: 1 / span 2; font-size: 26px; }
}
