/* Projects: catalogo semantico in Lettura, proiezione olografica in Viaggio. */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; padding: 8px 4px; }
.district-services {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: min(100%, 620px);
  height: 70px;
  margin: 20px auto 0;
  opacity: .8;
  pointer-events: none;
}
.district-services img { object-fit: contain; width: auto; height: 100%; min-width: 0; }
.district-services .service-cable { width: 32%; height: auto; }
.district-services .service-elbow { height: 80%; }

/* Project details are shared with the dialog. */
.project-media {
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0;
}
.project-media img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.project h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.summary { margin: 0; font-size: 15px; color: var(--body); }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stack li {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.case { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.case summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--cyan);
}
.case summary::-webkit-details-marker { display: none; }
.case summary > span:last-child { transition: transform .2s; }
.case[open] summary > span:last-child { transform: rotate(90deg); }

.case-body dl { margin: 8px 0 20px; }
.case-body dt,
#detail-content dt {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
}
.case-body dd,
#detail-content dd { margin: 4px 0 0; font-size: 15px; color: var(--body); }
.case-links { display: flex; flex-wrap: wrap; gap: 12px; }

.journey .district-services { display: none; }
.journey .project[hidden] { display: none !important; }
.journey .case { margin-top: 6px; border-top-color: #00daff30; }
.journey .case summary { width: fit-content; gap: 14px; }
.journey .case-body { display: none; }
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .district-services { height: 48px; gap: 6px; }
  .district-services .service-elbow { display: none; }
}

/* PNGs already contain their HUD: no second monitor frame. */
.project-carousel { display: none; }
.project { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.project-links { display: flex; gap: 20px; min-height: 24px; flex-wrap: wrap; }
.project-links .text-link { font-size: 14px; margin-top: 0; }
.journey #projects { container-type: size; padding-block: 28px 12px; }
.journey .holo-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 4vw, 60px);
  min-height: 100%;
  height: 100%;
  margin: 0;
}
.journey #projects .section-heading { align-self: start; padding-top: clamp(10px, 7cqh, 70px); }
.journey #projects-title { font-size: clamp(36px, 4.1vw, 68px); letter-spacing: -2px; }
.journey #projects .section-heading > p:last-child { display: block; line-height: 1.7; }
.journey .project-carousel { display: block; position: relative; min-width: 0; align-self: end; margin-bottom: 24px; }
.holo-projection {
  width: 100%; aspect-ratio: 3 / 2;
  opacity: 0; transform: translateY(10px) scaleY(.08); transform-origin: 50% 82%;
  visibility: hidden;
  transition: transform .3s ease-in-out, opacity .3s ease-in-out, visibility 0s .3s;
}
.holo-projection[data-power='on'] { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
/* Same endpoints, duration and symmetric easing for arrival and departure. */
.journey #projects :is(.projects-grid, .project-controls) {
  opacity: 0; transform: translateY(10px); visibility: hidden;
  transition: opacity .3s ease-in-out, transform .3s ease-in-out, visibility 0s .3s;
}
.journey #projects[data-project-power='on'] :is(.projects-grid, .project-controls) {
  opacity: 1; transform: none; visibility: visible; transition-delay: 0s;
}
.holo-float, .holo-card { width: 100%; height: 100%; }
.holo-float { animation: project-float 5s ease-in-out infinite; animation-play-state: paused; }
.holo-projection[data-power='on'] .holo-float { animation-play-state: running; }
.paused .holo-float { animation-play-state: paused !important; }
#project-image { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.project-controls {
  position: absolute; inset: 0 -48px; pointer-events: none;
}
.project-controls button {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 46px; height: 52px; padding: 0;
  border: 0; background: none; cursor: pointer; pointer-events: auto;
}
#project-prev { left: 0; }
#project-next { right: 0; }
.project-controls button img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.project-controls button:hover img { filter: brightness(1.2); }
.project-controls button[aria-disabled='true'] { opacity: .45; cursor: default; }
.project-controls button:focus-visible, .project-carousel:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.journey #projects .projects-grid {
  display: grid; grid-template-columns: 1fr; width: 100%; padding: 0;
  min-width: 0; min-height: 0; max-height: 100%; align-self: center;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: #378297 transparent;
}
.journey #projects .project {
  grid-area: 1 / 1; display: grid; align-content: start;
  grid-template-rows: 20px 84px 100px 62px 40px 40px;
  gap: 6px; min-width: 0; padding: 0 4px;
  background: none; border: 0; box-shadow: none;
}
.journey #projects .project-media { display: none; }
.journey #projects .project h3 { font-size: clamp(24px, 2.1vw, 32px); line-height: 1.3; font-weight: 700; color: var(--text); align-self: center; letter-spacing: -.6px; text-wrap: balance; }
.journey #projects .summary { font-size: 14px; line-height: 1.6; color: #bdccdc; }
.journey #projects .micro { font-size: 10px; letter-spacing: 1.2px; color: #76dce9; }
.journey #projects .stack { align-content: start; gap: 5px; }
.journey #projects .stack li { font-size: 10px; letter-spacing: .3px; padding: 4px 7px; color: #bbd6e3; border-color: #60b9d52b; background: #74dfff08; }
.journey #projects .case { margin: 0; padding-top: 10px; border-top-color: #63c9e025; }
.journey #projects .case summary { width: 100%; font-size: 14px; font-weight: 600; color: var(--cyan); }
.journey #projects .case summary:hover { color: white; }
.journey #projects .project-links { align-items: stretch; gap: 8px; flex-wrap: nowrap; }
.journey #projects .project-links .text-link {
  display: inline-flex; align-items: center; justify-content: center; padding: 0 12px;
  border: 1px solid #54d8ec80; background: #26c9e514; font-size: 13px; font-weight: 600; color: #c6f8ff;
  transition: background-color .15s, border-color .15s;
}
.journey #projects .project-links .text-link:hover { background: #26c9e520; border-color: #54d8ec90; }
.journey #projects :is(.project-links a, .case summary):focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
@keyframes project-float { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-2px); } }
@media (min-width: 900px) and (max-width: 1199px) {
  .journey .project-carousel { width: calc(100% - 24px); justify-self: center; }
  .journey #projects .project { grid-template-rows: 30px 100px 136px 104px 40px 40px; padding: 0 4px; }
  .journey #projects .micro { line-height: 1.5; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .journey #projects .project { grid-template-rows: 30px 100px 124px 104px 40px 40px; gap: 6px; padding: 0 4px; }
  .journey #projects .summary { font-size: 13px; line-height: 1.5; }
  .journey #projects .project h3 { font-size: 24px; }
}
@media (max-width: 899px) {
  .journey #projects { container-type: normal; }
  .journey .holo-deck { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 16px; min-height: 0; height: auto; }
  .journey #projects .section-heading { padding-top: 0; }
  .journey .project-carousel { width: min(480px, 100%); justify-self: center; margin-bottom: 0; }
  .project-controls { position: relative; inset: auto; display: flex; justify-content: center; gap: 32px; }
  .project-controls button { position: static; transform: none; }
  .journey #projects .project { grid-template-rows: auto; padding: 16px; }
  .journey #projects .project-links .text-link { min-height: 40px; }
  .journey #projects .projects-grid { padding-bottom: 20px; max-height: none; overflow: visible; }
  /* The stacked mobile reading area can scroll above the mechanical stage. */
  .journey .scene-link.beam { display: none; }
}
