/* Home layout: no site header (the hero already carries the name), an introduction over the original motif,
   then the most recent article featured on the same left edge as every other page. */
.home-top {
  position: absolute; z-index: 3; top: calc(0.75rem + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
}
.home-top .theme-switch { margin: 0; }
main { position: relative; }
main > .shell { position: relative; z-index: 1; }

/* Port of the original .bg-blocks at its original size (20vmin squares): four squares rotated 45°,
   on a grid of the square's side (s) and diagonal (d). It sits behind the page and runs past the hero, as on the old home page. */
.bg-blocks {
  --s: max(3.75rem, 20vmin); --d: calc(var(--s) * 1.41421);
  position: absolute; top: 0; right: 0; width: calc(var(--d) * 3); height: calc(var(--d) * 3);
  overflow: hidden; z-index: 0; pointer-events: none; isolation: isolate;
}
.bg-blocks__block {
  position: absolute; top: 0; left: 0; width: var(--s); height: var(--s);
  margin-top: calc(var(--s) * 0.5); margin-left: var(--d);
  background: var(--motif-yellow); mix-blend-mode: multiply; transform: rotate(-45deg);
  animation: 0.8s ease-out -0.15s backwards;
}
.bg-blocks__block.--alt { background: var(--motif-teal); }
.bg-blocks__block.--thin { width: calc(var(--s) / 2); height: calc(var(--s) * 3); top: calc(var(--s) * -1.5); margin-left: calc(var(--s) * 1.52); }
.bg-blocks__block.--b3 { left: var(--d); }
.bg-blocks__block.--b4 { left: calc(var(--d) * 0.5); top: calc(var(--s) * -1.5); }
.bg-blocks__block.--slide-top { animation-name: slide-top; }
.bg-blocks__block.--slide-bottom { animation-name: slide-bottom; }
.bg-blocks__block.--slide-bottom-fast { animation-name: slide-bottom-fast; }
@keyframes slide-top { from { transform: translate(calc(var(--s) * -3.5), calc(var(--s) * -3.5)) rotate(-45deg); } }
@keyframes slide-bottom { from { transform: translate(calc(var(--s) * 3.5), calc(var(--s) * 3.5)) rotate(-45deg); } }
@keyframes slide-bottom-fast { from { transform: translate(calc(var(--s) * 7.5), calc(var(--s) * 7.5)) rotate(-45deg); } }
@media (prefers-reduced-motion: reduce) { .bg-blocks__block { animation: none; } }

/* Same two-column system as the article page (.layout in article.html): one column at var(--measure) behind
   the shared indent, and from 1120px a 13rem left margin column, which holds the table of contents there and the portrait here. */
.hero, .featured {
  display: grid; grid-template-columns: minmax(0, var(--measure)); align-items: start;
  padding-left: var(--indent);
}
.hero { row-gap: 0.8rem; padding-block: clamp(3rem, 7vw, 4.5rem) clamp(1.25rem, 3vw, 2rem); }
.hero .photo { width: clamp(5rem, 8vw, 6rem); aspect-ratio: 1; border-radius: 50%; object-fit: cover; margin-bottom: 0.2rem; }
@media (min-width: 1120px) {
  .hero, .featured { grid-template-columns: 13rem minmax(0, var(--measure)); column-gap: clamp(3rem, 5vw, 4.5rem); padding-left: 0; }
  .hero > *, .featured > * { grid-column: 2; }
  .hero .photo { grid-column: 1; grid-row: 1 / span 5; justify-self: end; width: 11rem; margin: 0; }
}
.hero .name { font-family: var(--f-display); font-size: 1.125rem; font-weight: 400; line-height: 1.3; color: var(--ink-2); margin-bottom: -0.45rem; }
.hero h1 { max-width: 14em; }
.hero h1 { font-size: clamp(1.875rem, 3.4vw, 2.625rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; }
.hero p { font-size: 1.0625rem; line-height: 1.6; max-width: 32rem; } /* stops short of the motif, which light text cannot sit on in dark mode */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem; margin-top: 0.4rem; font-family: var(--f-display); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.65rem 1rem;
  background: #2B6D78; color: #FFFFFF; text-decoration: none; font-size: 1rem; font-weight: 500;
}
.btn-primary:hover { background: #1D4F57; color: #FFFFFF; text-decoration: none; }
.btn-primary svg { width: 1rem; height: 1rem; flex: none; }
.btn-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-size: 1rem; }
.btn-link:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.btn-link svg { width: 1.2rem; height: 1.2rem; flex: none; }

/* Featured: the most recent article, with its standfirst and opening paragraph. */
.featured { row-gap: 0.9rem; padding-block: clamp(1.5rem, 4vw, 2.5rem) 5rem; }
.featured .label { font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.featured h2 { font-size: var(--t-lg); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }
.featured .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-family: var(--f-display); font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.featured .meta .dot { width: 0.3em; height: 0.3em; background: var(--ink-2); transform: rotate(45deg); }
.featured .standfirst { font-size: 1.1875rem; }
.featured .excerpt { text-wrap: pretty; hyphens: auto; }
.featured .read { font-family: var(--f-display); font-size: 1rem; font-weight: 500; justify-self: start; }
.more {
  display: inline-flex; align-items: center; gap: 0.55rem; justify-self: start; margin-top: 1.75rem; padding: 0.6rem 1rem;
  border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-family: var(--f-display); font-size: 1rem; font-weight: 500;
}
.more:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.more svg { width: 1rem; height: 1rem; flex: none; }

@media (max-width: 760px) {
  .actions .long { display: none; }
  .actions { gap: 0.75rem 1.25rem; }
  .actions .btn-primary { flex-basis: 100%; justify-content: center; }
  /* Phones: the motif keeps the top-right corner to itself instead of running under the text. */
  .bg-blocks { --s: 3.25rem; }
  .hero { padding-top: 6.25rem; }
}
