/* The home page. Loaded only there, after site.css.
 *
 * The page opens and closes on a deep spruce band with a gold edge. Between
 * them the grounds alternate: white, wash, paper, white, paper, white, paper.
 * Gold is used for one phrase in the headline, the band edges, and lead rules.
 */

/* ---------------------------------------------------------------- rhythm --- */
main > .band:not(:first-child):not(.band--spruce) {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* ------------------------------------------------------------------ hero --- */
/* The hero is the home header band, with more room than the other pages. */
main > .band.band--hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero__copy > .eyebrow + .display {
  margin-top: 0.75rem;
}

.nowrap {
  white-space: nowrap;
}

/* Same face and style as the rest of the headline. Only the color changes. */
.hero .display .accent {
  color: var(--gold);
}

.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero__actions .btn {
  padding: 1.0625rem 2.125rem;
  font-size: 0.9375rem;
}

.band--hero .btn--primary {
  background: var(--paper);
  color: var(--band-deep);
}

.band--hero .btn--primary:hover:not(:disabled) {
  background: var(--white);
}

/* The portrait is a cutout, so the spruce ground shows behind it. */
.hero__portrait-frame {
  width: min(100%, 16rem);
  aspect-ratio: 9 / 10;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  line-height: 0;
}

.hero__portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: translateY(-1.25rem) scale(1.08);
  transform-origin: center top;
}

/* ------------------------------------------------- claim and practice areas --- */
.claim {
  max-width: none;
  font-size: clamp(1.5rem, 0.75rem + 2.4vw, 2.375rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink-950);
  text-wrap: pretty;
}

.claim em {
  font-style: italic;
  color: var(--spruce);
}

.practice-heading {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

/* Parallel practice areas, separated by rules rather than numbers. */
.practice-grid {
  margin-top: var(--label-gap);
  display: grid;
  gap: 2.5rem 2rem;
  list-style: none;
}

.practice-grid > li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink-300);
}

.practice-grid h3 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.25;
}

.practice-grid p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-700);
}

/* ------------------------------------------------------------ the demo --- */
/* One centered column: label, title, then a large sphere. The band is short,
   so it takes less room above and below than the other bands. */
main > .band.home-golf {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  background: var(--wash);
}

.home-golf__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
}

.home-golf__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 0.5rem + 2.8vw, 2.375rem);
  font-weight: 400;
  line-height: 1.2;
}

/* The padding gives the link a 44px target on a phone. */
.home-golf__title a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
}

.home-golf__title a:hover {
  color: var(--spruce);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* The sphere that takes a random path. home-sphere.js draws it. */
.home-golf__sphere {
  margin: 0.5rem 0 0;
  width: min(20rem, 100%);
}

.home-golf__sphere canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.home-golf__sphere figcaption {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-500);
}

.home-golf__sphere-gates {
  display: block;
  min-height: 1.5em;
  font-family: var(--font-mono);
  color: var(--ink-700);
}

.home-golf__pause {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--spruce);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* -------------------------------------------------------- featured work --- */
.featured-work__list {
  margin-top: var(--label-gap);
  display: grid;
  gap: 2.5rem;
}

.featured-work__item {
  padding-top: 1.25rem;
  border-top: 2px solid var(--gold);
}

.featured-work__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-500);
}

.featured-work__item h3 {
  margin-top: 0.625rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 0.5rem + 2.8vw, 2.375rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.featured-work__item h3 a {
  text-decoration: none;
}

.featured-work__item h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.featured-work__item > p:not(.featured-work__meta) {
  margin-top: 0.875rem;
  margin-bottom: 1rem;
  color: var(--ink-700);
  line-height: 1.7;
}

.featured-work__item > .textlink {
  display: inline-block;
}

/* --------------------------------------------------------------- writing --- */
.home-writing .writinglist > li:last-child {
  border-bottom: 0;
}

/* ----------------------------------------------------------- beyond work --- */
.eagle-project {
  margin-top: var(--label-gap);
  display: grid;
  gap: 1.5rem;
}

.eagle-project img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
}

.eagle-project__main {
  order: 1;
}

.eagle-project figcaption {
  order: 2;
  display: grid;
  gap: 0.75rem 2rem;
}

.eagle-project__plaque {
  order: 3;
}

.eagle-project figcaption > p:last-child {
  max-width: 58ch;
  color: var(--ink-700);
  line-height: 1.75;
}

.outside-work {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ink-200);
  display: grid;
  gap: 1.5rem;
}

.outside-work img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
}

.outside-work__copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 34rem;
}

.outside-work__copy > p:not(.eyebrow) {
  color: var(--ink-700);
  line-height: 1.75;
}

.outside-work__copy > p.outside-work__caption {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-500);
}

.outside-work__question {
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- motion --- */
/* Sections slide up as they enter the viewport, where the browser supports
   it. The animation moves only, so a section is never invisible. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes slide {
    from {
      transform: translateY(1.5rem);
    }
  }

  @supports (animation-timeline: view()) {
    main > .band:not(:first-child) > .band__inner > *,
    .cta > * {
      animation: slide linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
  }
}

/* ------------------------------------------------------------ responsive --- */
@media (min-width: 40em) {
  /* The portrait column stays narrow until the headline has room beside it.
     The portrait starts level with the top of the hero copy. */
  .hero {
    grid-template-columns: minmax(0, 1.6fr) minmax(12rem, 16rem);
    gap: clamp(2.5rem, 5vw, 3.5rem);
  }

  .hero__portrait-frame {
    width: min(100%, 18rem);
    margin: 0 0 0 auto;
    align-self: start;
  }

  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The main photo takes the full width, with the caption and plaque beside each
   other under it. */
@media (min-width: 48em) {
  .eagle-project {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .eagle-project__main {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .eagle-project figcaption {
    grid-column: 1;
    grid-row: 2;
  }

  .eagle-project__plaque {
    grid-column: 2;
    grid-row: 2;
  }

  /* The copy sits on the white half of the film scan, from where that half is
     wide enough to hold it. */
  .outside-work {
    position: relative;
  }

  .outside-work__copy {
    position: absolute;
    inset: 2rem auto 0 5%;
    width: 38%;
    justify-content: center;
    font-size: 0.9375rem;
  }

  .outside-work__copy > p:not(.eyebrow) {
    line-height: 1.6;
  }

  .outside-work__copy > p.outside-work__caption {
    font-size: 0.75rem;
  }
}

@media (min-width: 56.25em) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  }
}

@media (min-width: 64em) {
  /* The caption and plaque share the height of the main photo. */
  .eagle-project {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .eagle-project__main {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .eagle-project figcaption {
    grid-column: 2;
    grid-row: 1;
  }

  .eagle-project__plaque {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .outside-work__copy {
    font-size: 1rem;
  }

  .outside-work__copy > p:not(.eyebrow) {
    line-height: 1.75;
  }

  .outside-work__copy > p.outside-work__caption {
    font-size: 0.8125rem;
  }

  .practice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .featured-work__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
