/* Project scenes sit around the shared, stable reading surface. */
dialog.editing-project { background: rgb(241 240 235 / 55%); }
dialog.network-project { background: rgb(239 242 244 / 52%); }
.editing-project .project-atmosphere,
.network-project .project-atmosphere { isolation: isolate; }

/* A continuous film ribbon: the duplicated set makes the seam invisible. */
.editing-film {
  position: absolute; top: -15%; height: 130%;
  right: calc(50% + 355px); width: clamp(245px, 25vw, 370px);
  transform: rotate(-9deg); overflow: hidden;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.editing-film-scroll { animation: editing-film-drift 78s linear infinite; }
.editing-film-set { display: flex; flex-direction: column; gap: 28px; padding: 0 20px 28px; background: #e2e2db; position: relative; }
.editing-film-set::before, .editing-film-set::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 6px;
  background: repeating-linear-gradient(to bottom, #aaa99f 0 8px, transparent 8px 20px);
  opacity: .45;
}
.editing-film-set::before { left: 6px; }
.editing-film-set::after { right: 6px; }
.editing-frame { margin: 0; padding: 8px; border: 1px solid #d6d5cc; background: #fbfaf5; }
.editing-frame img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; filter: saturate(.66); background: #e4e3dc; }
.editing-frame figcaption { display: flex; justify-content: space-between; padding: 12px 3px 4px; color: #77786f; font: 9px var(--mono); letter-spacing: 1px; }
@keyframes editing-film-drift { to { transform: translateY(-50%); } }

/* The ruler and three tracks stay readable as the playhead sweeps through. */
.editing-timelines {
  position: absolute; top: -17%; height: 134%; left: calc(50% + 348px);
  width: clamp(290px, 27vw, 405px); transform: rotate(8deg); overflow: hidden;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.editing-timeline-scroll { animation: editing-film-drift 108s linear infinite reverse; }
.editing-sequence-set { display: flex; flex-direction: column; gap: 35px; padding: 0 12px 35px; }
.editing-sequence { padding: 24px 20px 20px; background: #fafaf7e6; border: 1px solid #d6d7cf; border-radius: 8px; box-shadow: 0 8px 24px #343c2708; }
.sequence-heading, .sequence-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 10px var(--mono); color: #7b7e74; letter-spacing: .5px; }
.sequence-heading { margin-bottom: 30px; }
.sequence-heading > span:last-child { border: 1px solid #cecec6; border-radius: 3px; padding: 3px 5px; font-size: 8px; }
.sequence-ruler { display: flex; justify-content: space-between; margin-left: 40px; padding-bottom: 13px; margin-bottom: 9px; font: 8px var(--mono); color: #8d9186; background: repeating-linear-gradient(90deg, #cbcec2 0 1px, transparent 1px 12px) left bottom / 100% 5px no-repeat; }
.sequence-tracks { position: relative; display: flex; flex-direction: column; gap: 9px; }
.sequence-track { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 46px; }
.track-label { font: 8px var(--mono); letter-spacing: .2px; color: #85877f; }
.sequence-clips { display: flex; gap: 4px; align-self: stretch; }
.sequence-video, .sequence-caption { display: flex; align-items: center; justify-content: center; min-width: 0; flex: 1; border-radius: 3px; font: 8px var(--mono); padding: 5px 2px; white-space: nowrap; }
.sequence-video { color: #5b6d79; background: #cbd5dc; border: 1px solid #b7c4ce; animation: sequence-video-light 12s ease-in-out infinite; }
.sequence-video + .sequence-video { animation-delay: -6s; }
.sequence-wave { height: 46px; display: flex; align-items: center; padding: 0 5px; background: #d2dccb; border: 1px solid #c1cdb9; border-radius: 3px; }
.sequence-wave svg { display: block; width: 100%; height: 35px; fill: #778b6d; }
.sequence-caption { color: #8a7b58; background: #e7dfcb; border: 1px solid #d9cdb1; animation: sequence-caption-light 12s ease-in-out infinite; }
.sequence-caption:nth-child(2) { animation-delay: -4s; }
.sequence-caption:nth-child(3) { animation-delay: -8s; }
.sequence-playhead { position: absolute; top: -9px; bottom: -9px; left: 40px; width: 1px; background: #63716c; box-shadow: 0 0 0 1px #ffffff6b; animation: sequence-scan 12s linear infinite; animation-delay: var(--scan-delay, -2s); }
.sequence-playhead::before { content: ""; position: absolute; top: -4px; left: -3px; width: 7px; height: 6px; background: #63716c; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.sequence-footer { margin-top: 24px; font-size: 8px; }
@keyframes sequence-scan { 0% { left: 40px; opacity: 0; } 3% { opacity: 1; } 96% { opacity: 1; } 100% { left: calc(100% - 2px); opacity: 0; } }
@keyframes sequence-video-light { 0%, 48%, 100% { background: #cbd5dc; } 12%, 32% { background: #b4c6d3; } }
@keyframes sequence-caption-light { 0%, 65%, 100% { opacity: .48; } 15%, 48% { opacity: 1; } }

/* Each side has its own hub, connected to two modules. */
.atlas-network {
  position: absolute; top: 50%; margin-top: -330px; height: 660px;
  width: clamp(265px, 25vw, 390px);
  mask-image: linear-gradient(transparent, #000 7%, #000 93%, transparent);
}
.atlas-network-left { right: calc(50% + 346px); transform: perspective(1000px) rotateY(10deg) rotateZ(-6deg); }
.atlas-network-right { left: calc(50% + 346px); transform: perspective(1000px) rotateY(-10deg) rotateZ(6deg); }
.atlas-network-float { width: 100%; height: 100%; animation: atlas-float 14s ease-in-out infinite; }
.atlas-network-right .atlas-network-float { animation-delay: -7s; }
.atlas-network svg { display: block; width: 100%; height: 100%; overflow: visible; }
.atlas-lines path { stroke: #b8c3cb; stroke-width: 1.2; }
.atlas-signal { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 3 97; animation: atlas-signal-flow 12s linear infinite; animation-delay: var(--signal-delay, 0s); opacity: .65; }
.atlas-junctions circle { fill: #f3f5f5; stroke: #aebdc7; stroke-width: 1; }
.atlas-module { animation: atlas-node-light 12s ease-in-out infinite; animation-delay: var(--node-delay, 0s); }
.atlas-module > rect { fill: #ffffffc9; stroke: currentColor; stroke-width: 1; }
.atlas-module .atlas-node-indicator { fill: currentColor; }
.atlas-node-index { fill: #8d959b; font: 8px var(--mono); letter-spacing: 1px; }
.atlas-node-name { fill: #47525a; font: 25px var(--font); letter-spacing: -.6px; }
.atlas-hub rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.atlas-flow .atlas-core { background: var(--panel); }
.atlas-core img { display: block; width: 100%; height: 100%; object-fit: contain; }
.atlas-core-caption { fill: #8e99a0; font: 8px var(--mono); letter-spacing: 2px; }
.atlas-network-label text { fill: #8e99a0; font: 8px var(--mono); letter-spacing: 1.2px; }
@keyframes atlas-signal-flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes atlas-node-light { 0%, 65%, 100% { color: #c5ced4; } 20%, 32% { color: #799ac6; } }
@keyframes atlas-float { 0%, 100% { transform: translateY(-9px); } 50% { transform: translateY(9px); } }
.project-atmosphere.is-paused .scene-motion { animation-play-state: paused; }

@media (max-width: 1100px) {
  :is(.editing-project, .network-project) .project-atmosphere { position: relative; height: 340px; }
  .editing-film { width: 32%; min-width: 180px; right: auto; left: 10%; top: -170px; height: 540px; transform: rotate(-9deg); }
  .editing-timelines { width: 39%; min-width: 240px; left: auto; right: 7%; top: -185px; height: 555px; }
  .editing-sequence { padding: 20px 14px; }
  .editing-sequence-set { gap: 22px; padding: 0 8px 22px; }
  .atlas-network { width: 37%; height: 330px; top: 0; margin: 0; }
  .atlas-network-left { right: auto; left: 10%; }
  .atlas-network-right { left: auto; right: 10%; }
  :is(.editing-project, .network-project) .ambient-caption { font-size: 8px; }
}
@media (max-width: 600px) {
  :is(.editing-project, .network-project) .project-atmosphere { height: 315px; }
  .editing-film { width: 43%; min-width: 0; left: -8px; top: -80px; height: 410px; }
  .editing-film-set { gap: 17px; padding: 0 13px 17px; }
  .editing-film-set::before, .editing-film-set::after { width: 4px; }
  .editing-film-set::before { left: 4px; }
  .editing-film-set::after { right: 4px; }
  .editing-frame { padding: 5px; }
  .editing-frame figcaption { font-size: 6px; padding-top: 8px; letter-spacing: .4px; }
  .editing-timelines { width: 61%; min-width: 0; right: -8px; top: -148px; height: 475px; }
  .editing-sequence { padding: 17px 11px; }
  .sequence-heading { font-size: 8px; gap: 6px; margin-bottom: 20px; }
  .sequence-ruler { margin-left: 31px; font-size: 6px; }
  .sequence-track { grid-template-columns: 26px minmax(0, 1fr); gap: 5px; min-height: 33px; }
  .track-label { font-size: 6px; }
  .sequence-wave { height: 33px; }
  .sequence-video, .sequence-caption { font-size: 5.5px; }
  .sequence-footer { font-size: 5.5px; margin-top: 17px; letter-spacing: .3px; }
  .sequence-playhead { animation-name: sequence-scan-mobile; }
  .atlas-network { width: 51%; height: 285px; top: 0; }
  .atlas-network-left { left: -2px; }
  .atlas-network-right { right: -2px; }
  .atlas-network-label text { font-size: 9px; }
  :is(.editing-project, .network-project) .ambient-caption { left: 16px; bottom: 15px; font-size: 7px; letter-spacing: .3px; }
}
@keyframes sequence-scan-mobile { 0% { left: 31px; opacity: 0; } 3% { opacity: 1; } 96% { opacity: 1; } 100% { left: calc(100% - 2px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .scene-motion { animation: none; }
  .atlas-signal { opacity: .35; }
  .atlas-module { color: #bac7cf; }
  .sequence-playhead { left: 52%; }
  .sequence-caption { opacity: 1; }
}
