/* ==========================================================================
   layout.css — the page skeleton.
   Owns: the page shell, section vertical rhythm, and every grid.
   This file is the ONLY place section padding is declared. components.css
   styles what sits inside a section and never touches section padding, so
   the two files cannot cancel each other out.
   ========================================================================== */

/* --- Shell ------------------------------------------------------------ */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Section rhythm ---------------------------------------------------
   Base padding, then one modifier per section that needs a different beat.
   Modifiers are more specific than .section by class count, so ordering
   here is not load-bearing.
   -------------------------------------------------------------------- */

.section {
  padding-block: clamp(4.5rem, 9vw, 9.5rem);
}

.section--hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 7rem);
  min-height: min(86svh, 920px);
  display: flex;
  align-items: center;
}

.section--ledger {
  padding-block: 0;
}

.section--about {
  padding-block: clamp(4.5rem, 9vw, 9.5rem);
  background: var(--lemon-wash);
}

.section--index {
  padding-block: clamp(4.5rem, 9vw, 9.5rem) clamp(4.5rem, 9vw, 8rem);
}

.section--contact {
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
  background: var(--lemon);
  color: var(--ink);
}

/* --- Hero ------------------------------------------------------------- */

/* The headline runs the full measure — it is the thesis of the page — and the
   lead and portrait share the row beneath it. On wide screens the portrait
   climbs into the space left by the two short closing lines. */

.hero__foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  margin-block-start: clamp(2rem, 3.5vw, 3rem);
}

.hero__intro {
  min-width: 0;
}

@media (min-width: 900px) {
  .hero__foot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.44fr);
    column-gap: clamp(2rem, 4vw, 4.5rem);
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .hero__foot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.4fr);
  }

  /* The portrait alone climbs into the space the two short closing lines
     leave open. Every headline line ends well left of this column, so it
     rises without touching the type — and the lead below stays put. */
  .hero__foot > .portrait {
    margin-block-start: calc(-1 * clamp(4rem, 9vw, 10rem));
  }
}

/* --- Reach ledger ----------------------------------------------------- */

.ledger {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0;
  /* One continuous band, top and bottom. Cells are separated by the column
     gap rather than by vertical rules — the brief asks for white space. */
  border-block: 1px solid var(--rule);
}

@media (min-width: 620px) {
  .ledger {
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
  }
}

@media (min-width: 1024px) {
  .ledger {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Pillars ---------------------------------------------------------- */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 4vw, 3rem);
}

@media (min-width: 620px) {
  .pillars {
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
  }
}

@media (min-width: 1024px) {
  .pillars {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- About ------------------------------------------------------------ */

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 1024px) {
  .about {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    column-gap: clamp(3rem, 7vw, 8rem);
  }
}

/* --- Selected work ---------------------------------------------------
   Asymmetric on wide screens: a 12-column field with deliberate holes
   and staggered tops, so the eye travels instead of scanning a table.
   -------------------------------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 7vw, 5.5rem);
}

@media (min-width: 620px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    row-gap: clamp(3rem, 6vw, 5rem);
  }
}

@media (min-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(12, 1fr);
    column-gap: clamp(1.25rem, 2.4vw, 2.5rem);
    row-gap: clamp(3.5rem, 7vw, 7.5rem);
  }

  .work:nth-child(1) {
    grid-column: 1 / 7;
    grid-row: 1;
  }

  .work:nth-child(2) {
    grid-column: 8 / 13;
    grid-row: 1;
    margin-block-start: clamp(2rem, 6vw, 6.5rem);
  }

  .work:nth-child(3) {
    grid-column: 1 / 5;
    grid-row: 2;
  }

  .work:nth-child(4) {
    grid-column: 5 / 9;
    grid-row: 2;
    margin-block-start: clamp(1.5rem, 4vw, 4rem);
  }

  .work:nth-child(5) {
    grid-column: 9 / 13;
    grid-row: 2;
  }

  .work:nth-child(6) {
    grid-column: 2 / 7;
    grid-row: 3;
  }

  .work:nth-child(7) {
    grid-column: 8 / 13;
    grid-row: 3;
    margin-block-start: clamp(2rem, 5vw, 5rem);
  }
}

/* --- Contact ---------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: start;
}

@media (min-width: 1024px) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
    column-gap: clamp(3rem, 7vw, 8rem);
  }
}

/* --- Footer ----------------------------------------------------------- */

.footer {
  padding-block: clamp(2.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  align-items: baseline;
}

@media (min-width: 780px) {
  .footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: clamp(1.5rem, 4vw, 4rem);
  }
}
