.home-page {
  --scene-gutter: 24px;
  padding-top: 16px;
  padding-inline: var(--scene-gutter);
}

.home-intro { padding: 17px 0 14px; }
.home-intro h1 { line-height: 1.4; }
.home-intro p { margin-top: 10px; line-height: 1.7; }
.home-foot { padding-top: 16px; }
.home-page .brand-line::after { display: none; }
.custom-scene-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  max-width: 100%;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.custom-scene-entry:hover { border-color: var(--primary); background: var(--primary-soft); }

.scene-carousel {
  --scene-reveal: 30px;
  --scene-gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.scene-carousel__header {
  min-height: 44px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scene-carousel__header h2 { font-size: 14px; font-weight: 500; white-space: nowrap; }
.scene-picker-trigger {
  min-height: 44px;
  margin-left: auto;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}
.scene-picker-trigger:hover { background: var(--primary-soft); }
.scene-carousel__controls { display: flex; align-items: center; gap: 2px; }
.scene-carousel__controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
}
.scene-carousel__controls button:hover:not([aria-disabled="true"]) { background: var(--primary-soft); }
.scene-carousel__controls button[aria-disabled="true"] { color: var(--subtle); cursor: default; }
.scene-carousel__controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scene-carousel__count { min-width: 32px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.scene-picker {
  width: min(344px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
}
.scene-picker::backdrop { background: #2a24206b; }
.scene-picker__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.scene-picker__header h2 { padding-left: 4px; font: 400 22px/1.4 var(--serif); }
.scene-picker__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}
.scene-picker__close:hover { background: var(--bg); }
.scene-picker__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.scene-picker__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  align-items: center;
  gap: 2px 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.5;
}
.scene-picker__list a:hover { background: var(--bg); }
.scene-picker__list a[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); }
.scene-picker__category { grid-column: 1; color: var(--muted); font-size: 11px; }
.scene-picker__arrow { grid-column: 2; grid-row: 1 / span 2; width: 6px; height: 6px; border: solid var(--primary); border-width: 1px 1px 0 0; transform: rotate(45deg); }
.scene-picker__custom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--primary);
  font-size: 13px;
}
.scene-picker__custom:hover { background: var(--primary-soft); }

.scene-carousel__rail {
  display: flex;
  gap: var(--scene-gap);
  margin-inline: calc(-1 * var(--scene-gutter));
  padding-inline: var(--scene-gutter);
  scroll-padding-inline: var(--scene-gutter);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scene-carousel__rail::-webkit-scrollbar { display: none; }

/* Keep the last card aligned with the first card's starting edge. */
.scene-carousel__rail:not([data-single])::after {
  content: "";
  flex: 0 0 calc(var(--scene-reveal) - var(--scene-gap));
}

.scene-card {
  flex: 0 0 calc(100% - var(--scene-reveal));
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  scroll-snap-align: start;
}
.scene-card:focus-visible { outline-offset: -4px; }
.scene-carousel__rail[data-single] .scene-card { flex-basis: 100%; }

.scene-preview {
  min-height: 105px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  background: #EBE4D7;
}
.scene-card[data-tint="sage"] .scene-preview { background: var(--sage-soft); }
.scene-card[data-tint="rose"] .scene-preview { background: var(--primary-soft); }
.scene-preview .eyebrow { position: relative; z-index: 1; color: var(--muted); }
.scene-preview blockquote { position: relative; z-index: 1; margin: 8px 0 0; font: 400 17px/1.5 var(--serif); }
.scene-art { position: absolute; width: 116px; height: 94px; right: -9px; bottom: -12px; }
.scene-detail { flex: 1; display: flex; flex-direction: column; padding: 13px 16px 0; }
.scene-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scene-heading h3 { font-size: 21px; font-weight: 500; line-height: 1.35; }
.scene-heading .avatar { width: 32px; height: 32px; font-size: 14px; }
.scene-detail p { margin: 4px 0 11px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.scene-action { min-height: 44px; margin-top: auto; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--primary); font-size: 13px; font-weight: 500; }
.scene-action > span:last-child { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 400; }
.scene-action .icon { width: 16px; height: 16px; color: var(--primary); }
.scene-card:hover .scene-action { color: var(--primary-pressed); }

@media (max-width: 350px) {
  .home-page { --scene-gutter: 20px; }
  .scene-carousel { --scene-reveal: 24px; }
  .scene-heading h3 { font-size: 18px; }
  .scene-preview blockquote { font-size: 16px; }
  .scene-art { width: 96px; height: 78px; bottom: -13px; }
}

@media (max-height: 720px) {
  .home-page { padding-top: 5px; }
  .home-intro { padding: 5px 0 2px; }
  .home-intro h1 { font-size: 29px; line-height: 1.28; }
  .home-intro p { margin-top: 7px; line-height: 1.55; }
  .home-intro::after { top: 4px; font-size: 84px; }
  .scene-preview { min-height: 96px; padding-block: 11px; }
  .scene-detail { padding-top: 10px; }
  .scene-detail p { margin-bottom: 8px; }
}
