:root,
[data-theme="light"] {
  --hero-image: url('assets/home-hero-notebook.webp');
}

/* Homepage notebook hero */
.hero {
  min-height: 100svh;
  padding: clamp(10rem, 18vh, 14rem) var(--page-edge) 5rem;
}

.hero-bg {
  inset: 0;
  width: auto;
  transform: none;
  background-color: #140d08;
  background-position: center center;
  background-size: contain;
}

.hero-inner {
  max-width: var(--max);
  margin-top: 0;
}

.hero-inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -3rem auto -3rem -4rem;
  width: min(46rem, 50vw);
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 48%, rgba(var(--scrim-rgb), .48), rgba(var(--scrim-rgb), .2) 52%, transparent 76%);
  filter: blur(12px);
}

.hero-tagline {
  max-width: 11ch;
  margin: 0 0 1rem;
  font-size: clamp(3.25rem, 6.4vw, 6.8rem);
  line-height: .96;
  letter-spacing: -.04em;
}

.hero-intro {
  width: min(38rem, 44%);
  max-width: 38rem;
  font-size: clamp(1rem, 1.45vw, 1.22rem);
}

.hero-cta {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

.hero-cta p {
  margin: 0 0 .85rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  font-style: italic;
  line-height: 1.2;
}

.pathway-card:last-of-type {
  border-right: 0;
}

.pathways.section-dark {
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--ink), white 6%) 0, var(--ink) 42%, color-mix(in srgb, var(--ink), black 6%) 100%);
}

@media (min-width: 1051px) {
  .pathway-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 781px) and (max-width: 1050px) {
  .pathway-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pathway-card:nth-of-type(2) {
    border-right: 1px solid var(--hairline);
  }

  .pathway-card:nth-of-type(3) {
    grid-column: auto;
  }
}

/* Roots detail: copy and artwork share the same page-width frame. */
.story-band {
  min-height: clamp(460px, 36vw, 580px);
  display: block;
  background: var(--paper);
}

.story-inner {
  position: relative;
  width: min(var(--max), calc(100% - (2 * var(--page-gutter))));
  min-height: inherit;
  margin: 0 auto;
  overflow: hidden;
}

.story-bg {
  position: absolute;
  inset-block: 0;
  right: 0;
  left: auto;
  width: 62%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.story-copy {
  position: relative;
  width: 38%;
  min-height: inherit;
  max-width: none;
  margin: 0;
  padding: clamp(3.5rem, 6vw, 6rem) 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-copy h2 {
  max-width: 9ch;
}

.story-copy::after {
  display: none;
}

@media (max-width: 1050px) {
  .hero {
    min-height: auto;
  }

  .hero-bg {
    background-color: #140d08;
  }

  .hero-inner::before {
    width: min(42rem, 64vw);
  }

  .hero-intro {
    width: min(36rem, 55%);
  }

  .story-bg {
    width: 58%;
    object-position: right center;
  }

  .story-copy {
    width: 42%;
  }
}

@media (max-width: 780px) {
  .hero {
    min-height: auto;
    padding: 8.5rem var(--page-gutter) 3.5rem;
  }

  .hero-bg {
    background-position: 64% center;
  }

  .hero-inner::before {
    inset: -2rem -1rem -2rem -1rem;
    width: auto;
    background: linear-gradient(90deg, rgba(var(--scrim-rgb), .76), rgba(var(--scrim-rgb), .36) 72%, transparent);
    filter: blur(8px);
  }

  .hero-tagline {
    max-width: 10ch;
    font-size: clamp(2.7rem, 12vw, 4.6rem);
  }

  .hero-intro {
    width: min(34rem, 92%);
  }

  .hero-cta {
    margin-top: 1.5rem;
  }

  .story-band {
    min-height: 0;
  }

  .story-inner {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .story-copy {
    order: 1;
    width: 100%;
    padding: 3rem var(--page-gutter) 2rem;
  }

  .story-bg {
    position: static;
    order: 2;
    width: calc(100% - (2 * var(--page-gutter)));
    height: auto;
    margin: 0 auto;
    object-position: right center;
  }
}


/* Hand-drawn pathway illustrations keep their natural notebook proportions. */
.pathway-card img {
  width: clamp(4.75rem, 6vw, 5.75rem);
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  object-position: left center;
}


/* Framed homepage experiment
   The browser canvas becomes the paper surface; every full-bleed homepage
   section now resolves inside one bounded 1600px sheet. */
body.homepage-framed {
  --sheet-max: 1600px;
  --sheet-margin: clamp(1rem, 2.1vw, 2rem);
  --home-header-clearance: 6.5rem;
  --page-edge: var(--page-gutter);
  --frame-edge: var(--page-gutter);
  background-color: #dcc8a7;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, .22), transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(92, 62, 31, .09), transparent 34%),
    repeating-linear-gradient(0deg, rgba(75, 49, 25, .025) 0 1px, transparent 1px 5px);
  background-attachment: fixed;
}

.homepage-framed .site-sheet {
  position: relative;
  width: min(var(--sheet-max), calc(100% - (2 * var(--sheet-margin))));
  min-height: 100vh;
  margin-inline: auto;
  overflow: clip;
  background: var(--ink);
  border-inline: 1px solid rgba(55, 39, 24, .28);
  box-shadow: 0 0 0 1px rgba(255, 248, 232, .16), 0 18px 56px rgba(44, 28, 14, .22);
}

.homepage-framed .hero {
  background: #140d08;
}

.homepage-framed .site-header {
  right: auto;
  left: 50%;
  width: min(var(--sheet-max), calc(100% - (2 * var(--sheet-margin))));
  transform: translateX(-50%);
}

@media (min-width: 1051px) {
  .homepage-framed .hero {
    /* Let the 1672 × 941 artwork determine the hero's desktop depth. The
       previous 100svh minimum left a dark bar beneath the image on tall
       viewports. */
    min-height: calc(
      var(--home-header-clearance) +
      (min(var(--sheet-max), calc(100vw - (2 * var(--sheet-margin)))) * 941 / 1672)
    );
  }

  .homepage-framed .hero-bg {
    inset: var(--home-header-clearance) 0 0;
    background-position: top center;
    background-size: 100% auto;
  }
}

@media (max-width: 780px) {
  body.homepage-framed {
    --sheet-margin: 0px;
  }

  .homepage-framed .site-sheet {
    width: 100%;
    border-inline: 0;
    box-shadow: none;
  }

  .homepage-framed .site-header {
    width: 100%;
  }
}
