/* Representative revision: scoped homepage changes, no site-wide content rollout. */
.selected-work {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.selected-work .project-card-body {
  padding: 1.1rem 1.4rem 1.15rem;
}
.selected-work .project-card .eyebrow {
  margin-bottom: .55rem;
  min-height: 1.8em;
}
.selected-work .project-card h3 {
  margin-bottom: .7rem;
}
.selected-work .project-card .card-arrow {
  border-top: 0;
  padding-top: 0;
  font-size: .76rem;
}
.selected-work .project-card-image {
  height: 285px;
}
.selected-work .project-card:nth-child(3) .project-card-image {
  object-position: center 30%;
}
body:has(.home-hero) .archive-intro,
body:has(.home-hero) .home-writing {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
@media (max-width: 650px) {
  .selected-work { padding: 2.5rem 0; }
  .selected-work .project-card-image { height: 225px; }
  .selected-work .project-card-body { padding: 1rem 1.2rem; }
  .selected-work .project-card h3 { font-size: 1.4rem; }
  .selected-work .project-card .eyebrow { min-height: 0; }
  body:has(.home-hero) .archive-intro,
  body:has(.home-hero) .home-writing { padding: 2.5rem 0; }
}

/* Original-pixel portrait, with a separate decorative person-free landscape. */
.home-hero {
  height: 610px;
  background: #edf3f6;
  isolation: isolate;
}
.home-hero::before {
  z-index: -2;
  background: linear-gradient(90deg, #f3f6f7 5%, #f3f6f7cc 42%, #f3f6f733),
    url('assets/revision/hero/atmospheric-mountains.webp') center bottom / cover no-repeat;
  opacity: .85;
}
.home-hero .hero-copy { position: relative; z-index: 2; width: 58%; }
.home-hero .hero-portrait {
  top: auto; bottom: 0; right: 2%; width: 46%; height: 94%;
  z-index: -1; mask-image: none; -webkit-mask-image: none;
  background: transparent; border: 0; box-shadow: none;
}
.home-hero .hero-portrait img {
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  filter: none;
}
.selected-work .research-card .project-card-image { object-fit: contain; padding: .6rem; background: white; }
.photo-grid, .before-after-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; margin: 2rem 0; }
.photo-grid > *, .before-after-pair > * { min-width: 0; margin: 0; }
.photo-grid img, .before-after-pair img { width: 100%; height: auto; object-fit: contain; }
.quarto-figure { margin: 2rem 0; }
.quarto-figure img { max-width: 100%; height: auto; }
figcaption { line-height: 1.55; }
.flight-video video { display: block; max-width: 100%; max-height: 620px; margin: 2rem auto; background: #102131; }
.project-flow { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin: 2rem 0; }
.project-flow-step { padding: 1.3rem; background: #edf3f6; border-top: 2px solid #426879; }
details { margin: 2rem 0; padding: 1rem; border: 1px solid #c8d2d9; border-radius: .3rem; }
summary { cursor: pointer; font-weight: 600; }
main { min-width: 0; }
main .math.display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .25rem 0; }
@media (max-width: 650px) {
  .home-hero { height: auto; min-height: 0; padding-top: 2.5rem; }
  .home-hero .hero-copy { width: 100%; }
  .home-hero::before { background: linear-gradient(#f3f6f7 24%, #f3f6f755 75%), url('assets/revision/hero/atmospheric-mountains.webp') center bottom / auto 65% no-repeat; }
  .home-hero .hero-portrait { position: relative; right: auto; bottom: auto; top: auto; width: 100%; height: auto; margin: 1.5rem 0 0; }
  .home-hero .hero-portrait img { display: block; width: min(100%,390px); height: auto; margin: auto; }
  .photo-grid, .before-after-pair, .project-flow { grid-template-columns: 1fr; }
}

details > summary { color: #344f60; }

.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; }
.table-scroll table { margin: 0; }
.table-scroll:focus-visible { outline: 2px solid #274656; outline-offset: 3px; }
/* R named arguments need sufficient contrast on the code-panel background. */
code span.at { color: #53601b; }
.callout-header[role="button"]:focus-visible { outline: 2px solid #274656; outline-offset: 3px; }

/* Approved covers fill the existing frames without stretching or hover zoom. */
.project-card:hover .approved-cover,
.project-card .approved-cover,
.selected-work .project-card:nth-child(3) .approved-cover {
  object-fit: cover;
  object-position: center;
  padding: 0;
  background: #eaf0f0;
  transform: none;
}

.project-card:nth-child(3) .approved-cover { object-position: center 60%; }
.selected-work .project-card:nth-child(3) .approved-cover { object-position: center 55%; }
.project-card.photo-card .approved-cover { background: #e9edef; object-position: center 70%; }
.research-cover { display: block; position: relative; background: #eaf0f0; }
.project-card:hover .research-cover .project-card-image,
.project-card .research-cover .project-card-image { object-fit: cover; padding: 0; background: #eaf0f0; transform: none; }
.selected-work .research-cover,
.selected-work .research-cover .project-card-image { background: white; }
.research-video { position: absolute; inset: 0; visibility: hidden; }
.research-cover.is-playing .research-video { visibility: visible; }
.cover-motion-toggle { position: absolute; top: .25rem; right: .25rem; z-index: 2; min-height: 28px; line-height: 1; border: 1px solid #c8d2d9; border-radius: 4px; padding: .2rem .45rem; background: #192d3b; color: white; font-size: .65rem; }
.cover-motion-toggle:focus-visible { outline: 3px solid white; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .research-video, .cover-motion-toggle { display: none; } }

/* Homepage coursework library: original scientific figure stays uncropped. */
.mathematical-library { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 2.5rem; }
.mathematical-library .library-copy > p:not(.eyebrow) { font-size: .95rem; line-height: 1.7; margin-bottom: 1rem; }
.mathematical-library h2 { font-size: clamp(2rem, 3.1vw, 2.7rem); line-height: 1.16; margin-bottom: 1.4rem; }
.mathematical-library .button-link { margin-top: .5rem; }
.library-feature { margin: 0; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: 9px; background: white; }
.library-plot-link { display: block; cursor: zoom-in; }
.library-feature img { display: block; width: 100%; height: auto; object-fit: contain; }
.library-feature figcaption { padding: 1rem .35rem .35rem; font-size: .82rem; line-height: 1.5; }
.library-feature figcaption > a:first-child { color: var(--ink); text-decoration: none; }
.library-feature figcaption > a:first-child:hover { text-decoration: underline; }
.library-full-size { display: block; width: fit-content; margin-top: .5rem; font-size: .72rem; color: var(--muted); }
@media (max-width: 900px) {
  .mathematical-library { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .mathematical-library .library-copy { max-width: 68ch; }
  .library-feature { width: 100%; }
}
@media (max-width: 650px) { .library-feature { padding: .5rem; } }

/* A static, spacious final chapter with a decorative mountain-to-stars landscape. */
.home-horizon { position: relative; isolation: isolate; overflow: hidden; margin-top: 2rem; min-height: 800px; padding: clamp(2rem, 6vw, 5.5rem); border-radius: 12px; background: #0b1826; color: #e5ebf2; }
.horizon-copy { position: relative; z-index: 2; max-width: 37rem; }
.home-horizon .eyebrow { color: #c1d1df; margin-bottom: 1.5rem; }
.home-horizon h2 { color: #f6f8fb; font-size: clamp(3rem, 6vw, 5.25rem); line-height: 1.06; letter-spacing: -.04em; margin-bottom: 2rem; }
.horizon-body p { color: #e0e7ef; font-size: 1rem; line-height: 1.85; margin-bottom: 1.4rem; }
.horizon-closing { margin: 2.8rem 0 0; padding-top: 1.8rem; border-top: 1px solid #8293a34d; color: #f1f5fa; font-family: var(--heading); font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.6; max-width: 35ch; }
.technical-notes { margin-top: 3rem; scroll-margin-top: 7rem; }
.technical-note { max-width: 52rem; margin-top: 2rem; padding: 1.6rem 0 0; border-top: 1px solid var(--line); }
.technical-note h3 { font-size: 1.6rem; }
.technical-note h3 a { text-decoration: none; }
.technical-note h3 a:hover { text-decoration: underline; }
.technical-note .eyebrow { margin-bottom: .7rem; }
@media (max-width: 900px) { .home-horizon { min-height: 0; padding: 3.5rem 2.5rem 16rem; } }
@media (max-width: 650px) { .home-horizon { padding: 3rem 1.4rem 13rem; border-radius: 9px; } .horizon-body p { font-size: .95rem; line-height: 1.8; } .horizon-closing { margin-top: 2rem; } }

.horizon-landscape { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 85% bottom; }
.home-horizon::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11,24,38,.96), rgba(11,24,38,.86) 60%, rgba(11,24,38,.15)); pointer-events: none; }
@media (max-width: 900px) {
  .horizon-landscape { top: auto; height: 18rem; mask-image: linear-gradient(180deg, transparent, black 8%); -webkit-mask-image: linear-gradient(180deg, transparent, black 8%); }
  .home-horizon::after { background: linear-gradient(180deg, #0b1826 0%, #0b1826 50%, rgba(11,24,38,0) 72%); }
}
@media (max-width: 650px) { .home-horizon { padding-bottom: 18rem; } .horizon-landscape { height: 20rem; } }

.home-horizon .anchorjs-link { display: none; }

/* Static sky-only light and fine stars share the original image's cover transform.
   The WebP, its crop, and all layout/typography remain unchanged. */
.home-horizon::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("assets/images/horizon/horizon-sky-layer.svg") 85% bottom / cover no-repeat; pointer-events: none; }
@media (max-width: 900px) { .home-horizon::before { top: auto; height: 18rem; mask-image: linear-gradient(180deg, transparent, black 8%); -webkit-mask-image: linear-gradient(180deg, transparent, black 8%); } }
@media (max-width: 650px) { .home-horizon::before { height: 20rem; } }
