.page-home { --home-caption-size: .8rem; color: #fff; background: #000; }
.page-home :where(figure, h1, h2, h3, p, ul) { margin: 0; }
.page-home :where(ul) { padding: 0; list-style: none; }
.home-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 410px;
  overflow: hidden;
  background: #000;
}
.home-hero-layout {
  position: absolute;
  inset: var(--gutter) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .14vw;
}
.hero-statement, .home-section h2, .topics-content {
  font-size: clamp(26px, 2.777778vw, 56px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.042em;
}
.hero-copy { display: contents; }
.hero-statement { grid-area: 1 / 1; max-width: 8.8em; }
.hero-statement-right { grid-column: 3; justify-self: end; text-align: right; }
.welcome-scene { grid-area: 1 / 2; position: relative; width: min(57vw, 96svh); aspect-ratio: 672 / 552; }
.welcome-scene img, .welcome-scene video { width: 100%; height: 100%; object-fit: contain; }
.welcome-scene video { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .welcome-scene.is-animating { background: #000 url("assets/home/welcome-opening.webp") center / contain no-repeat; }
  .welcome-scene.is-animating img { opacity: 0; }
  .welcome-scene.is-animating video.playing { opacity: 1; }
}

.home-section { padding-block: 48px 60px; }
.home-section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin: 0 var(--gutter) 32px; }
.home-text-link { font-size: var(--home-caption-size); line-height: 1.35; font-weight: 700; text-underline-offset: 2px; }
.home-section-head .home-text-link { flex-shrink: 0; margin-bottom: 4px; }
.home-section h2 span { color: #888; }
.rail-frame {
  --card-width: clamp(214px, 17.57vw, 312px);
  display: grid;
  grid-template: max-content / minmax(0, 1fr);
  align-content: start;
}
.home-rail, .rail-arrow { grid-area: 1 / 1; }
.featured-section .rail-frame {
  --photo-ratio: calc(253 / 316);
  grid-template-rows: calc(var(--card-width) / var(--photo-ratio)) auto;
}
.featured-section .home-rail { grid-row: 1 / 3; }
.news-section .rail-frame { min-height: 292px; }
.rail-arrow {
  z-index: 2;
  align-self: center;
  margin-inline: max(0px, calc(var(--gutter) - 24px));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}
.rail-prev { justify-self: start; }
.rail-next { justify-self: end; }
.rail-arrow[hidden] { display: none; }
.rail-arrow::after {
  content: "";
  width: 18px;
  height: 18px;
  border: solid currentColor;
  border-width: 3px 3px 0 0;
  transform: translateX(-25%) rotate(45deg);
  filter: drop-shadow(0 1px 2px #000);
}
.rail-prev::after { transform: translateX(25%) rotate(-135deg); }
@media (any-hover: hover) {
  .rail-arrow.is-near-edge { opacity: .65; pointer-events: auto; }
}
.rail-arrow:focus-visible { opacity: .9; }
.home-rail {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 0 var(--gutter);
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.home-rail::-webkit-scrollbar { display: none; }
.home-rail:focus-visible { outline-offset: -2px; }
.has-rail-controls:has(> .rail-positions[hidden]) .home-rail { overscroll-behavior-inline: auto; }
.home-rail li { flex: 0 0 var(--card-width); min-width: 0; scroll-snap-align: start; }
.home-rail a { display: block; height: 100%; text-decoration: none; }
.home-rail a:focus-visible { outline-offset: -2px; }
.home-rail a:is(:hover, :focus-visible) h3 { text-decoration: underline; text-underline-offset: 2px; }
.research-rail { min-height: calc(var(--card-width) * 1.25 + 158px); }
.research-photo { position: relative; width: 100%; aspect-ratio: var(--photo-ratio); margin-bottom: 12px; }
.research-photo > img { width: 100%; height: 100%; object-fit: cover; }
.research-photo > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.research-photo > video.playing { opacity: 1; }
.research-mark {
  position: absolute;
  z-index: 1;
  bottom: 6px; left: 6px;
  width: 31px; height: 24px;
  background: #000 url("assets/brand/nais-mark.svg") center / 24px auto no-repeat;
}
.home-rail h3 { font-size: 17.5px; font-weight: 700; line-height: 1.1; letter-spacing: -.025em; }
.home-rail small, .home-rail time { display: block; color: #a6a6a6; font-size: var(--home-caption-size); line-height: 1.35; }
.research-rail p { margin: 8px 0; color: #b8b8b8; font-size: 13.5px; line-height: 18px; }
.news-photo, .news-logo { width: 96px; height: 96px; margin-bottom: 12px; }
.news-photo { object-fit: cover; }
.news-logo { padding: 6px; object-fit: contain; background: #141414; }
.news-rail time { margin-top: 10px; }
.rail-positions { display: flex; justify-content: center; margin-top: 4px; }
.rail-positions[hidden] { display: none; }
.rail-positions button { display: grid; width: 24px; height: 28px; padding: 0; place-content: center; color: inherit; border: 0; background: none; cursor: pointer; }
.rail-positions button::after { content: ""; width: 7px; height: 7px; background: #6b6b6b; }
.rail-positions button[aria-pressed="true"]::after { background: #fff; }

.home-topics { padding: 48px 0 108px; }
.topics-panel {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  width: min(83.33333%, 1520px);
  aspect-ratio: 1200 / 582;
  margin: auto;
  align-items: center;
  background: #090909;
}
.topics-images { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.topics-images img, .topics-images::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.topics-images img { object-fit: cover; opacity: 0; transition: opacity .48s ease; }
.topics-images img.is-current { opacity: 1; }
.topics-images::after { content: ""; background: linear-gradient(90deg, rgb(0 0 0 / 48%), rgb(0 0 0 / 66%)); }
.topics-content {
  display: grid;
  grid-template-columns: minmax(0, 45.2fr) minmax(0, 54.8fr);
  gap: 2%;
  margin: 0 2%;
  font-size: clamp(16px, 3.3333cqw, 51px);
}
.topics-content h2 { align-self: center; font: inherit; text-align: right; }
.topic-list { display: grid; grid-template-rows: repeat(5, 1.16em); overflow: hidden; }
.topic-list li { display: flex; align-items: center; grid-column: 1; color: #c2c2c2; white-space: nowrap; }
.topic-list li.is-selected { color: #fff; }
.topic-list button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  white-space: inherit;
  cursor: pointer;
}
.topic-list button:focus-visible { outline-offset: -2px; }
.topics-tools { position: absolute; bottom: 6%; left: 4%; display: flex; align-items: center; gap: 12px; }
.topics-tools a { color: #ddd; font-size: .75rem; text-underline-offset: 2px; }
.topics-playback {
  display: grid;
  width: 36px;
  height: 36px;
  place-content: center;
  border: 1px solid rgb(255 255 255 / 55%);
  background: rgb(0 0 0 / 40%);
  color: #fff;
  cursor: pointer;
}
.topics-playback[hidden] { display: none; }
.topics-playback::before { content: ""; width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.topics-playback.is-paused::before { width: 0; height: 0; border: solid transparent; border-width: 7px 0 7px 11px; border-left-color: currentColor; }
.topics-panel > .home-text-link { position: absolute; right: 4%; bottom: 6%; }
@media (max-width: 700px) {
  .topics-panel { width: 100%; min-height: 208px; }
  .topics-content {
    grid-template-columns: minmax(0, 45.2fr) minmax(max-content, 54.8fr);
    gap: clamp(8px, 2vw, 14px);
    margin-inline: var(--gutter);
  }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-scene video { display: none; }
  .topics-images img, .rail-arrow { transition: none; }
}
@media (max-width: 760px) {
  .home-hero-layout { inset-block-start: 0; transform: translateY(1.22222svh); }
  .welcome-scene { width: min(46.66667vw, 78svh); }
  .hero-statement { font-size: clamp(15px, 3vw, 24px); }
  .home-section h2 { font-size: clamp(18px, 3.3vw, 26px); }
}
@media (max-width: 700px) {
  .featured-section .home-section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .featured-section .home-section-head .home-text-link { margin-bottom: 0; }
  .home-section .rail-frame {
    grid-template-rows: auto;
    min-height: 0;
    margin-inline: var(--gutter);
  }
  .home-section .home-rail {
    grid-row: 1;
    min-height: 0;
    padding: 0;
    scroll-padding-inline: 0;
    scroll-snap-type: x mandatory;
  }
  .home-rail li { flex-basis: 100%; scroll-snap-stop: always; }
  .home-section .rail-arrow { display: none; }
  .news-photo, .news-logo { width: clamp(132px, 42vw, 184px); height: auto; aspect-ratio: 1; margin-bottom: 16px; }
  .rail-positions { flex-wrap: wrap; margin: 8px var(--gutter) 0; }
  .rail-positions button { width: min(44px, 10vw); height: 44px; }

  .home-hero {
    display: grid;
    align-content: center;
    height: auto;
    min-height: min(84svh, 760px);
    padding: clamp(104px, 14svh, 136px) var(--gutter) clamp(40px, 7svh, 64px);
  }
  .home-hero-layout {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 540px);
    justify-content: center;
    gap: clamp(24px, 6vw, 36px);
    transform: none;
  }
  .welcome-scene { grid-area: auto; width: 100%; }
  .hero-copy {
    display: block;
    font-size: clamp(21px, 5.6vw, 28px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.035em;
    text-wrap: pretty;
  }
  .hero-statement { font: inherit; letter-spacing: inherit; }
}
