/* =============================================================
   home.css — homepage layout only (index.html).
   Mobile-first: the base rules are the phone layout; each
   min-width query adds columns. Tokens come from styles.css.
   ============================================================= */

.home {
  --gutter: clamp(1.1rem, 0.5rem + 3vw, 2.5rem);
  --gap: clamp(1rem, 0.6rem + 1.8vw, 2rem);
}

/* One wrapper per band: the section itself is the container. */
.home > section, .home > figure {
  padding-block: var(--space-section);
  padding-inline: max(var(--gutter), (100% - var(--maxw)) / 2 + var(--gutter));
  display: grid;
  gap: var(--gap);
}
.home h2 { font-size: var(--step-3); max-width: 22ch; }
.home .lede { max-width: 52ch; }

/* -------- Hero: copy, then the prism; 60/40 from tablet up -------- */
.home .home-hero {
  padding-block: clamp(2.2rem, 1rem + 6vw, 6.5rem) clamp(3rem, 2rem + 5vw, 6rem);
  align-items: center;
}
.home-hero h1 { font-size: var(--step-5); max-width: 16ch; }
.home-hero .hero-sub { max-width: 46ch; }
.home-hero .actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.6rem;
  margin-top: 1.8rem;
}
.home-hero .actions a:not(.btn) { font-weight: 600; }
.home-hero .hero-visual { width: min(55vw, 220px); justify-self: center; overflow: visible; }

/* -------- Start here: the card draw (widget styles in start-here.css) -------- */
.home .home-start { background: var(--paper-2); scroll-margin-top: 4.5rem; }
.home-start h2 { max-width: 24ch; }
.home-start .note { font-size: var(--step--1); color: var(--ink-2); margin-top: .8rem; }
.home-start header > * + * { margin-top: .8rem; }

/* -------- Design rule: a wide quote with its source to one side -------- */
.home .home-rule {
  background: var(--ink);
  padding-block: clamp(2.6rem, 2rem + 3vw, 4.5rem);
}
.home-rule blockquote {
  font-family: var(--font-display); font-size: var(--step-3); line-height: 1.15;
  color: var(--paper); max-width: 22ch;
}
.home-rule figcaption {
  font-size: var(--step--1); color: rgba(251,246,236,.72);
  border-top: 1px solid rgba(251,246,236,.22); padding-top: .8rem; max-width: 28ch;
}

/* -------- The six steps: a ruled ordered list -------- */
.home-steps ol {
  list-style: none; padding: 0; counter-reset: step;
  display: grid; border-top: 1px solid var(--line);
}
.home-steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 1rem;
  padding-block: 1rem; border-bottom: 1px solid var(--line);
}
.home-steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; color: #fff;
  background: var(--sc);
}
.home-steps li:nth-child(1) { --sc: var(--c-red); }
.home-steps li:nth-child(2) { --sc: var(--c-orange); }
.home-steps li:nth-child(3) { --sc: var(--c-yellow); }
.home-steps li:nth-child(4) { --sc: var(--c-green); }
.home-steps li:nth-child(5) { --sc: var(--c-blue); }
.home-steps li:nth-child(6) { --sc: var(--c-violet); }
.home-steps li:nth-child(2)::before,
.home-steps li:nth-child(3)::before,
.home-steps li:nth-child(4)::before { color: #1B1B19; }
.home-steps h3 { font-size: var(--step-1); }
.home-steps li p { color: var(--ink-2); font-size: var(--step--1); max-width: 48ch; }

/* -------- Impact Units: heading + aside, then an uneven bento -------- */
.home .home-units { background: var(--paper-2); }
.home-units aside {
  font-size: var(--step--1); color: var(--ink-2);
  border-left: 3px solid var(--saffron); padding-left: 1rem; max-width: 40ch;
}
.home-units .bento { display: grid; gap: var(--gap); }
.home-units .unit {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 1rem + 1vw, 1.9rem);
  display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; align-content: start;
}
.home-units .unit .glyph { grid-row: span 3; margin: 0; }
.home-units .unit h3 { font-size: var(--step-2); }
.home-units .unit p { color: var(--ink-2); max-width: 40ch; }
.home-units .unit .tag { grid-column: 2; }

/* -------- Programs: one lead, two smaller beside it -------- */
.home-programs .programs { display: grid; gap: var(--gap); }
.home-programs .card { gap: .5rem; }
.home-programs .card h3 { font-size: var(--step-1); }
.home-programs .card .status { order: 1; align-self: start; }
.home-programs .lead h3 { font-size: var(--step-3); }
.home-programs .lead p { font-size: var(--step-1); max-width: 34ch; }
.home-programs .card .link-arrow { order: 2; margin-top: auto; padding-top: .6rem; }

/* -------- Principles: ruled rows, name beside its reason -------- */
.home .home-principles { background: var(--paper-2); }
.home-principles dl { display: grid; border-top: 1px solid var(--line); }
.home-principles .row {
  display: grid; gap: .4rem; padding-block: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.home-principles dt { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: var(--ink); line-height: 1.15; }
.home-principles dd { margin: 0; max-width: 60ch; }

/* -------- Sita Tai: narrow argument, wide question -------- */
.home .home-test { background: var(--ink); color: rgba(251,246,236,.8); }
.home-test h2 { color: var(--paper); }
.home-test .lede { color: rgba(251,246,236,.85); }
.home-test .note { color: rgba(251,246,236,.72); font-size: var(--step--1); max-width: 46ch; }
.home-test a { color: #fff; }

/* -------- Closing: big statement, text and buttons beside it -------- */
.home-close h2 { font-size: var(--step-4); max-width: 16ch; }
.home-close .btn-row { margin-top: 1.4rem; }

/* =================== 48rem: tablet and up =================== */
@media (min-width: 48rem) {
  .home .home-hero { grid-template-columns: 3fr 2fr; }
  .home-hero .hero-visual { width: 100%; max-width: 340px; }

  .home .home-rule { grid-template-columns: 3fr 1fr; align-items: end; }

  .home-units .bento { grid-template-columns: repeat(12, 1fr); }
  .home-units .unit:nth-child(1) { grid-column: span 7; }
  .home-units .unit:nth-child(2) { grid-column: span 5; }
  .home-units .unit:nth-child(3) { grid-column: span 5; }
  .home-units .unit:nth-child(4) { grid-column: span 7; }

  .home-programs .programs { grid-template-columns: 1fr 1fr; }
  .home-programs .lead { grid-column: 1 / -1; }

  .home-principles .row { grid-template-columns: minmax(12rem, 1fr) 2fr; gap: var(--gap); align-items: baseline; }

  .home .home-test { grid-template-columns: 2fr 3fr; align-items: center; }
}

/* =================== 64rem: desktop =================== */
@media (min-width: 64rem) {
  /* Steps: heading column on the left stays put while the list scrolls. */
  .home .home-steps { grid-template-columns: 2fr 3fr; align-items: start; column-gap: clamp(2rem, 4vw, 5rem); }
  .home-steps header { position: sticky; top: 6rem; }
  .home-steps ol { grid-row: span 2; }
  .home-steps ol { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }

  .home .home-units { grid-template-columns: 7fr 5fr; align-items: baseline; }
  .home-units .bento { grid-column: 1 / -1; }

  .home .home-close { grid-template-columns: 7fr 5fr; align-items: baseline; }

  /* Programs: heading beside the lead card, the two smaller ones below at 5:7. */
  .home .home-programs { grid-template-columns: 5fr 7fr; align-items: end; }
  .home-programs .programs { display: contents; }
  .home-programs .lead { grid-column: 2; grid-row: 1; }
  .home-programs .card:not(.lead) { align-self: stretch; }
}
